2
* OpenVPN -- An application to securely tunnel IP networks
3
* over a single TCP/UDP port, with support for SSL/TLS-based
4
* session authentication and key exchange,
5
* packet encryption, packet authentication, and
8
* Copyright (C) 2002-2004 James Yonan <jim@yonan.net>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program (see the file COPYING included with this
22
* distribution); if not, write to the Free Software Foundation, Inc.,
23
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
#define TUN_OUT(c) (BLEN(&(c)->c2.to_tun) > 0)
34
#define LINK_OUT(c) (BLEN(&(c)->c2.to_link) > 0)
35
#define ANY_OUT(c) (TUN_OUT(c) || LINK_OUT(c))
37
#ifdef ENABLE_FRAGMENT
38
#define TO_LINK_FRAG(c) ((c)->c2.fragment && fragment_outgoing_defined ((c)->c2.fragment))
40
#define TO_LINK_FRAG(c) (false)
43
#define TO_LINK_DEF(c) (LINK_OUT(c) || TO_LINK_FRAG(c))
45
#define IOW_TO_TUN (1<<0)
46
#define IOW_TO_LINK (1<<1)
47
#define IOW_READ_TUN (1<<2)
48
#define IOW_READ_LINK (1<<3)
49
#define IOW_SHAPER (1<<4)
50
#define IOW_CHECK_RESIDUAL (1<<5)
51
#define IOW_FRAG (1<<6)
52
#define IOW_MBUF (1<<7)
53
#define IOW_READ_TUN_FORCE (1<<8)
54
#define IOW_WAIT_SIGNAL (1<<9)
56
#define IOW_READ (IOW_READ_TUN|IOW_READ_LINK)
58
void pre_select (struct context *c);
60
void process_io (struct context *c);
62
void encrypt_sign (struct context *c, bool comp_frag);
64
const char *wait_status_string (struct context *c, struct gc_arena *gc);
65
void show_wait_status (struct context *c);
67
void read_incoming_link (struct context *c);
68
void process_incoming_link (struct context *c);
69
void read_incoming_tun (struct context *c);
70
void process_incoming_tun (struct context *c);
71
void process_outgoing_link (struct context *c);
72
void process_outgoing_tun (struct context *c);
74
bool send_control_channel_string (struct context *c, const char *str, int msglevel);
76
#define PIPV4_PASSTOS (1<<0)
77
#define PIPV4_MSSFIX (1<<1)
79
void process_ipv4_header (struct context *c, unsigned int flags, struct buffer *buf);
82
void schedule_exit (struct context *c, const int n_seconds);
85
#endif /* FORWARD_H */