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>
14 #include <linux/types.h>
17 * enum batadv_forw_mode - the way a packet should be forwarded as
19 enum batadv_forw_mode
{
21 * @BATADV_FORW_BCAST: forward the packet to all nodes via a batman-adv
27 * @BATADV_FORW_UCASTS: forward the packet to some nodes via one
28 * or more batman-adv unicast packets
33 * @BATADV_FORW_MCAST: forward the packet to some nodes via a
34 * batman-adv multicast packet
38 /** @BATADV_FORW_NONE: don't forward, drop it */
42 #ifdef CONFIG_BATMAN_ADV_MCAST
45 batadv_mcast_forw_mode(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
,
46 unsigned short vid
, int *is_routable
);
48 int batadv_mcast_forw_send(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
,
49 unsigned short vid
, int is_routable
);
51 void batadv_mcast_init(struct batadv_priv
*bat_priv
);
53 int batadv_mcast_mesh_info_put(struct sk_buff
*msg
,
54 struct batadv_priv
*bat_priv
);
56 int batadv_mcast_flags_dump(struct sk_buff
*msg
, struct netlink_callback
*cb
);
58 void batadv_mcast_free(struct batadv_priv
*bat_priv
);
60 void batadv_mcast_purge_orig(struct batadv_orig_node
*orig_node
);
62 /* multicast_forw.c */
64 int batadv_mcast_forw_tracker_tvlv_handler(struct batadv_priv
*bat_priv
,
67 unsigned int batadv_mcast_forw_packet_hdrlen(unsigned int num_dests
);
69 bool batadv_mcast_forw_push(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
,
70 unsigned short vid
, int is_routable
, int count
);
72 int batadv_mcast_forw_mcsend(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
);
76 static inline enum batadv_forw_mode
77 batadv_mcast_forw_mode(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
,
78 unsigned short vid
, int *is_routable
)
80 return BATADV_FORW_BCAST
;
84 batadv_mcast_forw_send(struct batadv_priv
*bat_priv
, struct sk_buff
*skb
,
85 unsigned short vid
, int is_routable
)
91 static inline int batadv_mcast_init(struct batadv_priv
*bat_priv
)
97 batadv_mcast_mesh_info_put(struct sk_buff
*msg
, struct batadv_priv
*bat_priv
)
102 static inline int batadv_mcast_flags_dump(struct sk_buff
*msg
,
103 struct netlink_callback
*cb
)
108 static inline void batadv_mcast_free(struct batadv_priv
*bat_priv
)
112 static inline void batadv_mcast_purge_orig(struct batadv_orig_node
*orig_node
)
116 static inline int batadv_mcast_forw_mcsend(struct batadv_priv
*bat_priv
,
120 return NET_XMIT_DROP
;
123 #endif /* CONFIG_BATMAN_ADV_MCAST */
125 #endif /* _NET_BATMAN_ADV_MULTICAST_H_ */