From 174c14aefb5108dc53ed01c40f09a13f3a4d7893 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 5 May 2021 11:23:53 -0700 Subject: [PATCH] main: add a --developer,-E option This will enable developer features to be used. Currently the only user of this will be StationDiagnostics.Roam() method which should only be exposed in this mode. --- src/iwd.h | 1 + src/main.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/iwd.h b/src/iwd.h index 51548cbb..1be20df3 100644 --- a/src/iwd.h +++ b/src/iwd.h @@ -41,3 +41,4 @@ const char *iwd_get_iface_blacklist(void); const char *iwd_get_phy_whitelist(void); const char *iwd_get_phy_blacklist(void); +bool iwd_is_developer_mode(void); diff --git a/src/main.c b/src/main.c index f65fa7f4..01f1be22 100644 --- a/src/main.c +++ b/src/main.c @@ -54,6 +54,7 @@ static const char *nointerfaces; static const char *phys; static const char *nophys; static const char *debugopt; +static bool developeropt; static bool terminating; static bool nl80211_complete; @@ -126,6 +127,11 @@ const char *iwd_get_phy_blacklist(void) return nophys; } +bool iwd_is_developer_mode(void) +{ + return developeropt; +} + static void usage(void) { printf("iwd - Wireless daemon\n" @@ -143,6 +149,7 @@ static void usage(void) } static const struct option main_options[] = { + { "developer", no_argument, NULL, 'E' }, { "dbus-debug", no_argument, NULL, 'B' }, { "version", no_argument, NULL, 'v' }, { "interfaces", required_argument, NULL, 'i' }, @@ -405,7 +412,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "Bi:I:p:P:d::vh", + opt = getopt_long(argc, argv, "EBi:I:p:P:d::vh", main_options, NULL); if (opt < 0) break; @@ -414,6 +421,9 @@ int main(int argc, char *argv[]) case 'B': enable_dbus_debug = true; break; + case 'E': + developeropt = true; + break; case 'i': interfaces = optarg; break;