From nobody Wed Dec 07 17:57:08 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 4NS4jw30xxz4jQWd; Wed, 7 Dec 2022 17:57:08 +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 4NS4jw2H8bz4Jjj; Wed, 7 Dec 2022 17:57:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670435828; 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=deRG0OMZjpDWN5uoZfuuhU/q3Gxp+TFy9ZjweI/0WbI=; b=xiX0HDQuDAC4lj0aGCpFwJvqLHe3VfVLL7EppdErc8d8pYr4pLArjs14DHGrmcvOkPtPqo iKqGJRrKucwknCnwtnrpdRK8WaLr5ilzARTrYTKNm07apvU79ZBFF07ImlJvrynLJHyzxj CyFyIazDQi39izyGLjGXUQ/O6vR8xdOghwRNlVUtOsnIeTmPhOf9bCVJ0gAtATOGfaG3Lj YFEUrN5oQdrGncQiIrs6w17XecSMqOW1i9AprxUCY9DFiRKsGqYTF3zJD3tg+0sZ+745VX pkbFqdLspqD/kLp/nFn6F20ReksqzdpGdPsu68nqJQwA3ao7w+lPBuVhRreCaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670435828; 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=deRG0OMZjpDWN5uoZfuuhU/q3Gxp+TFy9ZjweI/0WbI=; b=T747kbMRm1uRHQqYEdMlBIMLo0V6Jxb1Ifuvj28ocAbDsIeLsatoYsq4gNmpzk2kRsnnlP YKp0WU763Z8S6YHkD1BAuA3BpSFkQxHoPuV3f2xMunQMTDHDzdUyOz4hBvuzwaqHM00Uqx y0nMTOpnCHs5uOcu5u6nBi+0ZGJzbMuz+khXkMmES0CslBagmpq2hHGWwaKo/budMpDy8X xt8kAGHr2/N2JSWHqreF+uvnnd0/hy2UHiJ6ETqcqnujZb7j75atBjihQATwq4DblicWsI sU0glQDOm3COQQ7X3ZA51XCyvV2l2NiiTn9gmU4EdginOr7FIcc9E+v4uqdMTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670435828; a=rsa-sha256; cv=none; b=qZ6VdpJB4MJZ2FSgfparcI/V94fFOjV3de4M2epfmOTOoDvbD0hHNfOqliwJ+nORdciboJ tnUcNx/tVaZ/2T5Z7nkZ9Ks9nUld22u0x/YLDfcJCkuLs/NZWIDrY4YdvGqEja2ZVs5iRZ 2LcqNcYWb9rhmtJhj7mUDyznWp0sNDEDqLZkuGxKS52gFdcqV2uf2LRSYWpQ66wT8211hE 18fxFxn4fA8xUIAhV6qrYgKoVa3yMUHMIJL3LNw3zDR+jfEkGn1xPAe6FptAA3VdhEwQ2Q gEbjiQDsShjjCPj0P7wfw9L++uE382fLYKKum2bj1BKi64bUphWx39LQ207chQ== 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 4NS4jw1N0nzQJB; Wed, 7 Dec 2022 17:57:08 +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 2B7Hv8ao057615; Wed, 7 Dec 2022 17:57:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B7Hv8F7057614; Wed, 7 Dec 2022 17:57:08 GMT (envelope-from git) Date: Wed, 7 Dec 2022 17:57:08 GMT Message-Id: <202212071757.2B7Hv8F7057614@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: 0c0d8a4f7e54 - main - udp: rearrange declarations in udp_var.h into user and _KERNEL halves 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: 0c0d8a4f7e54fd4931cf23a6a68fca78a0d9aad9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=0c0d8a4f7e54fd4931cf23a6a68fca78a0d9aad9 commit 0c0d8a4f7e54fd4931cf23a6a68fca78a0d9aad9 Author: Gleb Smirnoff AuthorDate: 2022-12-07 17:55:38 +0000 Commit: Gleb Smirnoff CommitDate: 2022-12-07 17:55:38 +0000 udp: rearrange declarations in udp_var.h into user and _KERNEL halves Bring everything that belongs to _KERNEL into single block. Move sub-includes to its beginning. --- sys/netinet/udp_var.h | 68 +++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/sys/netinet/udp_var.h b/sys/netinet/udp_var.h index 84ed16aa32f7..965630965352 100644 --- a/sys/netinet/udp_var.h +++ b/sys/netinet/udp_var.h @@ -58,33 +58,14 @@ struct udpiphdr { #define ui_ulen ui_u.uh_ulen #define ui_sum ui_u.uh_sum -struct inpcb; -struct mbuf; - -#ifdef _KERNEL -typedef bool udp_tun_func_t(struct mbuf *, int, struct inpcb *, - const struct sockaddr *, void *); -typedef union { - struct icmp *icmp; - struct ip6ctlparam *ip6cp; -} udp_tun_icmp_param_t __attribute__((__transparent_union__)); -typedef void udp_tun_icmp_t(udp_tun_icmp_param_t); - /* - * UDP control block; one per udp. + * Identifiers for UDP sysctl nodes. */ -struct udpcb { - udp_tun_func_t *u_tun_func; /* UDP kernel tunneling callback. */ - udp_tun_icmp_t *u_icmp_func; /* UDP kernel tunneling icmp callback */ - u_int u_flags; /* Generic UDP flags. */ - uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ - uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ - void *u_tun_ctx; /* Tunneling callback context. */ -}; - -#define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) -#define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) -#endif +#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ +#define UDPCTL_STATS 2 /* statistics (read-only) */ +#define UDPCTL_MAXDGRAM 3 /* max datagram size */ +#define UDPCTL_RECVSPACE 4 /* default receive buffer space */ +#define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ /* IPsec: ESP in UDP tunneling: */ #define UF_ESPINUDP_NON_IKE 0x00000001 /* w/ non-IKE marker .. */ @@ -113,7 +94,32 @@ struct udpstat { }; #ifdef _KERNEL +#include #include +struct mbuf; + +typedef bool udp_tun_func_t(struct mbuf *, int, struct inpcb *, + const struct sockaddr *, void *); +typedef union { + struct icmp *icmp; + struct ip6ctlparam *ip6cp; +} udp_tun_icmp_param_t __attribute__((__transparent_union__)); +typedef void udp_tun_icmp_t(udp_tun_icmp_param_t); + +/* + * UDP control block; one per udp. + */ +struct udpcb { + udp_tun_func_t *u_tun_func; /* UDP kernel tunneling callback. */ + udp_tun_icmp_t *u_icmp_func; /* UDP kernel tunneling icmp callback */ + u_int u_flags; /* Generic UDP flags. */ + uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ + uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ + void *u_tun_ctx; /* Tunneling callback context. */ +}; + +#define intoudpcb(ip) ((struct udpcb *)(ip)->inp_ppcb) +#define sotoudpcb(so) (intoudpcb(sotoinpcb(so))) VNET_PCPUSTAT_DECLARE(struct udpstat, udpstat); /* @@ -130,19 +136,7 @@ VNET_PCPUSTAT_DECLARE(struct udpstat, udpstat); void kmod_udpstat_inc(int statnum); #define KMOD_UDPSTAT_INC(name) \ kmod_udpstat_inc(offsetof(struct udpstat, name) / sizeof(uint64_t)) -#endif - -/* - * Identifiers for UDP sysctl nodes. - */ -#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */ -#define UDPCTL_STATS 2 /* statistics (read-only) */ -#define UDPCTL_MAXDGRAM 3 /* max datagram size */ -#define UDPCTL_RECVSPACE 4 /* default receive buffer space */ -#define UDPCTL_PCBLIST 5 /* list of PCBs for UDP sockets */ -#ifdef _KERNEL -#include SYSCTL_DECL(_net_inet_udp); VNET_DECLARE(struct inpcbinfo, udbinfo);