Class MPLS

  • All Implemented Interfaces:
    IPacket

    public class MPLS
    extends BasePacket
    Representation of an MPLS Packet.
    • Field Detail

      • label

        protected int label
      • bos

        protected byte bos
      • ttl

        protected byte ttl
      • protocol

        protected byte protocol
    • Constructor Detail

      • MPLS

        public MPLS()
        Default constructor that sets the version to 4.
    • Method Detail

      • 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
      • getLabel

        public int getLabel()
        Returns the MPLS label.
        Returns:
        MPLS label
      • setLabel

        public void setLabel​(int label)
        Sets the MPLS label.
        Parameters:
        label - MPLS label
      • getTtl

        public byte getTtl()
        Returns the MPLS TTL of the packet.
        Returns:
        MPLS TTL of the packet
      • setTtl

        public void setTtl​(byte ttl)
        Sets the MPLS TTL of the packet.
        Parameters:
        ttl - MPLS TTL
      • deserializer

        public static Deserializer<MPLS> deserializer()
        Deserializer function for MPLS packets.
        Returns:
        deserializer function