public class MPLS extends BasePacket
Modifier and Type | Field and Description |
---|---|
protected byte |
bos |
static int |
HEADER_LENGTH |
protected int |
label |
protected byte |
protocol |
static byte |
PROTOCOL_IPV4 |
static byte |
PROTOCOL_MPLS |
protected byte |
ttl |
parent, payload
Constructor and Description |
---|
MPLS()
Default constructor that sets the version to 4.
|
Modifier and Type | Method and Description |
---|---|
static Deserializer<MPLS> |
deserializer()
Deserializer function for MPLS packets.
|
int |
getLabel()
Returns the MPLS label.
|
byte |
getTtl()
Returns the MPLS TTL of the packet.
|
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads.
|
void |
setLabel(int label)
Sets the MPLS label.
|
void |
setTtl(byte ttl)
Sets the MPLS TTL of the packet.
|
java.lang.String |
toString() |
clone, equals, getParent, getPayload, hashCode, resetChecksum, setParent, setPayload
public static final int HEADER_LENGTH
public static final byte PROTOCOL_IPV4
public static final byte PROTOCOL_MPLS
protected int label
protected byte bos
protected byte ttl
protected byte protocol
public byte[] serialize()
IPacket
public int getLabel()
public void setLabel(int label)
label
- MPLS labelpublic byte getTtl()
public void setTtl(byte ttl)
ttl
- MPLS TTLpublic static Deserializer<MPLS> deserializer()
public java.lang.String toString()
toString
in class java.lang.Object