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

Method parse_args

scapy/layers/tftp.py:350–357  ·  view source on GitHub ↗
(self, ip=None, sport=None, *args, **kargs)

Source from the content-addressed store, hash-verified

348 """
349
350 def parse_args(self, ip=None, sport=None, *args, **kargs):
351 if "iface" not in kargs and ip:
352 ip = str(Net(ip))
353 kargs["iface"] = conf.route.route(ip)[0]
354 kargs.setdefault("session", IPSession())
355 Automaton.parse_args(self, *args, **kargs)
356 self.ip = ip
357 self.sport = sport
358
359 def master_filter(self, pkt):
360 return TFTP in pkt and (not self.ip or pkt[IP].dst == self.ip)

Callers

nothing calls this directly

Calls 4

NetClass · 0.90
IPSessionClass · 0.90
routeMethod · 0.45
parse_argsMethod · 0.45

Tested by

no test coverage detected