00001 /* 00002 * IP address processing 00003 * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 */ 00014 00015 #ifndef IP_ADDR_H 00016 #define IP_ADDR_H 00017 00018 struct hostapd_ip_addr { 00019 int af; /* AF_INET / AF_INET6 */ 00020 union { 00021 struct in_addr v4; 00022 #ifdef CONFIG_IPV6 00023 struct in6_addr v6; 00024 #endif /* CONFIG_IPV6 */ 00025 u8 max_len[16]; 00026 } u; 00027 }; 00028 00029 const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf, 00030 size_t buflen); 00031 int hostapd_ip_diff(struct hostapd_ip_addr *a, struct hostapd_ip_addr *b); 00032 int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr); 00033 00034 #endif /* IP_ADDR_H */