JNodeOS v1.2.0 API

edu.utah.janos.protocols.icmp
Class ICMPHeader

java.lang.Object
  |
  +--edu.utah.janos.protocols.icmp.ICMPHeader

public class ICMPHeader
extends java.lang.Object
implements PacketSegment

The ICMPHeader is a PacketSegment for the standard ICMP header.


Field Summary
static byte ECHO
           
static byte ECHOREPLY
          Message types and their codes.
static int HEADER_LENGTH
          Length of the header.
static byte IREQ
           
static byte IREQREPLY
           
static byte MASKREPLY
           
static byte MASKREQ
           
static byte MAXTYPE
           
static byte PARAMPROB
           
static byte PARAMPROB_OPTABSENT
           
static byte REDIRECT
           
static byte REDIRECT_HOST
           
static byte REDIRECT_NET
           
static byte REDIRECT_TOSHOST
           
static byte REDIRECT_TOSNET
           
static byte ROUTERADVERT
           
static byte ROUTERSOLICIT
           
static byte SOURCEQUENCH
           
static byte TIMXCEED
           
static byte TIMXCEED_INTRANS
           
static byte TIMXCEED_REASS
           
static byte TSTAMP
           
static byte TSTAMPREPLY
           
static byte UNREACH
           
static byte UNREACH_FILTER_PROHIB
           
static byte UNREACH_HOST
           
static byte UNREACH_HOST_PRECEDENCE
           
static byte UNREACH_HOST_PROHIB
           
static byte UNREACH_HOST_UNKNOWN
           
static byte UNREACH_ISOLATED
           
static byte UNREACH_NEEDFRAG
           
static byte UNREACH_NET
           
static byte UNREACH_NET_PROHIB
           
static byte UNREACH_NET_UNKNOWN
           
static byte UNREACH_PORT
           
static byte UNREACH_PRECEDENCE_CUTOFF
           
static byte UNREACH_PROTOCOL
           
static byte UNREACH_SRCFAIL
           
static byte UNREACH_TOSHOST
           
static byte UNREACH_TOSNET
           
 
Constructor Summary
ICMPHeader()
          Construct an ICMPHeader with zero type and code values.
ICMPHeader(byte type)
           
ICMPHeader(byte type, byte code)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 byte getCode()
           
 int getLength()
           
 byte getType()
           
 int hashCode()
           
 int marshal(BufferHandle bh, int offset)
           
static void matchCode(DemultiplexKey dk, int offset, byte code)
           
static void matchType(DemultiplexKey dk, int offset, byte type)
           
 void setCode(byte code)
           
 void setType(byte type)
           
 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
 

Field Detail

ECHOREPLY

public static final byte ECHOREPLY
Message types and their codes.

UNREACH

public static final byte UNREACH

UNREACH_NET

public static final byte UNREACH_NET

UNREACH_HOST

public static final byte UNREACH_HOST

UNREACH_PROTOCOL

public static final byte UNREACH_PROTOCOL

UNREACH_PORT

public static final byte UNREACH_PORT

UNREACH_NEEDFRAG

public static final byte UNREACH_NEEDFRAG

UNREACH_SRCFAIL

public static final byte UNREACH_SRCFAIL

UNREACH_NET_UNKNOWN

public static final byte UNREACH_NET_UNKNOWN

UNREACH_HOST_UNKNOWN

public static final byte UNREACH_HOST_UNKNOWN

UNREACH_ISOLATED

public static final byte UNREACH_ISOLATED

UNREACH_NET_PROHIB

public static final byte UNREACH_NET_PROHIB

UNREACH_HOST_PROHIB

public static final byte UNREACH_HOST_PROHIB

UNREACH_TOSNET

public static final byte UNREACH_TOSNET

UNREACH_TOSHOST

public static final byte UNREACH_TOSHOST

UNREACH_FILTER_PROHIB

public static final byte UNREACH_FILTER_PROHIB

UNREACH_HOST_PRECEDENCE

public static final byte UNREACH_HOST_PRECEDENCE

UNREACH_PRECEDENCE_CUTOFF

public static final byte UNREACH_PRECEDENCE_CUTOFF

SOURCEQUENCH

public static final byte SOURCEQUENCH

REDIRECT

public static final byte REDIRECT

REDIRECT_NET

public static final byte REDIRECT_NET

REDIRECT_HOST

public static final byte REDIRECT_HOST

REDIRECT_TOSNET

public static final byte REDIRECT_TOSNET

REDIRECT_TOSHOST

public static final byte REDIRECT_TOSHOST

ECHO

public static final byte ECHO

ROUTERADVERT

public static final byte ROUTERADVERT

ROUTERSOLICIT

public static final byte ROUTERSOLICIT

TIMXCEED

public static final byte TIMXCEED

TIMXCEED_INTRANS

public static final byte TIMXCEED_INTRANS

TIMXCEED_REASS

public static final byte TIMXCEED_REASS

PARAMPROB

public static final byte PARAMPROB

PARAMPROB_OPTABSENT

public static final byte PARAMPROB_OPTABSENT

TSTAMP

public static final byte TSTAMP

TSTAMPREPLY

public static final byte TSTAMPREPLY

IREQ

public static final byte IREQ

IREQREPLY

public static final byte IREQREPLY

MASKREQ

public static final byte MASKREQ

MASKREPLY

public static final byte MASKREPLY

MAXTYPE

public static final byte MAXTYPE

HEADER_LENGTH

public static final int HEADER_LENGTH
Length of the header.
Constructor Detail

ICMPHeader

public ICMPHeader(byte type,
                  byte code)
Parameters:
type - The type to give this header segment.
code - The code to give this header segment.

ICMPHeader

public ICMPHeader(byte type)
Parameters:
type - The type to give this header segment.

ICMPHeader

public ICMPHeader()
Construct an ICMPHeader with zero type and code values.
Method Detail

matchType

public static void matchType(DemultiplexKey dk,
                             int offset,
                             byte type)
Parameters:
dk - The key to add the matching data to.
offset - Offset of the IP header in the buffer.
type - The ICMP message type to match.

matchCode

public static void matchCode(DemultiplexKey dk,
                             int offset,
                             byte code)
Parameters:
dk - The key to add the matching data to.
offset - Offset of the IP header in the buffer.
code - The ICMP message code to match.

getLength

public int getLength()
Specified by:
getLength in interface PacketSegment
Tags copied from interface: PacketSegment
Returns:
The length of this packet segment.

getType

public byte getType()

setType

public void setType(byte type)

getCode

public byte getCode()

setCode

public void setCode(byte code)

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

JNodeOS v1.2.0 API

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