public class NeighborAdvertisement extends BasePacket
Modifier and Type | Field and Description |
---|---|
static byte |
HEADER_LENGTH |
protected static byte |
NDP_HOP_LIMIT |
protected static byte |
NDP_OVERRIDE_FLAG |
protected static byte |
NDP_SOLICITED_FLAG |
protected byte |
overrideFlag |
protected static byte |
RESERVED_CODE |
protected byte |
routerFlag |
protected byte |
solicitedFlag |
protected byte[] |
targetAddress |
parent, payload
Constructor and Description |
---|
NeighborAdvertisement() |
Modifier and Type | Method and Description |
---|---|
NeighborAdvertisement |
addOption(byte type,
byte[] data)
Adds a Neighbor Discovery Protocol packet option.
|
static Ethernet |
buildNdpAdv(byte[] srcIp,
byte[] srcMac,
Ethernet request)
Deprecated.
since 1.11.0
|
static Ethernet |
buildNdpAdv(Ip6Address srcIp,
MacAddress srcMac,
Ethernet request)
Builds an NDP reply based on a request.
|
static Deserializer<NeighborAdvertisement> |
deserializer()
Deserializer function for neighbor advertisement packets.
|
boolean |
equals(Object obj) |
List<NeighborDiscoveryOptions.Option> |
getOptions()
Gets the Neighbor Discovery Protocol packet options.
|
byte |
getOverrideFlag()
Gets override flag.
|
byte |
getRouterFlag()
Gets router flag.
|
byte |
getSolicitedFlag()
Gets solicited flag.
|
byte[] |
getTargetAddress()
Gets target address.
|
int |
hashCode() |
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads.
|
NeighborAdvertisement |
setOverrideFlag(byte overrideFlag)
Sets override flag.
|
NeighborAdvertisement |
setRouterFlag(byte routerFlag)
Sets router flag.
|
NeighborAdvertisement |
setSolicitedFlag(byte solicitedFlag)
Sets solicited flag.
|
NeighborAdvertisement |
setTargetAddress(byte[] targetAddress)
Sets target address.
|
String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayload
public static final byte HEADER_LENGTH
protected static final byte NDP_HOP_LIMIT
protected static final byte NDP_SOLICITED_FLAG
protected static final byte NDP_OVERRIDE_FLAG
protected static final byte RESERVED_CODE
protected byte routerFlag
protected byte solicitedFlag
protected byte overrideFlag
protected byte[] targetAddress
public byte getRouterFlag()
public NeighborAdvertisement setRouterFlag(byte routerFlag)
routerFlag
- the router flag to setpublic byte getSolicitedFlag()
public NeighborAdvertisement setSolicitedFlag(byte solicitedFlag)
solicitedFlag
- the solicited flag to setpublic byte getOverrideFlag()
public NeighborAdvertisement setOverrideFlag(byte overrideFlag)
overrideFlag
- the override flag to setpublic byte[] getTargetAddress()
public NeighborAdvertisement setTargetAddress(byte[] targetAddress)
targetAddress
- the target IPv6 address to setpublic List<NeighborDiscoveryOptions.Option> getOptions()
public NeighborAdvertisement addOption(byte type, byte[] data)
type
- the option typedata
- the option datapublic byte[] serialize()
IPacket
public int hashCode()
hashCode
in class BasePacket
public boolean equals(Object obj)
equals
in class BasePacket
public static Deserializer<NeighborAdvertisement> deserializer()
@Deprecated public static Ethernet buildNdpAdv(byte[] srcIp, byte[] srcMac, Ethernet request)
srcIp
- the IP address to use as the reply sourcesrcMac
- the MAC address to use as the reply sourcerequest
- the Neighbor Solicitation request we gotpublic static Ethernet buildNdpAdv(Ip6Address srcIp, MacAddress srcMac, Ethernet request)
srcIp
- the IP address to use as the reply sourcesrcMac
- the MAC address to use as the reply sourcerequest
- the Neighbor Solicitation request we got