blob: 0670411ccde43fb7e3de9ac15d89cdd5f3f9b73d [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * IP address processing
3 * Copyright (c) 2003-2006, Jouni Malinen <j@w1.fi>
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef IP_ADDR_H
10#define IP_ADDR_H
11
12struct 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
23const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf,
24 size_t buflen);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070025int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr);
26
27#endif /* IP_ADDR_H */