packet.h 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_MR_MULTICAST 0
  31. #define PACKET_MR_PROMISC 1
  32. #define PACKET_MR_ALLMULTI 2
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif