]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/multipath.c
ovsdb-idl: Remove prototype for function that is not defined or used.
[mirror_ovs.git] / lib / multipath.c
index c5d2ab52e6eaf6fb24b90db3a45a74ec73e02c2b..6896f94a1e2bd5884545b235a2f76ca6e1f3b6b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013, 2014, 2016, 2017, 2019 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <config.h>
 
 #include "multipath.h"
-#include <arpa/inet.h>
-#include <inttypes.h>
 #include <sys/types.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
+#include <inttypes.h>
 #include "colors.h"
-#include "dynamic-string.h"
 #include "nx-match.h"
-#include "ofp-actions.h"
-#include "ofp-util.h"
-#include "openvswitch/ofp-errors.h"
 #include "openflow/nicira-ext.h"
+#include "openvswitch/dynamic-string.h"
+#include "openvswitch/ofp-actions.h"
+#include "openvswitch/ofp-errors.h"
 #include "packets.h"
+#include "util.h"
 \f
 /* Checks that 'mp' is valid on flow.  Returns 0 if it is valid, otherwise an
  * OFPERR_*. */
 enum ofperr
 multipath_check(const struct ofpact_multipath *mp,
-                const struct flow *flow)
+                const struct match *match)
 {
-    return mf_check_dst(&mp->dst, flow);
+    return mf_check_dst(&mp->dst, match);
 }
 \f
 /* multipath_execute(). */
@@ -136,7 +136,7 @@ multipath_algorithm(uint32_t hash, enum nx_mp_algorithm algorithm,
 }
 \f
 /* Parses 's_' as a set of arguments to the "multipath" action and initializes
- * 'mp' accordingly.  ovs-ofctl(8) describes the format parsed.
+ * 'mp' accordingly.  ovs-actions(7) describes the format parsed.
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string.*/
@@ -167,6 +167,12 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s)
         mp->fields = NX_HASH_FIELDS_SYMMETRIC_L3L4;
     } else if (!strcasecmp(fields, "symmetric_l3l4+udp")) {
         mp->fields = NX_HASH_FIELDS_SYMMETRIC_L3L4_UDP;
+    } else if (!strcasecmp(fields, "nw_src")) {
+        mp->fields = NX_HASH_FIELDS_NW_SRC;
+    } else if (!strcasecmp(fields, "nw_dst")) {
+        mp->fields = NX_HASH_FIELDS_NW_DST;
+    } else if (!strcasecmp(fields, "symmetric_l3")) {
+        mp->fields = NX_HASH_FIELDS_SYMMETRIC_L3;
     } else {
         return xasprintf("%s: unknown fields `%s'", s_, fields);
     }
@@ -196,7 +202,7 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s)
     }
     if (!mf_nxm_header(mp->dst.field->id)) {
         return xasprintf("%s: experimenter OXM field '%s' not supported",
-                         s, dst);
+                         s_, dst);
     }
     if (mp->dst.n_bits < 16 && n_links > (1u << mp->dst.n_bits)) {
         return xasprintf("%s: %d-bit destination field has %u possible "
@@ -208,7 +214,7 @@ multipath_parse__(struct ofpact_multipath *mp, const char *s_, char *s)
 }
 
 /* Parses 's_' as a set of arguments to the "multipath" action and initializes
- * 'mp' accordingly.  ovs-ofctl(8) describes the format parsed.
+ * 'mp' accordingly.  ovs-actions(7) describes the format parsed.
  *
  * Returns NULL if successful, otherwise a malloc()'d string describing the
  * error.  The caller is responsible for freeing the returned string. */
@@ -221,7 +227,7 @@ multipath_parse(struct ofpact_multipath *mp, const char *s_)
     return error;
 }
 
-/* Appends a description of 'mp' to 's', in the format that ovs-ofctl(8)
+/* Appends a description of 'mp' to 's', in the format that ovs-actions(7)
  * describes. */
 void
 multipath_format(const struct ofpact_multipath *mp, struct ds *s)
@@ -247,7 +253,7 @@ multipath_format(const struct ofpact_multipath *mp, struct ds *s)
         algorithm = "<unknown>";
     }
 
-    ds_put_format(s, "%smultipath(%s%s,%"PRIu16",%s,%d,%"PRIu16",",
+    ds_put_format(s, "%smultipath(%s%s,%"PRIu16",%s,%d,%"PRIu32",",
                   colors.paren, colors.end, fields, mp->basis, algorithm,
                   mp->max_link + 1, mp->arg);
     mf_format_subfield(&mp->dst, s);