org.opennms.jicmp.ip
Class ICMPPacket

java.lang.Object
  extended by org.opennms.jicmp.ip.ICMPPacket
Direct Known Subclasses:
ICMPEchoPacket

public class ICMPPacket
extends Object

ICMPPacket

Author:
brozow

Nested Class Summary
static class ICMPPacket.Type
           
 
Field Summary
static int CHECKSUM_INDEX
           
 
Constructor Summary
ICMPPacket(ByteBuffer ipPayload)
           
ICMPPacket(ICMPPacket icmpPacket)
           
ICMPPacket(int size)
           
 
Method Summary
 int computeChecksum()
           
 int getChecksum()
           
 int getCode()
           
 ICMPPacket.Type getType()
           
 int getUnsignedShort(int index)
           
 int makeUnsignedShort(byte b1, byte b0)
           
 void setBytes(int index, byte[] b)
           
 void setChecksum()
           
 void setCode(int code)
           
 void setType(ICMPPacket.Type t)
           
 void setUnsignedShort(int index, int us)
           
 NativeDatagramPacket toDatagramPacket(InetAddress destinationAddress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHECKSUM_INDEX

public static final int CHECKSUM_INDEX
See Also:
Constant Field Values
Constructor Detail

ICMPPacket

public ICMPPacket(ByteBuffer ipPayload)

ICMPPacket

public ICMPPacket(ICMPPacket icmpPacket)

ICMPPacket

public ICMPPacket(int size)
Method Detail

getType

public ICMPPacket.Type getType()

setType

public void setType(ICMPPacket.Type t)

getCode

public int getCode()

setCode

public void setCode(int code)

getChecksum

public int getChecksum()

setChecksum

public void setChecksum()

computeChecksum

public int computeChecksum()

setBytes

public void setBytes(int index,
                     byte[] b)
Parameters:
index - The byte offset into the packet where the bytes will be inserted

makeUnsignedShort

public int makeUnsignedShort(byte b1,
                             byte b0)

getUnsignedShort

public int getUnsignedShort(int index)
Parameters:
index - The byte offset into the packet where the value can be found

setUnsignedShort

public void setUnsignedShort(int index,
                             int us)
Parameters:
index - The byte offset into the packet where the value can be found
us - Unsigned short value to insert into the buffer

toDatagramPacket

public NativeDatagramPacket toDatagramPacket(InetAddress destinationAddress)


Copyright © 2011. All Rights Reserved.