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