1
0

packet.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef _NETPACKET_PACKET_H
  2. #define _NETPACKET_PACKET_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. struct sockaddr_ll {
  7. unsigned short sll_family, sll_protocol;
  8. int sll_ifindex;
  9. unsigned short sll_hatype;
  10. unsigned char sll_pkttype, sll_halen;
  11. unsigned char sll_addr[8];
  12. };
  13. struct packet_mreq {
  14. int mr_ifindex;
  15. unsigned short int mr_type, mr_alen;
  16. unsigned char mr_address[8];
  17. };
  18. #define PACKET_HOST 0
  19. #define PACKET_BROADCAST 1
  20. #define PACKET_MULTICAST 2
  21. #define PACKET_OTHERHOST 3
  22. #define PACKET_OUTGOING 4
  23. #define PACKET_LOOPBACK 5
  24. #define PACKET_FASTROUTE 6
  25. #define PACKET_ADD_MEMBERSHIP 1
  26. #define PACKET_DROP_MEMBERSHIP 2
  27. #define PACKET_RECV_OUTPUT 3
  28. #define PACKET_RX_RING 5
  29. #define PACKET_STATISTICS 6
  30. #define PACKET_COPY_THRESH 7
  31. #define PACKET_AUXDATA 8
  32. #define PACKET_ORIGDEV 9
  33. #define PACKET_VERSION 10
  34. #define PACKET_HDRLEN 11
  35. #define PACKET_RESERVE 12
  36. #define PACKET_TX_RING 13
  37. #define PACKET_LOSS 14
  38. #define PACKET_VNET_HDR 15
  39. #define PACKET_TX_TIMESTAMP 16
  40. #define PACKET_TIMESTAMP 17
  41. #define PACKET_FANOUT 18
  42. #define PACKET_TX_HAS_OFF 19
  43. #define PACKET_QDISC_BYPASS 20
  44. #define PACKET_ROLLOVER_STATS 21
  45. #define PACKET_FANOUT_DATA 22
  46. #define PACKET_IGNORE_OUTGOING 23
  47. #define PACKET_MR_MULTICAST 0
  48. #define PACKET_MR_PROMISC 1
  49. #define PACKET_MR_ALLMULTI 2
  50. #define PACKET_MR_UNICAST 3
  51. #ifdef __cplusplus
  52. }
  53. #endif
  54. #endif