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

Class _BOOTP_chaddr

scapy/layers/dhcp.py:74–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74class _BOOTP_chaddr(StrFixedLenField):
75 def i2m(self, pkt, x):
76 if isinstance(x, VolatileValue):
77 x = x._fix()
78 return MACField.i2m(self, pkt, x)
79
80 def i2repr(self, pkt, v):
81 if isinstance(v, VolatileValue):
82 return repr(v)
83 if pkt.htype == 1: # Ethernet
84 if v[6:] == b"\x00" * 10: # Default padding
85 return "%s (+ 10 nul pad)" % str2mac(v[:6])
86 else:
87 return "%s (pad: %s)" % (str2mac(v[:6]), v[6:])
88 return super(_BOOTP_chaddr, self).i2repr(pkt, v)
89
90
91class BOOTP(Packet):

Callers 1

BOOTPClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…