blob: 128467a0fb895484c810502c5f86e4094de81748 [file] [log] [blame]
Sven Eckelmann7db7d9f2017-11-19 15:05:11 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sven Eckelmann7a79d712018-12-31 23:59:59 +01002/* Copyright (C) 2009-2019 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00003 *
4 * Marek Lindner
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of version 2 of the GNU General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
Antonio Quartulliebf38fb2013-11-03 20:40:48 +010016 * along with this program; if not, see <http://www.gnu.org/licenses/>.
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000017 */
18
19#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
20#define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
21
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020022#include "main.h"
23
24#include <linux/types.h>
25
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020026struct net_device;
27
Marek Lindner414254e2013-04-23 21:39:58 +080028/**
29 * enum batadv_bandwidth_units - bandwidth unit types
Marek Lindner414254e2013-04-23 21:39:58 +080030 */
31enum batadv_bandwidth_units {
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010032 /** @BATADV_BW_UNIT_KBIT: unit type kbit */
Marek Lindner414254e2013-04-23 21:39:58 +080033 BATADV_BW_UNIT_KBIT,
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010034
35 /** @BATADV_BW_UNIT_MBIT: unit type mbit */
Marek Lindner414254e2013-04-23 21:39:58 +080036 BATADV_BW_UNIT_MBIT,
37};
38
Sven Eckelmann97ea4ba2012-06-03 22:19:11 +020039#define BATADV_GW_MODE_OFF_NAME "off"
40#define BATADV_GW_MODE_CLIENT_NAME "client"
41#define BATADV_GW_MODE_SERVER_NAME "server"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000042
Sven Eckelmann84d5e5e2012-05-12 02:09:30 +020043ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
44 size_t count);
Marek Lindner414254e2013-04-23 21:39:58 +080045void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
46void batadv_gw_init(struct batadv_priv *bat_priv);
47void batadv_gw_free(struct batadv_priv *bat_priv);
Antonio Quartulli0b5ecc62016-01-16 16:40:14 +080048bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
49 const char *description, u32 *throughput);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000050
51#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */