Blame view
net/batman-adv/network-coding.h
3.56 KB
ac79cbb96
|
1 |
/* Copyright (C) 2012-2017 B.A.T.M.A.N. contributors: |
d353d8d4d
|
2 3 4 5 6 7 8 9 10 11 12 13 14 |
* * Martin Hundebøll, Jeppe Ledet-Pedersen * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License |
ebf38fb7a
|
15 |
* along with this program; if not, see <http://www.gnu.org/licenses/>. |
d353d8d4d
|
16 17 18 19 |
*/ #ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_ #define _NET_BATMAN_ADV_NETWORK_CODING_H_ |
1e2c2a4fe
|
20 21 22 |
#include "main.h" #include <linux/types.h> |
1e2c2a4fe
|
23 |
struct batadv_ogm_packet; |
1e2c2a4fe
|
24 25 26 |
struct net_device; struct seq_file; struct sk_buff; |
d353d8d4d
|
27 |
#ifdef CONFIG_BATMAN_ADV_NC |
3f4841ffb
|
28 |
void batadv_nc_status_update(struct net_device *net_dev); |
6c519bad7
|
29 30 31 |
int batadv_nc_init(void); int batadv_nc_mesh_init(struct batadv_priv *bat_priv); void batadv_nc_mesh_free(struct batadv_priv *bat_priv); |
d56b1705e
|
32 33 34 35 36 37 38 39 40 |
void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh_node, struct batadv_ogm_packet *ogm_packet, int is_single_hop_neigh); void batadv_nc_purge_orig(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, bool (*to_purge)(struct batadv_priv *, struct batadv_nc_node *)); |
d353d8d4d
|
41 |
void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv); |
d56b1705e
|
42 |
void batadv_nc_init_orig(struct batadv_orig_node *orig_node); |
953324776
|
43 |
bool batadv_nc_skb_forward(struct sk_buff *skb, |
e91ecfc64
|
44 |
struct batadv_neigh_node *neigh_node); |
612d2b4fe
|
45 46 47 48 |
void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, struct sk_buff *skb); void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, struct sk_buff *skb); |
d56b1705e
|
49 50 |
int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset); int batadv_nc_init_debugfs(struct batadv_priv *bat_priv); |
d353d8d4d
|
51 52 |
#else /* ifdef CONFIG_BATMAN_ADV_NC */ |
3f4841ffb
|
53 54 55 |
static inline void batadv_nc_status_update(struct net_device *net_dev) { } |
6c519bad7
|
56 |
static inline int batadv_nc_init(void) |
d353d8d4d
|
57 58 59 |
{ return 0; } |
6c519bad7
|
60 61 62 63 64 65 |
static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv) { return 0; } static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv) |
d353d8d4d
|
66 |
{ |
d353d8d4d
|
67 |
} |
d56b1705e
|
68 69 70 71 72 73 74 |
static inline void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, struct batadv_orig_node *orig_neigh_node, struct batadv_ogm_packet *ogm_packet, int is_single_hop_neigh) { |
d56b1705e
|
75 76 77 78 79 80 81 82 |
} static inline void batadv_nc_purge_orig(struct batadv_priv *bat_priv, struct batadv_orig_node *orig_node, bool (*to_purge)(struct batadv_priv *, struct batadv_nc_node *)) { |
d56b1705e
|
83 |
} |
d353d8d4d
|
84 85 |
static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv) { |
d353d8d4d
|
86 |
} |
d56b1705e
|
87 88 |
static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node) { |
d56b1705e
|
89 |
} |
953324776
|
90 |
static inline bool batadv_nc_skb_forward(struct sk_buff *skb, |
e91ecfc64
|
91 |
struct batadv_neigh_node *neigh_node) |
953324776
|
92 93 94 |
{ return false; } |
612d2b4fe
|
95 96 97 98 |
static inline void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, struct sk_buff *skb) { |
612d2b4fe
|
99 100 101 102 103 104 |
} static inline void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, struct sk_buff *skb) { |
612d2b4fe
|
105 |
} |
d56b1705e
|
106 107 108 109 110 111 112 113 114 115 |
static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset) { return 0; } static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv) { return 0; } |
d353d8d4d
|
116 117 118 |
#endif /* ifdef CONFIG_BATMAN_ADV_NC */ #endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */ |