Package org.opennms.jicmp.ip
Class ICMPPacket
- java.lang.Object
-
- org.opennms.jicmp.ip.ICMPPacket
-
- Direct Known Subclasses:
ICMPEchoPacket
public class ICMPPacket extends Object
ICMPPacket- Author:
- brozow
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ICMPPacket.Type
-
Field Summary
Fields Modifier and Type Field Description static int
CHECKSUM_INDEX
-
Constructor Summary
Constructors Constructor Description ICMPPacket(int size)
ICMPPacket(ByteBuffer ipPayload)
ICMPPacket(ICMPPacket icmpPacket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
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 foundus
- Unsigned short value to insert into the buffer
-
toDatagramPacket
public NativeDatagramPacket toDatagramPacket(InetAddress destinationAddress)
-
-