xref: /linux/net/batman-adv/gateway_common.h (revision af873fcecef567abf8a3468b06dd4e4aab46da6d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2009-2019  B.A.T.M.A.N. contributors:
3  *
4  * Marek Lindner
5  */
6 
7 #ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
8 #define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
9 
10 #include "main.h"
11 
12 #include <linux/types.h>
13 
14 struct net_device;
15 
16 /**
17  * enum batadv_bandwidth_units - bandwidth unit types
18  */
19 enum batadv_bandwidth_units {
20 	/** @BATADV_BW_UNIT_KBIT: unit type kbit */
21 	BATADV_BW_UNIT_KBIT,
22 
23 	/** @BATADV_BW_UNIT_MBIT: unit type mbit */
24 	BATADV_BW_UNIT_MBIT,
25 };
26 
27 #define BATADV_GW_MODE_OFF_NAME	"off"
28 #define BATADV_GW_MODE_CLIENT_NAME	"client"
29 #define BATADV_GW_MODE_SERVER_NAME	"server"
30 
31 ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
32 				size_t count);
33 void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
34 void batadv_gw_init(struct batadv_priv *bat_priv);
35 void batadv_gw_free(struct batadv_priv *bat_priv);
36 bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
37 			     const char *description, u32 *throughput);
38 
39 #endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */
40