History

batman-adv: Add gateway mesh genl configuration

The mesh/soft-interface can optimize the handling of DHCP packets. Instead of flooding them through the whole mesh, it can be forwarded as unicast to a specific gateway server. The originator which injects the packets in the mesh has to select (based on sel_class thresholds) a responsible gateway server. This is done by switching this originator to the gw_mode client. The servers announce their forwarding bandwidth (download/upload) when the gw_mode server was selected. The BATADV_CMD_SET_MESH/BATADV_CMD_GET_MESH commands allow to set/get the configuration of this feature using the attributes: * u8 BATADV_ATTR_GW_MODE (0 == off, 1 == client, 2 == server) * u32 BATADV_ATTR_GW_BANDWIDTH_DOWN (in 100 kbit/s steps) * u32 BATADV_ATTR_GW_BANDWIDTH_UP (in 100 kbit/s steps) * u32 BATADV_ATTR_GW_SEL_CLASS

Sven Eckelmann committed 7 years ago

Commit e2d0d351 parent 3e15b067 files · +135 −8Browse files

Showing the changes to include/uapi/linux (1 of 7 files). Show all

Unified · Split

include/uapi/linux/batman_adv.h+40−0
@@ -139,6 +139,20 @@ enum batadv_mcast_flags_priv { · 138 unmodified lines
139139 BATADV_MCAST_FLAGS_QUERIER_IPV6_SHADOWING = (1 << 4),
140140 };
141141
142+/**
143+ * enum batadv_gw_modes - gateway mode of node
144+ */
145+enum batadv_gw_modes {
146+ /** @BATADV_GW_MODE_OFF: gw mode disabled */
147+ BATADV_GW_MODE_OFF,
148+
149+ /** @BATADV_GW_MODE_CLIENT: send DHCP requests to gw servers */
150+ BATADV_GW_MODE_CLIENT,
151+
152+ /** @BATADV_GW_MODE_SERVER: announce itself as gatway server */
153+ BATADV_GW_MODE_SERVER,
154+};
155+
142156 /**
143157 * enum batadv_nl_attrs - batman-adv netlink attributes
144158 */
@@ -403,6 +417,32 @@ enum batadv_nl_attrs { · 258 unmodified lines
403417 */
404418 BATADV_ATTR_FRAGMENTATION_ENABLED,
405419
420+ /**
421+ * @BATADV_ATTR_GW_BANDWIDTH_DOWN: defines the download bandwidth which
422+ * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
423+ * to 'server'.
424+ */
425+ BATADV_ATTR_GW_BANDWIDTH_DOWN,
426+
427+ /**
428+ * @BATADV_ATTR_GW_BANDWIDTH_UP: defines the upload bandwidth which
429+ * is propagated by this node if %BATADV_ATTR_GW_BANDWIDTH_MODE was set
430+ * to 'server'.
431+ */
432+ BATADV_ATTR_GW_BANDWIDTH_UP,
433+
434+ /**
435+ * @BATADV_ATTR_GW_MODE: defines the state of the gateway features.
436+ * Possible values are specified in enum batadv_gw_modes
437+ */
438+ BATADV_ATTR_GW_MODE,
439+
440+ /**
441+ * @BATADV_ATTR_GW_SEL_CLASS: defines the selection criteria this node
442+ * will use to choose a gateway if gw_mode was set to 'client'.
443+ */
444+ BATADV_ATTR_GW_SEL_CLASS,
445+
406446 /* add attributes above here, update the policy in netlink.c */
407447
408448 /**