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

Message ID 1479107727-22883-1-git-send-email-guru@ovn.org
State Accepted
Headers show

Commit Message

Guru Shetty Nov. 14, 2016, 7:15 a.m. UTC
Upcoming commits use it.

Signed-off-by: Gurucharan Shetty <guru@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(-)

Comments

Russell Bryant Nov. 14, 2016, 8:47 p.m. UTC | #1
On Mon, Nov 14, 2016 at 2:15 AM, Gurucharan Shetty <guru@ovn.org> wrote:

> Upcoming commits use it.
>
> Signed-off-by: Gurucharan Shetty <guru@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(-)
>

Acked-by: Russell Bryant <russell@ovn.org>
Ben Pfaff Nov. 15, 2016, 12:51 a.m. UTC | #2
On Sun, Nov 13, 2016 at 11:15:26PM -0800, Gurucharan Shetty wrote:
> Upcoming commits use it.
> 
> Signed-off-by: Gurucharan Shetty <guru@ovn.org>
> ---
> v2->v3: no change

Assuming the tests pass:

Acked-by: Ben Pfaff <blp@ovn.org>

Patch
diff mbox

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]