hwaddr.h revision 22989
1/*
2 * hwaddr.h
3 *
4 *	$Id$
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#ifdef	__STDC__
26#define P(args) args
27#else
28#define P(args) ()
29#endif
30
31extern void setarp P((int, struct in_addr *, int, u_char *, int));
32extern char *haddrtoa P((u_char *, int));
33extern void haddr_conv802 P((u_char *, u_char *, int));
34
35#undef P
36
37/*
38 * Return the length in bytes of a hardware address of the given type.
39 * Return the canonical name of the network of the given type.
40 */
41#define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
42#define netname(type)		((hwinfolist[(int) (type)]).name)
43
44#endif	/* HWADDR_H */
45