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

Function get_if

scapy/arch/unix.py:34–42  ·  view source on GitHub ↗

Ease SIOCGIF* ioctl calls

(iff, cmd)

Source from the content-addressed store, hash-verified

32
33
34def get_if(iff, cmd):
35 # type: (str, int) -> bytes
36 """Ease SIOCGIF* ioctl calls"""
37
38 sck = socket.socket()
39 try:
40 return ioctl(sck, cmd, struct.pack("16s16x", iff.encode("utf8")))
41 finally:
42 sck.close()
43
44
45def get_if_raw_hwaddr(iff, # type: str

Callers 1

get_if_raw_hwaddrFunction · 0.85

Calls 2

encodeMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected