hwaddr.h revision 259065
1119679Smbr/*
251292Sobrien * hwaddr.h
3119679Smbr *
4119679Smbr * $FreeBSD: releng/10.0/libexec/bootpd/hwaddr.h 97417 2002-05-28 18:36:43Z alfred $
5119679Smbr */
6119679Smbr
7131702Smbr#ifndef	HWADDR_H
8131702Smbr#define HWADDR_H
9119679Smbr
10131702Smbr#define MAXHADDRLEN		8	/* Max hw address length in bytes */
11131702Smbr
12131702Smbr/*
13131702Smbr * This structure holds information about a specific network type.  The
14119679Smbr * length of the network hardware address is stored in "hlen".
15119679Smbr * The string pointed to by "name" is the cononical name of the network.
16119679Smbr */
17131702Smbrstruct hwinfo {
18131702Smbr    unsigned int hlen;
19119679Smbr    char *name;
20119679Smbr};
21119679Smbr
22119679Smbrextern struct hwinfo hwinfolist[];
23119679Smbrextern int hwinfocnt;
24119679Smbr
25119679Smbrextern void setarp(int, struct in_addr *, int, u_char *, int);
26119679Smbrextern char *haddrtoa(u_char *, int);
27119679Smbrextern void haddr_conv802(u_char *, u_char *, int);
28119679Smbr
29119679Smbr/*
30119679Smbr * Return the length in bytes of a hardware address of the given type.
31119679Smbr * Return the canonical name of the network of the given type.
32119679Smbr */
33119679Smbr#define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
34119679Smbr#define netname(type)		((hwinfolist[(int) (type)]).name)
35119679Smbr
36119679Smbr#endif	/* HWADDR_H */
37119679Smbr