Where Online Learning is simpler!
The C and C++ Include Header Files
cat -n /usr/include/openvpn/openvpn-msg.h
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 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_ */