sprintf(traceMsg,"%s (bond) Nominating link %s/%s to peer %llx. It has now entered its trial period",OSUtils::humanReadableTimestamp().c_str(),getLink(path)->ifname().c_str(),pathStr,_peer->_id.address().toInt());
sprintf(traceMsg,"%s (bond) Nominating link %s/%s to peer %llx. It has now entered its trial period",OSUtils::humanReadableTimestamp().c_str(),getLink(path)->ifname().c_str(),pathStr,(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (bond) Unable to assign outgoing flow %x to peer %llx, no active overflow link",OSUtils::humanReadableTimestamp().c_str(),flow->id(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (bond) Unable to assign outgoing flow %x to peer %llx, no active overflow link",OSUtils::humanReadableTimestamp().c_str(),flow->id(),(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (bond) There are no bonded paths to peer %llx, cannot assign flow %x\n",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),flowId);
sprintf(traceMsg,"%s (bond) There are no bonded paths to peer %llx, cannot assign flow %x\n",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),flowId);
RR->t->bondStateMessage(NULL,traceMsg);
returnSharedPtr<Flow>();
}
if(_flows.size()>=ZT_FLOW_MAX_COUNT){
sprintf(traceMsg,"%s (bond) Maximum number of flows on bond to peer %llx reached (%d), forcibly forgetting oldest flow\n",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),ZT_FLOW_MAX_COUNT);
sprintf(traceMsg,"%s (bond) Maximum number of flows on bond to peer %llx reached (%d), forcibly forgetting oldest flow\n",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),ZT_FLOW_MAX_COUNT);
sprintf(traceMsg,"%s (bond) Forgetting flow %x between this node and peer %llx, %lu active flow(s)",OSUtils::humanReadableTimestamp().c_str(),it->first,_peer->_id.address().toInt(),(_flows.size()-1));
sprintf(traceMsg,"%s (bond) Forgetting flow %x between this node and peer %llx, %lu active flow(s)",OSUtils::humanReadableTimestamp().c_str(),it->first,(unsignedlonglong)(_peer->_id.address().toInt()),(_flows.size()-1));
sprintf(traceMsg,"%s (bond) Agreeing with peer %llx to use alternate link %s/%s\n",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),link->ifname().c_str(),pathStr);
sprintf(traceMsg,"%s (bond) Agreeing with peer %llx to use alternate link %s/%s\n",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),link->ifname().c_str(),pathStr);
RR->t->bondStateMessage(NULL,traceMsg);
negotiatedPath=path;
}
else{
sprintf(traceMsg,"%s (bond) Ignoring petition from peer %llx to use alternate link %s/%s\n",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),link->ifname().c_str(),pathStr);
sprintf(traceMsg,"%s (bond) Ignoring petition from peer %llx to use alternate link %s/%s\n",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),link->ifname().c_str(),pathStr);
sprintf(traceMsg,"%s (bond) Link %s/%s to peer %llx was not bonded, no allocation consequences",OSUtils::humanReadableTimestamp().c_str(),getLink(_paths[i])->ifname().c_str(),pathStr,_peer->_id.address().toInt());
sprintf(traceMsg,"%s (bond) Link %s/%s to peer %llx was not bonded, no allocation consequences",OSUtils::humanReadableTimestamp().c_str(),getLink(_paths[i])->ifname().c_str(),pathStr,(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (bond) Bond to peer %llx is in a %s state (%d/%d links)",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),healthStatusStr.c_str(),_numAliveLinks,_numTotalLinks);
sprintf(traceMsg,"%s (bond) Bond to peer %llx is in a %s state (%d/%d links)",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),healthStatusStr.c_str(),_numAliveLinks,_numTotalLinks);
sprintf(traceMsg,"%s (active-backup) No active link to peer %llx",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) No active link to peer %llx",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
RR->t->bondStateMessage(NULL,traceMsg);
}
if(_abFailoverQueue.empty()){
sprintf(traceMsg,"%s (active-backup) Failover queue is empty, bond to peer %llx is NOT currently fault-tolerant",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Failover queue is empty, bond to peer %llx is NOT currently fault-tolerant",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (active-backup) No links to peer %llx specified. Searching...",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) No links to peer %llx specified. Searching...",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (active-backup) Found eligible link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_paths[i])->ifname().c_str(),curPathStr,_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Found eligible link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_paths[i])->ifname().c_str(),curPathStr,(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (active-backup) Found preferred primary link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_abPath)->ifname().c_str(),curPathStr,_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Found preferred primary link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_abPath)->ifname().c_str(),curPathStr,(unsignedlonglong)(_peer->_id.address().toInt()));
RR->t->bondStateMessage(NULL,traceMsg);
}
}
else{
if(bFoundPrimaryLink&&nonPreferredPath){
sprintf(traceMsg,"%s (active-backup) Found non-preferred primary link to peer %llx",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Found non-preferred primary link to peer %llx",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
RR->t->bondStateMessage(NULL,traceMsg);
_abPath=nonPreferredPath;
}
}
if(!_abPath){
sprintf(traceMsg,"%s (active-backup) Designated primary link to peer %llx is not yet ready",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Designated primary link to peer %llx is not yet ready",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
RR->t->bondStateMessage(NULL,traceMsg);
// TODO: Should wait for some time (failover interval?) and then switch to spare link
}
}
elseif(!userHasSpecifiedPrimaryLink()){
int_abIdx=ZT_MAX_PEER_NETWORK_PATHS;
sprintf(traceMsg,"%s (active-backup) User did not specify a primary link to peer %llx, selecting first available link",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) User did not specify a primary link to peer %llx, selecting first available link",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (active-backup) Selected non-primary link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_abPath)->ifname().c_str(),curPathStr,_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Selected non-primary link %s/%s to peer %llx",OSUtils::humanReadableTimestamp().c_str(),getLink(_abPath)->ifname().c_str(),curPathStr,(unsignedlonglong)(_peer->_id.address().toInt()));
sprintf(traceMsg,"%s (active-backup) Active link to peer %llx has been switched to %s/%s",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt(),getLink(_abPath)->ifname().c_str(),curPathStr);
sprintf(traceMsg,"%s (active-backup) Active link to peer %llx has been switched to %s/%s",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()),getLink(_abPath)->ifname().c_str(),curPathStr);
RR->t->bondStateMessage(NULL,traceMsg);
}
else{
sprintf(traceMsg,"%s (active-backup) Failover queue is empty. No links to peer %llx to choose from",OSUtils::humanReadableTimestamp().c_str(),_peer->_id.address().toInt());
sprintf(traceMsg,"%s (active-backup) Failover queue is empty. No links to peer %llx to choose from",OSUtils::humanReadableTimestamp().c_str(),(unsignedlonglong)(_peer->_id.address().toInt()));