classifier: Add support for conjunctive matches.
[cascardo/ovs.git] / lib / nx-match.c
index 9e9aeb4..114c35b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
 #include "shash.h"
 #include "unaligned.h"
 #include "util.h"
-#include "vlog.h"
+#include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(nx_match);
 
@@ -817,7 +817,7 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
     int match_len;
     int i;
 
-    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 28);
+    BUILD_ASSERT_DECL(FLOW_WC_SEQ == 30);
 
     /* Metadata. */
     if (match->wc.masks.dp_hash) {
@@ -829,6 +829,10 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
         nxm_put_32(b, MFF_RECIRC_ID, oxm, htonl(flow->recirc_id));
     }
 
+    if (match->wc.masks.conj_id) {
+        nxm_put_32(b, MFF_CONJ_ID, oxm, htonl(flow->conj_id));
+    }
+
     if (match->wc.masks.in_port.ofp_port) {
         ofp_port_t in_port = flow->in_port.ofp_port;
         if (oxm) {
@@ -1736,7 +1740,7 @@ oxm_maskable_fields(void)
 struct nxm_field_index {
     struct hmap_node header_node; /* In nxm_header_map. */
     struct hmap_node name_node;   /* In nxm_name_map. */
-    struct list mf_node;          /* In mf_mf_map[nf.id]. */
+    struct ovs_list mf_node;      /* In mf_mf_map[nf.id]. */
     const struct nxm_field nf;
 };
 
@@ -1744,7 +1748,7 @@ struct nxm_field_index {
 
 static struct hmap nxm_header_map;
 static struct hmap nxm_name_map;
-static struct list nxm_mf_map[MFF_N_IDS];
+static struct ovs_list nxm_mf_map[MFF_N_IDS];
 
 static void
 nxm_init(void)