OpenVPN
include
openvpn-msg.h
Go to the documentation of this file.
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.
7
*
8
* Copyright (C) 2013-2026 Heiko Hund <heiko.hund@sophos.com>
9
*
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.
13
*
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.
18
*
19
* You should have received a copy of the GNU General Public License along
20
* with this program; if not, see <https://www.gnu.org/licenses/>.
21
*/
22
23
#ifndef OPENVPN_MSG_H_
24
#define OPENVPN_MSG_H_
25
26
#include <windef.h>
27
#include <ws2tcpip.h>
28
29
typedef
enum
30
{
31
msg_acknowledgement
,
32
msg_add_address
,
33
msg_del_address
,
34
msg_add_route
,
35
msg_del_route
,
36
msg_add_dns_cfg
,
37
msg_del_dns_cfg
,
38
msg_add_nrpt_cfg
,
39
msg_del_nrpt_cfg
,
40
msg_add_nbt_cfg
,
41
msg_del_nbt_cfg
,
42
msg_flush_neighbors
,
43
msg_add_wfp_block
,
44
msg_del_wfp_block
,
45
msg_register_dns
,
46
msg_enable_dhcp
,
47
deprecated_msg_register_ring_buffers
,
48
msg_set_mtu
,
49
msg_add_wins_cfg
,
50
msg_del_wins_cfg
,
51
msg_create_adapter
52
}
message_type_t
;
53
54
typedef
struct
55
{
56
message_type_t
type
;
57
size_t
size
;
58
int
message_id
;
59
}
message_header_t
;
60
61
typedef
union
62
{
63
struct
in_addr ipv4;
64
struct
in6_addr ipv6;
65
}
inet_address_t
;
66
67
typedef
struct
68
{
69
#define TUN_ADAPTER_INDEX_INVALID ((DWORD)-1)
70
DWORD
index
;
71
char
name[256];
72
}
interface_t
;
73
74
typedef
enum
75
{
76
wfp_block_local
= 1 << 0,
77
wfp_block_dns
= 1 << 1
78
}
wfp_block_flags_t
;
79
80
typedef
struct
81
{
82
message_header_t
header
;
83
short
family
;
84
inet_address_t
address
;
85
int
prefix_len
;
86
interface_t
iface
;
87
}
address_message_t
;
88
89
typedef
struct
90
{
91
message_header_t
header
;
92
short
family
;
93
inet_address_t
prefix
;
94
int
prefix_len
;
95
inet_address_t
gateway
;
96
interface_t
iface
;
97
int
metric
;
98
}
route_message_t
;
99
100
typedef
struct
101
{
102
message_header_t
header
;
103
interface_t
iface
;
104
char
domains[512];
105
short
family
;
106
unsigned
int
addr_len
;
107
inet_address_t
addr[4];
/* support up to 4 dns addresses */
108
}
dns_cfg_message_t
;
109
110
111
typedef
enum
112
{
113
nrpt_dnssec
114
}
nrpt_flags_t
;
115
116
#define NRPT_ADDR_NUM 8
/* Max. number of addresses */
117
#define NRPT_ADDR_SIZE 48
/* Max. address strlen + some */
118
typedef
char
nrpt_address_t
[
NRPT_ADDR_SIZE
];
119
typedef
struct
120
{
121
message_header_t
header
;
122
interface_t
iface
;
123
nrpt_address_t
addresses[
NRPT_ADDR_NUM
];
124
char
resolve_domains[512];
/* double \0 terminated */
125
char
search_domains[512];
126
nrpt_flags_t
flags
;
127
}
nrpt_dns_cfg_message_t
;
128
129
typedef
struct
130
{
131
message_header_t
header
;
132
interface_t
iface
;
133
unsigned
int
addr_len
;
134
inet_address_t
addr[4];
/* support up to 4 dns addresses */
135
}
wins_cfg_message_t
;
136
137
typedef
struct
138
{
139
message_header_t
header
;
140
interface_t
iface
;
141
int
disable_nbt
;
142
int
nbt_type
;
143
char
scope_id[256];
144
struct
in_addr primary_nbns;
145
struct
in_addr secondary_nbns;
146
}
nbt_cfg_message_t
;
147
148
/* TODO: NTP */
149
150
typedef
struct
151
{
152
message_header_t
header
;
153
short
family
;
154
interface_t
iface
;
155
}
flush_neighbors_message_t
;
156
157
typedef
struct
158
{
159
message_header_t
header
;
160
int
error_number
;
161
}
ack_message_t
;
162
163
typedef
struct
164
{
165
message_header_t
header
;
166
wfp_block_flags_t
flags
;
167
interface_t
iface
;
168
}
wfp_block_message_t
;
169
170
typedef
struct
171
{
172
message_header_t
header
;
173
interface_t
iface
;
174
}
enable_dhcp_message_t
;
175
176
typedef
struct
177
{
178
message_header_t
header
;
179
interface_t
iface
;
180
short
family
;
181
int
mtu
;
182
}
set_mtu_message_t
;
183
184
typedef
enum
185
{
186
ADAPTER_TYPE_DCO
,
187
ADAPTER_TYPE_TAP
,
188
}
adapter_type_t
;
189
190
typedef
struct
191
{
192
message_header_t
header
;
193
adapter_type_t
adapter_type
;
194
}
create_adapter_message_t
;
195
196
#endif
/* ifndef OPENVPN_MSG_H_ */
nrpt_flags_t
nrpt_flags_t
Definition
openvpn-msg.h:112
nrpt_dnssec
@ nrpt_dnssec
Definition
openvpn-msg.h:113
wfp_block_flags_t
wfp_block_flags_t
Definition
openvpn-msg.h:75
wfp_block_local
@ wfp_block_local
Definition
openvpn-msg.h:76
wfp_block_dns
@ wfp_block_dns
Definition
openvpn-msg.h:77
nrpt_address_t
char nrpt_address_t[NRPT_ADDR_SIZE]
Definition
openvpn-msg.h:118
message_type_t
message_type_t
Definition
openvpn-msg.h:30
msg_add_nrpt_cfg
@ msg_add_nrpt_cfg
Definition
openvpn-msg.h:38
msg_del_address
@ msg_del_address
Definition
openvpn-msg.h:33
msg_add_wins_cfg
@ msg_add_wins_cfg
Definition
openvpn-msg.h:49
msg_add_address
@ msg_add_address
Definition
openvpn-msg.h:32
msg_del_nbt_cfg
@ msg_del_nbt_cfg
Definition
openvpn-msg.h:41
msg_del_wfp_block
@ msg_del_wfp_block
Definition
openvpn-msg.h:44
msg_enable_dhcp
@ msg_enable_dhcp
Definition
openvpn-msg.h:46
msg_add_wfp_block
@ msg_add_wfp_block
Definition
openvpn-msg.h:43
msg_add_route
@ msg_add_route
Definition
openvpn-msg.h:34
msg_add_nbt_cfg
@ msg_add_nbt_cfg
Definition
openvpn-msg.h:40
msg_create_adapter
@ msg_create_adapter
Definition
openvpn-msg.h:51
msg_del_wins_cfg
@ msg_del_wins_cfg
Definition
openvpn-msg.h:50
deprecated_msg_register_ring_buffers
@ deprecated_msg_register_ring_buffers
Definition
openvpn-msg.h:47
msg_acknowledgement
@ msg_acknowledgement
Definition
openvpn-msg.h:31
msg_add_dns_cfg
@ msg_add_dns_cfg
Definition
openvpn-msg.h:36
msg_register_dns
@ msg_register_dns
Definition
openvpn-msg.h:45
msg_del_nrpt_cfg
@ msg_del_nrpt_cfg
Definition
openvpn-msg.h:39
msg_del_route
@ msg_del_route
Definition
openvpn-msg.h:35
msg_set_mtu
@ msg_set_mtu
Definition
openvpn-msg.h:48
msg_flush_neighbors
@ msg_flush_neighbors
Definition
openvpn-msg.h:42
msg_del_dns_cfg
@ msg_del_dns_cfg
Definition
openvpn-msg.h:37
adapter_type_t
adapter_type_t
Definition
openvpn-msg.h:185
ADAPTER_TYPE_DCO
@ ADAPTER_TYPE_DCO
Definition
openvpn-msg.h:186
ADAPTER_TYPE_TAP
@ ADAPTER_TYPE_TAP
Definition
openvpn-msg.h:187
NRPT_ADDR_SIZE
#define NRPT_ADDR_SIZE
Definition
openvpn-msg.h:117
NRPT_ADDR_NUM
#define NRPT_ADDR_NUM
Definition
openvpn-msg.h:116
ack_message_t
Definition
openvpn-msg.h:158
ack_message_t::error_number
int error_number
Definition
openvpn-msg.h:160
ack_message_t::header
message_header_t header
Definition
openvpn-msg.h:159
address_message_t
Definition
openvpn-msg.h:81
address_message_t::address
inet_address_t address
Definition
openvpn-msg.h:84
address_message_t::family
short family
Definition
openvpn-msg.h:83
address_message_t::header
message_header_t header
Definition
openvpn-msg.h:82
address_message_t::prefix_len
int prefix_len
Definition
openvpn-msg.h:85
address_message_t::iface
interface_t iface
Definition
openvpn-msg.h:86
create_adapter_message_t
Definition
openvpn-msg.h:191
create_adapter_message_t::header
message_header_t header
Definition
openvpn-msg.h:192
create_adapter_message_t::adapter_type
adapter_type_t adapter_type
Definition
openvpn-msg.h:193
dns_cfg_message_t
Definition
openvpn-msg.h:101
dns_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:102
dns_cfg_message_t::family
short family
Definition
openvpn-msg.h:105
dns_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:103
dns_cfg_message_t::addr_len
unsigned int addr_len
Definition
openvpn-msg.h:106
enable_dhcp_message_t
Definition
openvpn-msg.h:171
enable_dhcp_message_t::header
message_header_t header
Definition
openvpn-msg.h:172
enable_dhcp_message_t::iface
interface_t iface
Definition
openvpn-msg.h:173
flush_neighbors_message_t
Definition
openvpn-msg.h:151
flush_neighbors_message_t::family
short family
Definition
openvpn-msg.h:153
flush_neighbors_message_t::iface
interface_t iface
Definition
openvpn-msg.h:154
flush_neighbors_message_t::header
message_header_t header
Definition
openvpn-msg.h:152
interface_t
Definition
openvpn-msg.h:68
interface_t::index
DWORD index
Definition
openvpn-msg.h:70
message_header_t
Definition
openvpn-msg.h:55
message_header_t::size
size_t size
Definition
openvpn-msg.h:57
message_header_t::message_id
int message_id
Definition
openvpn-msg.h:58
message_header_t::type
message_type_t type
Definition
openvpn-msg.h:56
nbt_cfg_message_t
Definition
openvpn-msg.h:138
nbt_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:139
nbt_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:140
nbt_cfg_message_t::disable_nbt
int disable_nbt
Definition
openvpn-msg.h:141
nbt_cfg_message_t::nbt_type
int nbt_type
Definition
openvpn-msg.h:142
nrpt_dns_cfg_message_t
Definition
openvpn-msg.h:120
nrpt_dns_cfg_message_t::flags
nrpt_flags_t flags
Definition
openvpn-msg.h:126
nrpt_dns_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:122
nrpt_dns_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:121
route_message_t
Definition
openvpn-msg.h:90
route_message_t::header
message_header_t header
Definition
openvpn-msg.h:91
route_message_t::family
short family
Definition
openvpn-msg.h:92
route_message_t::prefix_len
int prefix_len
Definition
openvpn-msg.h:94
route_message_t::iface
interface_t iface
Definition
openvpn-msg.h:96
route_message_t::gateway
inet_address_t gateway
Definition
openvpn-msg.h:95
route_message_t::prefix
inet_address_t prefix
Definition
openvpn-msg.h:93
route_message_t::metric
int metric
Definition
openvpn-msg.h:97
set_mtu_message_t
Definition
openvpn-msg.h:177
set_mtu_message_t::header
message_header_t header
Definition
openvpn-msg.h:178
set_mtu_message_t::mtu
int mtu
Definition
openvpn-msg.h:181
set_mtu_message_t::iface
interface_t iface
Definition
openvpn-msg.h:179
set_mtu_message_t::family
short family
Definition
openvpn-msg.h:180
wfp_block_message_t
Definition
openvpn-msg.h:164
wfp_block_message_t::flags
wfp_block_flags_t flags
Definition
openvpn-msg.h:166
wfp_block_message_t::header
message_header_t header
Definition
openvpn-msg.h:165
wfp_block_message_t::iface
interface_t iface
Definition
openvpn-msg.h:167
wins_cfg_message_t
Definition
openvpn-msg.h:130
wins_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:132
wins_cfg_message_t::addr_len
unsigned int addr_len
Definition
openvpn-msg.h:133
wins_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:131
inet_address_t
Definition
openvpn-msg.h:62
Generated by
1.9.8