aboutsummaryrefslogtreecommitdiff
path: root/lib/nx-match.h
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2012-08-01 16:01:45 +0900
committerBen Pfaff <blp@nicira.com>2012-08-06 11:07:27 -0700
commit7623f4ddb09b4393c64608446a89a3a82b6f6364 (patch)
tree473edea81ee8afd3e81866fb8ebc7bbff96cd393 /lib/nx-match.h
parent34b28fc7b666d5e58afbac842fe7987a35bc9467 (diff)
nx-match: Separate raw match and header/pad pull/put
In the case of Open Flow 1.2, which is currently the only time that OXM is be used, there is a 4 byte header before the match which needs to be taken into account when calculating the pad length. This complicates nx_match pull and put somewhat. This patch takes an approach suggested by Ben Pfaff to separate the encoding of the match and the adding of padding and, in the case of OXM, a header. Signed-off-by: Simon Horman <horms@verge.net.au> Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/nx-match.h')
-rw-r--r--lib/nx-match.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/nx-match.h b/lib/nx-match.h
index 161733f7..3bfeeb73 100644
--- a/lib/nx-match.h
+++ b/lib/nx-match.h
@@ -44,13 +44,21 @@ enum ofperr nx_pull_match(struct ofpbuf *, unsigned int match_len,
uint16_t priority, struct cls_rule *,
ovs_be64 *cookie, ovs_be64 *cookie_mask);
enum ofperr nx_pull_match_loose(struct ofpbuf *, unsigned int match_len,
- uint16_t priority, struct cls_rule *,
- ovs_be64 *cookie, ovs_be64 *cookie_mask);
-int nx_put_match(struct ofpbuf *, bool oxm, const struct cls_rule *,
+ uint16_t priority,
+ struct cls_rule *, ovs_be64 *cookie,
+ ovs_be64 *cookie_mask);
+enum ofperr oxm_pull_match(struct ofpbuf *, uint16_t priority,
+ struct cls_rule *);
+enum ofperr oxm_pull_match_loose(struct ofpbuf *, uint16_t priority,
+ struct cls_rule *);
+int nx_put_match(struct ofpbuf *, const struct cls_rule *,
ovs_be64 cookie, ovs_be64 cookie_mask);
+int oxm_put_match(struct ofpbuf *, const struct cls_rule *);
char *nx_match_to_string(const uint8_t *, unsigned int match_len);
+char *oxm_match_to_string(const uint8_t *, unsigned int match_len);
int nx_match_from_string(const char *, struct ofpbuf *);
+int oxm_match_from_string(const char *, struct ofpbuf *);
void nxm_parse_reg_move(struct ofpact_reg_move *, const char *);
void nxm_parse_reg_load(struct ofpact_reg_load *, const char *);