blob: c3a0c5a7f7e9d09be5be2b7854e4db1a49342404 [file] [log] [blame]
Sven Eckelmann7db7d9f2017-11-19 15:05:11 +01001/* SPDX-License-Identifier: GPL-2.0 */
Sven Eckelmann68e039f2020-01-01 00:00:01 +01002/* Copyright (C) 2009-2020 B.A.T.M.A.N. contributors:
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00003 *
4 * Marek Lindner
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +00005 */
6
7#ifndef _NET_BATMAN_ADV_GATEWAY_COMMON_H_
8#define _NET_BATMAN_ADV_GATEWAY_COMMON_H_
9
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020010#include "main.h"
11
Sven Eckelmann68a600d2019-05-24 20:11:17 +020012#include <linux/netdevice.h>
Sven Eckelmann1e2c2a42015-04-17 19:40:28 +020013#include <linux/types.h>
14
Marek Lindner414254e2013-04-23 21:39:58 +080015/**
16 * enum batadv_bandwidth_units - bandwidth unit types
Marek Lindner414254e2013-04-23 21:39:58 +080017 */
18enum batadv_bandwidth_units {
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010019 /** @BATADV_BW_UNIT_KBIT: unit type kbit */
Marek Lindner414254e2013-04-23 21:39:58 +080020 BATADV_BW_UNIT_KBIT,
Sven Eckelmann8b84cc42017-12-02 19:51:48 +010021
22 /** @BATADV_BW_UNIT_MBIT: unit type mbit */
Marek Lindner414254e2013-04-23 21:39:58 +080023 BATADV_BW_UNIT_MBIT,
24};
25
Sven Eckelmann97ea4ba2012-06-03 22:19:11 +020026#define BATADV_GW_MODE_OFF_NAME "off"
27#define BATADV_GW_MODE_CLIENT_NAME "client"
28#define BATADV_GW_MODE_SERVER_NAME "server"
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000029
Sven Eckelmann84d5e5e2012-05-12 02:09:30 +020030ssize_t batadv_gw_bandwidth_set(struct net_device *net_dev, char *buff,
31 size_t count);
Marek Lindner414254e2013-04-23 21:39:58 +080032void batadv_gw_tvlv_container_update(struct batadv_priv *bat_priv);
33void batadv_gw_init(struct batadv_priv *bat_priv);
34void batadv_gw_free(struct batadv_priv *bat_priv);
Antonio Quartulli0b5ecc62016-01-16 16:40:14 +080035bool batadv_parse_throughput(struct net_device *net_dev, char *buff,
36 const char *description, u32 *throughput);
Sven Eckelmannc6c8fea2010-12-13 11:19:28 +000037
38#endif /* _NET_BATMAN_ADV_GATEWAY_COMMON_H_ */