blob: afebd9c7edf454ed50e3ddd16211c4a4d3ac5f33 [file] [log] [blame]
Sven Eckelmann7db7d9f2017-11-19 15:05:11 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sven Eckelmannac79cbb2017-01-01 00:00:00 +01002/* Copyright (C) 2009-2017 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
Sven Eckelmanncd646ab2012-06-03 22:19:18 +020028enum batadv_gw_modes {
29 BATADV_GW_MODE_OFF,
30 BATADV_GW_MODE_CLIENT,
31 BATADV_GW_MODE_SERVER,
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000032};
33
Marek Lindner414254e2013-04-23 21:39:58 +080034/**
35 * enum batadv_bandwidth_units - bandwidth unit types
Marek Lindner414254e2013-04-23 21:39:58 +080036 */
37enum batadv_bandwidth_units {
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010038 /** @BATADV_BW_UNIT_KBIT: unit type kbit */
Marek Lindner414254e2013-04-23 21:39:58 +080039 BATADV_BW_UNIT_KBIT,
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010040
41 /** @BATADV_BW_UNIT_MBIT: unit type mbit */
Marek Lindner414254e2013-04-23 21:39:58 +080042 BATADV_BW_UNIT_MBIT,
43};
44
Sven Eckelmann97ea4ba2012-06-03 22:19:11 +020045#define BATADV_GW_MODE_OFF_NAME "off"
46#define BATADV_GW_MODE_CLIENT_NAME "client"
47#define BATADV_GW_MODE_SERVER_NAME "server"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000048
Sven Eckelmann84d5e5e2012-05-12 02:09:30 +020049ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
50 size_t count);
Marek Lindner414254e2013-04-23 21:39:58 +080051void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
52void batadv_gw_init(struct batadv_priv *bat_priv);
53void batadv_gw_free(struct batadv_priv *bat_priv);
Antonio Quartulli0b5ecc62016-01-16 16:40:14 +080054bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
55 const char *description, u32 *throughput);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000056
57#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */