DRCL J-Sim API

drcl.inet
Class InetPacket

java.lang.Object
  extended bydrcl.net.Packet
      extended bydrcl.inet.InetPacket
All Implemented Interfaces:
java.lang.Cloneable, Countable, ObjectCloneable, PacketWrapper
Direct Known Subclasses:
TraceRTPkt

public class InetPacket
extends Packet

Defines the packet structure for the INET framework.

Version:
1.1, 08/2002

Field Summary
static long CE
          CE (Congestion Experience) bit mask in the ToS field.
static long CONTROL
          Control packet type.
static long DATA
          Data packet type.
static int DONT_FRAGMENT
          The ``don't fragment'' bit mask in the flag field.
static long ECT
          ECT (ECN-Capable Transport) bit mask in the ToS field.
static int LABELLED
          The ``labelled'' bit mask in the flag field.
static int MORE_FRAGMENT
          The ``more fragment'' bit mask in the flag field.
static java.lang.String NAME
          Name of the InetPacket.
static int PACKET_IN_PACKET
          The ``packet-in-packet'' bit mask in the flag field.
static long TYPE_MASK
          Packet type bit mask in the ToS field.
 
Fields inherited from class drcl.net.Packet
body, headerSize, size
 
Constructor Summary
InetPacket()
           
InetPacket(long src_, long des_, int ulp_, int ttl_, int hops_, boolean ra_, long tos_, int id_, int flag_, int fragment_, java.lang.Object pkt_, int pktsize_)
           
InetPacket(long src_, long des_, int ulp_, int ttl_, int hops_, boolean ra_, long tos_, int id_, int flag_, int fragment_, java.lang.Object pkt_, int pktsize_, long nexthop_)
           
 
Method Summary
 InetPacket _clone()
          Returns a clone of this packet.
 java.lang.String _toString(java.lang.String separator_)
          Prints the packet header.
 java.lang.Object clone()
          Returns a clone of this object.
 boolean dontFragment()
           
 boolean equals(java.lang.Object o_)
          Returns true if that_ is a packet, and its packet size, header size and the encapsulated object are all equal to those of this packet.
 long getDestination()
           
 java.lang.Object getExtension()
           
 int getFlag()
           
 int getFragmentOffset()
           
 int getHops()
           
 int getID()
           
 int getIncomingIf()
           
 short getLabel()
           
 java.lang.String getName()
          Returns the name of this packet.
 long getNextHop()
           
 int getProtocol()
           
 long getSource()
           
 long getTOS()
           
 int getTTL()
           
 boolean hasMoreFragment()
           
 boolean isCE()
           
 boolean isControlPacket()
           
 boolean isDataPacket()
           
 boolean isECT()
           
 boolean isFragment()
           
 boolean isLabelled()
           
 boolean isPacketInPacket()
           
 boolean isRouterAlertEnabled()
           
 void setCE(boolean enabled_)
           
 void setDestination(long des)
           
 void setDontFragment(boolean value_)
           
 void setECT(boolean enabled_)
           
 void setExtension(java.lang.Object o_)
           
 void setFlag(int flag_)
           
 void setFragmentOffset(int offset_)
           
 void setFragmentParam(boolean more_, int offset_, int id_)
          One shot to set all the fragment parameters.
 void setHops(int hops_)
           
 void setID(int no_)
           
 void setIncomingIf(int if_)
           
 void setLabel(short label_)
           
 void setLabelled(boolean value_)
           
 void setMoreFragment(boolean value_)
           
 void setNextHop(long nexthop_)
           
 void setPacketInPacket(boolean value_)
           
 void setProtocol(int ulp_)
           
 void setRouterAlertEnabled(boolean ra)
           
 void setSource(long src_)
           
 void setTOS(long tos_)
           
 void setTOSBit(long bitmask_, boolean enabled_)
           
 void setTTL(int ttl_)
           
 
Methods inherited from class drcl.net.Packet
getBody, getByteCount, getHeaderSize, getNumberCount, getPacketCount, getPacketSize, getPacketType, getSize, getSizeCount, getTimestamp, isByteCountSupported, isPacketCountSupported, isTimestampSupported, setBody, setBody, setHeaderSize, setPacketSize, setSize, setTimestamp, toString, toString, wraps
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
Name of the InetPacket.

See Also:
Constant Field Values

TYPE_MASK

public static final long TYPE_MASK
Packet type bit mask in the ToS field.

See Also:
Constant Field Values

DATA

public static final long DATA
Data packet type.

See Also:
Constant Field Values

CONTROL

public static final long CONTROL
Control packet type.

See Also:
Constant Field Values

