summaryrefslogtreecommitdiffstats
path: root/src/network/netdev/batadv.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:49:52 +0000
commit55944e5e40b1be2afc4855d8d2baf4b73d1876b5 (patch)
tree33f869f55a1b149e9b7c2b7e201867ca5dd52992 /src/network/netdev/batadv.h
parentInitial commit. (diff)
downloadsystemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.tar.xz
systemd-55944e5e40b1be2afc4855d8d2baf4b73d1876b5.zip
Adding upstream version 255.4.upstream/255.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/network/netdev/batadv.h')
-rw-r--r--src/network/netdev/batadv.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/network/netdev/batadv.h b/src/network/netdev/batadv.h
new file mode 100644
index 0000000..f1f9b46
--- /dev/null
+++ b/src/network/netdev/batadv.h
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#pragma once
+
+#include <linux/batman_adv.h>
+
+#include "conf-parser.h"
+#include "netdev.h"
+
+#define BATADV_GENL_NAME "batadv"
+
+typedef enum BatadvGatewayModes {
+ BATADV_GATEWAY_MODE_OFF = BATADV_GW_MODE_OFF,
+ BATADV_GATEWAY_MODE_CLIENT = BATADV_GW_MODE_CLIENT,
+ BATADV_GATEWAY_MODE_SERVER = BATADV_GW_MODE_SERVER,
+ _BATADV_GATEWAY_MODE_MAX,
+ _BATADV_GATEWAY_MODE_INVALID = -EINVAL,
+} BatadvGatewayModes;
+
+typedef enum BatadvRoutingAlgorithm {
+ BATADV_ROUTING_ALGORITHM_BATMAN_V,
+ BATADV_ROUTING_ALGORITHM_BATMAN_IV,
+ _BATADV_ROUTING_ALGORITHM_MAX,
+ _BATADV_ROUTING_ALGORITHM_INVALID = -EINVAL,
+} BatadvRoutingAlgorithm;
+
+typedef struct Batadv {
+ NetDev meta;
+
+ BatadvGatewayModes gateway_mode;
+ uint32_t gateway_bandwidth_down;
+ uint32_t gateway_bandwidth_up;
+ uint8_t hop_penalty;
+ BatadvRoutingAlgorithm routing_algorithm;
+ usec_t originator_interval;
+ bool aggregation;
+ bool bridge_loop_avoidance;
+ bool distributed_arp_table;
+ bool fragmentation;
+} BatmanAdvanced;
+
+DEFINE_NETDEV_CAST(BATADV, BatmanAdvanced);
+extern const NetDevVTable batadv_vtable;
+
+CONFIG_PARSER_PROTOTYPE(config_parse_batadv_gateway_mode);
+CONFIG_PARSER_PROTOTYPE(config_parse_batadv_routing_algorithm);
+CONFIG_PARSER_PROTOTYPE(config_parse_badadv_bandwidth);