… | |
… | |
42 | #include <unistd.h> |
42 | #include <unistd.h> |
43 | #include <fcntl.h> |
43 | #include <fcntl.h> |
44 | |
44 | |
45 | #include <map> |
45 | #include <map> |
46 | |
46 | |
|
|
47 | #include <cstdio> /* bug in libgmp: gmp.h relies on cstdio being included */ |
47 | #include <gmp.h> |
48 | #include <gmp.h> |
48 | |
49 | |
49 | #include "netcompat.h" |
50 | #include "netcompat.h" |
50 | |
51 | |
51 | #include "vpn.h" |
52 | #include "vpn.h" |
… | |
… | |
559 | vector<dns_rcv *> rcvpq; |
560 | vector<dns_rcv *> rcvpq; |
560 | |
561 | |
561 | byte_stream rcvdq; int rcvseq; int repseq; |
562 | byte_stream rcvdq; int rcvseq; int repseq; |
562 | byte_stream snddq; int sndseq; |
563 | byte_stream snddq; int sndseq; |
563 | |
564 | |
564 | void time_cb (ev::timer &w, int revents); ev::timer tw; |
565 | inline void time_cb (ev::timer &w, int revents); ev::timer tw; |
565 | void receive_rep (dns_rcv *r); |
566 | void receive_rep (dns_rcv *r); |
566 | |
567 | |
567 | dns_connection (connection *c); |
568 | dns_connection (connection *c); |
568 | ~dns_connection (); |
569 | ~dns_connection (); |
569 | }; |
570 | }; |
… | |
… | |
724 | |
725 | |
725 | dns_connection::dns_connection (connection *c) |
726 | dns_connection::dns_connection (connection *c) |
726 | : c (c) |
727 | : c (c) |
727 | , rcvdq (MAX_BACKLOG * 2) |
728 | , rcvdq (MAX_BACKLOG * 2) |
728 | , snddq (MAX_BACKLOG) |
729 | , snddq (MAX_BACKLOG) |
729 | , tw (this, &dns_connection::time_cb) |
|
|
730 | { |
730 | { |
|
|
731 | tw.set<dns_connection, &dns_connection::time_cb> (this); |
|
|
732 | |
731 | vpn = c->vpn; |
733 | vpn = c->vpn; |
732 | |
734 | |
733 | established = false; |
735 | established = false; |
734 | |
736 | |
735 | rcvseq = repseq = sndseq = 0; |
737 | rcvseq = repseq = sndseq = 0; |