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

Function _init_socket

scapy/sendrecv.py:1478–1489  ·  view source on GitHub ↗
(iface,  # type: _GlobInterfaceType
                     count,  # type: int
                     L2socket=L2socket  # type: Optional[Type[SuperSocket]]
                     )

Source from the content-addressed store, hash-verified

1476 del kargs[arg]
1477
1478 def _init_socket(iface, # type: _GlobInterfaceType
1479 count, # type: int
1480 L2socket=L2socket # type: Optional[Type[SuperSocket]]
1481 ):
1482 # type: (...) -> Tuple[SuperSocket, _GlobInterfaceType]
1483 if isinstance(iface, SuperSocket):
1484 return iface, "iface%d" % count
1485 else:
1486 if not L2socket:
1487 iface = resolve_iface(iface or conf.iface)
1488 L2socket = iface.l2socket()
1489 return L2socket(iface=iface), iface
1490 sckt1, if1 = _init_socket(if1, 1)
1491 sckt2, if2 = _init_socket(if2, 2)
1492 peers = {if1: sckt2, if2: sckt1}

Callers 1

bridge_and_sniffFunction · 0.85

Calls 2

resolve_ifaceFunction · 0.90
l2socketMethod · 0.80

Tested by

no test coverage detected