Skip to content

Commit

Permalink
logical-fields: Add ct.dnat and ct.snat symbols.
Browse files Browse the repository at this point in the history
Upcoming commits use it.

Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Russell Bryant <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Nov 15, 2016
1 parent 56a5687 commit 858c2f7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ovn/lib/logical-fields.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 17 additions & 2 deletions ovn/ovn-sb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 3 additions & 1 deletion tests/ovn.at
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 858c2f7

Please sign in to comment.