From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=iXqlD35M; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 815AC5A004C for ; Wed, 06 Nov 2024 07:54:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730876064; bh=II34QYkrNM7V0H0aGCu0KRnkoihiurh4kfNX1QLuhps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iXqlD35MJgLJMy+oCPHdfLPEKOcNLo60eE/AIJ52hqE8zUkX7ufmbIUT9yAKHA24h 7Z+Vq5bVGxgPqKI0Zdy1ufH9FA8DmoEPPeXmYQ4+AK9NGTYLLAucdpPqO9/n7G1tHa BRXW3SSWXcI9jjSGcB3t5CUa13uPUHH02CfjXKDp/0+iqwkK8GeBo40utSzS1s2DGv yAWr57f2u6Qz0Sca7J/9o4ccwnwFYt1UH4Vd63EvdKHL7TEmdVnv5N4nGwJFkZe1Kr mEZRh9NSjQvYJGB8yA8yR8ZTVe8M/vV1Zo5tYUyDx3qt2qAAlCGKqxR9d2byQ3oXfA NwsGwN/Xfq47w== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Xjwt80Rvbz4x11; Wed, 6 Nov 2024 17:54:24 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 1/8] linux_dep: Generalise tcp_info.h to handling Linux extension compatibility Date: Wed, 6 Nov 2024 17:54:14 +1100 Message-ID: <20241106065421.2568179-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106065421.2568179-1-david@gibson.dropbear.id.au> References: <20241106065421.2568179-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: HLSIQYNWM4U5HBRCWDMCKZEYWKIS53IQ X-Message-ID-Hash: HLSIQYNWM4U5HBRCWDMCKZEYWKIS53IQ X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: tcp_info.h exists just to contain a modern enough version of struct tcp_info for our needs, removing compile time dependency on the version of kernel headers. There are several other cases where we can remove similar compile time dependencies on kernel version. Prepare for that by renaming tcp_info.h to linux_dep.h. Signed-off-by: David Gibson --- tcp_info.h => linux_dep.h | 10 ++++++---- tcp.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) rename tcp_info.h => linux_dep.h (97%) diff --git a/tcp_info.h b/linux_dep.h similarity index 97% rename from tcp_info.h rename to linux_dep.h index 06ccb16..8921623 100644 --- a/tcp_info.h +++ b/linux_dep.h @@ -1,13 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-or-later * Copyright Red Hat * - * Largely derived from include/linux/tcp.h in the Linux kernel + * Declarations for Linux specific dependencies */ -#ifndef TCP_INFO_H -#define TCP_INFO_H +#ifndef LINUX_DEP_H +#define LINUX_DEP_H /* struct tcp_info_linux - Information from Linux TCP_INFO getsockopt() + * + * Largely derived from include/linux/tcp.h in the Linux kernel * * Some fields returned by TCP_INFO have been there for ages and are shared with * BSD. struct tcp_info from netinet/tcp.h has only those fields. There are @@ -117,4 +119,4 @@ struct tcp_info_linux { */ }; -#endif /* TCP_INFO_H */ +#endif /* LINUX_DEP_H */ diff --git a/tcp.c b/tcp.c index 56ceba6..1bb122b 100644 --- a/tcp.c +++ b/tcp.c @@ -299,10 +299,10 @@ #include "log.h" #include "inany.h" #include "flow.h" +#include "linux_dep.h" #include "flow_table.h" #include "tcp_internal.h" -#include "tcp_info.h" #include "tcp_buf.h" /* MSS rounding: see SET_MSS() */ -- 2.47.0