hwaddr.h revision 97416
1/*
2 * hwaddr.h
3 *
4 * $FreeBSD: head/libexec/bootpd/hwaddr.h 97416 2002-05-28 18:31:41Z alfred $
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 */
17struct hwinfo {
18    unsigned int hlen;
19    char *name;
20};
21
22extern struct hwinfo hwinfolist[];
23extern int hwinfocnt;
24
25#define P(args) args
26
27extern void setarp P((int, struct in_addr *, int, u_char *, int));
28extern char *haddrtoa P((u_char *, int));
29extern void haddr_conv802 P((u_char *, u_char *, int));
30
31#undef P
32
33/*
34 * Return the length in bytes of a hardware address of the given type.
35 * Return the canonical name of the network of the given type.
36 */
37#define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
38#define netname(type)		((hwinfolist[(int) (type)]).name)
39
40#endif	/* HWADDR_H */
41