MCPcopy Create free account
hub / github.com/ActiveState/code / if_nametoindex

Function if_nametoindex

recipes/Python/442490_IPv6_Multicast/recipe-442490.py:23–28  ·  view source on GitHub ↗
(interfaceName)

Source from the content-addressed store, hash-verified

21 else:
22 _libc = ctypes.cdll.libc
23 def if_nametoindex(interfaceName):
24 # if you have a better way to get the interface index, I'd love to hear
25 # it... You are supposed to be able to leave the interface number as 0,
26 # but I get an exception when I try this. (MacOS 10.4) It may be because
27 # it is a multihomed device...
28 return _libc.if_nametoindex(interfaceName)
29
30if if_nametoindex is None:
31 try: import dl

Callers 1

ipv6MulticastFunction · 0.85

Calls 1

callMethod · 0.45

Tested by

no test coverage detected