1d353d8d4SMartin Hundebøll /* Copyright (C) 2012-2013 B.A.T.M.A.N. contributors: 2d353d8d4SMartin Hundebøll * 3d353d8d4SMartin Hundebøll * Martin Hundebøll, Jeppe Ledet-Pedersen 4d353d8d4SMartin Hundebøll * 5d353d8d4SMartin Hundebøll * This program is free software; you can redistribute it and/or 6d353d8d4SMartin Hundebøll * modify it under the terms of version 2 of the GNU General Public 7d353d8d4SMartin Hundebøll * License as published by the Free Software Foundation. 8d353d8d4SMartin Hundebøll * 9d353d8d4SMartin Hundebøll * This program is distributed in the hope that it will be useful, but 10d353d8d4SMartin Hundebøll * WITHOUT ANY WARRANTY; without even the implied warranty of 11d353d8d4SMartin Hundebøll * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12d353d8d4SMartin Hundebøll * General Public License for more details. 13d353d8d4SMartin Hundebøll * 14d353d8d4SMartin Hundebøll * You should have received a copy of the GNU General Public License 15d353d8d4SMartin Hundebøll * along with this program; if not, write to the Free Software 16d353d8d4SMartin Hundebøll * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 17d353d8d4SMartin Hundebøll * 02110-1301, USA 18d353d8d4SMartin Hundebøll */ 19d353d8d4SMartin Hundebøll 20d353d8d4SMartin Hundebøll #ifndef _NET_BATMAN_ADV_NETWORK_CODING_H_ 21d353d8d4SMartin Hundebøll #define _NET_BATMAN_ADV_NETWORK_CODING_H_ 22d353d8d4SMartin Hundebøll 23d353d8d4SMartin Hundebøll #ifdef CONFIG_BATMAN_ADV_NC 24d353d8d4SMartin Hundebøll 25*6c519badSMatthias Schiffer int batadv_nc_init(void); 26*6c519badSMatthias Schiffer int batadv_nc_mesh_init(struct batadv_priv *bat_priv); 27*6c519badSMatthias Schiffer void batadv_nc_mesh_free(struct batadv_priv *bat_priv); 28d56b1705SMartin Hundebøll void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, 29d56b1705SMartin Hundebøll struct batadv_orig_node *orig_node, 30d56b1705SMartin Hundebøll struct batadv_orig_node *orig_neigh_node, 31d56b1705SMartin Hundebøll struct batadv_ogm_packet *ogm_packet, 32d56b1705SMartin Hundebøll int is_single_hop_neigh); 33d56b1705SMartin Hundebøll void batadv_nc_purge_orig(struct batadv_priv *bat_priv, 34d56b1705SMartin Hundebøll struct batadv_orig_node *orig_node, 35d56b1705SMartin Hundebøll bool (*to_purge)(struct batadv_priv *, 36d56b1705SMartin Hundebøll struct batadv_nc_node *)); 37d353d8d4SMartin Hundebøll void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv); 38d56b1705SMartin Hundebøll void batadv_nc_init_orig(struct batadv_orig_node *orig_node); 3995332477SMartin Hundebøll bool batadv_nc_skb_forward(struct sk_buff *skb, 40e91ecfc6SMartin Hundebøll struct batadv_neigh_node *neigh_node); 41612d2b4fSMartin Hundebøll void batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, 42612d2b4fSMartin Hundebøll struct sk_buff *skb); 43612d2b4fSMartin Hundebøll void batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, 44612d2b4fSMartin Hundebøll struct sk_buff *skb); 45d56b1705SMartin Hundebøll int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset); 46d56b1705SMartin Hundebøll int batadv_nc_init_debugfs(struct batadv_priv *bat_priv); 47d353d8d4SMartin Hundebøll 48d353d8d4SMartin Hundebøll #else /* ifdef CONFIG_BATMAN_ADV_NC */ 49d353d8d4SMartin Hundebøll 50*6c519badSMatthias Schiffer static inline int batadv_nc_init(void) 51d353d8d4SMartin Hundebøll { 52d353d8d4SMartin Hundebøll return 0; 53d353d8d4SMartin Hundebøll } 54d353d8d4SMartin Hundebøll 55*6c519badSMatthias Schiffer static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv) 56*6c519badSMatthias Schiffer { 57*6c519badSMatthias Schiffer return 0; 58*6c519badSMatthias Schiffer } 59*6c519badSMatthias Schiffer 60*6c519badSMatthias Schiffer static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv) 61d353d8d4SMartin Hundebøll { 62d353d8d4SMartin Hundebøll return; 63d353d8d4SMartin Hundebøll } 64d353d8d4SMartin Hundebøll 65d56b1705SMartin Hundebøll static inline void 66d56b1705SMartin Hundebøll batadv_nc_update_nc_node(struct batadv_priv *bat_priv, 67d56b1705SMartin Hundebøll struct batadv_orig_node *orig_node, 68d56b1705SMartin Hundebøll struct batadv_orig_node *orig_neigh_node, 69d56b1705SMartin Hundebøll struct batadv_ogm_packet *ogm_packet, 70d56b1705SMartin Hundebøll int is_single_hop_neigh) 71d56b1705SMartin Hundebøll { 72d56b1705SMartin Hundebøll return; 73d56b1705SMartin Hundebøll } 74d56b1705SMartin Hundebøll 75d56b1705SMartin Hundebøll static inline void 76d56b1705SMartin Hundebøll batadv_nc_purge_orig(struct batadv_priv *bat_priv, 77d56b1705SMartin Hundebøll struct batadv_orig_node *orig_node, 78d56b1705SMartin Hundebøll bool (*to_purge)(struct batadv_priv *, 79d56b1705SMartin Hundebøll struct batadv_nc_node *)) 80d56b1705SMartin Hundebøll { 81d56b1705SMartin Hundebøll return; 82d56b1705SMartin Hundebøll } 83d56b1705SMartin Hundebøll 84d353d8d4SMartin Hundebøll static inline void batadv_nc_init_bat_priv(struct batadv_priv *bat_priv) 85d353d8d4SMartin Hundebøll { 86d353d8d4SMartin Hundebøll return; 87d353d8d4SMartin Hundebøll } 88d353d8d4SMartin Hundebøll 89d56b1705SMartin Hundebøll static inline void batadv_nc_init_orig(struct batadv_orig_node *orig_node) 90d56b1705SMartin Hundebøll { 91d56b1705SMartin Hundebøll return; 92d56b1705SMartin Hundebøll } 93d56b1705SMartin Hundebøll 9495332477SMartin Hundebøll static inline bool batadv_nc_skb_forward(struct sk_buff *skb, 95e91ecfc6SMartin Hundebøll struct batadv_neigh_node *neigh_node) 9695332477SMartin Hundebøll { 9795332477SMartin Hundebøll return false; 9895332477SMartin Hundebøll } 9995332477SMartin Hundebøll 100612d2b4fSMartin Hundebøll static inline void 101612d2b4fSMartin Hundebøll batadv_nc_skb_store_for_decoding(struct batadv_priv *bat_priv, 102612d2b4fSMartin Hundebøll struct sk_buff *skb) 103612d2b4fSMartin Hundebøll { 104612d2b4fSMartin Hundebøll return; 105612d2b4fSMartin Hundebøll } 106612d2b4fSMartin Hundebøll 107612d2b4fSMartin Hundebøll static inline void 108612d2b4fSMartin Hundebøll batadv_nc_skb_store_sniffed_unicast(struct batadv_priv *bat_priv, 109612d2b4fSMartin Hundebøll struct sk_buff *skb) 110612d2b4fSMartin Hundebøll { 111612d2b4fSMartin Hundebøll return; 112612d2b4fSMartin Hundebøll } 113612d2b4fSMartin Hundebøll 114d56b1705SMartin Hundebøll static inline int batadv_nc_nodes_seq_print_text(struct seq_file *seq, 115d56b1705SMartin Hundebøll void *offset) 116d56b1705SMartin Hundebøll { 117d56b1705SMartin Hundebøll return 0; 118d56b1705SMartin Hundebøll } 119d56b1705SMartin Hundebøll 120d56b1705SMartin Hundebøll static inline int batadv_nc_init_debugfs(struct batadv_priv *bat_priv) 121d56b1705SMartin Hundebøll { 122d56b1705SMartin Hundebøll return 0; 123d56b1705SMartin Hundebøll } 124d56b1705SMartin Hundebøll 125d353d8d4SMartin Hundebøll #endif /* ifdef CONFIG_BATMAN_ADV_NC */ 126d353d8d4SMartin Hundebøll 127d353d8d4SMartin Hundebøll #endif /* _NET_BATMAN_ADV_NETWORK_CODING_H_ */ 128