]>
Commit | Line | Data |
---|---|---|
a24dd2e3 HH |
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 | * | |
ccf9d572 | 8 | * Copyright (C) 2013-2023 Heiko Hund <heiko.hund@sophos.com> |
a24dd2e3 HH |
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 | * | |
caa54ac3 DS |
19 | * You should have received a copy of the GNU General Public License along |
20 | * with this program; if not, write to the Free Software Foundation, Inc., | |
21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
a24dd2e3 HH |
22 | */ |
23 | ||
24 | #ifndef OPENVPN_MSG_H_ | |
25 | #define OPENVPN_MSG_H_ | |
26 | ||
27 | typedef enum { | |
81d882d5 DS |
28 | msg_acknowledgement, |
29 | msg_add_address, | |
30 | msg_del_address, | |
31 | msg_add_route, | |
32 | msg_del_route, | |
33 | msg_add_dns_cfg, | |
34 | msg_del_dns_cfg, | |
35 | msg_add_nbt_cfg, | |
36 | msg_del_nbt_cfg, | |
37 | msg_flush_neighbors, | |
38 | msg_add_block_dns, | |
39 | msg_del_block_dns, | |
b4fc8bbd SN |
40 | msg_register_dns, |
41 | msg_enable_dhcp, | |
0213f80e | 42 | msg_register_ring_buffers, |
18826de5 LS |
43 | msg_set_mtu, |
44 | msg_add_wins_cfg, | |
45 | msg_del_wins_cfg | |
a24dd2e3 HH |
46 | } message_type_t; |
47 | ||
48 | typedef struct { | |
81d882d5 DS |
49 | message_type_t type; |
50 | size_t size; | |
51 | int message_id; | |
a24dd2e3 HH |
52 | } message_header_t; |
53 | ||
54 | typedef union { | |
81d882d5 DS |
55 | struct in_addr ipv4; |
56 | struct in6_addr ipv6; | |
a24dd2e3 HH |
57 | } inet_address_t; |
58 | ||
59 | typedef struct { | |
81d882d5 DS |
60 | int index; |
61 | char name[256]; | |
a24dd2e3 HH |
62 | } interface_t; |
63 | ||
64 | typedef struct { | |
81d882d5 DS |
65 | message_header_t header; |
66 | short family; | |
67 | inet_address_t address; | |
68 | int prefix_len; | |
69 | interface_t iface; | |
a24dd2e3 HH |
70 | } address_message_t; |
71 | ||
72 | typedef struct { | |
81d882d5 DS |
73 | message_header_t header; |
74 | short family; | |
75 | inet_address_t prefix; | |
76 | int prefix_len; | |
77 | inet_address_t gateway; | |
78 | interface_t iface; | |
79 | int metric; | |
a24dd2e3 HH |
80 | } route_message_t; |
81 | ||
82 | typedef struct { | |
81d882d5 DS |
83 | message_header_t header; |
84 | interface_t iface; | |
85 | char domains[512]; | |
86 | short family; | |
87 | int addr_len; | |
88 | inet_address_t addr[4]; /* support up to 4 dns addresses */ | |
a24dd2e3 | 89 | } dns_cfg_message_t; |
18826de5 LS |
90 | |
91 | typedef struct { | |
92 | message_header_t header; | |
93 | interface_t iface; | |
94 | int addr_len; | |
95 | inet_address_t addr[4]; /* support up to 4 dns addresses */ | |
96 | } wins_cfg_message_t; | |
a24dd2e3 HH |
97 | |
98 | typedef struct { | |
81d882d5 DS |
99 | message_header_t header; |
100 | interface_t iface; | |
101 | int disable_nbt; | |
102 | int nbt_type; | |
103 | char scope_id[256]; | |
104 | struct in_addr primary_nbns; | |
105 | struct in_addr secondary_nbns; | |
a24dd2e3 HH |
106 | } nbt_cfg_message_t; |
107 | ||
81d882d5 | 108 | /* TODO: NTP */ |
a24dd2e3 HH |
109 | |
110 | typedef struct { | |
81d882d5 DS |
111 | message_header_t header; |
112 | short family; | |
113 | interface_t iface; | |
a24dd2e3 HH |
114 | } flush_neighbors_message_t; |
115 | ||
116 | typedef struct { | |
81d882d5 DS |
117 | message_header_t header; |
118 | int error_number; | |
a24dd2e3 HH |
119 | } ack_message_t; |
120 | ||
2282b1be | 121 | typedef struct { |
81d882d5 DS |
122 | message_header_t header; |
123 | interface_t iface; | |
2282b1be SN |
124 | } block_dns_message_t; |
125 | ||
b4fc8bbd SN |
126 | typedef struct { |
127 | message_header_t header; | |
128 | interface_t iface; | |
129 | } enable_dhcp_message_t; | |
130 | ||
da2e66ca LS |
131 | typedef struct { |
132 | message_header_t header; | |
133 | HANDLE device; | |
134 | HANDLE send_ring_handle; | |
135 | HANDLE receive_ring_handle; | |
136 | HANDLE send_tail_moved; | |
137 | HANDLE receive_tail_moved; | |
138 | } register_ring_buffers_message_t; | |
139 | ||
0213f80e CS |
140 | typedef struct { |
141 | message_header_t header; | |
142 | interface_t iface; | |
143 | short family; | |
144 | int mtu; | |
145 | } set_mtu_message_t; | |
146 | ||
81d882d5 | 147 | #endif /* ifndef OPENVPN_MSG_H_ */ |