blob: 025152b3428239128da1958807bd0cbfaaec60c0 [file] [log] [blame]
Sven Eckelmann9f6446c2015-04-23 13:16:35 +02001/* Copyright (C) 2011-2015 B.A.T.M.A.N. contributors:
Simon Wunderlich23721382012-01-22 20:00:19 +01002 *
3 * Simon Wunderlich
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public
7 * License as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
Antonio Quartulliebf38fb2013-11-03 20:40:48 +010015 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Simon Wunderlich23721382012-01-22 20:00:19 +010016 */
17
18#ifndef _NET_BATMAN_ADV_BLA_H_
19#define _NET_BATMAN_ADV_BLA_H_
20
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020021#include "main.h"
22
23#include <linux/types.h>
24
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020025struct seq_file;
26struct sk_buff;
27
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010028#ifdef CONFIG_BATMAN_ADV_BLA
Antonio Quartullieb2deb62013-04-19 18:07:00 +020029int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb,
30 unsigned short vid, bool is_bcast);
31int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb,
32 unsigned short vid);
Sven Eckelmann08adf152012-05-12 13:38:47 +020033int batadv_bla_is_backbone_gw(struct sk_buff *skb,
Sven Eckelmann56303d32012-06-05 22:31:31 +020034 struct batadv_orig_node *orig_node, int hdr_size);
Sven Eckelmann08adf152012-05-12 13:38:47 +020035int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset);
Simon Wunderlich536a23f2012-06-18 18:39:26 +020036int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
37 void *offset);
Sven Eckelmann6b5e9712015-05-26 18:34:26 +020038bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv, u8 *orig,
Antonio Quartullicfd4f752013-08-07 18:28:56 +020039 unsigned short vid);
Sven Eckelmann56303d32012-06-05 22:31:31 +020040int batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
Simon Wunderlich004e86f2012-10-18 13:47:42 +020041 struct sk_buff *skb);
Sven Eckelmann56303d32012-06-05 22:31:31 +020042void batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
43 struct batadv_hard_iface *primary_if,
44 struct batadv_hard_iface *oldif);
45int batadv_bla_init(struct batadv_priv *bat_priv);
46void batadv_bla_free(struct batadv_priv *bat_priv);
Simon Wunderlich23721382012-01-22 20:00:19 +010047
Sven Eckelmann3964f722012-06-03 22:19:10 +020048#define BATADV_BLA_CRC_INIT 0
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010049#else /* ifdef CONFIG_BATMAN_ADV_BLA */
50
Sven Eckelmann56303d32012-06-05 22:31:31 +020051static inline int batadv_bla_rx(struct batadv_priv *bat_priv,
Antonio Quartullieb2deb62013-04-19 18:07:00 +020052 struct sk_buff *skb, unsigned short vid,
53 bool is_bcast)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010054{
55 return 0;
56}
57
Sven Eckelmann56303d32012-06-05 22:31:31 +020058static inline int batadv_bla_tx(struct batadv_priv *bat_priv,
Antonio Quartullieb2deb62013-04-19 18:07:00 +020059 struct sk_buff *skb, unsigned short vid)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010060{
61 return 0;
62}
63
Sven Eckelmann08adf152012-05-12 13:38:47 +020064static inline int batadv_bla_is_backbone_gw(struct sk_buff *skb,
Sven Eckelmann56303d32012-06-05 22:31:31 +020065 struct batadv_orig_node *orig_node,
Sven Eckelmann08adf152012-05-12 13:38:47 +020066 int hdr_size)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010067{
68 return 0;
69}
70
Sven Eckelmann08adf152012-05-12 13:38:47 +020071static inline int batadv_bla_claim_table_seq_print_text(struct seq_file *seq,
72 void *offset)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010073{
74 return 0;
75}
76
Simon Wunderlich536a23f2012-06-18 18:39:26 +020077static inline int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq,
78 void *offset)
79{
80 return 0;
81}
82
Antonio Quartullicfd4f752013-08-07 18:28:56 +020083static inline bool batadv_bla_is_backbone_gw_orig(struct batadv_priv *bat_priv,
Sven Eckelmann6b5e9712015-05-26 18:34:26 +020084 u8 *orig, unsigned short vid)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010085{
Antonio Quartullicfd4f752013-08-07 18:28:56 +020086 return false;
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010087}
88
Sven Eckelmann08adf152012-05-12 13:38:47 +020089static inline int
Sven Eckelmann56303d32012-06-05 22:31:31 +020090batadv_bla_check_bcast_duplist(struct batadv_priv *bat_priv,
Simon Wunderlich004e86f2012-10-18 13:47:42 +020091 struct sk_buff *skb)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +010092{
93 return 0;
94}
95
Sven Eckelmann08adf152012-05-12 13:38:47 +020096static inline void
Sven Eckelmann56303d32012-06-05 22:31:31 +020097batadv_bla_update_orig_address(struct batadv_priv *bat_priv,
98 struct batadv_hard_iface *primary_if,
99 struct batadv_hard_iface *oldif)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100100{
101}
102
Sven Eckelmann56303d32012-06-05 22:31:31 +0200103static inline int batadv_bla_init(struct batadv_priv *bat_priv)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100104{
105 return 1;
106}
107
Sven Eckelmann56303d32012-06-05 22:31:31 +0200108static inline void batadv_bla_free(struct batadv_priv *bat_priv)
Simon Wunderlich7a5cc242012-01-22 20:00:27 +0100109{
110}
111
112#endif /* ifdef CONFIG_BATMAN_ADV_BLA */
Simon Wunderlich23721382012-01-22 20:00:19 +0100113
114#endif /* ifndef _NET_BATMAN_ADV_BLA_H_ */