blob: e2783b9759594d197a4ea1d563ecff904dc3ec4c [file] [log] [blame]
Rich Lane8f2861e2013-01-11 09:13:20 -08001# Imported from scapy at revision 1270:113ef25f9583
2# This file is not included in the Ubuntu packages of scapy, so it is checked
3# in to our repo to simplify installation. This file is under the GPLv2.
4
5# http://trac.secdev.org/scapy/ticket/31
6
7# scapy.contrib.description = MPLS
8# scapy.contrib.status = loads
9
10from scapy.packet import Packet,bind_layers
11from scapy.fields import BitField,ByteField
12from scapy.layers.l2 import Ether
13
14class MPLS(Packet):
15 name = "MPLS"
16 fields_desc = [ BitField("label", 3, 20),
17 BitField("cos", 0, 3),
18 BitField("s", 1, 1),
19 ByteField("ttl", 0) ]
20
21bind_layers(Ether, MPLS, type=0x8847)
22
23# Not in upstream scapy
24bind_layers(MPLS, MPLS, s=0)