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