public class ICMPPacket extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ICMPPacket.Type |
Modifier and Type | Field and Description |
---|---|
static int |
CHECKSUM_INDEX |
Constructor and Description |
---|
ICMPPacket(ByteBuffer ipPayload) |
ICMPPacket(ICMPPacket icmpPacket) |
ICMPPacket(int size) |
Modifier and Type | Method and 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) |
public static final int CHECKSUM_INDEX
public ICMPPacket(ByteBuffer ipPayload)
public ICMPPacket(ICMPPacket icmpPacket)
public ICMPPacket(int size)
public ICMPPacket.Type getType()
public void setType(ICMPPacket.Type t)
public int getCode()
public void setCode(int code)
public int getChecksum()
public void setChecksum()
public int computeChecksum()
public void setBytes(int index, byte[] b)
index
- The byte offset into the packet where the bytes will
be insertedpublic int makeUnsignedShort(byte b1, byte b0)
public int getUnsignedShort(int index)
index
- The byte offset into the packet where the value
can be foundpublic void setUnsignedShort(int index, int us)
index
- The byte offset into the packet where the value
can be foundus
- Unsigned short value to insert into the bufferpublic NativeDatagramPacket toDatagramPacket(InetAddress destinationAddress)
Copyright © 2021. All rights reserved.