Home | History | Annotate | Line # | Download | only in common
hwaddr.h revision 1.3
      1  1.3    wiz /*	$NetBSD: hwaddr.h,v 1.3 2002/07/14 00:26:17 wiz Exp $	*/
      2  1.2  perry 
      3  1.1    gwr /* hwaddr.h */
      4  1.1    gwr #ifndef	HWADDR_H
      5  1.1    gwr #define HWADDR_H
      6  1.1    gwr 
      7  1.1    gwr #define MAXHADDRLEN		8	/* Max hw address length in bytes */
      8  1.1    gwr 
      9  1.1    gwr /*
     10  1.1    gwr  * This structure holds information about a specific network type.  The
     11  1.1    gwr  * length of the network hardware address is stored in "hlen".
     12  1.1    gwr  * The string pointed to by "name" is the cononical name of the network.
     13  1.1    gwr  */
     14  1.1    gwr struct hwinfo {
     15  1.1    gwr     unsigned int hlen;
     16  1.1    gwr     char *name;
     17  1.1    gwr };
     18  1.1    gwr 
     19  1.1    gwr extern struct hwinfo hwinfolist[];
     20  1.1    gwr extern int hwinfocnt;
     21  1.1    gwr 
     22  1.3    wiz extern void setarp(int, struct in_addr *, u_char *, int);
     23  1.3    wiz extern char *haddrtoa(u_char *, int);
     24  1.3    wiz extern void haddr_conv802(u_char *, u_char *, int);
     25  1.1    gwr 
     26  1.1    gwr /*
     27  1.1    gwr  * Return the length in bytes of a hardware address of the given type.
     28  1.1    gwr  * Return the canonical name of the network of the given type.
     29  1.1    gwr  */
     30  1.1    gwr #define haddrlength(type)	((hwinfolist[(int) (type)]).hlen)
     31  1.1    gwr #define netname(type)		((hwinfolist[(int) (type)]).name)
     32  1.1    gwr 
     33  1.1    gwr #endif	/* HWADDR_H */
     34