Class ICMPPacket

  • Direct Known Subclasses:
    ICMPEchoPacket

    public class ICMPPacket
    extends java.lang.Object
    ICMPPacket
    Author:
    brozow
    • Constructor Detail

      • ICMPPacket

        public ICMPPacket​(java.nio.ByteBuffer ipPayload)
      • ICMPPacket

        public ICMPPacket​(ICMPPacket icmpPacket)
      • ICMPPacket

        public ICMPPacket​(int size)
    • Method Detail

      • 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​(java.net.InetAddress destinationAddress)