@@ -55,7 +55,7 @@ static struct settings_data batctl_settings_aggregation = {
.netlink_set = set_aggregated_ogms,
};
-COMMAND_NAMED(SUBCOMMAND, aggregation, "ag", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, aggregation, "ag", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_aggregation,
"[0|1] \tdisplay or modify aggregation setting");
@@ -77,7 +77,7 @@ static struct settings_data batctl_settings_ap_isolation = {
.netlink_set = set_ap_isolation,
};
-COMMAND_NAMED(SUBCOMMAND, ap_isolation, "ap", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, ap_isolation, "ap", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_ap_isolation,
"[0|1] \tdisplay or modify ap_isolation setting");
@@ -54,7 +54,7 @@ static struct settings_data batctl_settings_bonding = {
.netlink_set = set_bonding,
};
-COMMAND_NAMED(SUBCOMMAND, bonding, "b", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, bonding, "b", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_bonding,
"[0|1] \tdisplay or modify bonding setting");
@@ -55,7 +55,7 @@ static struct settings_data batctl_settings_bridge_loop_avoidance = {
.netlink_set = set_bridge_loop_avoidance,
};
-COMMAND_NAMED(SUBCOMMAND, bridge_loop_avoidance, "bl", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, bridge_loop_avoidance, "bl", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_bridge_loop_avoidance,
"[0|1] \tdisplay or modify bridge_loop_avoidance setting");
@@ -55,7 +55,7 @@ static struct settings_data batctl_settings_distributed_arp_table = {
.netlink_set = set_distributed_arp_table,
};
-COMMAND_NAMED(SUBCOMMAND, distributed_arp_table, "dat", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, distributed_arp_table, "dat", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_distributed_arp_table,
"[0|1] \tdisplay or modify distributed_arp_table setting");
@@ -55,7 +55,7 @@ static struct settings_data batctl_settings_fragmentation = {
.netlink_set = set_fragmentation,
};
-COMMAND_NAMED(SUBCOMMAND, fragmentation, "f", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, fragmentation, "f", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_fragmentation,
"[0|1] \tdisplay or modify fragmentation setting");
@@ -392,6 +392,6 @@ static int gw_mode(struct state *state, int argc, char **argv)
return res;
}
-COMMAND(SUBCOMMAND, gw_mode, "gw",
+COMMAND(SUBCOMMAND_MIF, gw_mode, "gw",
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, NULL,
"[mode] \tdisplay or modify the gateway mode");
@@ -95,7 +95,7 @@ static struct settings_data batctl_settings_hop_penalty = {
.netlink_set = set_hop_penalty,
};
-COMMAND_NAMED(SUBCOMMAND, hop_penalty, "hp", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, hop_penalty, "hp", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_hop_penalty,
"[penalty] \tdisplay or modify hop_penalty setting");
@@ -534,5 +534,5 @@ static int interface(struct state *state, int argc, char **argv)
return EXIT_FAILURE;
}
-COMMAND(SUBCOMMAND, interface, "if", 0, NULL,
+COMMAND(SUBCOMMAND_MIF, interface, "if", 0, NULL,
"[add|del iface(s)]\tdisplay or modify the interface settings");
@@ -134,7 +134,7 @@ static struct settings_data batctl_settings_isolation_mark = {
.netlink_set = set_isolation_mark,
};
-COMMAND_NAMED(SUBCOMMAND, isolation_mark, "mark", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, isolation_mark, "mark", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_isolation_mark,
"[mark] \tdisplay or modify isolation_mark setting");
@@ -212,6 +212,6 @@ static int loglevel(struct state *state, int argc, char **argv)
return res;
}
-COMMAND(SUBCOMMAND, loglevel, "ll",
+COMMAND(SUBCOMMAND_MIF, loglevel, "ll",
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK, NULL,
"[level] \tdisplay or modify the log level");
@@ -35,6 +35,7 @@ static void print_usage(void)
{
.label = "commands:\n",
.types = BIT(SUBCOMMAND) |
+ BIT(SUBCOMMAND_MIF) |
BIT(SUBCOMMAND_VID) |
BIT(SUBCOMMAND_HIF),
},
@@ -47,9 +48,13 @@ static void print_usage(void)
"",
NULL,
};
+ const char *meshif_prefixes[] = {
+ "meshif <netdev> ",
+ NULL,
+ };
const char *vlan_prefixes[] = {
"vlan <vdev> ",
- "vid <vid> ",
+ "meshif <netdev> vid <vid> ",
NULL,
};
const char *hardif_prefixes[] = {
@@ -64,7 +69,6 @@ static void print_usage(void)
fprintf(stderr, "Usage: batctl [options] command|debug table [parameters]\n");
fprintf(stderr, "options:\n");
- fprintf(stderr, " \t-m mesh interface (default 'bat0')\n");
fprintf(stderr, " \t-h print this help (or 'batctl <command|debug table> -h' for the parameter help)\n");
fprintf(stderr, " \t-v print version\n");
@@ -83,6 +87,10 @@ static void print_usage(void)
continue;
switch (cmd->type) {
+ case DEBUGTABLE:
+ case SUBCOMMAND_MIF:
+ prefixes = meshif_prefixes;
+ break;
case SUBCOMMAND_VID:
prefixes = vlan_prefixes;
break;
@@ -102,7 +110,7 @@ static void print_usage(void)
snprintf(buf, sizeof(buf), "%s%s|%s",
*prefix, cmd->name, cmd->abbr);
- fprintf(stderr, " \t%-35s%s\n", buf,
+ fprintf(stderr, " \t%-43s%s\n", buf,
cmd->usage);
}
}
@@ -155,8 +163,11 @@ static const struct command *find_command(struct state *state, const char *name)
switch (state->selector) {
case SP_NONE_OR_MESHIF:
- types = BIT(SUBCOMMAND) |
- BIT(DEBUGTABLE);
+ types = BIT(SUBCOMMAND);
+ /* fall through */
+ case SP_MESHIF:
+ types |= BIT(SUBCOMMAND_MIF) |
+ BIT(DEBUGTABLE);
break;
case SP_VLAN:
types = BIT(SUBCOMMAND_VID);
@@ -179,7 +190,11 @@ static int detect_selector_prefix(int argc, char *argv[],
return -EINVAL;
/* only detect selector prefix which identifies meshif */
- if (strcmp(argv[0], "vlan") == 0) {
+ if (strcmp(argv[0], "meshif") == 0 ||
+ strcmp(argv[0], "dev") == 0) {
+ *selector = SP_MESHIF;
+ return 2;
+ } else if (strcmp(argv[0], "vlan") == 0) {
*selector = SP_VLAN;
return 2;
} else if (strcmp(argv[0], "hardif") == 0 ||
@@ -205,6 +220,11 @@ static int parse_meshif_args(struct state *state, int argc, char *argv[])
dev_arg = argv[parsed_args - 1];
switch (selector) {
+ case SP_MESHIF:
+ snprintf(state->mesh_iface, sizeof(state->mesh_iface), "%s",
+ dev_arg);
+ state->selector = SP_MESHIF;
+ return parsed_args;
case SP_VLAN:
ret = translate_vlan_iface(state, dev_arg);
if (ret < 0) {
@@ -253,6 +273,7 @@ static int parse_dev_args(struct state *state, int argc, char *argv[])
switch (state->selector) {
case SP_NONE_OR_MESHIF:
+ case SP_MESHIF:
/* continue below */
break;
default:
@@ -298,6 +319,7 @@ int main(int argc, char **argv)
"Error - multiple mesh interfaces specified\n");
goto err;
}
+ fprintf(stderr, "Warning - option -m was deprecated in will be removed in the future\n");
state.arg_iface = argv[2];
break;
@@ -58,12 +58,14 @@ enum command_flags {
enum selector_prefix {
SP_NONE_OR_MESHIF,
+ SP_MESHIF,
SP_VLAN,
SP_HARDIF,
};
enum command_type {
SUBCOMMAND,
+ SUBCOMMAND_MIF,
SUBCOMMAND_VID,
SUBCOMMAND_HIF,
DEBUGTABLE,
@@ -54,42 +54,42 @@ performances, is also included.
.br
.TP
.I \fBcommands:
-.IP "\fBinterface\fP|\fBif\fP [\fB-M\fP] [\fBadd\fP|\fBdel iface(s)\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBinterface\fP|\fBif\fP [\fB-M\fP] [\fBadd\fP|\fBdel iface(s)\fP]"
If no parameter is given or the first parameter is neither "add" nor "del" the current interface settings are displayed.
In order to add or delete interfaces specify "add" or "del" as first argument and append the interface names you wish to
add or delete. Multiple interfaces can be specified.
The "\-M" option tells batctl to not automatically create the batman-adv interface on "add" or to destroy it when "del"
removed all interfaces which belonged to it.
-.IP "\fBinterface\fP|\fBif\fP [\fBcreate\fP|\fBdestroy\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBinterface\fP|\fBif\fP [\fBcreate\fP|\fBdestroy\fP]"
A batman-adv interface without attached interfaces can be created using "create". The parameter "destroy" can be used to
free all attached interfaces and remove batman-adv interface.
.br
-.IP "\fBorig_interval\fP|\fBit\fP [\fBinterval\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBorig_interval\fP|\fBit\fP [\fBinterval\fP]"
If no parameter is given the current originator interval setting is displayed otherwise the parameter is used to set the
originator interval. The interval is in units of milliseconds.
.br
-.IP "\fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current ap isolation setting is displayed. Otherwise the parameter is used to enable or
disable ap isolation.
.br
-.IP "<\fBvlan <vdev>\fP|\fBvid <vid>\fP> \fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
+.IP "<\fBvlan <vdev>\fP|[\fBmeshif <netdev>\fP] \fBvid <vid>\fP> \fBap_isolation\fP|\fBap\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current ap isolation setting for the specified VLAN is displayed. Otherwise the parameter is used to enable or
disable ap isolation for the specified VLAN.
.br
-.IP "\fBbridge_loop_avoidance\fP|\fBbl\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBbridge_loop_avoidance\fP|\fBbl\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current bridge loop avoidance setting is displayed. Otherwise the parameter is used to enable
or disable the bridge loop avoidance. Bridge loop avoidance support has to be enabled when compiling the module otherwise
this option won't be available.
.br
-.IP "\fBdistributed_arp_table\fP|\fBdat\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBdistributed_arp_table\fP|\fBdat\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current distributed arp table setting is displayed. Otherwise the parameter is used to
enable or disable the distributed arp table.
.br
-.IP "\fBaggregation\fP|\fBag\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBaggregation\fP|\fBag\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current aggregation setting is displayed. Otherwise the parameter is used to enable or disable
OGM packet aggregation.
.br
-.IP "\fBbonding\fP|\fBb\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBbonding\fP|\fBb\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current bonding mode setting is displayed. Otherwise the parameter is used to enable or disable
the bonding mode.
.br
@@ -101,30 +101,30 @@ when parameter \fB\-t\fP is specified. Parameter \fB\-r\fP will do the same but
If no parameter is given the current ELP interval setting of the hard interface is displayed otherwise the parameter is used to set the
ELP interval. The interval is in units of milliseconds.
.br
-.IP "\fBfragmentation\fP|\fBf\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBfragmentation\fP|\fBf\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current fragmentation mode setting is displayed. Otherwise the parameter is used to enable or
disable fragmentation.
.br
-.IP "\fBhop_penalty\fP|\fBhp\fP [\fBpenalty\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBhop_penalty\fP|\fBhp\fP [\fBpenalty\fP]"
If no parameter is given the current hop penalty setting is displayed. Otherwise the parameter is used to set the
hop penalty. The penalty is can be 0-255 (255 sets originator message's TQ to zero when forwarded by this hop).
.br
-.IP "\fBnetwork_coding\fP|\fBnc\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBnetwork_coding\fP|\fBnc\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current network coding mode setting is displayed. Otherwise the parameter is used to enable or
disable network coding.
.br
-.IP "\fBmulticast_forceflood\fP|\fBmff\fP [\fB0\fP|\fB1\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBmulticast_forceflood\fP|\fBmff\fP [\fB0\fP|\fB1\fP]"
If no parameter is given the current multicast forceflood setting is displayed. Otherwise the parameter is used to enable or
disable multicast forceflood. This setting defines whether multicast optimizations should be replaced by simple broadcast-like
flooding of multicast packets. If set to non-zero then all nodes in the mesh are going to use classic flooding for any
multicast packet with no optimizations.
.br
-.IP "\fBmulticast_fanout\fP|\fBmo\fP [\fBfanout\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBmulticast_fanout\fP|\fBmo\fP [\fBfanout\fP]"
If no parameter is given the current multicast fanout setting is displayed. Otherwise the parameter is used to set
the multicast fanout. The multicast fanout defines the maximum number of packet copies that may be generated for a
multicast-to-unicast conversion. Once this limit is exceeded distribution will fall back to broadcast.
.br
-.IP "\fBloglevel\fP|\fBll\fP [\fBlevel\fP[ \fBlevel\fP[ \fBlevel\fP]] \fB...\fP]"
+.IP "[\fBmeshif <netdev>\fP] \fBloglevel\fP|\fBll\fP [\fBlevel\fP[ \fBlevel\fP[ \fBlevel\fP]] \fB...\fP]"
If no parameter is given the current log level settings are displayed otherwise the parameter(s) is/are used to set the log
level. Level 'none' disables all verbose logging. Level 'batman' enables messages related to routing / flooding / broadcasting.
Level 'routes' enables messages related to routes being added / changed / deleted. Level 'tt' enables messages related to
@@ -135,7 +135,7 @@ Level 'all' enables all messages. The messages are sent to the batman-adv debug
Make sure to have debugging output enabled when compiling the module otherwise the output as well as the loglevel options
won't be available.
.br
-.IP "\fBgw_mode|gw\fP [\fBoff\fP|\fBclient\fP|\fBserver\fP] [\fBsel_class|bandwidth\fP]\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBgw_mode|gw\fP [\fBoff\fP|\fBclient\fP|\fBserver\fP] [\fBsel_class|bandwidth\fP]\fP"
If no parameter is given the current gateway mode is displayed otherwise the parameter is used to set the gateway mode. The
second (optional) argument specifies the selection class (if 'client' was the first argument) or the gateway bandwidth (if 'server'
was the first argument). If the node is a server this parameter is used to inform other nodes in the network about
@@ -213,7 +213,7 @@ the parameter is used to set the throughput override for the specified hard
interface.
Just enter any number (optionally followed by "kbit" or "mbit").
.br
-.IP "\fBisolation_mark\fP|\fBmark\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBisolation_mark\fP|\fBmark\fP"
If no parameter is given the current isolation mark value is displayed.
Otherwise the parameter is used to set or unset the isolation mark used by the
Extended Isolation feature.
@@ -293,12 +293,12 @@ List of debug tables:
.RE
.RE
.br
-.IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Translates a destination (hostname, IP, MAC, bat_host-name) to the originator
mac address responsible for it.
.br
-.IP "\fBstatistics\fP|\fBs\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBstatistics\fP|\fBs\fP"
Retrieve traffic counters from batman-adv kernel module. The output may vary depending on which features have been compiled
into the kernel module.
.br
@@ -313,7 +313,7 @@ tt - translation table counters
All counters without a prefix concern payload (pure user data) traffic.
.RE
.br
-.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Layer 2 ping of a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter was
not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when
the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and
@@ -324,7 +324,7 @@ interval between pings and the timeout time for replies, both in seconds. When r
messages will be recorded. With "\-T" you can disable the automatic translation of a client MAC address to the originator
address which is responsible for this client.
.br
-.IP "\fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP"
Layer 2 traceroute to a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter
was not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when
the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and
@@ -376,7 +376,7 @@ specific sequence number, min. Furthermore using "\-o" you can filter the output
given batctl will not replace the MAC addresses with bat\-host names in the output.
.RE
.br
-.IP "\fBthroughputmeter\fP|\fBtp\fP \fBMAC\fP"
+.IP "[\fBmeshif <netdev>\fP] \fBthroughputmeter\fP|\fBtp\fP \fBMAC\fP"
This command starts a throughput test entirely controlled by batman module in
kernel space: the computational resources needed to align memory and copy data
between user and kernel space that are required by other user space tools may
@@ -95,7 +95,7 @@ static struct settings_data batctl_settings_multicast_fanout = {
.netlink_set = set_multicast_fanout,
};
-COMMAND_NAMED(SUBCOMMAND, multicast_fanout, "mo", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, multicast_fanout, "mo", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_multicast_fanout,
"[fanout] \tdisplay or modify multicast_fanout setting");
@@ -75,7 +75,7 @@ static struct settings_data batctl_settings_multicast_forceflood = {
.netlink_set = set_multicast_forceflood,
};
-COMMAND_NAMED(SUBCOMMAND, multicast_forceflood, "mff", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, multicast_forceflood, "mff", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK | COMMAND_FLAG_INVERSE,
&batctl_settings_multicast_forceflood,
"[0|1] \tdisplay or modify multicast_forceflood setting");
@@ -75,6 +75,6 @@ static struct settings_data batctl_settings_multicast_mode = {
.netlink_set = set_multicast_mode,
};
-COMMAND_NAMED(SUBCOMMAND, multicast_mode, "mm", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, multicast_mode, "mm", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_multicast_mode, NULL);
@@ -55,7 +55,7 @@ static struct settings_data batctl_settings_network_coding = {
.netlink_set = set_network_coding,
};
-COMMAND_NAMED(SUBCOMMAND, network_coding, "nc", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, network_coding, "nc", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_network_coding,
"[0|1] \tdisplay or modify network_coding setting");
@@ -95,7 +95,7 @@ static struct settings_data batctl_settings_orig_interval = {
.netlink_set = set_orig_interval,
};
-COMMAND_NAMED(SUBCOMMAND, orig_interval, "it", handle_sys_setting,
+COMMAND_NAMED(SUBCOMMAND_MIF, orig_interval, "it", handle_sys_setting,
COMMAND_FLAG_MESH_IFACE | COMMAND_FLAG_NETLINK,
&batctl_settings_orig_interval,
"[interval] \tdisplay or modify orig_interval setting");
@@ -323,5 +323,5 @@ static int ping(struct state *state, int argc, char **argv)
return ret;
}
-COMMAND(SUBCOMMAND, ping, "p", COMMAND_FLAG_MESH_IFACE, NULL,
+COMMAND(SUBCOMMAND_MIF, ping, "p", COMMAND_FLAG_MESH_IFACE, NULL,
"<destination> \tping another batman adv host via layer 2");
@@ -112,5 +112,5 @@ static int statistics(struct state *state, int argc __maybe_unused,
return ret;
}
-COMMAND(SUBCOMMAND, statistics, "s", COMMAND_FLAG_MESH_IFACE, NULL,
+COMMAND(SUBCOMMAND_MIF, statistics, "s", COMMAND_FLAG_MESH_IFACE, NULL,
" \tprint mesh statistics");
@@ -145,9 +145,13 @@ static void settings_usage(struct state *state)
"",
NULL,
};
+ const char *meshif_prefixes[] = {
+ "meshif <netdev> ",
+ NULL,
+ };
const char *vlan_prefixes[] = {
"vlan <vdev> ",
- "vid <vid> ",
+ "meshif <netdev> vid <vid> ",
NULL,
};
const char *hardif_prefixes[] = {
@@ -159,6 +163,9 @@ static void settings_usage(struct state *state)
const char **prefix;
switch (state->cmd->type) {
+ case SUBCOMMAND_MIF:
+ prefixes = meshif_prefixes;
+ break;
case SUBCOMMAND_VID:
prefixes = vlan_prefixes;
break;
@@ -268,6 +275,7 @@ int handle_sys_setting(struct state *state, int argc, char **argv)
switch (state->selector) {
case SP_NONE_OR_MESHIF:
+ case SP_MESHIF:
snprintf(path_buff, PATH_BUFF_LEN, SYS_BATIF_PATH_FMT,
state->mesh_iface);
break;
@@ -529,5 +529,5 @@ static int throughputmeter(struct state *state, int argc, char **argv)
return ret;
}
-COMMAND(SUBCOMMAND, throughputmeter, "tp", COMMAND_FLAG_MESH_IFACE, NULL,
+COMMAND(SUBCOMMAND_MIF, throughputmeter, "tp", COMMAND_FLAG_MESH_IFACE, NULL,
"<destination> \tstart a throughput measurement");
@@ -209,5 +209,5 @@ static int traceroute(struct state *state, int argc, char **argv)
return ret;
}
-COMMAND(SUBCOMMAND, traceroute, "tr", COMMAND_FLAG_MESH_IFACE, NULL,
+COMMAND(SUBCOMMAND_MIF, traceroute, "tr", COMMAND_FLAG_MESH_IFACE, NULL,
"<destination> \ttraceroute another batman adv host via layer 2");
@@ -64,5 +64,5 @@ static int translate(struct state *state, int argc, char **argv)
return ret;
}
-COMMAND(SUBCOMMAND, translate, "t", COMMAND_FLAG_MESH_IFACE, NULL,
+COMMAND(SUBCOMMAND_MIF, translate, "t", COMMAND_FLAG_MESH_IFACE, NULL,
"<destination> \ttranslate a destination to the originator responsible for it");