From patchwork Sun Jan 4 10:07:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Joan_Lled=C3=B3?= X-Patchwork-Id: 127354 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 6ACD84BA2E28 for ; Sun, 4 Jan 2026 10:35:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6ACD84BA2E28 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=mailfence.com header.i=jlledom@mailfence.com header.a=rsa-sha256 header.s=20240605-akrp header.b=ND54q+0Z X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id A58AC4BA2E04 for ; Sun, 4 Jan 2026 10:34:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A58AC4BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=mailfence.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aquilenet.fr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A58AC4BA2E04 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.233.100.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767522877; cv=none; b=oXRKMt6assx87KpZrk8ZxP7rlJOoEi1gZ8IYaSVNNkmyUndteePsuMwxIZT5XjGp/nvJHnN6IE0v5St8L2I/ZwV+ImZsmk0JyR/WWcul+x4Q3OT7neMdtha9fNX2aq3DMfj0yWFRgZUL32ogrQvmotA2yPFwPunSFLdThmu4uAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1767522877; c=relaxed/simple; bh=uQGfrxJZVopAYWRvGUVA6mv7Dhh8UdFlhm02Pw12HhY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Pdsl0nh+VDj+v/nVQL0qvc7/4PXLd5cnVSZFxPG6x65OLk/qHkpppKJH70paHyObx9tiGKF7IUbStF5QPp37rzg69kiEcb1esAg7/TDF2cLTbAXeqdFyNxPSh111Sddm1AcPLhwAowTZwbybF9unFTSEpV/VuW/iv88XSfvK96Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A58AC4BA2E04 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 7C0B5211 for ; Sun, 4 Jan 2026 11:34:34 +0100 (CET) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id 20zcD9z4jRK1 for ; Sun, 4 Jan 2026 11:34:33 +0100 (CET) Received: from end (aamiens-653-1-40-48.w83-192.abo.wanadoo.fr [83.192.199.48]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CF8C8204 for ; Sun, 4 Jan 2026 11:34:31 +0100 (CET) Received: from samy by end with local (Exim 4.99.1) (envelope-from ) id 1vcLRP-0000000AHe4-0Awo for libc-alpha@sourceware.org; Sun, 04 Jan 2026 11:34:31 +0100 Resent-From: Samuel Thibault Resent-Date: Sun, 4 Jan 2026 11:34:31 +0100 Resent-Message-ID: Resent-To: libc-alpha@sourceware.org X-Spam-Language: Received: from mail.aquilenet.fr [185.233.100.1] by end.youpi.perso.aquilenet.fr with IMAP (fetchmail-) for (single-drop); Sun, 04 Jan 2026 11:29:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C8DCD3E8 for ; Sun, 4 Jan 2026 11:29:36 +0100 (CET) X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id cKNimIyTs2Xp for ; Sun, 4 Jan 2026 11:29:33 +0100 (CET) Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by hera.aquilenet.fr (Postfix) with ESMTPS id 4E63C1AA for ; Sun, 4 Jan 2026 11:29:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 1A26DA027B for ; Sun, 4 Jan 2026 11:29:32 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ob2cwGYr-XSz for ; Sun, 4 Jan 2026 11:29:31 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPS id DC5E8A01D7 for ; Sun, 4 Jan 2026 11:29:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vcLME-0007Li-3e; Sun, 04 Jan 2026 05:29:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vcLMB-0007L7-Qd for bug-hurd@gnu.org; Sun, 04 Jan 2026 05:29:08 -0500 Received: from wilbur.contactoffice.com ([212.3.242.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vcLM9-00081e-AP for bug-hurd@gnu.org; Sun, 04 Jan 2026 05:29:07 -0500 Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by wilbur.contactoffice.com (Postfix) with ESMTP id D7E34697E; Sun, 4 Jan 2026 11:28:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1767522539; s=20240605-akrp; d=mailfence.com; i=jlledom@mailfence.com; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=BQKdx4aDGRoO7UT8Fkm4JUu8l3lg3kbbveq2vcJHSNQ=; b=ND54q+0ZMFKfrPKlTeCgciN/WJjPTsGP+s7dwdFP4RHKNng3IMRcLtX7hHyuq/5Y hXNP0kTeq2aJXjTY/e9fBc5m0LaEcDdngOAvnoVFYcvJlR1F1o+eW2lADv5JZd36Jys ZZNMN5skqVdNGa5N9k3AbAWaxU2blcbCxcx53sq024KFRRdOe0wYTSReHEkQ8KVT8J/ ALcn1YfsM9c5LFmsCppxK+thKbCRkaijAmm3UhiKwHu0SptCe0gZddkWGFb7DqUymfj 8Xyyb5LTc41C6JGyZegFYUmWygpmJktuzrKHtgC35S+EdpvBH0bjacWnjMKBLaAz+IJ EVEDRCYuVg== Received: by smtp.mailfence.com with ESMTPSA ; Sun, 4 Jan 2026 11:28:56 +0100 (CET) From: =?utf-8?q?Joan_Lled=C3=B3?= To: bug-hurd@gnu.org Cc: =?utf-8?q?Joan_Lled=C3=B3?= Subject: [PATCH] mach/hurd: add `bits/in.h` Date: Sun, 4 Jan 2026 11:07:26 +0100 Message-ID: <20260104102835.9373-2-jlledom@mailfence.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260104102835.9373-1-jlledom@mailfence.com> References: <20260104102835.9373-1-jlledom@mailfence.com> MIME-Version: 1.0 X-ContactOffice-Account: com:219870206 Received-SPF: pass client-ip=212.3.242.68; envelope-from=jlledom@mailfence.com; helo=wilbur.contactoffice.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: bug-hurd@gnu.org X-Mailman-Version: 2.1.29 Precedence: list Sender: bug-hurd-bounces+samuel.thibault=ens-lyon.org@gnu.org X-Rspamd-Action: no action X-Rspamd-Server: hera X-Rspamd-Queue-Id: 7C0B5211 X-Spamd-Bar: - X-Spamd-Result: default: False [-1.68 / 15.00]; NEURAL_HAM(-3.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MIXED_CHARSET(0.63)[subject]; MAILLIST(-0.20)[mailman]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jlledom@mailfence.com,samuel.thibault@aquilenet.fr]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWELVE(0.00)[15]; FORGED_SENDER_MAILLIST(0.00)[] X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, JMQ_SPF_NEUTRAL, KAM_SHORT, MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: Joan Lledó This defines `IP_PKTINFO` and `struct in_pktinfo` --- sysdeps/mach/hurd/bits/in.h | 156 ++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sysdeps/mach/hurd/bits/in.h diff --git a/sysdeps/mach/hurd/bits/in.h b/sysdeps/mach/hurd/bits/in.h new file mode 100644 index 0000000000..6f07e02c2b --- /dev/null +++ b/sysdeps/mach/hurd/bits/in.h @@ -0,0 +1,156 @@ +/* Copyright (C) 1997-2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Hurd version. */ + +#ifndef _NETINET_IN_H +# error "Never use directly; include instead." +#endif + +/* This is the hurd version, do not assume a linux-based kernel. */ +#define __USE_KERNEL_IPV6_DEFS 0 + +/* To select the IP level. */ +#define SOL_IP 0 + +/* Options for use with `getsockopt' and `setsockopt' at the IP level. + The first word in the comment at the right is the data type used; + "bool" means a boolean value stored in an `int'. */ +#define IP_OPTIONS 1 /* ip_opts; IP per-packet options. */ +#define IP_HDRINCL 2 /* int; Header is included with data. */ +#define IP_TOS 3 /* int; IP type of service and precedence. */ +#define IP_TTL 4 /* int; IP time to live. */ +#define IP_RECVOPTS 5 /* bool; Receive all IP options w/datagram. */ +#define IP_RECVRETOPTS 6 /* bool; Receive IP options for response. */ +#define IP_RECVDSTADDR 7 /* bool; Receive IP dst addr w/datagram. */ +#define IP_RETOPTS 8 /* ip_opts; Set/get IP per-packet options. */ +#define IP_MULTICAST_IF 9 /* in_addr; set/get IP multicast i/f */ +#define IP_MULTICAST_TTL 10 /* unsigned char; set/get IP multicast ttl */ +#define IP_MULTICAST_LOOP 11 /* bool; set/get IP multicast loopback */ +#define IP_ADD_MEMBERSHIP 12 /* ip_mreq; add an IP group membership */ +#define IP_DROP_MEMBERSHIP 13 /* ip_mreq; drop an IP group membership */ +#define IP_PKTINFO 25 /* bool; Receive if/addr w/datagram*/ + +/* IP_MTU_DISCOVER arguments. */ +#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */ +#define IP_PMTUDISC_WANT 1 /* Use per route hints. */ +#define IP_PMTUDISC_DO 2 /* Always DF. */ +#define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ +/* Always use interface mtu (ignores dst pmtu) but don't set DF flag. + Also incoming ICMP frag_needed notifications will be ignored on + this socket to prevent accepting spoofed ones. */ +#define IP_PMTUDISC_INTERFACE 4 +/* Like IP_PMTUDISC_INTERFACE but allow packets to be fragmented. */ +#define IP_PMTUDISC_OMIT 5 + +#ifdef __USE_MISC +/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS. + The `ip_dst' field is used for the first-hop gateway when using a + source route (this gets put into the header proper). */ +struct ip_opts + { + struct in_addr ip_dst; /* First hop; zero without source route. */ + char ip_opts[40]; /* Actually variable in size. */ + }; + +/* Structure used for IP_PKTINFO. */ +struct in_pktinfo + { + int ipi_ifindex; /* Interface index */ + struct in_addr ipi_spec_dst; /* Routing destination address */ + struct in_addr ipi_addr; /* Header destination address */ + }; +#endif + +/* Socket-level values for IPv6. */ +#define SOL_IPV6 41 +#define SOL_ICMPV6 58 + +/* IPV6 socket options. */ +#define IPV6_ADDRFORM 1 +#define IPV6_2292PKTINFO 2 +#define IPV6_2292HOPOPTS 3 +#define IPV6_2292DSTOPTS 4 +#define IPV6_2292RTHDR 5 +#define IPV6_2292PKTOPTIONS 6 +#define IPV6_CHECKSUM 7 +#define IPV6_2292HOPLIMIT 8 + +#define IPV6_RXINFO IPV6_2292PKTINFO +#define IPV6_TXINFO IPV6_RXINFO +#define SCM_SRCINFO IPV6_TXINFO +#define SCM_SRCRT IPV6_RXSRCRT + +#define IPV6_UNICAST_HOPS 16 +#define IPV6_MULTICAST_IF 17 +#define IPV6_MULTICAST_HOPS 18 +#define IPV6_MULTICAST_LOOP 19 +#define IPV6_JOIN_GROUP 20 +#define IPV6_LEAVE_GROUP 21 +#define IPV6_ROUTER_ALERT 22 +#define IPV6_MTU_DISCOVER 23 +#define IPV6_MTU 24 +#define IPV6_RECVERR 25 +#define IPV6_V6ONLY 26 +#define IPV6_JOIN_ANYCAST 27 +#define IPV6_LEAVE_ANYCAST 28 + +/* IPV6_MTU_DISCOVER values. */ +#define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */ +#define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */ +#define IPV6_PMTUDISC_DO 2 /* Always DF. */ +#define IPV6_PMTUDISC_PROBE 3 /* Ignore dst pmtu. */ +#define IPV6_PMTUDISC_INTERFACE 4 /* See IP_PMTUDISC_INTERFACE. */ +#define IPV6_PMTUDISC_OMIT 5 /* See IP_PMTUDISC_OMIT. */ + +/* Advanced API (RFC3542) (1). */ +#define IPV6_RECVPKTINFO 49 +#define IPV6_PKTINFO 50 +#define IPV6_RECVHOPLIMIT 51 +#define IPV6_HOPLIMIT 52 +#define IPV6_RECVHOPOPTS 53 +#define IPV6_HOPOPTS 54 +#define IPV6_RTHDRDSTOPTS 55 +#define IPV6_RECVRTHDR 56 +#define IPV6_RTHDR 57 +#define IPV6_RECVDSTOPTS 58 +#define IPV6_DSTOPTS 59 +#define IPV6_RECVPATHMTU 60 +#define IPV6_PATHMTU 61 +#define IPV6_DONTFRAG 62 + +/* Advanced API (RFC3542) (2). */ +#define IPV6_RECVTCLASS 66 +#define IPV6_TCLASS 67 + +/* RFC5014. */ +#define IPV6_ADDR_PREFERENCES 72 + +/* RFC5082. */ +#define IPV6_MINHOPCOUNT 73 + +/* Obsolete synonyms for the above. */ +#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP +#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP +#define IPV6_RXHOPOPTS IPV6_2292HOPOPTS +#define IPV6_RXDSTOPTS IPV6_2292DSTOPTS + +/* Routing header options for IPv6. */ +#define IPV6_RTHDR_LOOSE 0 /* Hop doesn't need to be neighbour. */ +#define IPV6_RTHDR_STRICT 1 /* Hop must be a neighbour. */ + +#define IPV6_RTHDR_TYPE_0 0 /* IPv6 Routing header type 0. */