Package org.onlab.packet.ndp
Class NeighborSolicitation
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ndp.NeighborSolicitation
-
- All Implemented Interfaces:
IPacket
public class NeighborSolicitation extends BasePacket
Implements ICMPv6 Neighbor Solicitation packet format. (RFC 4861)
-
-
Field Summary
Fields Modifier and Type Field Description static byte
HEADER_LENGTH
protected static byte
NDP_HOP_LIMIT
protected static byte
RESERVED_CODE
protected byte[]
targetAddress
-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description NeighborSolicitation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NeighborSolicitation
addOption(byte type, byte[] data)
Adds a Neighbor Discovery Protocol packet option.static Ethernet
buildNdpSolicit(Ip6Address targetIp, Ip6Address sourceIp, Ip6Address destinationIp, MacAddress sourceMac, MacAddress destinationMac, VlanId vlan)
Builds a NDP solicitation using the supplied parameters.static Deserializer<NeighborSolicitation>
deserializer()
Deserializer function for neighbor solicitation packets.boolean
equals(java.lang.Object obj)
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.NeighborSolicitation
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
-
NDP_HOP_LIMIT
protected static final byte NDP_HOP_LIMIT
- See Also:
- Constant Field Values
-
RESERVED_CODE
protected static final byte RESERVED_CODE
- See Also:
- Constant Field Values
-
targetAddress
protected byte[] targetAddress
-
-
Method Detail
-
getTargetAddress
public byte[] getTargetAddress()
Gets target address.- Returns:
- the target IPv6 address
-
setTargetAddress
public NeighborSolicitation setTargetAddress(byte[] targetAddress)
Sets target address.- Parameters:
targetAddress
- the target 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 NeighborSolicitation 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<NeighborSolicitation> deserializer()
Deserializer function for neighbor solicitation packets.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
buildNdpSolicit
public static Ethernet buildNdpSolicit(Ip6Address targetIp, Ip6Address sourceIp, Ip6Address destinationIp, MacAddress sourceMac, MacAddress destinationMac, VlanId vlan)
Builds a NDP solicitation using the supplied parameters.- Parameters:
targetIp
- the target ipsourceIp
- the source ipdestinationIp
- the destination ipsourceMac
- the source mac addressdestinationMac
- the destination mac addressvlan
- the vlan id- Returns:
- the ethernet packet containing the ndp solicitation
-
-