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