{"id":2232481,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2232481/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/cdccd394cedb331adcda844b61dfa38fa0a08e82.1777902424.git.tredaelli@redhat.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/1.1/projects/47/?format=json","name":"Open vSwitch","link_name":"openvswitch","list_id":"ovs-dev.openvswitch.org","list_email":"ovs-dev@openvswitch.org","web_url":"http://openvswitch.org/","scm_url":"git@github.com:openvswitch/ovs.git","webscm_url":"https://github.com/openvswitch/ovs"},"msgid":"<cdccd394cedb331adcda844b61dfa38fa0a08e82.1777902424.git.tredaelli@redhat.com>","date":"2026-05-04T15:23:42","name":"[ovs-dev,v2,3/5] lib/ct-state: Move ct-state macros to their own header.","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"76c6eeaa2a1ed644d688d6c19b5d92521f2a4d99","submitter":{"id":70949,"url":"http://patchwork.ozlabs.org/api/1.1/people/70949/?format=json","name":"Timothy Redaelli","email":"tredaelli@redhat.com"},"delegate":{"id":57772,"url":"http://patchwork.ozlabs.org/api/1.1/users/57772/?format=json","username":"imaximets","first_name":"Ilya","last_name":"Maximets","email":"i.maximets@samsung.com"},"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/cdccd394cedb331adcda844b61dfa38fa0a08e82.1777902424.git.tredaelli@redhat.com/mbox/","series":[{"id":502681,"url":"http://patchwork.ozlabs.org/api/1.1/series/502681/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=502681","date":"2026-05-04T15:23:39","name":"libopenvswitch: Restructure the massive OVS library into two parts","version":2,"mbox":"http://patchwork.ozlabs.org/series/502681/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2232481/comments/","check":"warning","checks":"http://patchwork.ozlabs.org/api/patches/2232481/checks/","tags":{},"headers":{"Return-Path":"<ovs-dev-bounces@openvswitch.org>","X-Original-To":["incoming@patchwork.ozlabs.org","dev@openvswitch.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ovs-dev@lists.linuxfoundation.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=GujAepzu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","smtp4.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=GujAepzu","smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","smtp2.osuosl.org;\n dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com\n header.a=rsa-sha256 header.s=mimecast20190719 header.b=GujAepzu"],"Received":["from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g8QRG5964z1yJ0\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 01:24:10 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp4.osuosl.org (Postfix) with ESMTP id 551D141C5B;\n\tMon,  4 May 2026 15:24:09 +0000 (UTC)","from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id sGLeTrTzzyjY; Mon,  4 May 2026 15:24:07 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp4.osuosl.org (Postfix) with ESMTPS id AD55141BFA;\n\tMon,  4 May 2026 15:24:06 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 73AC6C04EA;\n\tMon,  4 May 2026 15:24:06 +0000 (UTC)","from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id D193DC04E9\n for <dev@openvswitch.org>; Mon,  4 May 2026 15:24:05 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id C194640E33\n for <dev@openvswitch.org>; Mon,  4 May 2026 15:24:05 +0000 (UTC)","from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id LsV_9PSzASi4 for <dev@openvswitch.org>;\n Mon,  4 May 2026 15:24:05 +0000 (UTC)","from us-smtp-delivery-224.mimecast.com\n (us-smtp-delivery-224.mimecast.com [170.10.133.224])\n by smtp2.osuosl.org (Postfix) with ESMTPS id A473C40E14\n for <dev@openvswitch.org>; Mon,  4 May 2026 15:24:04 +0000 (UTC)","from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-480-tLYV47KaNiGPWVefdIKd9w-1; Mon,\n 04 May 2026 11:24:02 -0400","from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 9427F195609D\n for <dev@openvswitch.org>; Mon,  4 May 2026 15:24:01 +0000 (UTC)","from aldebaran.netbird.cloud (unknown [10.44.48.44])\n by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 6532B1944CED; Mon,  4 May 2026 15:24:00 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp4.osuosl.org AD55141BFA","OpenDKIM Filter v2.11.0 smtp2.osuosl.org A473C40E14"],"Received-SPF":"Pass (sender SPF authorized) identity=helo;\n client-ip=170.10.133.224; helo=us-smtp-delivery-224.mimecast.com;\n envelope-from=<>; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp2.osuosl.org A473C40E14","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777908243;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=XM6nOBCdXPaJLlLiXC9z01pt2d8Az4op2PU0qxgLaAM=;\n b=GujAepzuEgsbuUlLBxNGBufQtdTscOYIy7K0byuIxnC8F3P4eLHttltDDWLrYuEJ64bMgU\n ShbV+ASe5CEq/DrOEodcop87WotqqU1A/GReLTcitDHbTtRSuz11JmBeYs7FKPTA79qQxf\n TG3//aWxjQmqtVJaeUaONBOPD6/fC5Q=","X-MC-Unique":"tLYV47KaNiGPWVefdIKd9w-1","X-Mimecast-MFC-AGG-ID":"tLYV47KaNiGPWVefdIKd9w_1777908241","To":"dev@openvswitch.org","Date":"Mon,  4 May 2026 17:23:42 +0200","Message-ID":"\n <cdccd394cedb331adcda844b61dfa38fa0a08e82.1777902424.git.tredaelli@redhat.com>","In-Reply-To":"<cover.1777902424.git.tredaelli@redhat.com>","References":"<cover.1777902424.git.tredaelli@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.17","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"4D3VBIrVcN6JO4yJkwWB37nBfUtiJK8au9bqj_uEu1k_1777908241","X-Mimecast-Originator":"<>","Subject":"[ovs-dev] [PATCH v2 3/5] lib/ct-state: Move ct-state macros to\n their own header.","X-BeenThere":"ovs-dev@openvswitch.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"<ovs-dev.openvswitch.org>","List-Unsubscribe":"<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>","List-Archive":"<http://mail.openvswitch.org/pipermail/ovs-dev/>","List-Post":"<mailto:ovs-dev@openvswitch.org>","List-Help":"<mailto:ovs-dev-request@openvswitch.org?subject=help>","List-Subscribe":"<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>","From":"Timothy Redaelli via dev <ovs-dev@openvswitch.org>","Reply-To":"Timothy Redaelli <tredaelli@redhat.com>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"ovs-dev-bounces@openvswitch.org","Sender":"\"dev\" <ovs-dev-bounces@openvswitch.org>"},"content":"From: Timothy Redaelli <tredaelli@redhat.com>\n\nIn the future, if CT ever has to be abstracted out this will make it easier.\n\nCo-authored-by: Aaron Conole <aconole@redhat.com>\nSigned-off-by: Aaron Conole <aconole@redhat.com>\nSigned-off-by: Timothy Redaelli <tredaelli@redhat.com>\n---\n lib/automake.mk |  1 +\n lib/ct-state.h  | 50 +++++++++++++++++++++++++++++++++++++++++++++++++\n lib/flow.h      |  1 +\n lib/packets.h   | 31 ------------------------------\n 4 files changed, 52 insertions(+), 31 deletions(-)\n create mode 100644 lib/ct-state.h","diff":"diff --git a/lib/automake.mk b/lib/automake.mk\nindex 51aa99118..879300b4a 100644\n--- a/lib/automake.mk\n+++ b/lib/automake.mk\n@@ -99,6 +99,7 @@ lib_libopenvswitch_la_SOURCES = \\\n \tlib/cooperative-multitasking-private.h \\\n \tlib/coverage.c \\\n \tlib/coverage.h \\\n+\tlib/ct-state.h \\\n \tlib/cpu.c \\\n \tlib/cpu.h \\\n \tlib/crc32c.c \\\ndiff --git a/lib/ct-state.h b/lib/ct-state.h\nnew file mode 100644\nindex 000000000..7033744e0\n--- /dev/null\n+++ b/lib/ct-state.h\n@@ -0,0 +1,50 @@\n+/*\n+ * Copyright (c) 2015, 2017 Nicira, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at:\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#ifndef CT_STATE_H\n+#define CT_STATE_H 1\n+\n+/* Connection states.\n+ *\n+ * Names like CS_RELATED are bit values, e.g. 1 << 2.\n+ * Names like CS_RELATED_BIT are bit indexes, e.g. 2. */\n+#define CS_STATES                               \\\n+    CS_STATE(NEW,         0, \"new\")             \\\n+    CS_STATE(ESTABLISHED, 1, \"est\")             \\\n+    CS_STATE(RELATED,     2, \"rel\")             \\\n+    CS_STATE(REPLY_DIR,   3, \"rpl\")             \\\n+    CS_STATE(INVALID,     4, \"inv\")             \\\n+    CS_STATE(TRACKED,     5, \"trk\")             \\\n+    CS_STATE(SRC_NAT,     6, \"snat\")            \\\n+    CS_STATE(DST_NAT,     7, \"dnat\")\n+\n+enum {\n+#define CS_STATE(ENUM, INDEX, NAME) \\\n+    CS_##ENUM = 1 << INDEX, \\\n+    CS_##ENUM##_BIT = INDEX,\n+    CS_STATES\n+#undef CS_STATE\n+};\n+\n+/* Undefined connection state bits. */\n+enum {\n+#define CS_STATE(ENUM, INDEX, NAME) +CS_##ENUM\n+    CS_SUPPORTED_MASK = CS_STATES\n+#undef CS_STATE\n+};\n+#define CS_UNSUPPORTED_MASK  (~(uint32_t)CS_SUPPORTED_MASK)\n+\n+#endif /* ct-state.h */\ndiff --git a/lib/flow.h b/lib/flow.h\nindex 0b6743848..bf0656cac 100644\n--- a/lib/flow.h\n+++ b/lib/flow.h\n@@ -25,6 +25,7 @@\n #include \"bitmap.h\"\n #include \"byte-order.h\"\n #include \"openvswitch/compiler.h\"\n+#include \"ct-state.h\"\n #include \"openflow/nicira-ext.h\"\n #include \"openflow/openflow.h\"\n #include \"openvswitch/flow.h\"\ndiff --git a/lib/packets.h b/lib/packets.h\nindex f61993ae4..35e40b2dd 100644\n--- a/lib/packets.h\n+++ b/lib/packets.h\n@@ -212,37 +212,6 @@ void pop_eth(struct dp_packet *packet);\n void push_nsh(struct dp_packet *packet, const struct nsh_hdr *nsh_hdr_src);\n bool pop_nsh(struct dp_packet *packet);\n \n-/* Connection states.\n- *\n- * Names like CS_RELATED are bit values, e.g. 1 << 2.\n- * Names like CS_RELATED_BIT are bit indexes, e.g. 2. */\n-#define CS_STATES                               \\\n-    CS_STATE(NEW,         0, \"new\")             \\\n-    CS_STATE(ESTABLISHED, 1, \"est\")             \\\n-    CS_STATE(RELATED,     2, \"rel\")             \\\n-    CS_STATE(REPLY_DIR,   3, \"rpl\")             \\\n-    CS_STATE(INVALID,     4, \"inv\")             \\\n-    CS_STATE(TRACKED,     5, \"trk\")             \\\n-    CS_STATE(SRC_NAT,     6, \"snat\")            \\\n-    CS_STATE(DST_NAT,     7, \"dnat\")\n-\n-enum {\n-#define CS_STATE(ENUM, INDEX, NAME) \\\n-    CS_##ENUM = 1 << INDEX, \\\n-    CS_##ENUM##_BIT = INDEX,\n-    CS_STATES\n-#undef CS_STATE\n-};\n-\n-/* Undefined connection state bits. */\n-enum {\n-#define CS_STATE(ENUM, INDEX, NAME) +CS_##ENUM\n-    CS_SUPPORTED_MASK = CS_STATES\n-#undef CS_STATE\n-};\n-#define CS_UNSUPPORTED_MASK  (~(uint32_t)CS_SUPPORTED_MASK)\n-\n-\n void *eth_compose(struct dp_packet *, const struct eth_addr eth_dst,\n                   const struct eth_addr eth_src, uint16_t eth_type,\n                   size_t size);\n","prefixes":["ovs-dev","v2","3/5"]}