Package org.onlab.packet
Class PIM
- java.lang.Object
 - 
- org.onlab.packet.BasePacket
 - 
- org.onlab.packet.PIM
 
 
 
- 
- All Implemented Interfaces:
 IPacket
public class PIM extends BasePacket
Implements PIM control packet format. 
- 
- 
Field Summary
Fields Modifier and Type Field Description static byteADDRESS_FAMILY_IP4static byteADDRESS_FAMILY_IP6protected shortchecksumstatic IpAddressPIM_ADDRESSstatic intPIM_HEADER_LENstatic Map<Byte,Deserializer<? extends IPacket>>PROTOCOL_DESERIALIZER_MAPprotected bytereservedprotected bytetypestatic byteTYPE_ASSERTstatic byteTYPE_BOOTSTRAPstatic byteTYPE_CANDIDATE_RP_ADVstatic byteTYPE_GRAFTstatic byteTYPE_GRAFT_ACKstatic byteTYPE_HELLOstatic byteTYPE_JOIN_PRUNE_REQUESTstatic byteTYPE_REGISTERstatic byteTYPE_REGISTER_STOPprotected byteversion- 
Fields inherited from class org.onlab.packet.BasePacket
parent, payload 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PIM()Default constructor. 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Deserializer<PIM>deserializer()Deserializer function for IPv4 packets.booleanequals(Object obj)shortgetChecksum()Get the checksum of this packet.bytegetPimMsgType()Return the PIM message type.bytegetReserved()Get the reserved field.bytegetVersion()Get the version of PIM.inthashCode()byte[]serialize()Serializes the packet.voidsetChecksum(short checksum)Set the checksum.PIMsetPIMType(byte type)Set the PIM message type.voidsetReserved(byte reserved)Set the reserved field.voidsetVersion(byte version)Set the PIM version type.StringtoString()- 
Methods inherited from class org.onlab.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload 
 - 
 
 - 
 
- 
- 
Field Detail
- 
PIM_ADDRESS
public static final IpAddress PIM_ADDRESS
 
- 
TYPE_HELLO
public static final byte TYPE_HELLO
- See Also:
 - Constant Field Values
 
 
- 
TYPE_REGISTER
public static final byte TYPE_REGISTER
- See Also:
 - Constant Field Values
 
 
- 
TYPE_REGISTER_STOP
public static final byte TYPE_REGISTER_STOP
- See Also:
 - Constant Field Values
 
 
- 
TYPE_JOIN_PRUNE_REQUEST
public static final byte TYPE_JOIN_PRUNE_REQUEST
- See Also:
 - Constant Field Values
 
 
- 
TYPE_BOOTSTRAP
public static final byte TYPE_BOOTSTRAP
- See Also:
 - Constant Field Values
 
 
- 
TYPE_ASSERT
public static final byte TYPE_ASSERT
- See Also:
 - Constant Field Values
 
 
- 
TYPE_GRAFT
public static final byte TYPE_GRAFT
- See Also:
 - Constant Field Values
 
 
- 
TYPE_GRAFT_ACK
public static final byte TYPE_GRAFT_ACK
- See Also:
 - Constant Field Values
 
 
- 
TYPE_CANDIDATE_RP_ADV
public static final byte TYPE_CANDIDATE_RP_ADV
- See Also:
 - Constant Field Values
 
 
- 
PIM_HEADER_LEN
public static final int PIM_HEADER_LEN
- See Also:
 - Constant Field Values
 
 
- 
ADDRESS_FAMILY_IP4
public static final byte ADDRESS_FAMILY_IP4
- See Also:
 - Constant Field Values
 
 
- 
ADDRESS_FAMILY_IP6
public static final byte ADDRESS_FAMILY_IP6
- See Also:
 - Constant Field Values
 
 
- 
PROTOCOL_DESERIALIZER_MAP
public static final Map<Byte,Deserializer<? extends IPacket>> PROTOCOL_DESERIALIZER_MAP
 
- 
version
protected byte version
 
- 
type
protected byte type
 
- 
reserved
protected byte reserved
 
- 
checksum
protected short checksum
 
 - 
 
- 
Method Detail
- 
getPimMsgType
public byte getPimMsgType()
Return the PIM message type.- Returns:
 - the pimMsgType
 
 
- 
setPIMType
public PIM setPIMType(byte type)
Set the PIM message type. Currently PIMJoinPrune and PIMHello are supported.- Parameters:
 type- PIM message type- Returns:
 - PIM Header
 
 
- 
getVersion
public byte getVersion()
Get the version of PIM.- Returns:
 - the PIM version. Must be 2.
 
 
- 
setVersion
public void setVersion(byte version)
Set the PIM version type. Should not change from 2.- Parameters:
 version- PIM version
 
- 
getReserved
public byte getReserved()
Get the reserved field.- Returns:
 - the reserved field. Must be ignored.
 
 
- 
setReserved
public void setReserved(byte reserved)
Set the reserved field.- Parameters:
 reserved- should be 0
 
- 
getChecksum
public short getChecksum()
Get the checksum of this packet.- Returns:
 - the checksum
 
 
- 
setChecksum
public void setChecksum(short checksum)
Set the checksum.- Parameters:
 checksum- the checksum
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classBasePacket
 
- 
equals
public boolean equals(Object obj)
- Overrides:
 equalsin classBasePacket
 
- 
serialize
public byte[] serialize()
Serializes the packet. Will compute and set the following fields if they are set to specific values at the time serialize is called: -checksum : 0 -length : 0- Returns:
 - will return the serialized packet
 
 
- 
deserializer
public static Deserializer<PIM> deserializer()
Deserializer function for IPv4 packets.- Returns:
 - deserializer function
 
 
 - 
 
 -