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-2025 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
int
index
;
70
char
name[256];
71
}
interface_t
;
72
73
typedef
enum
74
{
75
wfp_block_local
= 1 << 0,
76
wfp_block_dns
= 1 << 1
77
}
wfp_block_flags_t
;
78
79
typedef
struct
80
{
81
message_header_t
header
;
82
short
family
;
83
inet_address_t
address
;
84
int
prefix_len
;
85
interface_t
iface
;
86
}
address_message_t
;
87
88
typedef
struct
89
{
90
message_header_t
header
;
91
short
family
;
92
inet_address_t
prefix
;
93
int
prefix_len
;
94
inet_address_t
gateway
;
95
interface_t
iface
;
96
int
metric
;
97
}
route_message_t
;
98
99
typedef
struct
100
{
101
message_header_t
header
;
102
interface_t
iface
;
103
char
domains[512];
104
short
family
;
105
int
addr_len
;
106
inet_address_t
addr[4];
/* support up to 4 dns addresses */
107
}
dns_cfg_message_t
;
108
109
110
typedef
enum
111
{
112
nrpt_dnssec
113
}
nrpt_flags_t
;
114
115
#define NRPT_ADDR_NUM 8
/* Max. number of addresses */
116
#define NRPT_ADDR_SIZE 48
/* Max. address strlen + some */
117
typedef
char
nrpt_address_t
[
NRPT_ADDR_SIZE
];
118
typedef
struct
119
{
120
message_header_t
header
;
121
interface_t
iface
;
122
nrpt_address_t
addresses[
NRPT_ADDR_NUM
];
123
char
resolve_domains[512];
/* double \0 terminated */
124
char
search_domains[512];
125
nrpt_flags_t
flags
;
126
}
nrpt_dns_cfg_message_t
;
127
128
typedef
struct
129
{
130
message_header_t
header
;
131
interface_t
iface
;
132
int
addr_len
;
133
inet_address_t
addr[4];
/* support up to 4 dns addresses */
134
}
wins_cfg_message_t
;
135
136
typedef
struct
137
{
138
message_header_t
header
;
139
interface_t
iface
;
140
int
disable_nbt
;
141
int
nbt_type
;
142
char
scope_id[256];
143
struct
in_addr primary_nbns;
144
struct
in_addr secondary_nbns;
145
}
nbt_cfg_message_t
;
146
147
/* TODO: NTP */
148
149
typedef
struct
150
{
151
message_header_t
header
;
152
short
family
;
153
interface_t
iface
;
154
}
flush_neighbors_message_t
;
155
156
typedef
struct
157
{
158
message_header_t
header
;
159
int
error_number
;
160
}
ack_message_t
;
161
162
typedef
struct
163
{
164
message_header_t
header
;
165
wfp_block_flags_t
flags
;
166
interface_t
iface
;
167
}
wfp_block_message_t
;
168
169
typedef
struct
170
{
171
message_header_t
header
;
172
interface_t
iface
;
173
}
enable_dhcp_message_t
;
174
175
typedef
struct
176
{
177
message_header_t
header
;
178
interface_t
iface
;
179
short
family
;
180
int
mtu
;
181
}
set_mtu_message_t
;
182
183
typedef
enum
184
{
185
ADAPTER_TYPE_DCO
,
186
ADAPTER_TYPE_TAP
,
187
}
adapter_type_t
;
188
189
typedef
struct
190
{
191
message_header_t
header
;
192
adapter_type_t
adapter_type
;
193
}
create_adapter_message_t
;
194
195
#endif
/* ifndef OPENVPN_MSG_H_ */
nrpt_flags_t
nrpt_flags_t
Definition
openvpn-msg.h:111
nrpt_dnssec
@ nrpt_dnssec
Definition
openvpn-msg.h:112
wfp_block_flags_t
wfp_block_flags_t
Definition
openvpn-msg.h:74
wfp_block_local
@ wfp_block_local
Definition
openvpn-msg.h:75
wfp_block_dns
@ wfp_block_dns
Definition
openvpn-msg.h:76
nrpt_address_t
char nrpt_address_t[NRPT_ADDR_SIZE]
Definition
openvpn-msg.h:117
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:184
ADAPTER_TYPE_DCO
@ ADAPTER_TYPE_DCO
Definition
openvpn-msg.h:185
ADAPTER_TYPE_TAP
@ ADAPTER_TYPE_TAP
Definition
openvpn-msg.h:186
NRPT_ADDR_SIZE
#define NRPT_ADDR_SIZE
Definition
openvpn-msg.h:116
NRPT_ADDR_NUM
#define NRPT_ADDR_NUM
Definition
openvpn-msg.h:115
ack_message_t
Definition
openvpn-msg.h:157
ack_message_t::error_number
int error_number
Definition
openvpn-msg.h:159
ack_message_t::header
message_header_t header
Definition
openvpn-msg.h:158
address_message_t
Definition
openvpn-msg.h:80
address_message_t::address
inet_address_t address
Definition
openvpn-msg.h:83
address_message_t::family
short family
Definition
openvpn-msg.h:82
address_message_t::header
message_header_t header
Definition
openvpn-msg.h:81
address_message_t::prefix_len
int prefix_len
Definition
openvpn-msg.h:84
address_message_t::iface
interface_t iface
Definition
openvpn-msg.h:85
create_adapter_message_t
Definition
openvpn-msg.h:190
create_adapter_message_t::header
message_header_t header
Definition
openvpn-msg.h:191
create_adapter_message_t::adapter_type
adapter_type_t adapter_type
Definition
openvpn-msg.h:192
dns_cfg_message_t
Definition
openvpn-msg.h:100
dns_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:101
dns_cfg_message_t::family
short family
Definition
openvpn-msg.h:104
dns_cfg_message_t::addr_len
int addr_len
Definition
openvpn-msg.h:105
dns_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:102
enable_dhcp_message_t
Definition
openvpn-msg.h:170
enable_dhcp_message_t::header
message_header_t header
Definition
openvpn-msg.h:171
enable_dhcp_message_t::iface
interface_t iface
Definition
openvpn-msg.h:172
flush_neighbors_message_t
Definition
openvpn-msg.h:150
flush_neighbors_message_t::family
short family
Definition
openvpn-msg.h:152
flush_neighbors_message_t::iface
interface_t iface
Definition
openvpn-msg.h:153
flush_neighbors_message_t::header
message_header_t header
Definition
openvpn-msg.h:151
interface_t
Definition
openvpn-msg.h:68
interface_t::index
int index
Definition
openvpn-msg.h:69
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:137
nbt_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:138
nbt_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:139
nbt_cfg_message_t::disable_nbt
int disable_nbt
Definition
openvpn-msg.h:140
nbt_cfg_message_t::nbt_type
int nbt_type
Definition
openvpn-msg.h:141
nrpt_dns_cfg_message_t
Definition
openvpn-msg.h:119
nrpt_dns_cfg_message_t::flags
nrpt_flags_t flags
Definition
openvpn-msg.h:125
nrpt_dns_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:121
nrpt_dns_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:120
route_message_t
Definition
openvpn-msg.h:89
route_message_t::header
message_header_t header
Definition
openvpn-msg.h:90
route_message_t::family
short family
Definition
openvpn-msg.h:91
route_message_t::prefix_len
int prefix_len
Definition
openvpn-msg.h:93
route_message_t::iface
interface_t iface
Definition
openvpn-msg.h:95
route_message_t::gateway
inet_address_t gateway
Definition
openvpn-msg.h:94
route_message_t::prefix
inet_address_t prefix
Definition
openvpn-msg.h:92
route_message_t::metric
int metric
Definition
openvpn-msg.h:96
set_mtu_message_t
Definition
openvpn-msg.h:176
set_mtu_message_t::header
message_header_t header
Definition
openvpn-msg.h:177
set_mtu_message_t::mtu
int mtu
Definition
openvpn-msg.h:180
set_mtu_message_t::iface
interface_t iface
Definition
openvpn-msg.h:178
set_mtu_message_t::family
short family
Definition
openvpn-msg.h:179
wfp_block_message_t
Definition
openvpn-msg.h:163
wfp_block_message_t::flags
wfp_block_flags_t flags
Definition
openvpn-msg.h:165
wfp_block_message_t::header
message_header_t header
Definition
openvpn-msg.h:164
wfp_block_message_t::iface
interface_t iface
Definition
openvpn-msg.h:166
wins_cfg_message_t
Definition
openvpn-msg.h:129
wins_cfg_message_t::iface
interface_t iface
Definition
openvpn-msg.h:131
wins_cfg_message_t::addr_len
int addr_len
Definition
openvpn-msg.h:132
wins_cfg_message_t::header
message_header_t header
Definition
openvpn-msg.h:130
inet_address_t
Definition
openvpn-msg.h:62
Generated by
1.9.8