(iface, # type: _GlobInterfaceType
count, # type: int
L2socket=L2socket # type: Optional[Type[SuperSocket]]
)
| 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} |
no test coverage detected