From nobody Fri Jun 02 12:22:32 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QXhw83hnLz4YBnT; Fri, 2 Jun 2023 12:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QXhw82vJyz3tk3; Fri, 2 Jun 2023 12:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685708552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LzQ7yS4Ij8g6kFZdKVJn9Zfrhx+r9jSSfbiJG+exuW0=; b=jrrsx2NzEKGekmD9xBSP5VIDoe6J8mpfSVaIfiSowZsgEUKV8V6QfavG48HZAvFcRgfP90 EMCX1C8zNj7Br7tTbjxLzf6+iyDevUG2QOjx4zdzFlMIYjeJ6T8d5TcunZc8qe83LNc/iy QwQ68IeKCxWSfTMtSYHFi31CZVfg2+/EblpxzKgruEM0AaHAEuuyZ4ujWbnecAdBR+v2Wy dDFOmV/nhZ1PUDJdk8EHfS2+mPMKwbznBsVTIUYZ+edvDPMEhyJscsf4pnlx0rHUmu8IkK hODoCMCmmH6WCWTGlaJWtaleT+/aUXhbDvMZDtKUDNUFI6kn14rxUwxqxzIgSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685708552; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LzQ7yS4Ij8g6kFZdKVJn9Zfrhx+r9jSSfbiJG+exuW0=; b=CpHNOjcI/Oze+AbBFue3UfRSoa63XNYhjaZZGb6Ugv/hP5Pn2goAJllVNaCR/2y5WZ3wKx QHQHb0qVBiL1Hhj/F8jpH/UXF9VBAEOo1jshTwFagcP1DCr8KV85vLGA1fvyzgymtSnCyr G0iOPrI7wgCiIcVeeSgUiCN+qjH54k4W8mYmIBKObA3W5nCiKli4BaWBwiRyX/I4lqBcV7 q8XtOvhhoHqMNHPvL21YqGTblSONLuEtDg61B0mk7N4AdZWjrwkzRVMzDgLk5R/FTkPzPe /0Jv81DUTu5jfPW4BFzSl1aiWm5zpq0VnQ+tDVIrEpFx/CjSFGw95PDbT0M3zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685708552; a=rsa-sha256; cv=none; b=NaVYawGyq7E3Y3OUAw2AIQCVYHmDpWUhKL3LRoz/sDjVCiLCymacdBXea9MAr65T7yUMG2 BWJShS8sg9NAOQwCbCSIbplxFsVc8+bJFAUGcF49t9p8joRceBWepB6wqVl2AApSB3425X Ugy2eiaz+o9s8iwWowg/pO1dAgNHSozpEhTHvbEfEhMhRmLl22VOPX/Kto25wZmVTJ/+h2 rkiCYWtyY4IiSkSRqMWaFK/w9taQmkhJkbcZBngzF0zSU0frlecSrz00TuyQwZ0NeZPBDZ 9jRxss+htKCquHkEuUrdQxJptStH7vKksThgglnaIqlL7LgKHCq9uK8SDNANog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QXhw81znbzyjC; Fri, 2 Jun 2023 12:22:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 352CMWXX079509; Fri, 2 Jun 2023 12:22:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 352CMWxB079508; Fri, 2 Jun 2023 12:22:32 GMT (envelope-from git) Date: Fri, 2 Jun 2023 12:22:32 GMT Message-Id: <202306021222.352CMWxB079508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 99084611932f - main - nlsysevent: add default command to the events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99084611932f5b61e1ed875da550a889f170e125 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=99084611932f5b61e1ed875da550a889f170e125 commit 99084611932f5b61e1ed875da550a889f170e125 Author: Baptiste Daroussin AuthorDate: 2023-06-02 12:19:17 +0000 Commit: Baptiste Daroussin CommitDate: 2023-06-02 12:22:10 +0000 nlsysevent: add default command to the events --- sys/netlink/netlink_sysevent.c | 2 +- sys/netlink/netlink_sysevent.h | 17 +++++++++++++---- 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