x_snoop.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Generic Snooping for Proxy ARP
  3. * Copyright (c) 2014, Qualcomm Atheros, Inc.
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef X_SNOOP_H
  9. #define X_SNOOP_H
  10. #include "l2_packet/l2_packet.h"
  11. #ifdef CONFIG_PROXYARP
  12. int x_snoop_init(struct hostapd_data *hapd);
  13. struct l2_packet_data *
  14. x_snoop_get_l2_packet(struct hostapd_data *hapd,
  15. void (*handler)(void *ctx, const u8 *src_addr,
  16. const u8 *buf, size_t len),
  17. enum l2_packet_filter_type type);
  18. void x_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd,
  19. struct sta_info *sta, u8 *buf,
  20. size_t len);
  21. void x_snoop_deinit(struct hostapd_data *hapd);
  22. #else /* CONFIG_PROXYARP */
  23. static inline int x_snoop_init(struct hostapd_data *hapd)
  24. {
  25. return 0;
  26. }
  27. static inline struct l2_packet_data *
  28. x_snoop_get_l2_packet(struct hostapd_data *hapd,
  29. void (*handler)(void *ctx, const u8 *src_addr,
  30. const u8 *buf, size_t len),
  31. enum l2_packet_filter_type type)
  32. {
  33. return NULL;
  34. }
  35. static inline void
  36. x_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd,
  37. struct sta_info *sta, void *buf,
  38. size_t len)
  39. {
  40. }
  41. static inline void x_snoop_deinit(struct hostapd_data *hapd)
  42. {
  43. }
  44. #endif /* CONFIG_PROXYARP */
  45. #endif /* X_SNOOP_H */