mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 11:52:34 +01:00
main: Add command line options for white/black list
--interfaces (-i) tells iwd which interfaces to manage. If the option is ommitted, all interfaces will be managed. --nointerfaces (-I) tells iwd which interfaces to blacklist. If the option is ommitted, no interfaces will be blacklisted.
This commit is contained in:
parent
cda2026b23
commit
04de3af41f
14
src/main.c
14
src/main.c
@ -45,6 +45,8 @@
|
||||
#include "src/backtrace.h"
|
||||
|
||||
static struct l_timeout *timeout = NULL;
|
||||
static const char *interfaces;
|
||||
static const char *nointerfaces;
|
||||
|
||||
static void main_loop_quit(struct l_timeout *timeout, void *user_data)
|
||||
{
|
||||
@ -74,6 +76,8 @@ static void usage(void)
|
||||
printf("Options:\n"
|
||||
"\t-B, --dbus-debug Enable DBus debugging\n"
|
||||
"\t-K, --kdbus Setup Kernel D-Bus\n"
|
||||
"\t-i, --interfaces Interfaces to manage\n"
|
||||
"\t-I, --nointerfaces Interfaces to ignore\n"
|
||||
"\t-h, --help Show help options\n");
|
||||
}
|
||||
|
||||
@ -81,6 +85,8 @@ static const struct option main_options[] = {
|
||||
{ "kdbus", no_argument, NULL, 'K' },
|
||||
{ "dbus-debug", no_argument, NULL, 'B' },
|
||||
{ "version", no_argument, NULL, 'v' },
|
||||
{ "interfaces", required_argument, NULL, 'i' },
|
||||
{ "nointerfaces", required_argument, NULL, 'I' },
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
{ }
|
||||
};
|
||||
@ -134,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
for (;;) {
|
||||
int opt;
|
||||
|
||||
opt = getopt_long(argc, argv, "KBvh", main_options, NULL);
|
||||
opt = getopt_long(argc, argv, "KBi:I:vh", main_options, NULL);
|
||||
if (opt < 0)
|
||||
break;
|
||||
|
||||
@ -145,6 +151,12 @@ int main(int argc, char *argv[])
|
||||
case 'B':
|
||||
enable_dbus_debug = true;
|
||||
break;
|
||||
case 'i':
|
||||
interfaces = optarg;
|
||||
break;
|
||||
case 'I':
|
||||
nointerfaces = optarg;
|
||||
break;
|
||||
case 'v':
|
||||
printf("%s\n", VERSION);
|
||||
return EXIT_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user