1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) B.A.T.M.A.N. contributors:
7 #ifndef _NET_BATMAN_ADV_MULTICAST_H_
8 #define _NET_BATMAN_ADV_MULTICAST_H_
12 #include <linux/netlink.h>
13 #include <linux/skbuff.h>
16 * enum batadv_forw_mode - the way a packet should be forwarded as
18 enum batadv_forw_mode {
20 * @BATADV_FORW_BCAST: forward the packet to all nodes via a batman-adv
26 * @BATADV_FORW_UCASTS: forward the packet to some nodes via one
27 * or more batman-adv unicast packets
31 /** @BATADV_FORW_NONE: don't forward, drop it */
35 #ifdef CONFIG_BATMAN_ADV_MCAST
38 batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
41 int batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
42 unsigned short vid, int is_routable);
44 void batadv_mcast_init(struct batadv_priv *bat_priv);
46 int batadv_mcast_mesh_info_put(struct sk_buff *msg,
47 struct batadv_priv *bat_priv);
49 int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb);
51 void batadv_mcast_free(struct batadv_priv *bat_priv);
53 void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node);
57 static inline enum batadv_forw_mode
58 batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
61 return BATADV_FORW_BCAST;
65 batadv_mcast_forw_send(struct batadv_priv *bat_priv, struct sk_buff *skb,
66 unsigned short vid, int is_routable)
72 static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
78 batadv_mcast_mesh_info_put(struct sk_buff *msg, struct batadv_priv *bat_priv)
83 static inline int batadv_mcast_flags_dump(struct sk_buff *msg,
84 struct netlink_callback *cb)
89 static inline void batadv_mcast_free(struct batadv_priv *bat_priv)
93 static inline void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node)
97 #endif /* CONFIG_BATMAN_ADV_MCAST */
99 #endif /* _NET_BATMAN_ADV_MULTICAST_H_ */