Changeset 185 for vtcross/trunk/src
- Timestamp:
- 03/22/09 15:00:49 (15 years ago)
- Location:
- vtcross/trunk/src
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/components.h
r183 r185 245 245 struct SML_Info *SML; 246 246 247 248 /* The RemoteComponent struct represents either the VTCROSS shell or the 249 * VTCROSS SML. If 'SML_present' is false, it is the former. Otherwise, 250 * it is the latter. 251 */ 252 bool SML_present; 253 struct RemoteComponent *control; 254 247 255 }; 248 256 -
vtcross/trunk/src/policy_engines/PolicyEngine.cpp
r182 r185 24 24 { 25 25 LOG("Creating Policy Engine.\n"); 26 SML = NULL; 26 SML_present = false; 27 control = new RemoteComponent; 27 28 LoadPolicies(); 28 29 } … … 31 32 PolicyEngine::~PolicyEngine() 32 33 { 33 if(SML) 34 delete SML; 34 delete control; 35 35 } 36 36 … … 40 40 LOG("Creating Policy Engine.\n"); 41 41 42 SML = new SML_Info; 43 SML->hostname = std::string(serverName); 44 SML->port = std::string(portNumber); 42 SML_present = true; 43 control = new RemoteComponent; 44 control->serverName = std::string(serverName); 45 control->serverPort = atoi(portNumber); 45 46 46 SML->socketFD = ClientSocket(serverName, portNumber);47 RegisterServices( SML->socketFD);47 control->socketFD = ClientSocket(serverName, portNumber); 48 RegisterServices(control->socketFD); 48 49 49 50 LOG("Policy Engine connected to SML at %s.\n", serverName); … … 82 83 PolicyEngine::Shutdown() 83 84 { 84 if(SML )85 DeregisterServices( SML->socketFD);85 if(SML_present) 86 DeregisterServices(control->socketFD); 86 87 // TODO otherwise, deregister from shell 87 88 }