18dbcf02cSchristos /* 28dbcf02cSchristos * IP address processing 38dbcf02cSchristos * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi> 48dbcf02cSchristos * 5*62a52023Schristos * This software may be distributed under the terms of the BSD license. 6*62a52023Schristos * See README for more details. 78dbcf02cSchristos */ 88dbcf02cSchristos 98dbcf02cSchristos #ifndef IP_ADDR_H 108dbcf02cSchristos #define IP_ADDR_H 118dbcf02cSchristos 128dbcf02cSchristos struct hostapd_ip_addr { 138dbcf02cSchristos int af; /* AF_INET / AF_INET6 */ 148dbcf02cSchristos union { 158dbcf02cSchristos struct in_addr v4; 168dbcf02cSchristos #ifdef CONFIG_IPV6 178dbcf02cSchristos struct in6_addr v6; 188dbcf02cSchristos #endif /* CONFIG_IPV6 */ 198dbcf02cSchristos u8 max_len[16]; 208dbcf02cSchristos } u; 218dbcf02cSchristos }; 228dbcf02cSchristos 238dbcf02cSchristos const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf, 248dbcf02cSchristos size_t buflen); 258dbcf02cSchristos int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr); 268dbcf02cSchristos 278dbcf02cSchristos #endif /* IP_ADDR_H */ 28