11 #ifndef DtForwarderNode_H_
12 #define DtForwarderNode_H_
18 #include <vlutil/vlConfig.h>
19 #include <vlutil/vlUtil.h>
20 #include <vlutil/vlTime.h>
54 #define DtForwarderIntfcIn 0x01
55 #define DtForwarderIntfcOut 0x02
56 #define DtForwarderIntfcLan 0x04
114 const MAKRti::DtInetEndpoint& forwarderAddrToConnectTo,
115 bool writeToPipeWhenReady );
125 virtual int tick(
double maxTime = 0.0f );
130 virtual void addTickCallback(
DtTickCbFn fn,
void* usr, MAKRti::DtTime interval );
131 virtual void removeTickCallback(
DtTickCbFn fn,
void* usr );
134 virtual inline bool ready()
const;
140 virtual inline DtBoost::shared_ptr<DtRouteMap> routeMap()
const;
148 virtual void selectParams( MAKRti::DtSelectParamWithWrite& selectParams );
151 virtual unsigned long localNodeId()
const;
158 virtual MAKRti::DtString localNodeName()
const;
161 virtual MAKRti::DtString localNodeHostName()
const;
193 virtual void packageAndSendReliable(
DtRtiMsg& msg,
unsigned int sendViaIntfc );
194 virtual void packageAndSendReliable(
DtRtiMsg& msg,
unsigned int sendViaIntfc,
198 virtual void setMetadataControl(
DtMetadataType type,
bool onOff );
202 virtual void lanPortListenToMulticastGroup(
const MAKRti::DtInetAddr& mcastAddr );
203 virtual void lanPortDropMulticastGroup(
const MAKRti::DtInetAddr& mcastAddr );
207 virtual bool lanPortUpdateFederateConnectionId(
unsigned long orig,
208 unsigned long final );
214 virtual DtInetAddrAndPort nextForwarderOnRoute(
const MAKRti::DtString& targetGroupName );
224 virtual void abortPendingConnections();
227 virtual unsigned int abortedConnections();
230 virtual bool connectionInformation(
231 unsigned int& numForwarderToForwarderConns,
232 std::vector<MAKRti::DtString>& forwarderIdentifiers,
233 std::vector<MAKRti::DtString>& forwarderConnectionHostNames,
234 std::vector<DtInetAddrAndPort>& forwarderConnectionAddrs,
235 unsigned int& numForwarderExecConns,
236 unsigned int& numForwarderClientConns,
237 std::vector<MAKRti::DtString>& clientConnectionHostNames,
238 std::vector<MAKRti::DtInetAddr>& clientConnectionAddrs);
243 virtual void continueWithoutUnconnectedFws();
246 virtual void connectForwarder(
const DtString& host,
const MAKRti::DtInetAddr& ipAddress,
int port);
250 static int forwarderToForwarderConnectionChanged(
251 const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
252 unsigned int oldConnID,
unsigned int newConnID,
254 virtual int forwarderToForwarderConnectionChanged(
255 const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
256 unsigned int oldConnID,
unsigned int newConnID,
const DtInetAddrAndPort& connAddr );
266 MAKRti::DtInetEndpoint forwarderAddrToConnectTo,
267 bool writeToPipeWhenReady );
274 MAKRti::DtInetEndpoint forwarderAddrToConnectTo,
275 bool writeToPipeWhenReady );
280 static void setCreatorFunction( DtForwarderNodeCreatorFcn creator );
283 static int newInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
284 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
285 static int newOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
286 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
287 static int lostInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
288 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
289 static int lostOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
290 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr,
void* usr);
291 static void inOutForwarderPortReady(
unsigned long forwarderNodeId,
void* usr);
303 int refreshConnections();
306 void writeMessageToPipe(
const MAKRti::DtString& msg );
309 int newInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
310 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
311 int newOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
312 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
313 int lostInPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
314 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
315 int lostOutPortConnection(
const MAKRti::DtString& connName,
const MAKRti::DtString& hostName,
316 unsigned int connID,
const std::pair<DtInetAddrAndPort, DtInetAddrAndPort>& connAddr);
317 void inOutForwarderPortReady(
unsigned long forwarderNodeId);
413 return (
outPort()->pendingConnectionsAborted() +
lanPort()->pendingConnectionsAborted());