2
0

ifaddrs.h 592 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _IFADDRS_H
  2. #define _IFADDRS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #include <netinet/in.h>
  8. #include <sys/socket.h>
  9. struct ifaddrs {
  10. struct ifaddrs *ifa_next;
  11. char *ifa_name;
  12. unsigned ifa_flags;
  13. struct sockaddr *ifa_addr;
  14. struct sockaddr *ifa_netmask;
  15. union {
  16. struct sockaddr *ifu_broadaddr;
  17. struct sockaddr *ifu_dstaddr;
  18. } ifa_ifu;
  19. void *ifa_data;
  20. };
  21. #define ifa_broadaddr ifa_ifu.ifu_broadaddr
  22. #define ifa_dstaddr ifa_ifu.ifu_dstaddr
  23. void freeifaddrs(struct ifaddrs *);
  24. int getifaddrs(struct ifaddrs **);
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif