(listener, method, mux, handlers)
| 568 | |
| 569 | |
| 570 | def ondns(listener, method, mux, handlers): |
| 571 | now = time.time() |
| 572 | t = method.recv_udp(listener, 4096) |
| 573 | if t is None: |
| 574 | return |
| 575 | srcip, dstip, data = t |
| 576 | # dstip is None if we are using a method where we can't determine |
| 577 | # the destination IP of the DNS request that we captured from the client. |
| 578 | if dstip is None: |
| 579 | debug1('DNS request from %r: %d bytes' % (srcip, len(data))) |
| 580 | else: |
| 581 | debug1('DNS request from %r to %r: %d bytes' % |
| 582 | (srcip, dstip, len(data))) |
| 583 | chan = mux.next_channel() |
| 584 | dnsreqs[chan] = now + 30 |
| 585 | mux.send(chan, ssnet.CMD_DNS_REQ, data) |
| 586 | mux.channels[chan] = lambda cmd, data: dns_done( |
| 587 | chan, data, method, listener, srcip=dstip, dstip=srcip, mux=mux) |
| 588 | expire_connections(now, mux) |
| 589 | |
| 590 | |
| 591 | def _main(tcp_listener, udp_listener, fw, ssh_cmd, remotename, |
nothing calls this directly
no test coverage detected