edu.gwu.simplenetsim
Class DatalinkPacket

java.lang.Object
  extended by edu.gwu.simplenetsim.NetsimPacket
      extended by edu.gwu.simplenetsim.DatalinkPacket

public class DatalinkPacket
extends NetsimPacket

The class that contains stuff for a datalink-layer packet. The class has a number of public fields typical in datalink packets.

See Also:
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

fromNeighbor

public int fromNeighbor
Who is this from?


toNeighbor

public int toNeighbor
Where is it going? This can only be a neighbor.


data

public NetworkPacket data
The payload.


isControl

public boolean isControl
Is this a control packet, generated by and used solely by datalink layers?


controlInfo

public java.lang.String controlInfo
The control payload.


seqnum

public int seqnum
The well-known sequence-number field.

Constructor Detail

DatalinkPacket

public DatalinkPacket(int fromNeighbor,
                      int toNeighbor,
                      NetworkPacket data)
Constructor used for regular packets.

Parameters:
fromNeighbor - an int value
toNeighbor - an int value
data - a NetworkPacket value

DatalinkPacket

public DatalinkPacket(int fromNeighbor,
                      int toNeighbor,
                      java.lang.String controlInfo)
Constructor used by control packets.

Parameters:
fromNeighbor - an int value
toNeighbor - an int value
controlInfo - a String value
Method Detail

toString

public java.lang.String toString()
For debugging.

Overrides:
toString in class java.lang.Object
Returns:
a String value