x_snoop.h revision 303975
1219820Sjeff/*
2219820Sjeff * Generic Snooping for Proxy ARP
3219820Sjeff * Copyright (c) 2014, Qualcomm Atheros, Inc.
4219820Sjeff *
5219820Sjeff * This software may be distributed under the terms of the BSD license.
6219820Sjeff * See README for more details.
7219820Sjeff */
8219820Sjeff
9219820Sjeff#ifndef X_SNOOP_H
10219820Sjeff#define X_SNOOP_H
11219820Sjeff
12219820Sjeff#include "l2_packet/l2_packet.h"
13219820Sjeff
14219820Sjeff#ifdef CONFIG_PROXYARP
15219820Sjeff
16219820Sjeffint x_snoop_init(struct hostapd_data *hapd);
17219820Sjeffstruct l2_packet_data *
18219820Sjeffx_snoop_get_l2_packet(struct hostapd_data *hapd,
19219820Sjeff		      void (*handler)(void *ctx, const u8 *src_addr,
20219820Sjeff				      const u8 *buf, size_t len),
21219820Sjeff		      enum l2_packet_filter_type type);
22219820Sjeffvoid x_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd,
23219820Sjeff					 struct sta_info *sta, u8 *buf,
24219820Sjeff					 size_t len);
25219820Sjeffvoid x_snoop_deinit(struct hostapd_data *hapd);
26219820Sjeff
27219820Sjeff#else /* CONFIG_PROXYARP */
28219820Sjeff
29219820Sjeffstatic inline int x_snoop_init(struct hostapd_data *hapd)
30219820Sjeff{
31219820Sjeff	return 0;
32219820Sjeff}
33219820Sjeff
34219820Sjeffstatic inline struct l2_packet_data *
35219820Sjeffx_snoop_get_l2_packet(struct hostapd_data *hapd,
36219820Sjeff		      void (*handler)(void *ctx, const u8 *src_addr,
37219820Sjeff				      const u8 *buf, size_t len),
38219820Sjeff		      enum l2_packet_filter_type type)
39219820Sjeff{
40219820Sjeff	return NULL;
41219820Sjeff}
42219820Sjeff
43219820Sjeffstatic inline void
44219820Sjeffx_snoop_mcast_to_ucast_convert_send(struct hostapd_data *hapd,
45219820Sjeff				    struct sta_info *sta, void *buf,
46219820Sjeff				    size_t len)
47219820Sjeff{
48219820Sjeff}
49219820Sjeff
50219820Sjeffstatic inline void x_snoop_deinit(struct hostapd_data *hapd)
51219820Sjeff{
52219820Sjeff}
53219820Sjeff
54219820Sjeff#endif /* CONFIG_PROXYARP */
55219820Sjeff
56219820Sjeff#endif /* X_SNOOP_H */
57219820Sjeff