1 /****************************************************************************
2 * Copyright (C) 2006-2008 by Jason Ansel, Kapil Arya, and Gene Cooperman *
3 * jansel@csail.mit.edu, kapil@ccs.neu.edu, gene@ccs.neu.edu *
4 * *
5 * This file is part of the dmtcp/src module of DMTCP (DMTCP:dmtcp/src). *
6 * *
7 * DMTCP:dmtcp/src is free software: you can redistribute it and/or *
8 * modify it under the terms of the GNU Lesser General Public License as *
9 * published by the Free Software Foundation, either version 3 of the *
10 * License, or (at your option) any later version. *
11 * *
12 * DMTCP:dmtcp/src is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU Lesser General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with DMTCP:dmtcp/src. If not, see *
19 * <http://www.gnu.org/licenses/>. *
20 ****************************************************************************/
21
22 #ifndef DMTCPCHECKPOINTSTATE_H
23 #define DMTCPCHECKPOINTSTATE_H
24
25 #include "dmtcpalloc.h"
26 #include "kernelbufferdrainer.h"
27 #include "connectionmanager.h"
28 #include "connectionrewirer.h"
29 #include "../jalib/jsocket.h"
30 #include "../jalib/jalloc.h"
31
32 namespace dmtcp
33 {
34
35 /**
36 * State of open connections, stored in checkpoint image
37 */
38 class ConnectionState
39 {
40 public:
41 #ifdef JALIB_ALLOCATOR
42 static void* operator new(size_t nbytes, void* p) { return p; }
43 static void* operator new(size_t nbytes) { JALLOC_HELPER_NEW(nbytes); }
44 static void operator delete(void* p) { JALLOC_HELPER_DELETE(p); }
45 #endif
46 ConnectionState ( const ConnectionToFds& ctfd = ConnectionToFds() );
47
48 void deleteDupFileConnections();
49 void deleteStaleConnections();
50 #ifdef EXTERNAL_SOCKET_HANDLING
51 void preCheckpointPeerLookup( dmtcp::vector<TcpConnectionInfo>& conInfoTable );
52 #endif
53 void preLockSaveOptions();
54 void preCheckpointLock();
55 void preCheckpointDrain();
56 void preCheckpointHandshakes(const UniquePid& coordinator);
57 void postCheckpoint(bool isRestart);
58 void outputDmtcpConnectionTable(int fd);
59
60 void postRestart();
61 void doReconnect ( jalib::JSocket& coordinator, jalib::JSocket& restoreListen );
62 int numPeers(){ return _numPeers; }
63 int numPeers(int np){ return _numPeers = np; }
64 UniquePid compGroup(){ return _compGroup; }
65 void compGroup(UniquePid cg){ _compGroup = cg; }
66
67 private:
|
Event member_decl: |
Class member declaration for _numPeers. |
| Also see events: |
[uninit_member] |
68 int _numPeers;
69 UniquePid _compGroup;
70 KernelBufferDrainer _drain;
71 ConnectionToFds _conToFds;
72 ConnectionRewirer _rewirer;
73 };
74
75 }
76
77 #endif