… | |
… | |
19 | #ifndef VPE_CONNECTION_H__ |
19 | #ifndef VPE_CONNECTION_H__ |
20 | #define VPE_CONNECTION_H__ |
20 | #define VPE_CONNECTION_H__ |
21 | |
21 | |
22 | #include <netinet/ip.h> // for tos etc. |
22 | #include <netinet/ip.h> // for tos etc. |
23 | |
23 | |
24 | #include <openssl/rand.h> |
|
|
25 | #include <openssl/hmac.h> |
24 | #include <openssl/hmac.h> |
26 | #include <openssl/evp.h> |
|
|
27 | #include <openssl/rsa.h> |
|
|
28 | #include <openssl/err.h> |
|
|
29 | |
25 | |
30 | #include "global.h" |
26 | #include "global.h" |
31 | #include "conf.h" |
27 | #include "conf.h" |
32 | #include "sockinfo.h" |
28 | #include "sockinfo.h" |
33 | #include "util.h" |
29 | #include "util.h" |
… | |
… | |
140 | |
136 | |
141 | void reset_dstaddr (); |
137 | void reset_dstaddr (); |
142 | |
138 | |
143 | void shutdown (); |
139 | void shutdown (); |
144 | void reset_connection (); |
140 | void reset_connection (); |
145 | void establish_connection_cb (tstamp &ts); time_watcher establish_connection; |
141 | void establish_connection_cb (time_watcher &w); time_watcher establish_connection; |
146 | void rekey_cb (tstamp &ts); time_watcher rekey; // next rekying (actually current reset + reestablishing) |
142 | void rekey_cb (time_watcher &w); time_watcher rekey; // next rekying (actually current reset + reestablishing) |
147 | void keepalive_cb (tstamp &ts); time_watcher keepalive; // next keepalive probe |
143 | void keepalive_cb (time_watcher &w); time_watcher keepalive; // next keepalive probe |
148 | |
144 | |
149 | void send_auth_request (const sockinfo &si, bool initiate); |
145 | void send_auth_request (const sockinfo &si, bool initiate); |
150 | void send_auth_response (const sockinfo &si, const rsaid &id, const rsachallenge &chg); |
146 | void send_auth_response (const sockinfo &si, const rsaid &id, const rsachallenge &chg); |
151 | void send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols); |
147 | void send_connect_info (int rid, const sockinfo &rsi, u8 rprotocols); |
152 | void send_reset (const sockinfo &dsi); |
148 | void send_reset (const sockinfo &dsi); |
… | |
… | |
157 | |
153 | |
158 | void send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos = IPTOS_RELIABILITY); |
154 | void send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos = IPTOS_RELIABILITY); |
159 | void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); |
155 | void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); |
160 | |
156 | |
161 | void script_node (); |
157 | void script_node (); |
162 | const char *script_node_up (int); |
158 | const char *script_node_up (); |
163 | const char *script_node_down (int); |
159 | const char *script_node_down (); |
164 | |
160 | |
165 | void dump_status (); |
161 | void dump_status (); |
166 | |
162 | |
167 | connection(struct vpn *vpn_); |
163 | connection(struct vpn *vpn_); |
168 | ~connection (); |
164 | ~connection (); |