ECT

public static final long ECT
ECT (ECN-Capable Transport) bit mask in the ToS field.

See Also:
Constant Field Values

CE

public static final long CE
CE (Congestion Experience) bit mask in the ToS field.

See Also:
Constant Field Values

DONT_FRAGMENT

public static final int DONT_FRAGMENT
The ``don't fragment'' bit mask in the flag field.

See Also:
Constant Field Values

MORE_FRAGMENT

public static final int MORE_FRAGMENT
The ``more fragment'' bit mask in the flag field.

See Also:
Constant Field Values

PACKET_IN_PACKET

public static final int PACKET_IN_PACKET
The ``packet-in-packet'' bit mask in the flag field.

See Also:
Constant Field Values

LABELLED

public static final int LABELLED
The ``labelled'' bit mask in the flag field.

See Also:
Constant Field Values
Constructor Detail

InetPacket

public InetPacket()

InetPacket

public InetPacket(long src_,
                  long des_,
                  int ulp_,
                  int ttl_,
                  int hops_,
                  boolean ra_,
                  long tos_,
                  int id_,
                  int flag_,
                  int fragment_,
                  java.lang.Object pkt_,
                  int pktsize_)

InetPacket

public InetPacket(long src_,
                  long des_,
                  int ulp_,
                  int ttl_,
                  int hops_,
                  boolean ra_,
                  long tos_,
                  int id_,
                  int flag_,
                  int fragment_,
                  java.lang.Object pkt_,
                  int pktsize_,
                  long nexthop_)
Method Detail

setSource

public void setSource(long src_)

getSource

public long getSource()

setDestination

public void setDestination(long des)

getDestination

public long getDestination()

setProtocol

public void setProtocol(int ulp_)

getProtocol

public int getProtocol()

setTTL

public void setTTL(int ttl_)

getTTL

public int getTTL()

setHops

public void setHops(int hops_)

getHops

public int getHops()

setRouterAlertEnabled

public void setRouterAlertEnabled(boolean ra)

isRouterAlertEnabled

public boolean isRouterAlertEnabled()

setTOS

public void setTOS(long tos_)

getTOS

public long getTOS()

setID

public void setID(int no_)

getID

public int getID()

setFlag

public void setFlag(int flag_)

getFlag

public int getFlag()

setFragmentParam

public void setFragmentParam(boolean more_,
                             int offset_,
                             int id_)
One shot to set all the fragment parameters.


setFragmentOffset

public void setFragmentOffset(int offset_)

getFragmentOffset

public int getFragmentOffset()

dontFragment

public boolean dontFragment()

setDontFragment

public void setDontFragment(boolean value_)

hasMoreFragment

public boolean hasMoreFragment()

isFragment

public boolean isFragment()

setMoreFragment

public void setMoreFragment(boolean value_)

isPacketInPacket

public boolean isPacketInPacket()

setPacketInPacket

public void setPacketInPacket(boolean value_)

isLabelled

public boolean isLabelled()

setLabelled

public void setLabelled(boolean value_)

getLabel

public short getLabel()

setLabel

public void setLabel(short label_)

getExtension

public java.lang.Object getExtension()

setExtension

public void setExtension(java.lang.Object o_)

isDataPacket

public boolean isDataPacket()

isControlPacket

public boolean isControlPacket()

isECT

public boolean isECT()

isCE

public boolean isCE()

setECT

public void setECT(boolean enabled_)

setCE

public void setCE(boolean enabled_)

setTOSBit

public void setTOSBit(long bitmask_,
                      boolean enabled_)

getIncomingIf

public int getIncomingIf()

setIncomingIf

public void setIncomingIf(int if_)

setNextHop

public void setNextHop(long nexthop_)

getNextHop

public long getNextHop()

equals

public boolean equals(java.lang.Object o_)
Description copied from class: Packet
Returns true if that_ is a packet, and its packet size, header size and the encapsulated object are all equal to those of this packet.

Overrides:
equals in class Packet

clone

public java.lang.Object clone()
Description copied from interface: ObjectCloneable
Returns a clone of this object.

Specified by:
clone in interface ObjectCloneable
Specified by:
clone in class Packet

_clone

public InetPacket _clone()
Returns a clone of this packet. The difference between this method and clone() is that this method only copies the reference of the encapsulated object rather than the object content.


getName

public java.lang.String getName()
Description copied from class: Packet
Returns the name of this packet.

Specified by:
getName in class Packet

_toString

public java.lang.String _toString(java.lang.String separator_)
Description copied from class: Packet
Prints the packet header.

Overrides:
_toString in class Packet

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~