Class Bmp

  • All Implemented Interfaces:
    IPacket

    public class Bmp
    extends BasePacket
    The following common header appears in all BMP messages. The rest of the data in a BMP message is dependent on the Message Type field in the common header.

    Version (1 byte): Indicates the BMP version. This is set to '3' for all messages defined in this specification. ('1' and '2' were used by draft versions of this document.) Version 0 is reserved and MUST NOT be sent.

    Message Length (4 bytes): Length of the message in bytes (including headers, data, and encapsulated messages, if any).

    Message Type (1 byte): This identifies the type of the BMP message. A BMP implementation MUST ignore unrecognized message types upon receipt.

    Type = 0: Route Monitoring Type = 1: Statistics Report Type = 2: Peer Down Notification Type = 3: Peer Up Notification Type = 4: Initiation Message Type = 5: Termination Message Type = 6: Route Mirroring Message

    • Field Detail

      • DEFAULT_PACKET_MINIMUM_LENGTH

        public static final int DEFAULT_PACKET_MINIMUM_LENGTH
        See Also:
        Constant Field Values
      • version

        protected byte version
      • type

        protected byte type
      • length

        protected int length
    • Constructor Detail

      • Bmp

        public Bmp()
    • Method Detail

      • setVersion

        public void setVersion​(byte version)
        Sets version field.
        Parameters:
        version - message version field
      • setType

        public void setType​(byte type)
        Sets message type.
        Parameters:
        type - message type
      • setLength

        public void setLength​(int length)
        Sets message length.
        Parameters:
        length - message length
      • getLength

        public int getLength()
        Returns message length.
        Returns:
        message length
      • getVersion

        public byte getVersion()
        Returns message version.
        Returns:
        message version
      • getType

        public byte getType()
        Returns message type.
        Returns:
        message type
      • serialize

        public byte[] serialize()
        Description copied from interface: IPacket
        Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
        Returns:
        a byte[] containing this packet and payloads
      • deserializer

        public static Deserializer<Bmp> deserializer()
        Deserializer function for Bmp Packets.
        Returns:
        deserializer function