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

Method __init__

scapy/fields.py:164–176  ·  view source on GitHub ↗
(self, name, default, fmt="H")

Source from the content-addressed store, hash-verified

162 holds_packets = 0
163
164 def __init__(self, name, default, fmt="H"):
165 # type: (str, Any, str) -> None
166 if not isinstance(name, str):
167 raise ValueError("name should be a string")
168 self.name = name
169 if fmt[0] in "@=<>!":
170 self.fmt = fmt
171 else:
172 self.fmt = "!" + fmt
173 self.struct = struct.Struct(self.fmt)
174 self.default = self.any2i(None, default)
175 self.sz = struct.calcsize(self.fmt) # type: int
176 self.owners = [] # type: List[Type[Packet]]
177
178 def register_owner(self, cls):
179 # type: (Type[Packet]) -> None

Callers

nothing calls this directly

Calls 1

any2iMethod · 0.95

Tested by

no test coverage detected