aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Prestwood <prestwoj@gmail.com>2024-02-22 07:24:48 -0800
committerDenis Kenzior <denkenz@gmail.com>2024-02-22 10:14:59 -0600
commitd8a6fb86c1fefeebefba31b66eba2d4f33ba3a34 (patch)
tree0c951b9ed5329930e8fa058e694c271c5dd7b806
parent32f3745745c3bb9ddedbc900bbbff5aa12769dc1 (diff)
iwd: add iwd_notice for special event/state type of logging
iwd_notice is being added so modules can communicate internal state or event information via the NOTICE log level. This log level will be reserved in IWD for only these type of messages. The iwd_notice macro aims to help enforce some formatting requirements for these type of log messages. The messages should be one or more comma-separated "key: value" pairs starting with "event: <name>" and followed by any additional info that pertains to that event. iwd_notice only enforces the initial event key/value format and additional arguments are left to the caller to be formatted correctly.
-rw-r--r--src/iwd.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/iwd.h b/src/iwd.h
index 1be20df36..a8e2c5dbe 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -42,3 +42,17 @@ 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);
+
+#define IWD_NOTICE_STATE "state"
+#define IWD_NOTICE_CONNECT_INFO "connect-info"
+#define IWD_NOTICE_ROAM_INFO "roam-info"
+#define IWD_NOTICE_DISCONNECT_INFO "disconnect-info"
+#define IWD_NOTICE_FT_ROAM_FAILED "ft-roam-failed"
+#define IWD_NOTICE_CONNECT_FAILED "connect-failed"
+#define IWD_NOTICE_AUTH_TIMEOUT "authentication-timeout"
+#define IWD_NOTICE_ASSOC_TIMEOUT "association-timeout"
+#define IWD_NOTICE_CONNECT_TIMEOUT "connect-timeout"
+#define IWD_NOTICE_ROAM_SCAN "roam-scan"
+
+#define iwd_notice(event, ...) \
+ l_notice("event: " event ", " __VA_ARGS__)