From nobody Sat Jan 06 11:08:24 2024 X-Original-To: dev-commits-src-all@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 4T6cy10Pnhz56GfL; Sat, 6 Jan 2024 11:08:25 +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 4T6cy05s1Dz41V0; Sat, 6 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704539304; 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=uX+G5ZwB4BGsCGIdeRSujIrigQcyZfCXeI68ICzsd9E=; b=dpQpdBA3ItNZE4zgJQzkuiCXlqjH5SueDwadnljGDCk5lEnplfpZG/KkW/GOkrPr1UvVyl eFaIW4KBLJ8273C3NfjvnPkFI4VLT2BCoC9HlM9N9mHQJOzZtJo747hroK1M8xNVRP4Tqk Xhb7+yo+eAjUsNJBvyPxuxOgxdXrH7U6/ucvQxhXu3/XhM5msw/sN8QrvgsAB03XAxcwYL WLf/DgHB0jqj1KYe7VV5EBld4bSHXfFVMVQAEcTmVVmOAufPm5mSDkC0/RZ/8dh7WmZ48X GyqHUOTIRGHpNBDUhdsNwRmIqTwZjQeGDvvCZkXrFeGfMn15nle+dLed8PTMPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704539304; 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=uX+G5ZwB4BGsCGIdeRSujIrigQcyZfCXeI68ICzsd9E=; b=TVJbR2VXxkOvZLFOW/zIkRBS6sXmSSWLcSd//pMCTl/Ch8604MMunjfP72EB+s9+bSYwoi 3f5esUxkI576DrgpGsvg+cYnQYQu1660AfbAM9uw+jjdyzUOlUpV941/NrhrZ3vckqO0iQ dhad8ijTnvrVvmo1PKn4s9auZEObhRNL+zg4RO/+eRPGey9yZJjpzqtXDJXNsiZt7Get5C pbGVuAkac253aLoW8xkGPqWTy1WNZS2UBx3KqwXkk26RSL5ZwwzXhkIeKjVOcuptCYN/K4 RhFpwHgWm45xJ/fAsNb/xLQ1K8aS3ca/rzIvDDosF8Br6fU8lRApB+a0t+NPgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704539304; a=rsa-sha256; cv=none; b=tn5cvd2O466vMhNrEXyCdzLxUQeHRGUCOZIDVoJFIEG/y5VHR1BjTPSdr8Mm5HOTGc6Jmp BljkkPBoZg32ywSCZNrtRF4GswYzbrIugn1cunNkBHsSBxp6fHBYTRBFhohRSpxPHd/K4k 7qk+whZt0Oxe79eJiKER0jxTzG4FUoPgO2GiUOFTh8z/cb1XQAEEBPHTkjcxy5kZH/vNGA FP8R9MF2YDE1o5zHqdvks1OmepcEGBABbFb5U9wYlQRZUfbNmnAGPScmJ74b2pfFDM9OOb Rn5ETKKuV35dDLgX2kXq+u9CU/zMQMoN1wo9kgm6IDP7XyquqV9RTtFTfVe7Ig== 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 4T6cy04vX2zdy1; Sat, 6 Jan 2024 11:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 406B8OfI025242; Sat, 6 Jan 2024 11:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 406B8O01025239; Sat, 6 Jan 2024 11:08:24 GMT (envelope-from git) Date: Sat, 6 Jan 2024 11:08:24 GMT Message-Id: <202401061108.406B8O01025239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: aa1223ac3afc - main - tcp: limit visibility of symbols List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa1223ac3afc5c2054cde84a73e01a48dc4e8c6a Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=aa1223ac3afc5c2054cde84a73e01a48dc4e8c6a commit aa1223ac3afc5c2054cde84a73e01a48dc4e8c6a Author: Michael Tuexen AuthorDate: 2024-01-06 11:00:38 +0000 Commit: Michael Tuexen CommitDate: 2024-01-06 11:00:38 +0000 tcp: limit visibility of symbols Put most symbols under __BSD_VISIBLE and limit the namespace of tcp_[gs]et_flags. Reviewed by: kib, karels, rscheff Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D43245 --- sys/netinet/tcp.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 64286ede9575..f9e561f6ce35 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -80,18 +80,23 @@ struct tcphdr { }; static __inline uint16_t -tcp_get_flags(const struct tcphdr *th) +__tcp_get_flags(const struct tcphdr *th) { - return (((uint16_t)th->th_x2 << 8) | th->th_flags); + return (((uint16_t)th->th_x2 << 8) | th->th_flags); } static __inline void -tcp_set_flags(struct tcphdr *th, uint16_t flags) +__tcp_set_flags(struct tcphdr *th, uint16_t flags) { - th->th_x2 = (flags >> 8) & 0x0f; - th->th_flags = flags & 0xff; + th->th_x2 = (flags >> 8) & 0x0f; + th->th_flags = flags & 0xff; } +#ifdef _KERNEL +#define tcp_get_flags(th) __tcp_get_flags(th) +#define tcp_set_flags(th, flags) __tcp_set_flags(th, flags) +#endif + #define PADTCPOLEN(len) ((((len) / 4) + !!((len) % 4)) * 4) #define TCPOPT_EOL 0 @@ -455,7 +460,7 @@ struct tcp_fastopen { int enable; uint8_t psk[TCP_FASTOPEN_PSK_LEN]; }; -#endif + #define TCP_FUNCTION_NAME_LEN_MAX 32 struct tcp_function_set { @@ -542,4 +547,5 @@ struct tcp_hybrid_req { #define TCP_REUSPORT_LB_NUMA_NODOM (-2) /* remove numa binding */ #define TCP_REUSPORT_LB_NUMA_CURDOM (-1) /* bind to current domain */ +#endif /* __BSD_VISIBLE */ #endif /* !_NETINET_TCP_H_ */