OpenVPN
socket_util.c
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) 2002-2026 OpenVPN Inc <sales@openvpn.net>
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#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27#include "syshead.h"
28
29#include "socket_util.h"
30#include "crypto.h"
31#include "manage.h"
32
33/*
34 * Format IP addresses in ascii
35 */
36
37const char *
38print_sockaddr_ex(const struct sockaddr *sa, const char *separator, const unsigned int flags,
39 struct gc_arena *gc)
40{
41 struct buffer out = alloc_buf_gc(128, gc);
42 bool addr_is_defined = false;
43 char hostaddr[NI_MAXHOST] = "";
44 char servname[NI_MAXSERV] = "";
45 int status;
46
47 socklen_t salen = 0;
48 switch (sa->sa_family)
49 {
50 case AF_INET:
51 if (!(flags & PS_DONT_SHOW_FAMILY))
52 {
53 buf_puts(&out, "[AF_INET]");
54 }
55 salen = sizeof(struct sockaddr_in);
56 addr_is_defined = ((struct sockaddr_in *)sa)->sin_addr.s_addr != 0;
57 break;
58
59 case AF_INET6:
60 if (!(flags & PS_DONT_SHOW_FAMILY))
61 {
62 buf_puts(&out, "[AF_INET6]");
63 }
64 salen = sizeof(struct sockaddr_in6);
65 addr_is_defined = !IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *)sa)->sin6_addr);
66 break;
67
68 case AF_UNSPEC:
69 if (!(flags & PS_DONT_SHOW_FAMILY))
70 {
71 return "[AF_UNSPEC]";
72 }
73 else
74 {
75 return "";
76 }
77
78 default:
79 ASSERT(0);
80 }
81
82 status = getnameinfo(sa, salen, hostaddr, sizeof(hostaddr), servname, sizeof(servname),
83 NI_NUMERICHOST | NI_NUMERICSERV);
84
85 if (status != 0)
86 {
87 buf_printf(&out, "[nameinfo() err: %s]", gai_strerror(status));
88 return BSTR(&out);
89 }
90
91 if (!(flags & PS_DONT_SHOW_ADDR))
92 {
93 if (addr_is_defined)
94 {
95 buf_puts(&out, hostaddr);
96 }
97 else
98 {
99 buf_puts(&out, "[undef]");
100 }
101 }
102
103 if ((flags & PS_SHOW_PORT) || (flags & PS_SHOW_PORT_IF_DEFINED))
104 {
105 if (separator)
106 {
107 buf_puts(&out, separator);
108 }
109
110 buf_puts(&out, servname);
111 }
112
113 return BSTR(&out);
114}
115
116const char *
121
122#ifndef IF_NAMESIZE
123#define IF_NAMESIZE 16
124#endif
125
126#if defined(__GNUC__) || defined(__clang__)
127#pragma GCC diagnostic push
128#pragma GCC diagnostic ignored "-Wsign-conversion"
129#endif
130
131const char *
132print_link_socket_actual_ex(const struct link_socket_actual *act, const char *separator,
133 const unsigned int flags, struct gc_arena *gc)
134{
135 if (act)
136 {
137 struct buffer out = alloc_buf_gc(128, gc);
138 buf_printf(&out, "%s", print_sockaddr_ex(&act->dest.addr.sa, separator, flags, gc));
139#if ENABLE_IP_PKTINFO
140 char ifname[IF_NAMESIZE] = "[undef]";
141
142 if ((flags & PS_SHOW_PKTINFO) && addr_defined_ipi(act))
143 {
144 switch (act->dest.addr.sa.sa_family)
145 {
146 case AF_INET:
147 {
148 struct openvpn_sockaddr sa;
149 CLEAR(sa);
150 sa.addr.in4.sin_family = AF_INET;
151#if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST)
152 sa.addr.in4.sin_addr = act->pi.in4.ipi_spec_dst;
153 if_indextoname(act->pi.in4.ipi_ifindex, ifname);
154#elif defined(IP_RECVDSTADDR)
155 sa.addr.in4.sin_addr = act->pi.in4;
156 ifname[0] = 0;
157#else /* if defined(HAVE_IN_PKTINFO) && defined(HAVE_IPI_SPEC_DST) */
158#error ENABLE_IP_PKTINFO is set without IP_PKTINFO xor IP_RECVDSTADDR (fix syshead.h)
159#endif
160 buf_printf(&out, " (via %s%%%s)",
161 print_sockaddr_ex(&sa.addr.sa, separator, 0, gc), ifname);
162 }
163 break;
164
165 case AF_INET6:
166 {
167 struct sockaddr_in6 sin6;
168 char buf[INET6_ADDRSTRLEN] = "[undef]";
169 CLEAR(sin6);
170 sin6.sin6_family = AF_INET6;
171 sin6.sin6_addr = act->pi.in6.ipi6_addr;
172 if_indextoname(act->pi.in6.ipi6_ifindex, ifname);
173 if (getnameinfo((struct sockaddr *)&sin6, sizeof(struct sockaddr_in6), buf,
174 sizeof(buf), NULL, 0, NI_NUMERICHOST)
175 == 0)
176 {
177 buf_printf(&out, " (via %s%%%s)", buf, ifname);
178 }
179 else
180 {
181 buf_printf(&out, " (via [getnameinfo() err]%%%s)", ifname);
182 }
183 }
184 break;
185 }
186 }
187#endif /* if ENABLE_IP_PKTINFO */
188 return BSTR(&out);
189 }
190 else
191 {
192 return "[NULL]";
193 }
194}
195
196#if defined(__GNUC__) || defined(__clang__)
197#pragma GCC diagnostic pop
198#endif
199
200/*
201 * Convert an in_addr_t in host byte order
202 * to an ascii dotted quad.
203 */
204const char *
205print_in_addr_t(in_addr_t addr, unsigned int flags, struct gc_arena *gc)
206{
207 struct in_addr ia;
208 char *out = gc_malloc(INET_ADDRSTRLEN, true, gc);
209
210 if (addr || !(flags & IA_EMPTY_IF_UNDEF))
211 {
212 CLEAR(ia);
213 ia.s_addr = (flags & IA_NET_ORDER) ? addr : htonl(addr);
214
215 inet_ntop(AF_INET, &ia, out, INET_ADDRSTRLEN);
216 }
217 return out;
218}
219
220/*
221 * Convert an in6_addr in host byte order
222 * to an ascii representation of an IPv6 address
223 */
224const char *
225print_in6_addr(struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
226{
227 char *out = gc_malloc(INET6_ADDRSTRLEN, true, gc);
228
229 if (memcmp(&a6, &in6addr_any, sizeof(a6)) != 0 || !(flags & IA_EMPTY_IF_UNDEF))
230 {
231 inet_ntop(AF_INET6, &a6, out, INET6_ADDRSTRLEN);
232 }
233 return out;
234}
235
236/*
237 * Convert an in_port_t in host byte order to a string
238 */
239const char *
241{
242 struct buffer buffer = alloc_buf_gc(8, gc);
243 buf_printf(&buffer, "%hu", port);
244 return BSTR(&buffer);
245}
246
247/* add some offset to an ipv6 address
248 * (add in steps of 8 bits, taking overflow into next round)
249 */
250struct in6_addr
251add_in6_addr(struct in6_addr base, uint32_t add)
252{
253 for (int i = 15; i >= 0 && add > 0; i--)
254 {
255 register uint32_t carry;
256 register uint32_t h;
257
258 h = base.s6_addr[i];
259 base.s6_addr[i] = (h + add) & UINT8_MAX;
260
261 /* using explicit carry for the 8-bit additions will catch
262 * 8-bit and(!) 32-bit overruns nicely
263 */
264 carry = ((h & 0xff) + (add & 0xff)) >> 8;
265 add = (add >> 8) + carry;
266 }
267 return base;
268}
269
270/* set environmental variables for ip/port in *addr */
271void
272setenv_sockaddr(struct env_set *es, const char *name_prefix, const struct openvpn_sockaddr *addr,
273 const unsigned int flags)
274{
275 char name_buf[256];
276
277 char buf[INET6_ADDRSTRLEN];
278 switch (addr->addr.sa.sa_family)
279 {
280 case AF_INET:
281 if (flags & SA_IP_PORT)
282 {
283 snprintf(name_buf, sizeof(name_buf), "%s_ip", name_prefix);
284 }
285 else
286 {
287 snprintf(name_buf, sizeof(name_buf), "%s", name_prefix);
288 }
289
290 inet_ntop(AF_INET, &addr->addr.in4.sin_addr, buf, sizeof(buf));
291 setenv_str(es, name_buf, buf);
292
293 if ((flags & SA_IP_PORT) && addr->addr.in4.sin_port)
294 {
295 snprintf(name_buf, sizeof(name_buf), "%s_port", name_prefix);
296 setenv_int(es, name_buf, ntohs(addr->addr.in4.sin_port));
297 }
298 break;
299
300 case AF_INET6:
301 if (IN6_IS_ADDR_V4MAPPED(&addr->addr.in6.sin6_addr))
302 {
303 struct in_addr ia;
304 memcpy(&ia.s_addr, &addr->addr.in6.sin6_addr.s6_addr[12], sizeof(ia.s_addr));
305 snprintf(name_buf, sizeof(name_buf), "%s_ip", name_prefix);
306 inet_ntop(AF_INET, &ia, buf, sizeof(buf));
307 }
308 else
309 {
310 snprintf(name_buf, sizeof(name_buf), "%s_ip6", name_prefix);
311 inet_ntop(AF_INET6, &addr->addr.in6.sin6_addr, buf, sizeof(buf));
312 }
313 setenv_str(es, name_buf, buf);
314
315 if ((flags & SA_IP_PORT) && addr->addr.in6.sin6_port)
316 {
317 snprintf(name_buf, sizeof(name_buf), "%s_port", name_prefix);
318 setenv_int(es, name_buf, ntohs(addr->addr.in6.sin6_port));
319 }
320 break;
321 }
322}
323
324void
325setenv_in_addr_t(struct env_set *es, const char *name_prefix, in_addr_t addr,
326 const unsigned int flags)
327{
328 if (addr || !(flags & SA_SET_IF_NONZERO))
329 {
330 struct openvpn_sockaddr si;
331 CLEAR(si);
332 si.addr.in4.sin_family = AF_INET;
333 si.addr.in4.sin_addr.s_addr = htonl(addr);
334 setenv_sockaddr(es, name_prefix, &si, flags);
335 }
336}
337
338void
339setenv_in6_addr(struct env_set *es, const char *name_prefix, const struct in6_addr *addr,
340 const unsigned int flags)
341{
342 if (!IN6_IS_ADDR_UNSPECIFIED(addr) || !(flags & SA_SET_IF_NONZERO))
343 {
344 struct openvpn_sockaddr si;
345 CLEAR(si);
346 si.addr.in6.sin6_family = AF_INET6;
347 si.addr.in6.sin6_addr = *addr;
348 setenv_sockaddr(es, name_prefix, &si, flags);
349 }
350}
351
352void
353setenv_link_socket_actual(struct env_set *es, const char *name_prefix,
354 const struct link_socket_actual *act, const unsigned int flags)
355{
356 setenv_sockaddr(es, name_prefix, &act->dest, flags);
357}
358
359/*
360 * Convert protocol names between index and ascii form.
361 */
362
364{
365 const char *short_form;
366 const char *display_form;
368 uint8_t proto;
369};
370
371/* Indexed by PROTO_x */
372static const struct proto_names proto_names[] = {
373 { "proto-uninitialized", "proto-NONE", AF_UNSPEC, PROTO_NONE },
374 /* try IPv4 and IPv6 (client), bind dual-stack (server) */
375 { "udp", "UDP", AF_UNSPEC, PROTO_UDP },
376 { "tcp-server", "TCP_SERVER", AF_UNSPEC, PROTO_TCP_SERVER },
377 { "tcp-client", "TCP_CLIENT", AF_UNSPEC, PROTO_TCP_CLIENT },
378 { "tcp", "TCP", AF_UNSPEC, PROTO_TCP },
379 /* force IPv4 */
380 { "udp4", "UDPv4", AF_INET, PROTO_UDP },
381 { "tcp4-server", "TCPv4_SERVER", AF_INET, PROTO_TCP_SERVER },
382 { "tcp4-client", "TCPv4_CLIENT", AF_INET, PROTO_TCP_CLIENT },
383 { "tcp4", "TCPv4", AF_INET, PROTO_TCP },
384 /* force IPv6 */
385 { "udp6", "UDPv6", AF_INET6, PROTO_UDP },
386 { "tcp6-server", "TCPv6_SERVER", AF_INET6, PROTO_TCP_SERVER },
387 { "tcp6-client", "TCPv6_CLIENT", AF_INET6, PROTO_TCP_CLIENT },
388 { "tcp6", "TCPv6", AF_INET6, PROTO_TCP },
389};
390
391int
392ascii2proto(const char *proto_name)
393{
394 for (size_t i = 0; i < SIZE(proto_names); ++i)
395 {
396 if (!strcmp(proto_name, proto_names[i].short_form))
397 {
398 return proto_names[i].proto;
399 }
400 }
401 return -1;
402}
403
405ascii2af(const char *proto_name)
406{
407 for (size_t i = 0; i < SIZE(proto_names); ++i)
408 {
409 if (!strcmp(proto_name, proto_names[i].short_form))
410 {
411 return proto_names[i].proto_af;
412 }
413 }
414 return 0;
415}
416
417const char *
419{
420 for (size_t i = 0; i < SIZE(proto_names); ++i)
421 {
422 if (proto_names[i].proto_af == af && proto_names[i].proto == proto)
423 {
424 if (display_form)
425 {
426 return proto_names[i].display_form;
427 }
428 else
429 {
430 return proto_names[i].short_form;
431 }
432 }
433 }
434
435 return "[unknown protocol]";
436}
437
438const char *
440{
441 struct buffer out = alloc_buf_gc(256, gc);
442
443 for (size_t i = 0; i < SIZE(proto_names); ++i)
444 {
445 if (i)
446 {
447 buf_printf(&out, " ");
448 }
449 buf_printf(&out, "[%s]", proto_names[i].short_form);
450 }
451 return BSTR(&out);
452}
453
454const char *
456{
457 switch (af)
458 {
459 case AF_INET:
460 return "AF_INET";
461
462 case AF_INET6:
463 return "AF_INET6";
464 }
465 return "AF_UNSPEC";
466}
467
468/*
469 * Given a local proto, return local proto
470 * if !remote, or compatible remote proto
471 * if remote.
472 *
473 * This is used for options compatibility
474 * checking.
475 *
476 * IPv6 and IPv4 protocols are comptabile but OpenVPN
477 * has always sent UDPv4, TCPv4 over the wire. Keep these
478 * strings for backward compatibility
479 */
480const char *
481proto_remote(int proto, bool remote)
482{
483 ASSERT(proto >= 0 && proto < PROTO_N);
484 if (proto == PROTO_UDP)
485 {
486 return "UDPv4";
487 }
488
489 if ((remote && proto == PROTO_TCP_CLIENT) || (!remote && proto == PROTO_TCP_SERVER))
490 {
491 return "TCPv4_SERVER";
492 }
493 if ((remote && proto == PROTO_TCP_SERVER) || (!remote && proto == PROTO_TCP_CLIENT))
494 {
495 return "TCPv4_CLIENT";
496 }
497
498 ASSERT(0);
499 return ""; /* Make the compiler happy */
500}
501
502/*
503 * We do our own inet_aton because the glibc function
504 * isn't very good about error checking.
505 */
506int
507openvpn_inet_aton(const char *dotted_quad, struct in_addr *addr)
508{
509 unsigned int a, b, c, d;
510
511 CLEAR(*addr);
512 if (sscanf(dotted_quad, "%u.%u.%u.%u", &a, &b, &c, &d) == 4)
513 {
514 if (a < 256 && b < 256 && c < 256 && d < 256)
515 {
516 addr->s_addr = htonl(a << 24 | b << 16 | c << 8 | d);
517 return OIA_IP; /* good dotted quad */
518 }
519 }
521 {
522 return OIA_ERROR; /* probably a badly formatted dotted quad */
523 }
524 else
525 {
526 return OIA_HOSTNAME; /* probably a hostname */
527 }
528}
529
530bool
532{
533 /* verify non-NULL */
534 if (!dotted_quad)
535 {
536 return false;
537 }
538
539 /* verify length is within limits */
540 if (strlen(dotted_quad) > 15)
541 {
542 return false;
543 }
544
545 /* verify that all chars are either numeric or '.' and that no numeric
546 * substring is greater than 3 chars */
547 {
548 int nnum = 0;
549 const char *p = dotted_quad;
550 int c;
551
552 while ((c = *p++))
553 {
554 if (c >= '0' && c <= '9')
555 {
556 ++nnum;
557 if (nnum > 3)
558 {
559 return false;
560 }
561 }
562 else if (c == '.')
563 {
564 nnum = 0;
565 }
566 else
567 {
568 return false;
569 }
570 }
571 }
572
573 /* verify that string will convert to IP address */
574 {
575 struct in_addr a;
576 return openvpn_inet_aton(dotted_quad, &a) == OIA_IP;
577 }
578}
579
580bool
581ipv6_addr_safe(const char *ipv6_text_addr)
582{
583 /* verify non-NULL */
584 if (!ipv6_text_addr)
585 {
586 return false;
587 }
588
589 /* verify length is within limits */
590 if (strlen(ipv6_text_addr) > INET6_ADDRSTRLEN)
591 {
592 return false;
593 }
594
595 /* verify that string will convert to IPv6 address */
596 {
597 struct in6_addr a6;
598 return inet_pton(AF_INET6, ipv6_text_addr, &a6) == 1;
599 }
600}
601
602static bool
603dns_addr_safe(const char *addr)
604{
605 if (addr)
606 {
607 const size_t len = strlen(addr);
608 return len > 0 && len <= 255 && string_class(addr, CC_ALNUM | CC_DASH | CC_DOT, 0);
609 }
610 else
611 {
612 return false;
613 }
614}
615
616bool
617ip_or_dns_addr_safe(const char *addr, const bool allow_fqdn)
618{
619 if (ip_addr_dotted_quad_safe(addr))
620 {
621 return true;
622 }
623 else if (allow_fqdn)
624 {
625 return dns_addr_safe(addr);
626 }
627 else
628 {
629 return false;
630 }
631}
632
633bool
634mac_addr_safe(const char *mac_addr)
635{
636 /* verify non-NULL */
637 if (!mac_addr)
638 {
639 return false;
640 }
641
642 /* verify length is within limits */
643 if (strlen(mac_addr) > 17)
644 {
645 return false;
646 }
647
648 /* verify that all chars are either alphanumeric or ':' and that no
649 * alphanumeric substring is greater than 2 chars */
650 {
651 int nnum = 0;
652 const char *p = mac_addr;
653 int c;
654
655 while ((c = *p++))
656 {
657 if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
658 {
659 ++nnum;
660 if (nnum > 2)
661 {
662 return false;
663 }
664 }
665 else if (c == ':')
666 {
667 nnum = 0;
668 }
669 else
670 {
671 return false;
672 }
673 }
674 }
675
676 /* error-checking is left to script invoked in lladdr.c */
677 return true;
678}
bool buf_printf(struct buffer *buf, const char *format,...)
printf-style append to a buffer with overflow check.
Definition buffer.c:231
bool string_class(const char *str, const unsigned int inclusive, const unsigned int exclusive)
Test whether all characters in a string satisfy a character class filter.
Definition buffer.c:1003
void * gc_malloc(size_t size, bool clear, struct gc_arena *a)
Allocate memory and, optionally, zero it.
Definition buffer.c:321
void buf_puts(struct buffer *buf, const char *str)
Append a string to a buffer with overflow check.
Definition buffer.c:256
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
Allocate a buffer of the given size under garbage collection.
Definition buffer.c:77
#define CC_DASH
dash
Definition buffer.h:1705
#define BSTR(buf)
Return the buffer content pointer cast to char *.
Definition buffer.h:157
#define CC_DIGIT
digit isdigit()
Definition buffer.h:1693
#define CC_DOT
dot
Definition buffer.h:1706
#define CC_ALNUM
alphanumeric isalnum()
Definition buffer.h:1689
Data Channel Cryptography Module.
void setenv_int(struct env_set *es, const char *name, int value)
Definition env_set.c:289
void setenv_str(struct env_set *es, const char *name, const char *value)
Definition env_set.c:305
static SERVICE_STATUS status
Definition interactive.c:52
#define CLEAR(x)
Definition basic.h:32
#define SIZE(x)
Definition basic.h:29
#define ASSERT(x)
Definition error.h:221
static bool dns_addr_safe(const char *addr)
const char * proto2ascii(int proto, sa_family_t af, bool display_form)
bool mac_addr_safe(const char *mac_addr)
void setenv_in_addr_t(struct env_set *es, const char *name_prefix, in_addr_t addr, const unsigned int flags)
const char * print_sockaddr_ex(const struct sockaddr *sa, const char *separator, const unsigned int flags, struct gc_arena *gc)
Definition socket_util.c:38
const char * print_in_port_t(in_port_t port, struct gc_arena *gc)
const char * proto2ascii_all(struct gc_arena *gc)
void setenv_link_socket_actual(struct env_set *es, const char *name_prefix, const struct link_socket_actual *act, const unsigned int flags)
void setenv_in6_addr(struct env_set *es, const char *name_prefix, const struct in6_addr *addr, const unsigned int flags)
const char * print_link_socket_actual(const struct link_socket_actual *act, struct gc_arena *gc)
void setenv_sockaddr(struct env_set *es, const char *name_prefix, const struct openvpn_sockaddr *addr, const unsigned int flags)
const char * print_link_socket_actual_ex(const struct link_socket_actual *act, const char *separator, const unsigned int flags, struct gc_arena *gc)
struct in6_addr add_in6_addr(struct in6_addr base, uint32_t add)
sa_family_t ascii2af(const char *proto_name)
int openvpn_inet_aton(const char *dotted_quad, struct in_addr *addr)
const char * proto_remote(int proto, bool remote)
bool ipv6_addr_safe(const char *ipv6_text_addr)
const char * print_in6_addr(struct in6_addr a6, unsigned int flags, struct gc_arena *gc)
bool ip_or_dns_addr_safe(const char *addr, const bool allow_fqdn)
int ascii2proto(const char *proto_name)
const char * print_in_addr_t(in_addr_t addr, unsigned int flags, struct gc_arena *gc)
#define IF_NAMESIZE
const char * addr_family_name(int af)
bool ip_addr_dotted_quad_safe(const char *dotted_quad)
#define IA_EMPTY_IF_UNDEF
Definition socket_util.h:89
#define OIA_HOSTNAME
#define SA_IP_PORT
Definition socket_util.h:99
#define PS_SHOW_PORT
Definition socket_util.h:31
@ PROTO_NONE
@ PROTO_UDP
@ PROTO_TCP
@ PROTO_TCP_CLIENT
@ PROTO_N
@ PROTO_TCP_SERVER
#define PS_DONT_SHOW_ADDR
Definition socket_util.h:33
#define OIA_ERROR
#define PS_SHOW_PORT_IF_DEFINED
Definition socket_util.h:30
#define OIA_IP
#define PS_DONT_SHOW_FAMILY
Definition socket_util.h:34
#define IA_NET_ORDER
Definition socket_util.h:90
#define SA_SET_IF_NONZERO
#define PS_SHOW_PKTINFO
Definition socket_util.h:32
Wrapper structure for dynamically allocated memory.
Definition buffer.h:71
int len
Length in bytes of the actual content within the allocated memory.
Definition buffer.h:76
Garbage collection arena used to keep track of dynamically allocated memory.
Definition buffer.h:127
union openvpn_sockaddr::@27 addr
struct sockaddr sa
Definition socket_util.h:42
struct sockaddr_in in4
Definition socket_util.h:43
struct sockaddr_in6 in6
Definition socket_util.h:44
const char * short_form
uint8_t proto
const char * display_form
sa_family_t proto_af
unsigned short sa_family_t
Definition syshead.h:405
uint16_t in_port_t
Definition syshead.h:53
uint32_t in_addr_t
Definition syshead.h:52
struct gc_arena gc
Definition test_ssl.c:138