]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - net/batman-adv/multicast.h
batman-adv: Drop license boilerplate
[mirror_ubuntu-jammy-kernel.git] / net / batman-adv / multicast.h
CommitLineData
7db7d9f3 1/* SPDX-License-Identifier: GPL-2.0 */
7a79d717 2/* Copyright (C) 2014-2019 B.A.T.M.A.N. contributors:
c5caf4ef
LL
3 *
4 * Linus Lüssing
c5caf4ef
LL
5 */
6
7#ifndef _NET_BATMAN_ADV_MULTICAST_H_
8#define _NET_BATMAN_ADV_MULTICAST_H_
9
1e2c2a4f
SE
10#include "main.h"
11
53dd9a68 12struct netlink_callback;
4e3e823b 13struct seq_file;
1e2c2a4f
SE
14struct sk_buff;
15
1d8ab8d3 16/**
6f68b002 17 * enum batadv_forw_mode - the way a packet should be forwarded as
1d8ab8d3
LL
18 */
19enum batadv_forw_mode {
8b84cc4f
SE
20 /**
21 * @BATADV_FORW_ALL: forward the packet to all nodes (currently via
22 * classic flooding)
23 */
1d8ab8d3 24 BATADV_FORW_ALL,
8b84cc4f
SE
25
26 /**
27 * @BATADV_FORW_SINGLE: forward the packet to a single node (currently
28 * via the BATMAN unicast routing protocol)
29 */
1d8ab8d3 30 BATADV_FORW_SINGLE,
8b84cc4f
SE
31
32 /** @BATADV_FORW_NONE: don't forward, drop it */
1d8ab8d3
LL
33 BATADV_FORW_NONE,
34};
35
c5caf4ef
LL
36#ifdef CONFIG_BATMAN_ADV_MCAST
37
1d8ab8d3
LL
38enum batadv_forw_mode
39batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
40 struct batadv_orig_node **mcast_single_orig);
41
60432d75
LL
42void batadv_mcast_init(struct batadv_priv *bat_priv);
43
4e3e823b
LL
44int batadv_mcast_flags_seq_print_text(struct seq_file *seq, void *offset);
45
53dd9a68
LL
46int batadv_mcast_mesh_info_put(struct sk_buff *msg,
47 struct batadv_priv *bat_priv);
48
49int batadv_mcast_flags_dump(struct sk_buff *msg, struct netlink_callback *cb);
50
c5caf4ef
LL
51void batadv_mcast_free(struct batadv_priv *bat_priv);
52
60432d75
LL
53void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node);
54
c5caf4ef
LL
55#else
56
1d8ab8d3
LL
57static inline enum batadv_forw_mode
58batadv_mcast_forw_mode(struct batadv_priv *bat_priv, struct sk_buff *skb,
59 struct batadv_orig_node **mcast_single_orig)
60{
61 return BATADV_FORW_ALL;
62}
63
60432d75
LL
64static inline int batadv_mcast_init(struct batadv_priv *bat_priv)
65{
66 return 0;
67}
68
53dd9a68
LL
69static inline int
70batadv_mcast_mesh_info_put(struct sk_buff *msg, struct batadv_priv *bat_priv)
71{
72 return 0;
73}
74
75static inline int batadv_mcast_flags_dump(struct sk_buff *msg,
76 struct netlink_callback *cb)
77{
78 return -EOPNOTSUPP;
79}
80
c5caf4ef
LL
81static inline void batadv_mcast_free(struct batadv_priv *bat_priv)
82{
c5caf4ef
LL
83}
84
60432d75
LL
85static inline void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node)
86{
60432d75
LL
87}
88
c5caf4ef
LL
89#endif /* CONFIG_BATMAN_ADV_MCAST */
90
91#endif /* _NET_BATMAN_ADV_MULTICAST_H_ */