[ovs-dev] [PATCH v3 1/2] logical-fields: Add ct.dnat and ct.snat symbols.

Gurucharan Shetty guru at ovn.org
Mon Nov 14 07:15:26 UTC 2016


Upcoming commits use it.

Signed-off-by: Gurucharan Shetty <guru at ovn.org>
---
v2->v3: no change
---
 ovn/lib/logical-fields.c |  2 ++
 ovn/ovn-sb.xml           | 19 +++++++++++++++++--
 tests/ovn.at             |  4 +++-
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/ovn/lib/logical-fields.c b/ovn/lib/logical-fields.c
index 2d3e217..d4578c3 100644
--- a/ovn/lib/logical-fields.c
+++ b/ovn/lib/logical-fields.c
@@ -108,6 +108,8 @@ ovn_init_symtab(struct shash *symtab)
         {"rel", CS_RELATED_BIT},
         {"rpl", CS_REPLY_DIR_BIT},
         {"inv", CS_INVALID_BIT},
+        {"dnat", CS_DST_NAT_BIT},
+        {"snat", CS_SRC_NAT_BIT},
     };
     for (const struct ct_bit *b = bits; b < &bits[ARRAY_SIZE(bits)]; b++) {
         char *name = xasprintf("ct.%s", b->name);
diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml
index 45c473c..65191ed 100644
--- a/ovn/ovn-sb.xml
+++ b/ovn/ovn-sb.xml
@@ -841,8 +841,23 @@
             <li><code>ct.inv</code>: True for a connection entry in a bad state</li>
           </ul>
           <p>
-            <code>ct_state</code> and its subfields are initialized by the
-            <code>ct_next</code> action, described below.
+            The above subfields of <code>ct_state</code> are initialized by
+            the <code>ct_next</code> action, described later.
+          </p>
+          <ul>
+            <li>
+              <code>ct.dnat</code>: True for a packet whose destination IP
+              address has been changed.
+            </li>
+            <li>
+              <code>ct.snat</code>: True for a packet whose source IP
+              address has been changed.
+            </li>
+          </ul>
+          <p>
+            The above subfields of <code>ct_state</code> are initialized by
+            the actions like <code>ct_dnat</code>, <code>ct_snat</code> and
+            <code>ct_lb</code> described later.
           </p>
         </li>
       </ul>
diff --git a/tests/ovn.at b/tests/ovn.at
index 6ae4247..69f5277 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -162,11 +162,13 @@ AT_CLEANUP
 dnl Check that the OVN conntrack field definitions are correct.
 AT_SETUP([ovn -- conntrack fields])
 AT_CHECK([ovstest test-ovn dump-symtab | grep ^ct | sort], [0],
-[[ct.est = ct_state[1]
+[[ct.dnat = ct_state[7]
+ct.est = ct_state[1]
 ct.inv = ct_state[4]
 ct.new = ct_state[0]
 ct.rel = ct_state[2]
 ct.rpl = ct_state[3]
+ct.snat = ct_state[6]
 ct.trk = ct_state[5]
 ct_label = NXM_NX_CT_LABEL
 ct_label.blocked = ct_label[0]
-- 
1.9.1



More information about the dev mailing list