Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members

Packet Class Reference

#include <netelem.h>

List of all members.

Public Member Functions

 Packet (NetElement *src, NetElement *dst, unsigned int bits, timeunits stamp, unsigned long datagramid=0, unsigned int totalbits=0, unsigned int k=0)
timeunits GetStamp (void) const
unsigned long int GetPacketId (void) const
unsigned int GetBits (void) const
unsigned int GetTotalBits (void) const
unsigned long GetDatagramId (void) const
NetElementGetSrc (void) const
NetElementGetDst (void) const
unsigned int GetPos (void) const
void Jump (void)
void SetTotalBits (unsigned int b)
void SetBytes (unsigned int B)
void SetBits (unsigned int b)
void SetDatagramId (unsigned long id)
void Stamp (timeunits stamp)


Detailed Description

Implements a generic packet or fragment. Packets are generated in a PacketSource, can be stored in Server Queues, and are destroyed in Sinks.


Constructor & Destructor Documentation

Packet::Packet NetElement src,
NetElement dst,
unsigned int  bits,
timeunits  stamp,
unsigned long  datagramid = 0,
unsigned int  totalbits = 0,
unsigned int  k = 0
 

Constructor.

Parameters:
src pointer to the source NetElement, typically a PacketSource
dst pointer to the destination NetElement, typically a PacketSink
bits packet size in bits. Has to be multiple of 8.
stamp generation time of the packet.
datagramid identifies the original packet a fragment packet belongs to.
totalbits datagram size in bits. Has to be multiple of 8.
k puts the packet in the k-th hop alogn the route from src to dst.


Member Function Documentation

unsigned int Packet::GetBits void   )  const
 

Returns:
the size, in bits, of this packet or fragment.

unsigned long Packet::GetDatagramId void   )  const
 

Returns:
the original packet identifier.

NetElement * Packet::GetDst void   )  const
 

Returns:
pointer to the destination NetElement

unsigned long int Packet::GetPacketId void   )  const
 

Returns:
the packet or fragment unique identifier.

unsigned int Packet::GetPos void   )  const
 

Returns:
current position of this packet along the route from src to dst, in number of hops

NetElement * Packet::GetSrc void   )  const
 

Returns:
pointer to the originating NetElement

timeunits Packet::GetStamp void   )  const [inline]
 

Returns:
the origination time of the packet.

unsigned int Packet::GetTotalBits void   )  const
 

Returns:
the size, in bits, of the original packet, before any fragmentation.

void Packet::Jump void   ) 
 

Advances the packet to the next hop to dst.

void Packet::SetBits unsigned int  b  ) 
 

Modifies this fragment size.

Parameters:
b fragment size in bits.

void Packet::SetBytes unsigned int  B  ) 
 

Modifies the original packet length

Parameters:
B packet size in octets.

void Packet::SetDatagramId unsigned long  id  ) 
 

Parameters:
id Changes the unique datagram identifier.

void Packet::SetTotalBits unsigned int  b  ) 
 

Modifies the original packet length

Parameters:
b packet size in bits.

void Packet::Stamp timeunits  stamp  ) 
 

Modifies the origination time

Parameters:
stamp time to stamp in the Packet.


The documentation for this class was generated from the following files:
Generated on Fri Jan 19 15:35:17 2007 by  doxygen 1.4.2