YansCoreNS::NetworkMessage Class Reference

Messages sent in the network. More...

List of all members.

Public Member Functions

boost::shared_ptr
< NetworkMessageData
GetData (void) const
 Returns the data this message carries.
NodeNS::IPAddress GetDestinationIPAddress (void) const
 Returns the IP address of the node intended as the receiver of this message.
NodeNS::Port GetDestinationPort (void) const
 Returns the port of the node intended as the received of this message.
NodeNS::IPAddress GetNextHopIPAddress (void) const
 Returns the IP address of the node requested to forward this message to the destination.
NodeNS::IPAddress GetSenderIPAddress (void) const
 Returns the IP address of the node sending this message.
NodeNS::Port GetSenderPort (void) const
 Returns the port of the node sending this message.
TopologyNS::HopCount GetTTLHopCount (void) const
 Returns the maximum remaining number of hops this message is allowed to travel.
 NetworkMessage (NetworkMessage const &other)
 Copy-constructor.
 NetworkMessage (NodeNS::IPAddress senderIPAddress, NodeNS::Port senderPort, NodeNS::IPAddress nextHopIPAddress, NodeNS::IPAddress destinationIPAddress, NodeNS::Port destinationPort, TopologyNS::HopCount hopCount)
 Constructor.
void SetData (boost::shared_ptr< NetworkMessageData > data)
 Sets the data carried by this message.
 ~NetworkMessage (void)
 Destructor.


Detailed Description

Messages sent in the network.

Constructor & Destructor Documentation

YansCoreNS::NetworkMessage::NetworkMessage ( NodeNS::IPAddress  senderIPAddress,
NodeNS::Port  senderPort,
NodeNS::IPAddress  nextHopIPAddress,
NodeNS::IPAddress  destinationIPAddress,
NodeNS::Port  destinationPort,
TopologyNS::HopCount  hopCount 
) [explicit]

Constructor.

YansCoreNS::NetworkMessage::NetworkMessage ( NetworkMessage const &  other  ) 

Copy-constructor.

Parameters:
other The object to copy for the creation of this instance.

YansCoreNS::NetworkMessage::~NetworkMessage ( void   ) 

Destructor.


Member Function Documentation

boost::shared_ptr<NetworkMessageData> YansCoreNS::NetworkMessage::GetData ( void   )  const

Returns the data this message carries.

Returns:
The information this message carries.
Note:
Receivers of this message should call boost::dynamic_pointer_cast<>() on the return value to determine if they can handle the data.

NodeNS::IPAddress YansCoreNS::NetworkMessage::GetDestinationIPAddress ( void   )  const

Returns the IP address of the node intended as the receiver of this message.

NodeNS::Port YansCoreNS::NetworkMessage::GetDestinationPort ( void   )  const

Returns the port of the node intended as the received of this message.

NodeNS::IPAddress YansCoreNS::NetworkMessage::GetNextHopIPAddress ( void   )  const

Returns the IP address of the node requested to forward this message to the destination.

NodeNS::IPAddress YansCoreNS::NetworkMessage::GetSenderIPAddress ( void   )  const

Returns the IP address of the node sending this message.

Note:
If receivers of this messages want to reply to the sender, they should specify this address as the destination IP address.

NodeNS::Port YansCoreNS::NetworkMessage::GetSenderPort ( void   )  const

Returns the port of the node sending this message.

Note:
If receivers of this messages want to reply to the sender, they should specify this port as the destination port, in general (unless the application protocol is different).

TopologyNS::HopCount YansCoreNS::NetworkMessage::GetTTLHopCount ( void   )  const

Returns the maximum remaining number of hops this message is allowed to travel.

Nodes forwarding this message should decrement the hop count if it is positive or discard the message otherwise.

void YansCoreNS::NetworkMessage::SetData ( boost::shared_ptr< NetworkMessageData data  ) 

Sets the data carried by this message.

Parameters:
data The information this message carries.


Generated on Sat May 2 19:18:06 2009 for Yans - Yet another network simulator by  doxygen 1.5.8