xref: /freebsd/contrib/wpa/src/utils/ip_addr.h (revision a4128aad8503277614f2d214011ef60a19447b83)
1 /*
2  * IP address processing
3  * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef IP_ADDR_H
10 #define IP_ADDR_H
11 
12 struct hostapd_ip_addr {
13 	int af; /* AF_INET / AF_INET6 */
14 	union {
15 		struct in_addr v4;
16 #ifdef CONFIG_IPV6
17 		struct in6_addr v6;
18 #endif /* CONFIG_IPV6 */
19 		u8 max_len[16];
20 	} u;
21 };
22 
23 const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf,
24 			    size_t buflen);
25 int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr);
26 bool hostapd_ip_equal(const struct hostapd_ip_addr *a,
27 		      const struct hostapd_ip_addr *b);
28 
29 #endif /* IP_ADDR_H */
30