Class PIM

  • All Implemented Interfaces:
    IPacket

    public class PIM
    extends BasePacket
    Implements PIM control packet format.
    • Constructor Detail

      • PIM

        public PIM()
        Default constructor.
    • 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
      • 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