1
2
3
4
5
6
7#ifndef _NET_BATMAN_ADV_MULTICAST_H_
8#define _NET_BATMAN_ADV_MULTICAST_H_
9
10#include "main.h"
11
12#include <linux/netlink.h>
13#include <linux/seq_file.h>
14#include <linux/skbuff.h>
15
16
17
18
19enum batadv_forw_mode {
20
21
22
23
24 BATADV_FORW_ALL,
25
26
27
28
29
30
31 BATADV_FORW_SOME,
32
33
34
35
36
37 BATADV_FORW_SINGLE,
38
39
40 BATADV_FORW_NONE,
41};
42
43#ifdef CONFIG_BATMAN_ADV_MCAST
44
45enum batadv_forw_mode
46batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
47 struct batadv_orig_node **mcast_single_orig);
48
49int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
50 unsigned short vid);
51
52void batadv_mcast_init(struct batadv_priv *bat_priv);
53
54int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset);
55
56int batadv_mcast_mesh_info_put(struct sk_buff *msg,
57 struct batadv_priv *bat_priv);
58
59int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb);
60
61void batadv_mcast_free(struct batadv_priv *bat_priv);
62
63void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node);
64
65#else
66
67static inline enum batadv_forw_mode
68batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
69 struct batadv_orig_node **mcast_single_orig)
70{
71 return BATADV_FORW_ALL;
72}
73
74static inline int
75batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
76 unsigned short vid)
77{
78 kfree_skb(skb);
79 return NET_XMIT_DROP;
80}
81
82static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
83{
84 return 0;
85}
86
87static inline int
88batadv_mcast_mesh_info_put(struct sk_buff *msg, struct batadv_priv *bat_priv)
89{
90 return 0;
91}
92
93static inline int batadv_mcast_flags_dump(struct sk_buff *msg,
94 struct netlink_callback *cb)
95{
96 return -EOPNOTSUPP;
97}
98
99static inline void batadv_mcast_free(struct batadv_priv *bat_priv)
100{
101}
102
103static inline void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node)
104{
105}
106
107#endif
108
109#endif
110