edu.utah.janos.protocols.ip
Class IPHeader
java.lang.Object
|
+--edu.utah.janos.protocols.ip.IPHeader
- public class IPHeader
- extends java.lang.Object
- implements PacketSegment
The IPHeader is a PacketSegment for the standard IP header.
Constructor Summary |
IPHeader()
|
IPHeader(byte typeOfService,
short identification,
short fragOffset,
byte ttl,
byte protocol,
int src,
int dest)
Construct an IPHeader with the given values. |
Method Summary |
void |
consumeTTL()
|
static boolean |
consumeTTL(BufferHandle bh,
int offset)
|
boolean |
equals(java.lang.Object obj)
|
int |
getDestination()
|
static int |
getDestination(BufferHandle bh,
int offset)
|
int |
getLength()
|
int |
getSource()
|
byte |
getTTL()
|
int |
hashCode()
|
int |
marshal(BufferHandle bh,
int offset)
|
static void |
matchDeadPacket(DemultiplexKey dk,
int offset)
Match any fields that would indicate this is a dead packet. |
static void |
matchDestination(DemultiplexKey dk,
int offset,
int addr)
|
static void |
matchNoOptionIP(DemultiplexKey dk,
int offset)
|
static void |
matchProtocol(DemultiplexKey dk,
int offset,
byte proto)
|
static void |
matchSource(DemultiplexKey dk,
int offset,
int addr)
|
void |
newID()
|
void |
setDestination(int dest)
|
void |
setSource(int src)
|
void |
setTTL(byte ttl)
|
java.lang.String |
toString()
|
int |
unmarshal(BufferHandle bh,
int offset)
|
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
TOS_LOWDELAY
public static final byte TOS_LOWDELAY
- Type of service constants.
TOS_THROUGHPUT
public static final byte TOS_THROUGHPUT
TOS_RELIABILITY
public static final byte TOS_RELIABILITY
TOS_MINCOST
public static final byte TOS_MINCOST
PROTO_IP
public static final byte PROTO_IP
- Protocol types.
PROTO_ICMP
public static final byte PROTO_ICMP
PROTO_TCP
public static final byte PROTO_TCP
PROTO_UDP
public static final byte PROTO_UDP
MAX_TTL
public static final byte MAX_TTL
- Maximum possible TTL.
OFFSET_VHL
public static final int OFFSET_VHL
- Offsets into an IP header in a buffer.
OFFSET_TOS
public static final int OFFSET_TOS
OFFSET_LEN
public static final int OFFSET_LEN
OFFSET_ID
public static final int OFFSET_ID
OFFSET_OFF
public static final int OFFSET_OFF
OFFSET_TTL
public static final int OFFSET_TTL
OFFSET_PROTOCOL
public static final int OFFSET_PROTOCOL
OFFSET_SUM
public static final int OFFSET_SUM
OFFSET_SRC
public static final int OFFSET_SRC
OFFSET_DST
public static final int OFFSET_DST
HEADER_LENGTH_NO_OPTIONS
public static final int HEADER_LENGTH_NO_OPTIONS
- Length of the header with no options.
IPHeader
public IPHeader(byte typeOfService,
short identification,
short fragOffset,
byte ttl,
byte protocol,
int src,
int dest)
- Construct an IPHeader with the given values.
IPHeader
public IPHeader()
matchNoOptionIP
public static void matchNoOptionIP(DemultiplexKey dk,
int offset)
- Parameters:
dk
- The key to add the matching data to.offset
- Offset of the IP header in the buffer.
matchProtocol
public static void matchProtocol(DemultiplexKey dk,
int offset,
byte proto)
- Parameters:
dk
- The key to add the matching data to.offset
- Offset of the IP header in the buffer.proto
- The protocol to match.
matchDeadPacket
public static void matchDeadPacket(DemultiplexKey dk,
int offset)
- Match any fields that would indicate this is a dead packet.
- Parameters:
dk
- The key to add the matching data to.offset
- Offset of the IP header in the buffer.
matchSource
public static void matchSource(DemultiplexKey dk,
int offset,
int addr)
- Parameters:
dk
- The key to add the matching data to.offset
- Offset of the IP header in the buffer.addr
- The source address to match.
matchDestination
public static void matchDestination(DemultiplexKey dk,
int offset,
int addr)
- Parameters:
dk
- The key to add the matching data to.offset
- Offset of the IP header in the buffer.addr
- The destination address to match.
getLength
public int getLength()
- Specified by:
- getLength in interface PacketSegment
- Tags copied from interface: PacketSegment
- Returns:
- The length of this packet segment.
newID
public void newID()
getSource
public int getSource()
setSource
public void setSource(int src)
getDestination
public int getDestination()
getDestination
public static int getDestination(BufferHandle bh,
int offset)
setDestination
public void setDestination(int dest)
setTTL
public void setTTL(byte ttl)
getTTL
public byte getTTL()
consumeTTL
public void consumeTTL()
consumeTTL
public static boolean consumeTTL(BufferHandle bh,
int offset)
marshal
public int marshal(BufferHandle bh,
int offset)
- Specified by:
- marshal in interface PacketSegment
- Tags copied from interface: PacketSegment
- Parameters:
bh
- The buffer to marshal this packet into.offset
- The offset in the buffer to start marshalling.
unmarshal
public int unmarshal(BufferHandle bh,
int offset)
throws InvalidPacketException
- Specified by:
- unmarshal in interface PacketSegment
- Tags copied from interface: PacketSegment
- Parameters:
bh
- The buffer that contains the marshalled packet segments.offset
- The offset in the buffer to start unmarshalling.
hashCode
public int hashCode()
- Overrides:
- hashCode in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
- equals in class java.lang.Object
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
This documentation is Copyright (C) 1998-2002 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project web site: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002