DCStartd::DCStartd( const char* tName, const char* tPool, const char* tAddr, const char* tId ) : Daemon( DT_STARTD, tName, tPool ) { if( tAddr ) { New_addr( strnewp(tAddr) ); } // claim_id isn't initialized by Daemon's constructor, so we // have to treat it slightly differently claim_id = NULL; if( tId ) { claim_id = strnewp( tId ); } }
bool DCStarter::initFromClassAd( ClassAd* ad ) { char* tmp = NULL; if( ! ad ) { dprintf( D_ALWAYS, "ERROR: DCStarter::initFromClassAd() called with NULL ad\n" ); return false; } ad->LookupString( ATTR_STARTER_IP_ADDR, &tmp ); if( ! tmp ) { // If that's not defined, try ATTR_MY_ADDRESS ad->LookupString( ATTR_MY_ADDRESS, &tmp ); } if( ! tmp ) { dprintf( D_FULLDEBUG, "ERROR: DCStarter::initFromClassAd(): " "Can't find starter address in ad\n" ); return false; } else { if( is_valid_sinful(tmp) ) { New_addr( strnewp(tmp) ); is_initialized = true; } else { dprintf( D_FULLDEBUG, "ERROR: DCStarter::initFromClassAd(): invalid %s in ad (%s)\n", ATTR_STARTER_IP_ADDR, tmp ); } free( tmp ); tmp = NULL; } if( ad->LookupString(ATTR_VERSION, &tmp) ) { New_version( strnewp(tmp) ); free( tmp ); tmp = NULL; } return is_initialized; }