/* vpn.h -- header for vpn.C This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef VPE_VPN_H__ #define VPE_VPN_H__ #include "conf.h" #include "device.h" #include "connection.h" struct vpn { int udpv4_fd; int ipv4_fd; int events; enum { EVENT_RECONNECT = 1, EVENT_SHUTDOWN = 2, }; void event_cb (tstamp &ts); time_watcher event; tap_device *tap; typedef vector conns_vector; conns_vector conns; connection *find_router (); void reconnect_all (); void shutdown_all (); void connect_request (int id); void tap_ev (short revents); io_watcher tap_ev_watcher; void ipv4_ev (short revents); io_watcher ipv4_ev_watcher; void udpv4_ev (short revents); io_watcher udpv4_ev_watcher; void recv_vpn_packet (vpn_packet *pkt, const sockinfo &rsi); void send_udpv4_packet (vpn_packet *pkt, const sockinfo &si, int tos = IPTOS_RELIABILITY); void send_ipv4_packet (vpn_packet *pkt, const sockinfo &si, int tos = IPTOS_RELIABILITY); vpn (); ~vpn (); int setup (); void dump_status (); const char *script_if_up (int); }; #endif