arp.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /*
  10. * this file used by (at least) the kernel, arpd, snoopy, tboot
  11. */
  12. typedef struct Arppkt Arppkt;
  13. typedef struct Arpentry Arpentry;
  14. typedef struct Arpstats Arpstats;
  15. /* Format of ethernet arp request */
  16. struct Arppkt {
  17. uint8_t d[6];
  18. uint8_t s[6];
  19. uint8_t type[2];
  20. uint8_t hrd[2];
  21. uint8_t pro[2];
  22. uint8_t hln;
  23. uint8_t pln;
  24. uint8_t op[2];
  25. uint8_t sha[6];
  26. uint8_t spa[4];
  27. uint8_t tha[6];
  28. uint8_t tpa[4];
  29. };
  30. #define ARPSIZE 42
  31. /* Format of request from starp to user level arpd */
  32. struct Arpentry {
  33. uint8_t etaddr[6];
  34. uint8_t ipaddr[4];
  35. };
  36. /* Arp cache statistics */
  37. struct Arpstats {
  38. int hit;
  39. int miss;
  40. int failed;
  41. };
  42. #define ET_ARP 0x0806
  43. #define ET_RARP 0x8035
  44. #define ARP_REQUEST 1
  45. #define ARP_REPLY 2
  46. #define RARP_REQUEST 3
  47. #define RARP_REPLY 4