bugfix with strerror_r - still not working but at least not using uninitialized data
[anytun.git] / src / openvpn / occ.h
blob9d50c2d241fa5ed6f22bf5f3a1a2631813540f4a
1 /*
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
6 * packet compression.
8 * Copyright (C) 2002-2005 OpenVPN Solutions LLC <info@openvpn.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 version 2
12 * as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (see the file COPYING included with this
21 * distribution); if not, write to the Free Software Foundation, Inc.,
22 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef OCC_H
26 #define OCC_H
28 #ifdef ENABLE_OCC
30 #include "forward.h"
32 /* OCC_STRING_SIZE must be set to sizeof (occ_magic) */
33 #define OCC_STRING_SIZE 16
36 * OCC (OpenVPN Configuration Control) protocol opcodes.
39 #define OCC_REQUEST 0 /* request options string from peer */
40 #define OCC_REPLY 1 /* deliver options string to peer */
43 * Send an OCC_REQUEST once every OCC_INTERVAL
44 * seconds until a reply is received.
46 * If we haven't received a reply after
47 * OCC_N_TRIES, give up.
49 #define OCC_INTERVAL_SECONDS 10
50 #define OCC_N_TRIES 12
53 * Other OCC protocol opcodes used to estimate the MTU empirically.
55 #define OCC_MTU_LOAD_REQUEST 2 /* Ask peer to send a big packet to us */
56 #define OCC_MTU_LOAD 3 /* Send a big packet to peer */
57 #define OCC_MTU_REQUEST 4 /* Ask peer to tell us the largest
58 packet it has received from us so far */
59 #define OCC_MTU_REPLY 5 /* Send largest packet size to peer */
62 * Process one command from mtu_load_test_sequence
63 * once every n seconds, if --mtu-test is specified.
65 #define OCC_MTU_LOAD_INTERVAL_SECONDS 3
68 * Send an exit message to remote.
70 #define OCC_EXIT 6
73 * Used to conduct a load test command sequence
74 * of UDP connection for empirical MTU measurement.
76 struct mtu_load_test
78 int op; /* OCC opcode to send to peer */
79 int delta; /* determine packet size to send by using
80 this delta against currently
81 configured MTU */
84 extern const uint8_t occ_magic[];
86 static inline bool
87 is_occ_msg (const struct buffer* buf)
89 return buf_string_match_head (buf, occ_magic, OCC_STRING_SIZE);
92 void process_received_occ_msg (struct context *c);
94 #endif
95 #endif