net :sunrpc :clnt :Fix xps refcount imbalance on the error path
[linux-2.6-block.git] / net / batman-adv / network-coding.h
CommitLineData
7db7d9f3 1/* SPDX-License-Identifier: GPL-2.0 */
7a79d717 2/* Copyright (C) 2012-2019 B.A.T.M.A.N. contributors:
d353d8d4
MH
3 *
4 * Martin Hundebøll, Jeppe Ledet-Pedersen
d353d8d4
MH
5 */
6
7#ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_
8#define _NET_BATMAN_ADV_NETWORK_CODING_H_
9
1e2c2a4f
SE
10#include "main.h"
11
12#include <linux/types.h>
13
1e2c2a4f 14struct batadv_ogm_packet;
1e2c2a4f
SE
15struct net_device;
16struct seq_file;
17struct sk_buff;
18
d353d8d4
MH
19#ifdef CONFIG_BATMAN_ADV_NC
20
3f4841ff 21void batadv_nc_status_update(struct net_device *net_dev);
6c519bad
MS
22int batadv_nc_init(void);
23int batadv_nc_mesh_init(struct batadv_priv *bat_priv);
24void batadv_nc_mesh_free(struct batadv_priv *bat_priv);
d56b1705
MH
25void batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
26 struct batadv_orig_node *orig_node,
27 struct batadv_orig_node *orig_neigh_node,
28 struct batadv_ogm_packet *ogm_packet,
29 int is_single_hop_neigh);
30void batadv_nc_purge_orig(struct batadv_priv *bat_priv,
31 struct batadv_orig_node *orig_node,
32 bool (*to_purge)(struct batadv_priv *,
33 struct batadv_nc_node *));
d353d8d4 34void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv);
d56b1705 35void batadv_nc_init_orig(struct batadv_orig_node *orig_node);
95332477 36bool batadv_nc_skb_forward(struct sk_buff *skb,
e91ecfc6 37 struct batadv_neigh_node *neigh_node);
612d2b4f
MH
38void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
39 struct sk_buff *skb);
40void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
41 struct sk_buff *skb);
d56b1705
MH
42int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset);
43int batadv_nc_init_debugfs(struct batadv_priv *bat_priv);
d353d8d4
MH
44
45#else /* ifdef CONFIG_BATMAN_ADV_NC */
46
3f4841ff
ML
47static inline void batadv_nc_status_update(struct net_device *net_dev)
48{
49}
50
6c519bad 51static inline int batadv_nc_init(void)
d353d8d4
MH
52{
53 return 0;
54}
55
6c519bad
MS
56static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv)
57{
58 return 0;
59}
60
61static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv)
d353d8d4 62{
d353d8d4
MH
63}
64
d56b1705
MH
65static inline void
66batadv_nc_update_nc_node(struct batadv_priv *bat_priv,
67 struct batadv_orig_node *orig_node,
68 struct batadv_orig_node *orig_neigh_node,
69 struct batadv_ogm_packet *ogm_packet,
70 int is_single_hop_neigh)
71{
d56b1705
MH
72}
73
74static inline void
75batadv_nc_purge_orig(struct batadv_priv *bat_priv,
76 struct batadv_orig_node *orig_node,
77 bool (*to_purge)(struct batadv_priv *,
78 struct batadv_nc_node *))
79{
d56b1705
MH
80}
81
d353d8d4
MH
82static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv)
83{
d353d8d4
MH
84}
85
d56b1705
MH
86static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node)
87{
d56b1705
MH
88}
89
95332477 90static inline bool batadv_nc_skb_forward(struct sk_buff *skb,
e91ecfc6 91 struct batadv_neigh_node *neigh_node)
95332477
MH
92{
93 return false;
94}
95
612d2b4f
MH
96static inline void
97batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv,
98 struct sk_buff *skb)
99{
612d2b4f
MH
100}
101
102static inline void
103batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv,
104 struct sk_buff *skb)
105{
612d2b4f
MH
106}
107
d56b1705
MH
108static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq,
109 void *offset)
110{
111 return 0;
112}
113
114static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv)
115{
116 return 0;
117}
118
d353d8d4
MH
119#endif /* ifdef CONFIG_BATMAN_ADV_NC */
120
121#endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */