unpifi.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* Our own header for the programs that need interface configuration info.
  2. Include this file, instead of "unp.h". */
  3. #ifndef __unp_ifi_h
  4. #define __unp_ifi_h
  5. #include "unp.h"
  6. #include <net/if.h>
  7. #define IFI_NAME 16 /* same as IFNAMSIZ in <net/if.h> */
  8. #define IFI_HADDR 8 /* allow for 64-bit EUI-64 in future */
  9. struct ifi_info {
  10. char ifi_name[IFI_NAME]; /* interface name, null-terminated */
  11. short ifi_index; /* interface index */
  12. short ifi_mtu; /* interface MTU */
  13. u_char ifi_haddr[IFI_HADDR]; /* hardware address */
  14. u_short ifi_hlen; /* # bytes in hardware address: 0, 6, 8 */
  15. short ifi_flags; /* IFF_xxx constants from <net/if.h> */
  16. short ifi_myflags; /* our own IFI_xxx flags */
  17. struct sockaddr *ifi_addr; /* primary address */
  18. struct sockaddr *ifi_brdaddr;/* broadcast address */
  19. struct sockaddr *ifi_dstaddr;/* destination address */
  20. struct ifi_info *ifi_next; /* next of these structures */
  21. };
  22. #define IFI_ALIAS 1 /* ifi_addr is an alias */
  23. /* function prototypes */
  24. struct ifi_info *get_ifi_info(int, int);
  25. struct ifi_info *Get_ifi_info(int, int);
  26. void free_ifi_info(struct ifi_info *);
  27. #endif /* __unp_ifi_h */