ip_addr.h 608 B

123456789101112131415161718192021222324252627
  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. #ifndef IP_ADDR_H
  9. #define IP_ADDR_H
  10. struct hostapd_ip_addr {
  11. int af; /* AF_INET / AF_INET6 */
  12. union {
  13. struct in_addr v4;
  14. #ifdef CONFIG_IPV6
  15. struct in6_addr v6;
  16. #endif /* CONFIG_IPV6 */
  17. u8 max_len[16];
  18. } u;
  19. };
  20. const char * hostapd_ip_txt(const struct hostapd_ip_addr *addr, char *buf,
  21. size_t buflen);
  22. int hostapd_parse_ip_addr(const char *txt, struct hostapd_ip_addr *addr);
  23. #endif /* IP_ADDR_H */