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 byte
ADDRESS_FAMILY_IP4
static byte
ADDRESS_FAMILY_IP6
protected short
checksum
static IpAddress
PIM_ADDRESS
static int
PIM_HEADER_LEN
static Map<Byte,Deserializer<? extends IPacket>>
PROTOCOL_DESERIALIZER_MAP
protected byte
reserved
protected byte
type
static byte
TYPE_ASSERT
static byte
TYPE_BOOTSTRAP
static byte
TYPE_CANDIDATE_RP_ADV
static byte
TYPE_GRAFT
static byte
TYPE_GRAFT_ACK
static byte
TYPE_HELLO
static byte
TYPE_JOIN_PRUNE_REQUEST
static byte
TYPE_REGISTER
static byte
TYPE_REGISTER_STOP
protected byte
version
-
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.boolean
equals(Object obj)
short
getChecksum()
Get the checksum of this packet.byte
getPimMsgType()
Return the PIM message type.byte
getReserved()
Get the reserved field.byte
getVersion()
Get the version of PIM.int
hashCode()
byte[]
serialize()
Serializes the packet.void
setChecksum(short checksum)
Set the checksum.PIM
setPIMType(byte type)
Set the PIM message type.void
setReserved(byte reserved)
Set the reserved field.void
setVersion(byte version)
Set the PIM version type.String
toString()
-
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:
hashCode
in classBasePacket
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in 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
-
-