MCPcopy
hub / github.com/sshuttle/sshuttle / recv_udp

Function recv_udp

sshuttle/methods/ipfw.py:15–26  ·  view source on GitHub ↗
(listener, bufsize)

Source from the content-addressed store, hash-verified

13
14
15def recv_udp(listener, bufsize):
16 debug3('Accept UDP python using recvmsg.')
17 data, ancdata, _, srcip = listener.recvmsg(4096,
18 socket.CMSG_SPACE(4))
19 dstip = None
20 for cmsg_level, cmsg_type, cmsg_data in ancdata:
21 if cmsg_level == socket.SOL_IP and cmsg_type == IP_RECVDSTADDR:
22 port = 53
23 ip = socket.inet_ntop(socket.AF_INET, cmsg_data[0:4])
24 dstip = (ip, port)
25 break
26 return (srcip, dstip, data)
27
28
29def ipfw_rule_exists(n):

Callers 1

recv_udpMethod · 0.70

Calls 1

debug3Function · 0.90

Tested by

no test coverage detected