1 1.2 perry /* $NetBSD: hwaddr.h,v 1.2 1998/01/09 08:09:11 perry Exp $ */ 2 1.2 perry 3 1.1 gwr /* hwaddr.h */ 4 1.1 gwr #ifndef HWADDR_H 5 1.1 gwr #define HWADDR_H 6 1.1 gwr 7 1.1 gwr #define MAXHADDRLEN 8 /* Max hw address length in bytes */ 8 1.1 gwr 9 1.1 gwr /* 10 1.1 gwr * This structure holds information about a specific network type. The 11 1.1 gwr * length of the network hardware address is stored in "hlen". 12 1.1 gwr * The string pointed to by "name" is the cononical name of the network. 13 1.1 gwr */ 14 1.1 gwr struct hwinfo { 15 1.1 gwr unsigned int hlen; 16 1.1 gwr char *name; 17 1.1 gwr }; 18 1.1 gwr 19 1.1 gwr extern struct hwinfo hwinfolist[]; 20 1.1 gwr extern int hwinfocnt; 21 1.1 gwr 22 1.1 gwr #ifdef __STDC__ 23 1.1 gwr #define P(args) args 24 1.1 gwr #else 25 1.1 gwr #define P(args) () 26 1.1 gwr #endif 27 1.1 gwr 28 1.1 gwr extern void setarp P((int, struct in_addr *, u_char *, int)); 29 1.1 gwr extern char *haddrtoa P((u_char *, int)); 30 1.1 gwr extern void haddr_conv802 P((u_char *, u_char *, int)); 31 1.1 gwr 32 1.1 gwr #undef P 33 1.1 gwr 34 1.1 gwr /* 35 1.1 gwr * Return the length in bytes of a hardware address of the given type. 36 1.1 gwr * Return the canonical name of the network of the given type. 37 1.1 gwr */ 38 1.1 gwr #define haddrlength(type) ((hwinfolist[(int) (type)]).hlen) 39 1.1 gwr #define netname(type) ((hwinfolist[(int) (type)]).name) 40 1.1 gwr 41 1.1 gwr #endif /* HWADDR_H */ 42