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[]destinationAddressstatic byteHEADER_LENGTHprotected 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 RedirectaddOption(byte type, byte[] data)Adds a Neighbor Discovery Protocol packet option.static Deserializer<Redirect>deserializer()Deserializer function for redirect packets.booleanequals(Object obj)byte[]getDestinationAddress()Gets destination address.List<NeighborDiscoveryOptions.Option>getOptions()Gets the Neighbor Discovery Protocol packet options.byte[]getTargetAddress()Gets target address.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.RedirectsetDestinationAddress(byte[] destinationAddress)Sets destination address.RedirectsetTargetAddress(byte[] targetAddress)Sets target address.StringtoString()- 
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 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:IPacketSets 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:
 hashCodein classBasePacket
 
- 
equals
public boolean equals(Object obj)
- Overrides:
 equalsin classBasePacket
 
- 
deserializer
public static Deserializer<Redirect> deserializer()
Deserializer function for redirect packets.- Returns:
 - deserializer function
 
 
 - 
 
 -