xref: /netbsd-src/usr.sbin/bootp/common/hwaddr.h (revision 5e4c038a45edbc7d63b7c2daa76e29f88b64a4e3)
1 /*	$NetBSD: hwaddr.h,v 1.2 1998/01/09 08:09:11 perry 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 cononical name of the network.
13  */
14 struct hwinfo {
15     unsigned int hlen;
16     char *name;
17 };
18 
19 extern struct hwinfo hwinfolist[];
20 extern int hwinfocnt;
21 
22 #ifdef	__STDC__
23 #define P(args) args
24 #else
25 #define P(args) ()
26 #endif
27 
28 extern void setarp P((int, struct in_addr *, u_char *, int));
29 extern char *haddrtoa P((u_char *, int));
30 extern void haddr_conv802 P((u_char *, u_char *, int));
31 
32 #undef P
33 
34 /*
35  * Return the length in bytes of a hardware address of the given type.
36  * Return the canonical name of the network of the given type.
37  */
38 #define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
39 #define netname(type)		((hwinfolist[(int) (type)]).name)
40 
41 #endif	/* HWADDR_H */
42