def _linux_get_dest_addr(self): # pragma: no cover
src_stream = self.context.src_stream
sock_opt = src_stream.socket.getsockopt(socket.SOL_IP,
self.SO_ORIGINAL_DST,
16)
_, port, a1, a2, a3, a4 = struct.unpack("!HHBBBBxxxxxxxx", sock_opt)
address = "%d.%d.%d.%d" % (a1, a2, a3, a4)
return (address, port)
评论列表
文章目录