Package org.onlab.packet.ndp
Class RouterAdvertisement
- java.lang.Object
-
- org.onlab.packet.BasePacket
-
- org.onlab.packet.ndp.RouterAdvertisement
-
- All Implemented Interfaces:
IPacket
public class RouterAdvertisement extends BasePacket
Implements ICMPv6 Router Advertisement packet format. (RFC 4861)
-
-
Field Summary
Fields Modifier and Type Field Description protected bytecurrentHopLimitstatic byteHEADER_LENGTHprotected bytemFlagprotected byteoFlagprotected intreachableTimeprotected intretransmitTimerprotected shortrouterLifetime-
Fields inherited from class org.onlab.packet.BasePacket
parent, payload
-
-
Constructor Summary
Constructors Constructor Description RouterAdvertisement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RouterAdvertisementaddOption(byte type, byte[] data)Adds a Neighbor Discovery Protocol packet option.static Deserializer<RouterAdvertisement>deserializer()Deserializer function for router advertisement packets.booleanequals(java.lang.Object obj)bytegetCurrentHopLimit()Gets current hop limit.bytegetMFlag()Gets managed address configuration flag.bytegetOFlag()Gets other configuration flag.java.util.List<NeighborDiscoveryOptions.Option>getOptions()Gets the Neighbor Discovery Protocol packet options.intgetReachableTime()Gets reachable time.intgetRetransmitTimer()Gets retransmission timer.shortgetRouterLifetime()Gets router lifetime.inthashCode()byte[]serialize()Sets all payloads parent packet if applicable, then serializes this packet and all payloads.RouterAdvertisementsetCurrentHopLimit(byte currentHopLimit)Sets current hop limit.RouterAdvertisementsetMFlag(byte mFlag)Sets managed address configuration flag.RouterAdvertisementsetOFlag(byte oFlag)Sets other configuration flag.RouterAdvertisementsetReachableTime(int reachableTime)Sets reachable time.RouterAdvertisementsetRetransmitTimer(int retransmitTimer)Sets retransmission timer.RouterAdvertisementsetRouterLifetime(short routerLifetime)Sets router lifetime.java.lang.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
-
currentHopLimit
protected byte currentHopLimit
-
mFlag
protected byte mFlag
-
oFlag
protected byte oFlag
-
routerLifetime
protected short routerLifetime
-
reachableTime
protected int reachableTime
-
retransmitTimer
protected int retransmitTimer
-
-
Method Detail
-
getCurrentHopLimit
public byte getCurrentHopLimit()
Gets current hop limit.- Returns:
- the current hop limit
-
setCurrentHopLimit
public RouterAdvertisement setCurrentHopLimit(byte currentHopLimit)
Sets current hop limit.- Parameters:
currentHopLimit- the current hop limit to set- Returns:
- this
-
getMFlag
public byte getMFlag()
Gets managed address configuration flag.- Returns:
- the managed address configuration flag
-
setMFlag
public RouterAdvertisement setMFlag(byte mFlag)
Sets managed address configuration flag.- Parameters:
mFlag- the managed address configuration flag to set- Returns:
- this
-
getOFlag
public byte getOFlag()
Gets other configuration flag.- Returns:
- the other configuration flag
-
setOFlag
public RouterAdvertisement setOFlag(byte oFlag)
Sets other configuration flag.- Parameters:
oFlag- the other configuration flag to set- Returns:
- this
-
getRouterLifetime
public short getRouterLifetime()
Gets router lifetime.- Returns:
- the router lifetime
-
setRouterLifetime
public RouterAdvertisement setRouterLifetime(short routerLifetime)
Sets router lifetime.- Parameters:
routerLifetime- the router lifetime to set- Returns:
- this
-
getReachableTime
public int getReachableTime()
Gets reachable time.- Returns:
- the reachable time
-
setReachableTime
public RouterAdvertisement setReachableTime(int reachableTime)
Sets reachable time.- Parameters:
reachableTime- the reachable time to set- Returns:
- this
-
getRetransmitTimer
public int getRetransmitTimer()
Gets retransmission timer.- Returns:
- the retransmission timer
-
setRetransmitTimer
public RouterAdvertisement setRetransmitTimer(int retransmitTimer)
Sets retransmission timer.- Parameters:
retransmitTimer- the retransmission timer 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 RouterAdvertisement 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(java.lang.Object obj)
- Overrides:
equalsin classBasePacket
-
deserializer
public static Deserializer<RouterAdvertisement> deserializer()
Deserializer function for router advertisement packets.- Returns:
- deserializer function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-