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