Changeset 185

Show
Ignore:
Timestamp:
03/22/09 15:00:49 (15 years ago)
Author:
bhilburn
Message:

PolicyEngine? code now compiling with new RemoteComponent? struct changes. Still
using old ClientSocket? function.

Location:
vtcross/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/include/vtcross/components.h

    r183 r185  
    245245        struct SML_Info *SML; 
    246246 
     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 
    247255}; 
    248256 
  • vtcross/trunk/src/policy_engines/PolicyEngine.cpp

    r182 r185  
    2424{ 
    2525    LOG("Creating Policy Engine.\n"); 
    26     SML = NULL; 
     26    SML_present = false; 
     27    control = new RemoteComponent; 
    2728    LoadPolicies(); 
    2829} 
     
    3132PolicyEngine::~PolicyEngine() 
    3233{ 
    33     if(SML) 
    34         delete SML; 
     34    delete control; 
    3535} 
    3636 
     
    4040    LOG("Creating Policy Engine.\n"); 
    4141 
    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); 
    4546 
    46     SML->socketFD = ClientSocket(serverName, portNumber); 
    47     RegisterServices(SML->socketFD); 
     47    control->socketFD = ClientSocket(serverName, portNumber); 
     48    RegisterServices(control->socketFD); 
    4849 
    4950    LOG("Policy Engine connected to SML at %s.\n", serverName); 
     
    8283PolicyEngine::Shutdown() 
    8384{ 
    84     if(SML) 
    85         DeregisterServices(SML->socketFD); 
     85    if(SML_present) 
     86        DeregisterServices(control->socketFD); 
    8687    // TODO otherwise, deregister from shell 
    8788}