Package org.onlab.packet.ndp
Class Redirect
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ndp.Redirect
-
- All Implemented Interfaces:
IPacket
public class Redirect extends BasePacket
Implements ICMPv6 Redirect packet format. (RFC 4861)
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
destinationAddress
static byte
HEADER_LENGTH
protected byte[]
targetAddress
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description Redirect()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Redirect
addOption(byte type, byte[] data)
Adds a Neighbor Discovery Protocol packet option.static Deserializer<Redirect>
deserializer()
Deserializer function for redirect packets.boolean
equals(java.lang.Object obj)
byte[]
getDestinationAddress()
Gets destination address.java.util.List<NeighborDiscoveryOptions.Option>
getOptions()
Gets the Neighbor Discovery Protocol packet options.byte[]
getTargetAddress()
Gets target address.int
hashCode()
byte[]
serialize()
Sets all payloads parent packet if applicable, then serializes this packet and all payloads.Redirect
setDestinationAddress(byte[] destinationAddress)
Sets destination address.Redirect
setTargetAddress(byte[] targetAddress)
Sets target address.java.lang.String
toString()
-
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
-
-
-
-
Field Detail
-
HEADER_LENGTH
public static final byte HEADER_LENGTH
- See Also:
- Constant Field Values
-
targetAddress
protected byte[] targetAddress
-
destinationAddress
protected byte[] destinationAddress
-
-
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 typedata
- 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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBasePacket
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classBasePacket
-
deserializer
public static Deserializer<Redirect> deserializer()
Deserializer function for redirect packets.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-