17db7d9f3SSven Eckelmann /* SPDX-License-Identifier: GPL-2.0 */
2ac79cbb9SSven Eckelmann /* Copyright (C) 2009-2017  B.A.T.M.A.N. contributors:
3c6c8fea2SSven Eckelmann  *
4c6c8fea2SSven Eckelmann  * Marek Lindner
5c6c8fea2SSven Eckelmann  *
6c6c8fea2SSven Eckelmann  * This program is free software; you can redistribute it and/or
7c6c8fea2SSven Eckelmann  * modify it under the terms of version 2 of the GNU General Public
8c6c8fea2SSven Eckelmann  * License as published by the Free Software Foundation.
9c6c8fea2SSven Eckelmann  *
10c6c8fea2SSven Eckelmann  * This program is distributed in the hope that it will be useful, but
11c6c8fea2SSven Eckelmann  * WITHOUT ANY WARRANTY; without even the implied warranty of
12c6c8fea2SSven Eckelmann  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13c6c8fea2SSven Eckelmann  * General Public License for more details.
14c6c8fea2SSven Eckelmann  *
15c6c8fea2SSven Eckelmann  * You should have received a copy of the GNU General Public License
16ebf38fb7SAntonio Quartulli  * along with this program; if not, see <http://www.gnu.org/licenses/>.
17c6c8fea2SSven Eckelmann  */
18c6c8fea2SSven Eckelmann 
19c6c8fea2SSven Eckelmann #ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
20c6c8fea2SSven Eckelmann #define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
21c6c8fea2SSven Eckelmann 
221e2c2a4fSSven Eckelmann #include "main.h"
231e2c2a4fSSven Eckelmann 
241e2c2a4fSSven Eckelmann #include <linux/types.h>
251e2c2a4fSSven Eckelmann 
261e2c2a4fSSven Eckelmann struct net_device;
271e2c2a4fSSven Eckelmann 
28cd646ab1SSven Eckelmann enum batadv_gw_modes {
29cd646ab1SSven Eckelmann 	BATADV_GW_MODE_OFF,
30cd646ab1SSven Eckelmann 	BATADV_GW_MODE_CLIENT,
31cd646ab1SSven Eckelmann 	BATADV_GW_MODE_SERVER,
32c6c8fea2SSven Eckelmann };
33c6c8fea2SSven Eckelmann 
34414254e3SMarek Lindner /**
35414254e3SMarek Lindner  * enum batadv_bandwidth_units - bandwidth unit types
36414254e3SMarek Lindner  */
37414254e3SMarek Lindner enum batadv_bandwidth_units {
388b84cc4fSSven Eckelmann 	/** @BATADV_BW_UNIT_KBIT: unit type kbit */
39414254e3SMarek Lindner 	BATADV_BW_UNIT_KBIT,
408b84cc4fSSven Eckelmann 
418b84cc4fSSven Eckelmann 	/** @BATADV_BW_UNIT_MBIT: unit type mbit */
42414254e3SMarek Lindner 	BATADV_BW_UNIT_MBIT,
43414254e3SMarek Lindner };
44414254e3SMarek Lindner 
4597ea4ba1SSven Eckelmann #define BATADV_GW_MODE_OFF_NAME	"off"
4697ea4ba1SSven Eckelmann #define BATADV_GW_MODE_CLIENT_NAME	"client"
4797ea4ba1SSven Eckelmann #define BATADV_GW_MODE_SERVER_NAME	"server"
48c6c8fea2SSven Eckelmann 
4984d5e5e0SSven Eckelmann ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
5084d5e5e0SSven Eckelmann 				size_t count);
51414254e3SMarek Lindner void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
52414254e3SMarek Lindner void batadv_gw_init(struct batadv_priv *bat_priv);
53414254e3SMarek Lindner void batadv_gw_free(struct batadv_priv *bat_priv);
540b5ecc68SAntonio Quartulli bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
550b5ecc68SAntonio Quartulli 			     const char *description, u32 *throughput);
56c6c8fea2SSven Eckelmann 
57c6c8fea2SSven Eckelmann #endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */
58