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