{"id":2235224,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2235224/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/patch/6c76dbcec1eaccbc2d520fc1950c735485c0a033.1778261956.git.tredaelli@redhat.com/","project":{"id":47,"url":"http://patchwork.ozlabs.org/api/1.2/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","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<6c76dbcec1eaccbc2d520fc1950c735485c0a033.1778261956.git.tredaelli@redhat.com>","list_archive_url":null,"date":"2026-05-08T22:08:35","name":"[ovs-dev,v3,3/6] lib/ct-state: Move ct-state macros to their own header.","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"67678490efe4ac73e1cfca47d02e36a2afa4d4ad","submitter":{"id":70949,"url":"http://patchwork.ozlabs.org/api/1.2/people/70949/?format=json","name":"Timothy Redaelli","email":"tredaelli@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openvswitch/patch/6c76dbcec1eaccbc2d520fc1950c735485c0a033.1778261956.git.tredaelli@redhat.com/mbox/","series":[{"id":503454,"url":"http://patchwork.ozlabs.org/api/1.2/series/503454/?format=json","web_url":"http://patchwork.ozlabs.org/project/openvswitch/list/?series=503454","date":"2026-05-08T22:08:32","name":"libopenvswitch: Restructure the massive OVS library into two parts.","version":3,"mbox":"http://patchwork.ozlabs.org/series/503454/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2235224/comments/","check":"success","checks":"http://patchwork.ozlabs.org/api/patches/2235224/checks/","tags":{},"related":[],"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=X9EbEarn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)","smtp3.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=X9EbEarn","smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","smtp4.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=X9EbEarn"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\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 4gC3Fn1jCpz1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 08:10:05 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id A140261C52;\n\tFri,  8 May 2026 22:10:03 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id HZ36ZoiqJbSQ; Fri,  8 May 2026 22:10:01 +0000 (UTC)","from lists.linuxfoundation.org (lf-lists.osuosl.org\n [IPv6:2605:bc80:3010:104::8cd3:938])\n\tby smtp3.osuosl.org (Postfix) with ESMTPS id 4683761C38;\n\tFri,  8 May 2026 22:10:01 +0000 (UTC)","from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 30A73C04EB;\n\tFri,  8 May 2026 22:10:01 +0000 (UTC)","from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id D7ACCC04E7\n for <dev@openvswitch.org>; Fri,  8 May 2026 22:09:59 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id C996D4217E\n for <dev@openvswitch.org>; Fri,  8 May 2026 22:09:59 +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 rHQN7h31a7oq for <dev@openvswitch.org>;\n Fri,  8 May 2026 22:09:59 +0000 (UTC)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by smtp4.osuosl.org (Postfix) with ESMTPS id BCB4840F34\n for <dev@openvswitch.org>; Fri,  8 May 2026 22:09:58 +0000 (UTC)","from mx-prod-mc-03.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-362-tnw97ou3MqeuJh2PEP28Fg-1; Fri,\n 08 May 2026 18:09:56 -0400","from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 8B2621956050\n for <dev@openvswitch.org>; Fri,  8 May 2026 22:09:55 +0000 (UTC)","from aldebaran.netbird.cloud (unknown [10.44.32.34])\n by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 8C93B3002D30; Fri,  8 May 2026 22:09:54 +0000 (UTC)"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections -\n client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp3.osuosl.org 4683761C38","OpenDKIM Filter v2.11.0 smtp4.osuosl.org BCB4840F34"],"Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124;\n helo=us-smtp-delivery-124.mimecast.com; envelope-from=tredaelli@redhat.com;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp4.osuosl.org BCB4840F34","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1778278197;\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=0MC2uOj32Lf3Z1lM1jdte2zogV+EnCS9DnRd3qu1Jxw=;\n b=X9EbEarndX4WNIlZhF/Sd9pDFUk+G9fTzInWSYOv6fRwpi+VCejWTu3Io/xUUKBPml5n/I\n zKLgmDCjWBIcfovqrveT4VTa2ldMrIr6Q2xVozLZLfzX3qrkXikvQPGKHgvjxxUWc3OLil\n h2mzZEyTxm3sTEweF+G5flJjyu9G0qM=","X-MC-Unique":"tnw97ou3MqeuJh2PEP28Fg-1","X-Mimecast-MFC-AGG-ID":"tnw97ou3MqeuJh2PEP28Fg_1778278195","To":"dev@openvswitch.org","Date":"Sat,  9 May 2026 00:08:35 +0200","Message-ID":"\n <6c76dbcec1eaccbc2d520fc1950c735485c0a033.1778261956.git.tredaelli@redhat.com>","In-Reply-To":"<cover.1778261956.git.tredaelli@redhat.com>","References":"<cover.1778261956.git.tredaelli@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.4","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"fojDgXTNurE3JEsnhwcuR9N2toZLBNYyrn0yv2KGmrE_1778278195","X-Mimecast-Originator":"redhat.com","Subject":"[ovs-dev] [PATCH v3 3/6] 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":"In 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..2b723e6a6\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","v3","3/6"]}