MCPcopy Index your code
hub / github.com/secdev/scapy / SNMP

Class SNMP

scapy/layers/snmp.py:267–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265
266
267class SNMP(ASN1_Packet):
268 ASN1_codec = ASN1_Codecs.BER
269 ASN1_root = ASN1F_SEQUENCE(
270 ASN1F_enum_INTEGER("version", 1, {0: "v1", 1: "v2c", 2: "v2", 3: "v3"}), # noqa: E501
271 ASN1F_STRING("community", "public"),
272 ASN1F_CHOICE("PDU", SNMPget(),
273 SNMPget, SNMPnext, SNMPresponse, SNMPset,
274 SNMPtrapv1, SNMPbulk, SNMPinform, SNMPtrapv2)
275 )
276
277 def answers(self, other):
278 return (isinstance(self.PDU, SNMPresponse) and
279 isinstance(other.PDU, (SNMPget, SNMPnext, SNMPset)) and
280 self.PDU.id == other.PDU.id)
281
282
283bind_bottom_up(UDP, SNMP, sport=161)

Callers 1

snmpwalkFunction · 0.85

Calls 5

ASN1F_SEQUENCEClass · 0.90
ASN1F_enum_INTEGERClass · 0.90
ASN1F_STRINGClass · 0.90
ASN1F_CHOICEClass · 0.90
SNMPgetClass · 0.85

Tested by

no test coverage detected