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