home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / bootpd-2.zip / HWADDR.H < prev    next >
C/C++ Source or Header  |  1995-02-15  |  970b  |  40 lines

  1. /* hwaddr.h */
  2. #ifndef    HWADDR_H
  3. #define HWADDR_H
  4.  
  5. #define MAXHADDRLEN        8    /* Max hw address length in bytes */
  6.  
  7. /*
  8.  * This structure holds information about a specific network type.  The
  9.  * length of the network hardware address is stored in "hlen".
  10.  * The string pointed to by "name" is the cononical name of the network.
  11.  */
  12. struct hwinfo {
  13.     unsigned int hlen;
  14.     char *name;
  15. };
  16.  
  17. extern struct hwinfo hwinfolist[];
  18. extern int hwinfocnt;
  19.  
  20. #ifdef    __STDC__
  21. #define P(args) args
  22. #else
  23. #define P(args) ()
  24. #endif
  25.  
  26. extern void setarp P((int, struct in_addr *, int, u_char *, int));
  27. extern char *haddrtoa P((u_char *, int));
  28. extern void haddr_conv802 P((u_char *, u_char *, int));
  29.  
  30. #undef P
  31.  
  32. /*
  33.  * Return the length in bytes of a hardware address of the given type.
  34.  * Return the canonical name of the network of the given type.
  35.  */
  36. #define haddrlength(type)    ((hwinfolist[(int) (type)]).hlen)
  37. #define netname(type)        ((hwinfolist[(int) (type)]).name)
  38.  
  39. #endif    /* HWADDR_H */
  40.