java.lang.Object edu.gwu.simplenetsim.NetsimPacket edu.gwu.simplenetsim.DatalinkPacket
public class DatalinkPacket
The class that contains stuff for a datalink-layer packet. The class has a number of public fields typical in datalink packets.
NetsimPacket
Field Summary | |
---|---|
java.lang.String |
controlInfo
The control payload. |
NetworkPacket |
data
The payload. |
int |
fromNeighbor
Who is this from? |
boolean |
isControl
Is this a control packet, generated by and used solely by datalink layers? |
int |
seqnum
The well-known sequence-number field. |
int |
toNeighbor
Where is it going? This can only be a neighbor. |
Fields inherited from class edu.gwu.simplenetsim.NetsimPacket |
---|
CIRCLE, IDCount, SQUARE |
Constructor Summary | |
---|---|
DatalinkPacket(int fromNeighbor,
int toNeighbor,
NetworkPacket data)
Constructor used for regular packets. |
|
DatalinkPacket(int fromNeighbor,
int toNeighbor,
java.lang.String controlInfo)
Constructor used by control 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 fromNeighbor
public int toNeighbor
public NetworkPacket data
public boolean isControl
public java.lang.String controlInfo
public int seqnum
Constructor Detail |
---|
public DatalinkPacket(int fromNeighbor, int toNeighbor, NetworkPacket data)
fromNeighbor
- an int
valuetoNeighbor
- an int
valuedata
- a NetworkPacket
valuepublic DatalinkPacket(int fromNeighbor, int toNeighbor, java.lang.String controlInfo)
fromNeighbor
- an int
valuetoNeighbor
- an int
valuecontrolInfo
- a String
valueMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
String
value