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 SummaryFields Modifier and Type Field Description protected bytecurrentHopLimitstatic byteHEADER_LENGTHprotected bytemFlagprotected byteoFlagprotected intreachableTimeprotected intretransmitTimerprotected shortrouterLifetime- 
Fields inherited from class org.onlab.packet.BasePacketparent, payload
 
- 
 - 
Constructor SummaryConstructors Constructor Description RouterAdvertisement()
 - 
Method SummaryAll 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(Object obj)bytegetCurrentHopLimit()Gets current hop limit.bytegetMFlag()Gets managed address configuration flag.bytegetOFlag()Gets other configuration flag.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.StringtoString()- 
Methods inherited from class org.onlab.packet.BasePacketclone, getParent, getPayload, resetChecksum, setParent, setPayload
 
- 
 
- 
- 
- 
Field Detail- 
HEADER_LENGTHpublic static final byte HEADER_LENGTH - See Also:
- Constant Field Values
 
 - 
currentHopLimitprotected byte currentHopLimit 
 - 
mFlagprotected byte mFlag 
 - 
oFlagprotected byte oFlag 
 - 
routerLifetimeprotected short routerLifetime 
 - 
reachableTimeprotected int reachableTime 
 - 
retransmitTimerprotected int retransmitTimer 
 
- 
 - 
Method Detail- 
getCurrentHopLimitpublic byte getCurrentHopLimit() Gets current hop limit.- Returns:
- the current hop limit
 
 - 
setCurrentHopLimitpublic RouterAdvertisement setCurrentHopLimit(byte currentHopLimit) Sets current hop limit.- Parameters:
- currentHopLimit- the current hop limit to set
- Returns:
- this
 
 - 
getMFlagpublic byte getMFlag() Gets managed address configuration flag.- Returns:
- the managed address configuration flag
 
 - 
setMFlagpublic RouterAdvertisement setMFlag(byte mFlag) Sets managed address configuration flag.- Parameters:
- mFlag- the managed address configuration flag to set
- Returns:
- this
 
 - 
getOFlagpublic byte getOFlag() Gets other configuration flag.- Returns:
- the other configuration flag
 
 - 
setOFlagpublic RouterAdvertisement setOFlag(byte oFlag) Sets other configuration flag.- Parameters:
- oFlag- the other configuration flag to set
- Returns:
- this
 
 - 
getRouterLifetimepublic short getRouterLifetime() Gets router lifetime.- Returns:
- the router lifetime
 
 - 
setRouterLifetimepublic RouterAdvertisement setRouterLifetime(short routerLifetime) Sets router lifetime.- Parameters:
- routerLifetime- the router lifetime to set
- Returns:
- this
 
 - 
getReachableTimepublic int getReachableTime() Gets reachable time.- Returns:
- the reachable time
 
 - 
setReachableTimepublic RouterAdvertisement setReachableTime(int reachableTime) Sets reachable time.- Parameters:
- reachableTime- the reachable time to set
- Returns:
- this
 
 - 
getRetransmitTimerpublic int getRetransmitTimer() Gets retransmission timer.- Returns:
- the retransmission timer
 
 - 
setRetransmitTimerpublic RouterAdvertisement setRetransmitTimer(int retransmitTimer) Sets retransmission timer.- Parameters:
- retransmitTimer- the retransmission timer to set
- Returns:
- this
 
 - 
getOptionspublic List<NeighborDiscoveryOptions.Option> getOptions() Gets the Neighbor Discovery Protocol packet options.- Returns:
- the Neighbor Discovery Protocol packet options
 
 - 
addOptionpublic RouterAdvertisement addOption(byte type, byte[] data) Adds a Neighbor Discovery Protocol packet option.- Parameters:
- type- the option type
- data- the option data
- Returns:
- this
 
 - 
serializepublic 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
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- BasePacket
 
 - 
equalspublic boolean equals(Object obj) - Overrides:
- equalsin class- BasePacket
 
 - 
deserializerpublic static Deserializer<RouterAdvertisement> deserializer() Deserializer function for router advertisement packets.- Returns:
- deserializer function
 
 
- 
 
-