JNodeOS v1.2.0 API

edu.utah.janos.util
Class Packet

java.lang.Object
  |
  +--edu.utah.janos.util.Packet
Direct Known Subclasses:
ICMPEcho, ICMPTimeExceeded

public class Packet
extends java.lang.Object

Packet is a helper class that can be used to build packets from several PacketSegments.


Constructor Summary
Packet(PacketSegment[] segs)
           
 
Method Summary
 int getLength()
           
 PacketSegment[] getSegments()
           
 void marshal(BufferHandle bh)
          Marshal this packet into the beginning of the given buffer.
 void marshal(BufferHandle bh, int offset)
           
 java.lang.String toString()
           
 void unmarshal(BufferHandle bh)
          Unmarshal this packet from the beginning of the given buffer.
 void unmarshal(BufferHandle bh, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Packet

public Packet(PacketSegment[] segs)
Parameters:
segs - The array of segments that make up this Packet.
Method Detail

getSegments

public PacketSegment[] getSegments()
Returns:
The array of packet segments that make up this Packet.

getLength

public int getLength()
Returns:
The total length of this packet.

marshal

public void marshal(BufferHandle bh,
                    int offset)
Parameters:
bh - The buffer to marshal this packet into.
offset - The offset in the buffer to start marshalling.

marshal

public void marshal(BufferHandle bh)
Marshal this packet into the beginning of the given buffer.
Parameters:
bh - The buffer to marshal this packet into.

unmarshal

public void unmarshal(BufferHandle bh,
                      int offset)
               throws InvalidPacketException
Parameters:
bh - The buffer that contains the marshalled packet segments.
offset - The offset in the buffer to start unmarshalling.

unmarshal

public void unmarshal(BufferHandle bh)
               throws InvalidPacketException
Unmarshal this packet from the beginning of the given buffer.
Parameters:
bh - The buffer that contains the marshalled packet segments.

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