aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2023-06-02 12:19:17 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2023-06-02 12:22:10 +0000
commit99084611932f5b61e1ed875da550a889f170e125 (patch)
tree799e65d653fc40bcb544c6ff4eae3dff60b128a2 /sys
parent0bcb3ebd1fb71f397f020d30e6c087d2831fd72e (diff)
downloadsrc-99084611932f5b61e1ed875da550a889f170e125.tar.gz
src-99084611932f5b61e1ed875da550a889f170e125.zip
nlsysevent: add default command to the events
Diffstat (limited to 'sys')
-rw-r--r--sys/netlink/netlink_sysevent.c2
-rw-r--r--sys/netlink/netlink_sysevent.h17
2 files changed, 14 insertions, 5 deletions
diff --git a/sys/netlink/netlink_sysevent.c b/sys/netlink/netlink_sysevent.c
index aeb819e6e85d..9da72a121ecd 100644
--- a/sys/netlink/netlink_sysevent.c
+++ b/sys/netlink/netlink_sysevent.c
@@ -74,7 +74,7 @@ sysevent_write(struct sysevent_group *se, const char *subsystem, const char *typ
return;
}
ghdr->version = 0;
- ghdr->cmd = 0;
+ ghdr->cmd = NLSE_CMD_NEWEVENT;
ghdr->reserved = 0;
nlattr_add_string(&nw, NLSE_ATTR_SYSTEM, se->name);
nlattr_add_string(&nw, NLSE_ATTR_SUBSYSTEM, subsystem);
diff --git a/sys/netlink/netlink_sysevent.h b/sys/netlink/netlink_sysevent.h
index 23288d2dd5c3..8434a0de078e 100644
--- a/sys/netlink/netlink_sysevent.h
+++ b/sys/netlink/netlink_sysevent.h
@@ -30,11 +30,20 @@
enum {
NLSE_ATTR_UNSPEC = 0,
- NLSE_ATTR_SYSTEM = 1,
- NLSE_ATTR_SUBSYSTEM = 2,
- NLSE_ATTR_TYPE = 3,
- NLSE_ATTR_DATA = 4,
+ NLSE_ATTR_SYSTEM = 1, /* string reporting the system name */
+ NLSE_ATTR_SUBSYSTEM = 2, /* string reporting the subsystem name */
+ NLSE_ATTR_TYPE = 3, /* string reporting the type if the event */
+ NLSE_ATTR_DATA = 4, /* string reporting the extra data (can be null) */
__NLSE_ATTR_MAX,
};
#define NLSE_ATTR_MAX (__NLSE_ATTR_MAX -1)
+
+/* commands */
+enum {
+ NLSE_CMD_UNSPEC = 0,
+ NLSE_CMD_NEWEVENT = 1,
+ __NLSE_CMD_MAX,
+};
+#define NLSE_CMD_MAX (__NLSE_CMD_MAX - 1)
+
#endif