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

Method ifadd

scapy/route.py:159–166  ·  view source on GitHub ↗
(self, iff, addr)

Source from the content-addressed store, hash-verified

157 self.routes = new_routes
158
159 def ifadd(self, iff, addr):
160 # type: (str, str) -> None
161 self.invalidate_cache()
162 the_addr, the_msk_b = (addr.split("/") + ["32"])[:2]
163 the_msk = itom(int(the_msk_b))
164 the_rawaddr = atol(the_addr)
165 the_net = the_rawaddr & the_msk
166 self.routes.append((the_net, the_msk, '0.0.0.0', iff, the_addr, 1))
167
168 def route(self, dst=None, dev=None, verbose=conf.verb, _internal=False):
169 # type: (Optional[str], Optional[str], int, bool) -> Tuple[str, str, str]

Callers

nothing calls this directly

Calls 4

invalidate_cacheMethod · 0.95
itomFunction · 0.90
atolFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected