From nobody Wed Mar 01 15:24:51 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 4PRdMS1Ffdz3v03D; Wed, 1 Mar 2023 15:24:52 +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 4PRdMS0m4Gz3QC7; Wed, 1 Mar 2023 15:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677684292; 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=e4DwnioVM2SOyI5Qa56bJgEt26uXaDWgzuBmKQaGZlw=; b=KGASTTstDNELqEyFq/yzfWxzEyQFb5I87PtyIclRuKvTkyA9Ua4OLUe8rCJnWexNrsuIsT 2AmCH+iX/Kn8D5rTiNxP0BbDFQI/cWw8OjmlvI497Ev04aH52UM72b8zUY0UjZpQRZeoVZ Prok7Qfd5XeFFPWw0FslQq0QbU7DPpOHWloMGTu8Qfw/kkXFt9I/+D6DQMyaek4Ksqsy8H Njqk40I/OllEaXQL89tvON8w0N7MlpcGJLRubajezlGotJitukUjRL8F5+zleMe5h6zPRy jn8kbWjFjFYlGo8YYm3W2TS/ocrXj/l+iLosekbKmREQdCpMOJ1nHQpmCdvh+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677684292; 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=e4DwnioVM2SOyI5Qa56bJgEt26uXaDWgzuBmKQaGZlw=; b=ALXxT9gqtCZXqKe/ntywEOEwMa0OXkEzPEg5A2GhN0SDlyHEXR1j1p/kITh9eVZXCQgmxp 1mZqcsXX52AXXdX0euQd4SwMPij810oN1kyGc0liWLJE1oeM7pZ9G7YtTNN6+WxVRTAOt4 YwM9grBV27PCdSnpkkYQuQnZQiN3J3Qun9MVQpS/7iY3+86iuhGXlwkoEI4WGwjfi4YHVw aGJ5vjzlj53M4bE0a/o3sP6Ls7HXPm4cL1wbchNWyF+4xUZ1KbS+vztFXXUCdcppfb2uP/ hpqrSkno2S+gF6tMSyiU33Q3eW6bZovk6oKiTDksKXLXZmB5+SvNx83WPapcZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677684292; a=rsa-sha256; cv=none; b=jdc568MfeJuprOWKGOrIIz2WbK/FETU5sUG/jV/iEgFs2YpP0x8pbZ9OWMZHQGf7j8XXmu uIvE8OseUeMRlBXbP+4AJGFboo27W4SR6duEkklJIL0KZhDV/2VTk0wZ/3k2NJeDeflm9Y omtu/+XDF8qElClVTYnL4oVTLPc2kLfl9dv+nHcLVG7E7Y6ZrzgaK6RVnH/32+nRq/p/8i ldc3agE3lgjMmhMsep6zgolVy3GhoCK/2KR11UooYKGuzdJl1Gel4QC+o20RIgeqHDzWmw Hk2MJxIsq4CIwaM+Ny2Pc3fU7iiRYw28ejpp3Bf5oQ/MJcJSeOX8tmo916EE7Q== 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 4PRdMR6wTyzfVx; Wed, 1 Mar 2023 15:24:51 +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 321FOpxc087278; Wed, 1 Mar 2023 15:24:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 321FOppq087277; Wed, 1 Mar 2023 15:24:51 GMT (envelope-from git) Date: Wed, 1 Mar 2023 15:24:51 GMT Message-Id: <202303011524.321FOppq087277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: e6b4177c478d - main - netlink: add userland name mappings to all NETLINK_ROUTE messages. 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: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6b4177c478da54e25db464ae60ddae9e890c2cb Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=e6b4177c478da54e25db464ae60ddae9e890c2cb commit e6b4177c478da54e25db464ae60ddae9e890c2cb Author: Alexander V. Chernikov AuthorDate: 2023-03-01 15:22:21 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-01 15:24:45 +0000 netlink: add userland name mappings to all NETLINK_ROUTE messages. MFC after: 1 day --- sys/netlink/route/common.h | 78 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/sys/netlink/route/common.h b/sys/netlink/route/common.h index 1bfb888b34c0..1f1d98dc4384 100644 --- a/sys/netlink/route/common.h +++ b/sys/netlink/route/common.h @@ -97,23 +97,64 @@ enum { * Use NL_RTM_ prefix in the kernel and map it to RTM_ * for userland. */ -#define RTM_BASE NL_RTM_BASE -#define RTM_NEWLINK NL_RTM_NEWLINK -#define RTM_DELLINK NL_RTM_DELLINK -#define RTM_GETLINK NL_RTM_GETLINK -#define RTM_SETLINK NL_RTM_SETLINK -#define RTM_NEWADDR NL_RTM_NEWADDR -#define RTM_DELADDR NL_RTM_DELADDR -#define RTM_GETADDR NL_RTM_GETADDR -#define RTM_NEWROUTE NL_RTM_NEWROUTE -#define RTM_DELROUTE NL_RTM_DELROUTE -#define RTM_GETROUTE NL_RTM_GETROUTE -#define RTM_NEWNEXTHOP NL_RTM_NEWNEXTHOP -#define RTM_DELNEXTHOP NL_RTM_DELNEXTHOP -#define RTM_GETNEXTHOP NL_RTM_GETNEXTHOP -#endif +#define RTM_BASE NL_RTM_BASE +#define RTM_NEWLINK NL_RTM_NEWLINK +#define RTM_DELLINK NL_RTM_DELLINK +#define RTM_GETLINK NL_RTM_GETLINK +#define RTM_SETLINK NL_RTM_SETLINK +#define RTM_NEWADDR NL_RTM_NEWADDR +#define RTM_DELADDR NL_RTM_DELADDR +#define RTM_GETADDR NL_RTM_GETADDR +#define RTM_NEWROUTE NL_RTM_NEWROUTE +#define RTM_DELROUTE NL_RTM_DELROUTE +#define RTM_GETROUTE NL_RTM_GETROUTE +#define RTM_NEWNEIGH NL_RTM_NEWNEIGH +#define RTM_DELNEIGH NL_RTM_DELNEIGH +#define RTM_GETNEIGH NL_RTM_GETNEIGH +#define RTM_NEWRULE NL_RTM_NEWRULE +#define RTM_DELRULE NL_RTM_DELRULE +#define RTM_GETRULE NL_RTM_GETRULE +#define RTM_NEWQDISC NL_RTM_NEWQDISC +#define RTM_DELQDISC NL_RTM_DELQDISC +#define RTM_GETQDISC NL_RTM_GETQDISC +#define RTM_NEWTCLASS NL_RTM_NEWTCLASS +#define RTM_DELTCLASS NL_RTM_DELTCLASS +#define RTM_GETTCLASS NL_RTM_GETTCLASS +#define RTM_NEWTFILTER NL_RTM_NEWTFILTER +#define RTM_DELTFILTER NL_RTM_DELTFILTER +#define RTM_GETTFILTER NL_RTM_GETTFILTER +#define RTM_NEWACTION NL_RTM_NEWACTION +#define RTM_DELACTION NL_RTM_DELACTION +#define RTM_GETACTION NL_RTM_GETACTION +#define RTM_NEWPREFIX NL_RTM_NEWPREFIX +#define RTM_GETMULTICAST NL_RTM_GETMULTICAST +#define RTM_GETANYCAST NL_RTM_GETANYCAST +#define RTM_NEWNEIGHTBL NL_RTM_NEWNEIGHTBL +#define RTM_GETNEIGHTBL NL_RTM_GETNEIGHTBL +#define RTM_SETNEIGHTBL NL_RTM_SETNEIGHTBL +#define RTM_NEWNDUSEROPT NL_RTM_NEWNDUSEROPT +#define RTM_NEWADDRLABEL NL_RTM_NEWADDRLABEL +#define RTM_DELADDRLABEL NL_RTM_DELADDRLABEL +#define RTM_GETADDRLABEL NL_RTM_GETADDRLABEL +#define RTM_GETDCB NL_RTM_GETDCB +#define RTM_SETDCB NL_RTM_SETDCB +#define RTM_NEWNETCONF NL_RTM_NEWNETCONF +#define RTM_GETNETCONF NL_RTM_GETNETCONF +#define RTM_NEWMDB NL_RTM_NEWMDB +#define RTM_DELMDB NL_RTM_DELMDB +#define RTM_GETMDB NL_RTM_GETMDB +#define RTM_NEWNSID NL_RTM_NEWNSID +#define RTM_DELNSID NL_RTM_DELNSID +#define RTM_GETNSID NL_RTM_GETNSID +#define RTM_NEWSTATS NL_RTM_NEWSTATS +#define RTM_GETSTATS NL_RTM_GETSTATS +#define RTM_NEWNEXTHOP NL_RTM_NEWNEXTHOP +#define RTM_DELNEXTHOP NL_RTM_DELNEXTHOP +#define RTM_GETNEXTHOP NL_RTM_GETNEXTHOP +#define __RTM_MAX __NL_RTM_MAX + +#define RTM_MAX (roundup2(__RTM_MAX, 4)) -#ifndef _KERNEL /* rtnetlink multicast groups - backwards compatibility for userspace */ #define RTMGRP_LINK 0x01 #define RTMGRP_NOTIFY 0x02 @@ -209,5 +250,10 @@ enum rtnetlink_groups { #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) +/* Defined NETLINK_ROUTE virtual multicast address families */ +#define RTNL_FAMILY_IPMR 128 /* Not supported */ +#define RTNL_FAMILY_IP6MR 129 /* Not supported */ +#define RTNL_FAMILY_MAX 129 + #endif