1 /* $NetBSD: hwaddr.h,v 1.6 2009/04/15 00:23:29 lukem Exp $ */ 2 3 /* hwaddr.h */ 4 #ifndef HWADDR_H 5 #define HWADDR_H 6 7 #define MAXHADDRLEN 8 /* Max hw address length in bytes */ 8 9 /* 10 * This structure holds information about a specific network type. The 11 * length of the network hardware address is stored in "hlen". 12 * The string pointed to by "name" is the canonical name of the network. 13 */ 14 struct hwinfo { 15 unsigned int hlen; 16 const char *name; 17 }; 18 19 extern struct hwinfo hwinfolist[]; 20 extern size_t hwinfocnt; 21 22 extern void setarp(int, struct in_addr *, u_char *, int); 23 extern char *haddrtoa(u_char *, int); 24 extern void haddr_conv802(u_char *, u_char *, int); 25 26 /* 27 * Return the length in bytes of a hardware address of the given type. 28 * Return the canonical name of the network of the given type. 29 */ 30 #define haddrlength(type) ((hwinfolist[(int) (type)]).hlen) 31 #define netname(type) ((hwinfolist[(int) (type)]).name) 32 33 #endif /* HWADDR_H */ 34