… | |
… | |
40 | struct vpn |
40 | struct vpn |
41 | { |
41 | { |
42 | int udpv4_fd , tcpv4_fd, ipv4_fd , icmpv4_fd , dnsv4_fd; |
42 | int udpv4_fd , tcpv4_fd, ipv4_fd , icmpv4_fd , dnsv4_fd; |
43 | int udpv4_tos, ipv4_tos, icmpv4_tos, dnsv4_tos; |
43 | int udpv4_tos, ipv4_tos, icmpv4_tos, dnsv4_tos; |
44 | |
44 | |
|
|
45 | #if 1 //D |
|
|
46 | int ipv42_fd, ipv42_tos; |
|
|
47 | void ipv42_ev (ev::io &w, int revents); ev::io ipv42_ev_watcher; |
|
|
48 | bool send_ipv42_packet (vpn_packet *pkt, const sockinfo &si, int tos); |
|
|
49 | #endif |
|
|
50 | |
45 | int events; |
51 | int events; |
46 | |
52 | |
47 | enum { |
53 | enum { |
48 | EVENT_RECONNECT = 1, |
54 | EVENT_RECONNECT = 1, |
49 | EVENT_SHUTDOWN = 2, |
55 | EVENT_SHUTDOWN = 2, |
… | |
… | |
67 | void shutdown_all (); |
73 | void shutdown_all (); |
68 | |
74 | |
69 | void tap_ev (ev::io &w, int revents); ev::io tap_ev_watcher; |
75 | void tap_ev (ev::io &w, int revents); ev::io tap_ev_watcher; |
70 | void inject_data_packet (tap_packet *pkt, int dst); |
76 | void inject_data_packet (tap_packet *pkt, int dst); |
71 | |
77 | |
72 | void send_connect_request (int id); |
78 | void send_connect_request (connection *c); |
73 | |
79 | |
74 | void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); |
80 | void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); |
75 | bool send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos = 0); |
81 | bool send_vpn_packet (vpn_packet *pkt, const sockinfo &si, int tos = 0); |
76 | |
82 | |
77 | #if ENABLE_TCP |
83 | #if ENABLE_TCP |
… | |
… | |
102 | bool send_ipv4_packet (vpn_packet *pkt, const sockinfo &si, int tos); |
108 | bool send_ipv4_packet (vpn_packet *pkt, const sockinfo &si, int tos); |
103 | |
109 | |
104 | vpn (); |
110 | vpn (); |
105 | ~vpn (); |
111 | ~vpn (); |
106 | |
112 | |
|
|
113 | int setup_socket (u8 prot, int family, int type, int proto); |
107 | int setup (); |
114 | int setup (); |
108 | |
115 | |
109 | void dump_status (); |
116 | void dump_status (); |
110 | |
117 | |
111 | void script_init_env (); |
118 | void script_init_env (); |