22 Jun 2011 19:13
show2() and self.__class__ question
Jill Kaminski <jill <at> firstpasseng.com>
2011-06-22 17:13:33 GMT
2011-06-22 17:13:33 GMT
Hello,
I have created a new file named mpls.py under the layers/ directory to
define two new layers: MPLS and MPLS_MULTI.
They are working properly, except when I have an MPLS_MULTI() after an
MPLS(), as in a = MPLS() / MPLS_MULTI().
If I call a.show2(), the MPLS_MULTI layer is displayed as an MPLS.
Here is my class:
"""
MPLS (Multi-Protocol Label Switching)
[RFC 3032]
"""
from scapy.packet import *
from scapy.fields import *
from scapy.layers.l2 import Ether, Dot1Q
from scapy.layers.ppp import PPP
from scapy.layers.inet import IP
from scapy.layers.inet6 import IPv6
class MPLS(Packet):
name = "MPLS-Unicast"
fields_desc = [
BitField("label", 3, 20),
BitField("experimental", 0, 3),
BitField("bottom_of_stack", 1, 1),
ByteField("ttl", 32)
(Continue reading)
RSS Feed