NetBSD/usr.sbin/bootp/common/hwaddr.h

34 lines
938 B
C
Raw Normal View History

2007-04-30 00:23:34 +04:00
/* $NetBSD: hwaddr.h,v 1.4 2007/04/29 20:23:37 msaitoh Exp $ */
1998-01-09 11:03:16 +03:00
/* hwaddr.h */
#ifndef HWADDR_H
#define HWADDR_H
#define MAXHADDRLEN 8 /* Max hw address length in bytes */
/*
* This structure holds information about a specific network type. The
* length of the network hardware address is stored in "hlen".
2007-04-30 00:23:34 +04:00
* The string pointed to by "name" is the canonical name of the network.
*/
struct hwinfo {
unsigned int hlen;
char *name;
};
extern struct hwinfo hwinfolist[];
extern int hwinfocnt;
2002-07-14 03:56:39 +04:00
extern void setarp(int, struct in_addr *, u_char *, int);
extern char *haddrtoa(u_char *, int);
extern void haddr_conv802(u_char *, u_char *, int);
/*
* Return the length in bytes of a hardware address of the given type.
* Return the canonical name of the network of the given type.
*/
#define haddrlength(type) ((hwinfolist[(int) (type)]).hlen)
#define netname(type) ((hwinfolist[(int) (type)]).name)
#endif /* HWADDR_H */