From nobody Wed Aug 17 18:52:26 2022 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 4M7HFQ4Rckz4YxQ8; Wed, 17 Aug 2022 18:52:26 +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 4M7HFQ3zGjz4Cxm; Wed, 17 Aug 2022 18:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762346; 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=tEI9FZEKzzHWrfMEBjxk2RPQWzaxv5CTCFfk7EKsa+4=; b=AjorLdYn5PTdqYBu1BcPSAqjFzrikKsOQZchh+g9vdR9Bv9t6LFPLBQfs5M78h1auO//Dn 8sWn0MaOfP9THySyw1qklq7+AjwGg+tsKvZaS9VzEJwWU8hc0WVp4MS9n/uYU4z4l+DfEn QVwl1yWsip71RnfJEYO4fC5HEDg/2n7wGUhBd13/jQQ1/mir0AIEqBXo6v8YRxERdJamkk 1MBJDzBSjlvl7l+AhrSoEWv8swhX2rcpWl8uvIpAiJNWMbAo+p+8LsSsp1DJD0tL5f6uTQ MWmvnIsmnPsrdXMsC+JMtR0H5KIfPj2/OFVUEPw7y27bdTQisgreGz9cm/ytbQ== 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 4M7HFQ2vMHz10qn; Wed, 17 Aug 2022 18:52:26 +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 27HIqQoF013222; Wed, 17 Aug 2022 18:52:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27HIqQl6013221; Wed, 17 Aug 2022 18:52:26 GMT (envelope-from git) Date: Wed, 17 Aug 2022 18:52:26 GMT Message-Id: <202208171852.27HIqQl6013221@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d9f6ac882a95 - main - protosw: retire PRU_ flags and their char names 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: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9f6ac882a9597a660f83bac088a485b42fbba2c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660762346; 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=tEI9FZEKzzHWrfMEBjxk2RPQWzaxv5CTCFfk7EKsa+4=; b=tur8n3NSwPBeVuVpDzmAft02SK5lumRrZBnhR8jXcuTqpXAq7HlAcGP8PvfUppzFoJPR6/ LOyhGCOCfuV0a1RkUjWVnYXS+rO8DOliWubFChmbUd6kIGzU8rnX5I3mrLsOmd0n0SYnNb 3UvQwykTYptWvgEPpBQJK2XLacNioyNURBlazE0eBEfjmrEfSkFAfGdpfTydsla0XnLmkr I1e5354rpUhiMGWsryEB9wJ/GPg0w3zss1cPd3LPNZG82sPmC5L55R5uZ+VQaG5kIJ7hOX kVl2+1hWRcmpO+NoeOy7E7QSm6qgIGUQ6aanGsVC2Srd1+zeMvyU4KWZkS5mCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660762346; a=rsa-sha256; cv=none; b=le/KAXHzeI07hNtt9jZLX6acOb6gz8jb35V6YX2I/RXYtuxtXeKAV78AKsVkmDB+vqRmyh wJyIazmsae8IafCy5rudPP0/oYKAS7fbiSivyEqU1dbU3BjGuzujEHnQ1sjfdVQkt72co+ +iSrY15o4XH6T/SoT6sQfRJLK8xKVKYD7qtC1vfYeWOGMdO32R8Q15wfNsXe9mTTcBjV6C dLHkvn3A377dxqmwGS/oFotRtpajk7j1WaVPcvkCPMo3VAncDyWI0a8TADiy2mD/ukly4I 9wdMcgeJJb0Tk0LIjQruntXCXUaFkTTyioX3HR8/L1ydc9WQK3EorwXFQ3B9FQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d9f6ac882a9597a660f83bac088a485b42fbba2c commit d9f6ac882a9597a660f83bac088a485b42fbba2c Author: Gleb Smirnoff AuthorDate: 2022-08-17 18:50:32 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-17 18:50:32 +0000 protosw: retire PRU_ flags and their char names For many years only TCP debugging used them, but relatively recently TCP DTrace probes also start to use them. Move their declarations into tcp_debug.h, but start including tcp_debug.h unconditionally, so that compilation with DTrace and without TCPDEBUG is possible. --- sys/netinet/tcp_debug.c | 1 - sys/netinet/tcp_debug.h | 43 ++++++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_input.c | 2 -- sys/netinet/tcp_timer.c | 2 -- sys/netinet/tcp_usrreq.c | 2 -- sys/sys/protosw.h | 49 ------------------------------------------------ 6 files changed, 43 insertions(+), 56 deletions(-) diff --git a/sys/netinet/tcp_debug.c b/sys/netinet/tcp_debug.c index 1c8924ea09dd..0708d3ebb29d 100644 --- a/sys/netinet/tcp_debug.c +++ b/sys/netinet/tcp_debug.c @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/netinet/tcp_debug.h b/sys/netinet/tcp_debug.h index 0b3c895e9909..6bb296ea0e52 100644 --- a/sys/netinet/tcp_debug.h +++ b/sys/netinet/tcp_debug.h @@ -73,4 +73,47 @@ static const char *tanames[] = #define TCP_NDEBUG 100 +/* These older constants are still present in order to support TCP debugging. */ +#define PRU_ATTACH 0 /* attach protocol to up */ +#define PRU_DETACH 1 /* detach protocol from up */ +#define PRU_BIND 2 /* bind socket to address */ +#define PRU_LISTEN 3 /* listen for connection */ +#define PRU_CONNECT 4 /* establish connection to peer */ +#define PRU_ACCEPT 5 /* accept connection from peer */ +#define PRU_DISCONNECT 6 /* disconnect from peer */ +#define PRU_SHUTDOWN 7 /* won't send any more data */ +#define PRU_RCVD 8 /* have taken data; more room now */ +#define PRU_SEND 9 /* send this data */ +#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */ +#define PRU_CONTROL 11 /* control operations on protocol */ +#define PRU_SENSE 12 /* return status into m */ +#define PRU_RCVOOB 13 /* retrieve out of band data */ +#define PRU_SENDOOB 14 /* send out of band data */ +#define PRU_SOCKADDR 15 /* fetch socket's address */ +#define PRU_PEERADDR 16 /* fetch peer's address */ +#define PRU_CONNECT2 17 /* connect two sockets */ +/* begin for protocols internal use */ +#define PRU_FASTTIMO 18 /* 200ms timeout */ +#define PRU_SLOWTIMO 19 /* 500ms timeout */ +#define PRU_PROTORCV 20 /* receive from below */ +#define PRU_PROTOSEND 21 /* send to below */ +/* end for protocol's internal use */ +#define PRU_SEND_EOF 22 /* send and close */ +#define PRU_SOSETLABEL 23 /* MAC label change */ +#define PRU_CLOSE 24 /* socket close */ +#define PRU_FLUSH 25 /* flush the socket */ +#define PRU_NREQ 25 + +#ifdef PRUREQUESTS +const char *prurequests[] = { + "ATTACH", "DETACH", "BIND", "LISTEN", + "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN", + "RCVD", "SEND", "ABORT", "CONTROL", + "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR", + "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO", + "PROTORCV", "PROTOSEND", "SEND_EOF", "SOSETLABEL", + "CLOSE", "FLUSH", +}; +#endif + #endif /* !_NETINET_TCP_DEBUG_H_ */ diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 8aed90be69a0..12f78e9f3248 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -117,9 +117,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#ifdef TCPDEBUG #include -#endif /* TCPDEBUG */ #ifdef TCP_OFFLOAD #include #endif diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index e5af5cf5afef..6828364deea1 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -77,9 +77,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#ifdef TCPDEBUG #include -#endif int tcp_persmin; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, persmin, diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index d77f37efad7c..1245995724e1 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -103,9 +103,7 @@ __FBSDID("$FreeBSD$"); #ifdef TCPPCAP #include #endif -#ifdef TCPDEBUG #include -#endif #ifdef TCP_OFFLOAD #include #endif diff --git a/sys/sys/protosw.h b/sys/sys/protosw.h index 2fd7a0b30412..965c363afce1 100644 --- a/sys/sys/protosw.h +++ b/sys/sys/protosw.h @@ -145,55 +145,6 @@ struct protosw { #define PR_CAPATTACH 0x80 /* socket can attach in cap mode */ #define PR_SOCKBUF 0x100 /* private implementation of buffers */ -/* - * In earlier BSD network stacks, a single pr_usrreq() function pointer was - * invoked with an operation number indicating what operation was desired. - * We now provide individual function pointers which protocols can implement, - * which offers a number of benefits (such as type checking for arguments). - * These older constants are still present in order to support TCP debugging. - */ -#define PRU_ATTACH 0 /* attach protocol to up */ -#define PRU_DETACH 1 /* detach protocol from up */ -#define PRU_BIND 2 /* bind socket to address */ -#define PRU_LISTEN 3 /* listen for connection */ -#define PRU_CONNECT 4 /* establish connection to peer */ -#define PRU_ACCEPT 5 /* accept connection from peer */ -#define PRU_DISCONNECT 6 /* disconnect from peer */ -#define PRU_SHUTDOWN 7 /* won't send any more data */ -#define PRU_RCVD 8 /* have taken data; more room now */ -#define PRU_SEND 9 /* send this data */ -#define PRU_ABORT 10 /* abort (fast DISCONNECT, DETATCH) */ -#define PRU_CONTROL 11 /* control operations on protocol */ -#define PRU_SENSE 12 /* return status into m */ -#define PRU_RCVOOB 13 /* retrieve out of band data */ -#define PRU_SENDOOB 14 /* send out of band data */ -#define PRU_SOCKADDR 15 /* fetch socket's address */ -#define PRU_PEERADDR 16 /* fetch peer's address */ -#define PRU_CONNECT2 17 /* connect two sockets */ -/* begin for protocols internal use */ -#define PRU_FASTTIMO 18 /* 200ms timeout */ -#define PRU_SLOWTIMO 19 /* 500ms timeout */ -#define PRU_PROTORCV 20 /* receive from below */ -#define PRU_PROTOSEND 21 /* send to below */ -/* end for protocol's internal use */ -#define PRU_SEND_EOF 22 /* send and close */ -#define PRU_SOSETLABEL 23 /* MAC label change */ -#define PRU_CLOSE 24 /* socket close */ -#define PRU_FLUSH 25 /* flush the socket */ -#define PRU_NREQ 25 - -#ifdef PRUREQUESTS -const char *prurequests[] = { - "ATTACH", "DETACH", "BIND", "LISTEN", - "CONNECT", "ACCEPT", "DISCONNECT", "SHUTDOWN", - "RCVD", "SEND", "ABORT", "CONTROL", - "SENSE", "RCVOOB", "SENDOOB", "SOCKADDR", - "PEERADDR", "CONNECT2", "FASTTIMO", "SLOWTIMO", - "PROTORCV", "PROTOSEND", "SEND_EOF", "SOSETLABEL", - "CLOSE", "FLUSH", -}; -#endif - #ifdef _KERNEL /* users shouldn't see this decl */ struct ifnet;