… | |
… | |
60 | ~pkt_queue (); |
60 | ~pkt_queue (); |
61 | }; |
61 | }; |
62 | |
62 | |
63 | enum auth_subtype { AUTH_INIT, AUTH_INITREPLY, AUTH_REPLY }; |
63 | enum auth_subtype { AUTH_INIT, AUTH_INITREPLY, AUTH_REPLY }; |
64 | |
64 | |
|
|
65 | struct auth_packet; |
|
|
66 | |
65 | struct connection |
67 | struct connection |
66 | { |
68 | { |
67 | conf_node *conf; |
69 | conf_node *conf; |
68 | struct vpn *vpn; |
70 | struct vpn *vpn; |
|
|
71 | u32 seqrand; |
69 | |
72 | |
70 | SOCKADDR sa; |
73 | SOCKADDR sa; |
71 | int retry_cnt; |
74 | int retry_cnt; |
72 | |
75 | |
73 | tstamp last_activity; // time of last packet received |
76 | tstamp last_activity; // time of last packet received |
… | |
… | |
87 | void reset_connection (); |
90 | void reset_connection (); |
88 | void establish_connection_cb (tstamp &ts); time_watcher establish_connection; |
91 | void establish_connection_cb (tstamp &ts); time_watcher establish_connection; |
89 | void rekey_cb (tstamp &ts); time_watcher rekey; // next rekying (actually current reset + reestablishing) |
92 | void rekey_cb (tstamp &ts); time_watcher rekey; // next rekying (actually current reset + reestablishing) |
90 | void keepalive_cb (tstamp &ts); time_watcher keepalive; // next keepalive probe |
93 | void keepalive_cb (tstamp &ts); time_watcher keepalive; // next keepalive probe |
91 | |
94 | |
92 | void send_auth (auth_subtype subtype, SOCKADDR *sa, rsachallenge *k = 0); |
95 | void send_auth (auth_subtype subtype, SOCKADDR *sa, const rsachallenge *k = 0); |
93 | void send_reset (SOCKADDR *dsa); |
96 | void send_reset (SOCKADDR *dsa); |
94 | void send_ping (SOCKADDR *dss, u8 pong = 0); |
97 | void send_ping (SOCKADDR *dss, u8 pong = 0); |
95 | void send_data_packet (tap_packet *pkt, bool broadcast = false); |
98 | void send_data_packet (tap_packet *pkt, bool broadcast = false); |
96 | void inject_data_packet (tap_packet *pkt, bool broadcast = false); |
99 | void inject_data_packet (tap_packet *pkt, bool broadcast = false); |
97 | void connect_request (int id); |
100 | void connect_request (int id); |