hwaddr.h revision 50476
1190207Srpaulo/*
2190207Srpaulo * hwaddr.h
375115Sfenner *
475115Sfenner * $FreeBSD: head/libexec/bootpd/hwaddr.h 50476 1999-08-28 00:22:10Z peter $
575115Sfenner */
675115Sfenner
775115Sfenner#ifndef	HWADDR_H
875115Sfenner#define HWADDR_H
975115Sfenner
1075115Sfenner#define MAXHADDRLEN		8	/* Max hw address length in bytes */
1175115Sfenner
1275115Sfenner/*
1375115Sfenner * This structure holds information about a specific network type.  The
1475115Sfenner * length of the network hardware address is stored in "hlen".
1575115Sfenner * The string pointed to by "name" is the cononical name of the network.
1675115Sfenner */
1775115Sfennerstruct hwinfo {
1875115Sfenner    unsigned int hlen;
1975115Sfenner    char *name;
2075115Sfenner};
2175115Sfenner
2275115Sfennerextern struct hwinfo hwinfolist[];
2375115Sfennerextern int hwinfocnt;
2475115Sfenner
2575115Sfenner#ifdef	__STDC__
2675115Sfenner#define P(args) args
2775115Sfenner#else
2875115Sfenner#define P(args) ()
2975115Sfenner#endif
3075115Sfenner
3175115Sfennerextern void setarp P((int, struct in_addr *, int, u_char *, int));
3275115Sfennerextern char *haddrtoa P((u_char *, int));
3375115Sfennerextern void haddr_conv802 P((u_char *, u_char *, int));
3475115Sfenner
3575115Sfenner#undef P
3675115Sfenner
3775115Sfenner/*
3875115Sfenner * Return the length in bytes of a hardware address of the given type.
3975115Sfenner * Return the canonical name of the network of the given type.
4075115Sfenner */
4175115Sfenner#define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
4275115Sfenner#define netname(type)		((hwinfolist[(int) (type)]).name)
4375115Sfenner
4475115Sfenner#endif	/* HWADDR_H */
4575115Sfenner