java.lang.Object edu.gwu.simplenetsim.NetsimPacket edu.gwu.simplenetsim.NetworkPacket
public class NetworkPacket
This class contains all the packet info for a network-level packet, including the whole transport-packet. There are a number of public fields, all of which are typical in network layers.
NetsimPacket
Field Summary | |
---|---|
java.lang.String |
controlInfo
The control payload. |
TransportPacket |
data
The payload. |
int |
dest
Where it needs to go. |
boolean |
isControl
Is this a control packet, generated solely by and used by network layers? |
int |
seqnum
Sequence numbers. |
int |
src
Where it came from. |
int |
timeToLive
Long-lived packets are often assumed to be useless and are discarded. |
Fields inherited from class edu.gwu.simplenetsim.NetsimPacket |
---|
CIRCLE, IDCount, SQUARE |
Constructor Summary | |
---|---|
NetworkPacket(int src,
int dest,
java.lang.String controlInfo)
The constructor for control packets. |
|
NetworkPacket(int src,
int dest,
TransportPacket data)
The constructor for regular packets. |
Method Summary | |
---|---|
java.lang.String |
toString()
For debugging. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int src
public int dest
public TransportPacket data
public boolean isControl
public java.lang.String controlInfo
public int seqnum
public int timeToLive
Constructor Detail |
---|
public NetworkPacket(int src, int dest, TransportPacket data)
src
- an int
valuedest
- an int
valuedata
- a TransportPacket
valuepublic NetworkPacket(int src, int dest, java.lang.String controlInfo)
src
- an int
valuedest
- an int
valuecontrolInfo
- a String
valueMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
String
value