MCPcopy Create free account
hub / github.com/secdev/scapy / MegId

Class MegId

scapy/contrib/oam.py:66–111  ·  view source on GitHub ↗

MEG ID

Source from the content-addressed store, hash-verified

64
65
66class MegId(Packet):
67 """
68 MEG ID
69 """
70
71 name = "MEG ID"
72
73 fields_desc = [
74 ByteField("resv", 1),
75 ByteField("format", 0),
76 MultipleTypeField(
77 [
78 (
79 LenField("length", 13, fmt="B"),
80 lambda p: p.format == 32,
81 ),
82 (
83 LenField("length", 15, fmt="B"),
84 lambda p: p.format == 33,
85 )
86 ],
87 LenField("length", 45, fmt="B"),
88 ),
89 PadField(
90 MultipleTypeField(
91 [
92 (
93 FieldListField("values", [0] * 13,
94 ByteField("value", 0),
95 count_from=lambda pkt: pkt.length),
96 lambda x: x.format == 32,
97 ),
98 (
99 FieldListField("values", [0] * 15,
100 ByteField("value", 0),
101 count_from=lambda pkt: pkt.length),
102 lambda x: x.format == 33,
103 )
104 ],
105 NBytesField("values", 0, sz=45),
106 ),
107 45),
108 ]
109
110 def extract_padding(self, s):
111 return b"", s
112
113
114class OAM_TLV(Packet):

Callers 1

OAMClass · 0.85

Calls 6

ByteFieldClass · 0.90
MultipleTypeFieldClass · 0.90
LenFieldClass · 0.90
PadFieldClass · 0.90
FieldListFieldClass · 0.90
NBytesFieldClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…