Class Redirect

  • All Implemented Interfaces:
    IPacket

    public class Redirect
    extends BasePacket
    Implements ICMPv6 Redirect packet format. (RFC 4861)
    • Field Detail

      • targetAddress

        protected byte[] targetAddress
      • destinationAddress

        protected byte[] destinationAddress
    • Constructor Detail

      • Redirect

        public Redirect()
    • Method Detail

      • getTargetAddress

        public byte[] getTargetAddress()
        Gets target address.
        Returns:
        the target IPv6 address
      • setTargetAddress

        public Redirect setTargetAddress​(byte[] targetAddress)
        Sets target address.
        Parameters:
        targetAddress - the target IPv6 address to set
        Returns:
        this
      • getDestinationAddress

        public byte[] getDestinationAddress()
        Gets destination address.
        Returns:
        the destination IPv6 address
      • setDestinationAddress

        public Redirect setDestinationAddress​(byte[] destinationAddress)
        Sets destination address.
        Parameters:
        destinationAddress - the destination IPv6 address to set
        Returns:
        this
      • getOptions

        public java.util.List<NeighborDiscoveryOptions.Option> getOptions()
        Gets the Neighbor Discovery Protocol packet options.
        Returns:
        the Neighbor Discovery Protocol packet options
      • addOption

        public Redirect addOption​(byte type,
                                  byte[] data)
        Adds a Neighbor Discovery Protocol packet option.
        Parameters:
        type - the option type
        data - the option data
        Returns:
        this
      • serialize

        public byte[] serialize()
        Description copied from interface: IPacket
        Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
        Returns:
        a byte[] containing this packet and payloads
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class BasePacket
      • deserializer

        public static Deserializer<Redirect> deserializer()
        Deserializer function for redirect packets.
        Returns:
        deserializer function
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object