public class NeighborSolicitation extends BasePacket
Modifier and Type | Field and Description |
---|---|
static byte |
HEADER_LENGTH |
protected byte[] |
targetAddress |
parent, payload
Constructor and Description |
---|
NeighborSolicitation() |
Modifier and Type | Method and Description |
---|---|
NeighborSolicitation |
addOption(byte type,
byte[] data)
Adds a Neighbor Discovery Protocol packet option.
|
static Ethernet |
buildNdpSolicit(byte[] targetIp,
byte[] sourceIp,
byte[] destinationIp,
byte[] sourceMac,
byte[] destinationMac,
VlanId vlan)
Builds a NDP solicitation using the supplied parameters.
|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserialize this packet layer and all possible payloads.
|
static Deserializer<NeighborSolicitation> |
deserializer()
Deserializer function for neighbor solicitation packets.
|
boolean |
equals(Object obj) |
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.
|
String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayload
public static final byte HEADER_LENGTH
protected byte[] targetAddress
public byte[] getTargetAddress()
public NeighborSolicitation setTargetAddress(byte[] targetAddress)
targetAddress
- the target IPv6 address to setpublic List<NeighborDiscoveryOptions.Option> getOptions()
public NeighborSolicitation addOption(byte type, byte[] data)
type
- the option typedata
- the option datapublic byte[] serialize()
IPacket
public IPacket deserialize(byte[] data, int offset, int length)
IPacket
data
- bytes to deserializeoffset
- offset to start deserializing fromlength
- length of the data to deserializepublic int hashCode()
hashCode
in class BasePacket
public boolean equals(Object obj)
equals
in class BasePacket
public static Deserializer<NeighborSolicitation> deserializer()
public static Ethernet buildNdpSolicit(byte[] targetIp, byte[] sourceIp, byte[] destinationIp, byte[] sourceMac, byte[] destinationMac, VlanId vlan)
targetIp
- the target ipsourceIp
- the source ipdestinationIp
- the destination ipsourceMac
- the source mac addressdestinationMac
- the destination mac addressvlan
- the vlan id