]> git.proxmox.com Git - mirror_ovs.git/commitdiff
json: Move from lib to include/openvswitch.
authorTerry Wilson <twilson@redhat.com>
Tue, 12 Jul 2016 21:37:34 +0000 (16:37 -0500)
committerBen Pfaff <blp@ovn.org>
Sat, 23 Jul 2016 00:09:17 +0000 (17:09 -0700)
To easily allow both in- and out-of-tree building of the Python
wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to
include/openvswitch. This also requires moving lib/{hmap,shash}.h.

Both hmap.h and shash.h were #include-ing "util.h" even though the
headers themselves did not use anything from there, but rather from
include/openvswitch/util.h. Fixing that required including util.h
in several C files mostly due to OVS_NOT_REACHED and things like
xmalloc.

Signed-off-by: Terry Wilson <twilson@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
144 files changed:
include/openvswitch/automake.mk
include/openvswitch/hmap.h [new file with mode: 0644]
include/openvswitch/json.h [new file with mode: 0644]
include/openvswitch/shash.h [new file with mode: 0644]
lib/automake.mk
lib/bfd.c
lib/bundle.c
lib/cfm.c
lib/cfm.h
lib/db-ctl-base.c
lib/db-ctl-base.h
lib/dpctl.c
lib/dpif-netdev.c
lib/dpif-netlink.c
lib/dpif.c
lib/fat-rwlock.c
lib/fatal-signal.c
lib/flow.c
lib/hmap.c
lib/hmap.h [deleted file]
lib/hmapx.h
lib/id-pool.c
lib/json.c
lib/json.h [deleted file]
lib/jsonrpc.c
lib/lacp.c
lib/learning-switch.c
lib/lockfile.c
lib/mac-learning.h
lib/mcast-snooping.h
lib/meta-flow.c
lib/multipath.c
lib/netdev-bsd.c
lib/netdev-dpdk.c
lib/netdev-dummy.c
lib/netdev-linux.c
lib/netdev-provider.h
lib/netdev-windows.c
lib/netdev.c
lib/netlink-conntrack.h
lib/netlink-socket.c
lib/netlink.c
lib/nx-match.c
lib/odp-util.h
lib/ofp-actions.c
lib/ofp-msgs.c
lib/ofp-parse.c
lib/ofp-util.c
lib/ovs-lldp.h
lib/ovs-numa.c
lib/ovs-rcu.c
lib/ovsdb-data.c
lib/ovsdb-data.h
lib/ovsdb-error.c
lib/ovsdb-idl-provider.h
lib/ovsdb-idl.c
lib/ovsdb-map-op.c
lib/ovsdb-parser.h
lib/ovsdb-types.c
lib/packets.c
lib/pcap-file.c
lib/perf-counter.c
lib/poll-loop.c
lib/reconnect.c
lib/rstp-common.h
lib/seq.c
lib/shash.c
lib/shash.h [deleted file]
lib/simap.h
lib/smap.c
lib/smap.h
lib/sset.h
lib/stream-ssl.c
lib/table.c
lib/timeval.c
lib/tun-metadata.c
lib/unixctl.c
lib/util.h
ofproto/bond.c
ofproto/bundles.c
ofproto/connmgr.c
ofproto/connmgr.h
ofproto/ofproto-dpif-ipfix.c
ofproto/ofproto-dpif-mirror.c
ofproto/ofproto-dpif-monitor.c
ofproto/ofproto-dpif-sflow.c
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif.c
ofproto/ofproto-provider.h
ofproto/ofproto.c
ofproto/pinsched.c
ofproto/tunnel.c
ovn/controller-vtep/binding.c
ovn/controller-vtep/vtep.c
ovn/controller/binding.c
ovn/controller/chassis.c
ovn/controller/lport.h
ovn/controller/ofctrl.c
ovn/controller/ovn-controller.c
ovn/controller/patch.c
ovn/controller/physical.c
ovn/lib/actions.c
ovn/lib/actions.h
ovn/lib/expr.c
ovn/lib/expr.h
ovn/lib/lex.c
ovn/lib/ovn-dhcp.h
ovn/northd/ovn-northd.c
ovn/utilities/ovn-nbctl.c
ovn/utilities/ovn-sbctl.c
ovsdb/column.c
ovsdb/condition.c
ovsdb/execution.c
ovsdb/file.c
ovsdb/jsonrpc-server.c
ovsdb/log.c
ovsdb/monitor.c
ovsdb/mutation.c
ovsdb/ovsdb-client.c
ovsdb/ovsdb-server.c
ovsdb/ovsdb-tool.c
ovsdb/ovsdb.c
ovsdb/ovsdb.h
ovsdb/replication.c
ovsdb/replication.h
ovsdb/row.c
ovsdb/row.h
ovsdb/server.h
ovsdb/table.c
ovsdb/table.h
ovsdb/transaction.c
ovsdb/trigger.c
python/ovs/_json.c
tests/test-ccmap.c
tests/test-cmap.c
tests/test-hmap.c
tests/test-json.c
tests/test-jsonrpc.c
tests/test-ovn.c
tests/test-ovsdb.c
utilities/ovs-vsctl.c
vswitchd/bridge.c
vswitchd/system-stats.c
vtep/vtep-ctl.c

index d8541dc84544be1cb0856f280b673400247a612a..c0e276f9d127d89927cbf61c432282184a587e73 100644 (file)
@@ -2,8 +2,10 @@ openvswitchincludedir = $(includedir)/openvswitch
 openvswitchinclude_HEADERS = \
        include/openvswitch/compiler.h \
        include/openvswitch/dynamic-string.h \
+       include/openvswitch/hmap.h \
        include/openvswitch/flow.h \
        include/openvswitch/geneve.h \
+       include/openvswitch/json.h \
        include/openvswitch/list.h \
        include/openvswitch/netdev.h \
        include/openvswitch/match.h \
@@ -17,6 +19,7 @@ openvswitchinclude_HEADERS = \
        include/openvswitch/ofp-prop.h \
        include/openvswitch/ofp-util.h \
        include/openvswitch/packets.h \
+       include/openvswitch/shash.h \
        include/openvswitch/thread.h \
        include/openvswitch/token-bucket.h \
        include/openvswitch/tun-metadata.h \
diff --git a/include/openvswitch/hmap.h b/include/openvswitch/hmap.h
new file mode 100644 (file)
index 0000000..ef272a6
--- /dev/null
@@ -0,0 +1,407 @@
+/*
+ * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015, 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef HMAP_H
+#define HMAP_H 1
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include "openvswitch/util.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+/* A hash map node, to be embedded inside the data structure being mapped. */
+struct hmap_node {
+    size_t hash;                /* Hash value. */
+    struct hmap_node *next;     /* Next in linked list. */
+};
+
+/* Returns the hash value embedded in 'node'. */
+static inline size_t hmap_node_hash(const struct hmap_node *node)
+{
+    return node->hash;
+}
+
+#define HMAP_NODE_NULL ((struct hmap_node *) 1)
+#define HMAP_NODE_NULL_INITIALIZER { 0, HMAP_NODE_NULL }
+
+/* Returns true if 'node' has been set to null by hmap_node_nullify() and has
+ * not been un-nullified by being inserted into an hmap. */
+static inline bool
+hmap_node_is_null(const struct hmap_node *node)
+{
+    return node->next == HMAP_NODE_NULL;
+}
+
+/* Marks 'node' with a distinctive value that can be tested with
+ * hmap_node_is_null().  */
+static inline void
+hmap_node_nullify(struct hmap_node *node)
+{
+    node->next = HMAP_NODE_NULL;
+}
+
+/* A hash map. */
+struct hmap {
+    struct hmap_node **buckets; /* Must point to 'one' iff 'mask' == 0. */
+    struct hmap_node *one;
+    size_t mask;
+    size_t n;
+};
+
+/* Initializer for an empty hash map. */
+#define HMAP_INITIALIZER(HMAP) \
+    { (struct hmap_node **const) &(HMAP)->one, NULL, 0, 0 }
+
+/* Initializer for an immutable struct hmap 'HMAP' that contains a single
+ * 'NODE'. */
+#define HMAP_CONST1(HMAP, NODE) {                                   \
+        CONST_CAST(struct hmap_node **, &(HMAP)->one), NODE, 0, 1 }
+#define HMAP_NODE_INIT(HASH) { HASH, NULL }
+
+/* Initialization. */
+void hmap_init(struct hmap *);
+void hmap_destroy(struct hmap *);
+void hmap_clear(struct hmap *);
+void hmap_swap(struct hmap *a, struct hmap *b);
+void hmap_moved(struct hmap *hmap);
+static inline size_t hmap_count(const struct hmap *);
+static inline bool hmap_is_empty(const struct hmap *);
+
+/* Adjusting capacity. */
+void hmap_expand_at(struct hmap *, const char *where);
+#define hmap_expand(HMAP) hmap_expand_at(HMAP, OVS_SOURCE_LOCATOR)
+
+void hmap_shrink_at(struct hmap *, const char *where);
+#define hmap_shrink(HMAP) hmap_shrink_at(HMAP, OVS_SOURCE_LOCATOR)
+
+void hmap_reserve_at(struct hmap *, size_t capacity, const char *where);
+#define hmap_reserve(HMAP, CAPACITY) \
+    hmap_reserve_at(HMAP, CAPACITY, OVS_SOURCE_LOCATOR)
+
+/* Insertion and deletion. */
+static inline void hmap_insert_at(struct hmap *, struct hmap_node *,
+                                  size_t hash, const char *where);
+#define hmap_insert(HMAP, NODE, HASH) \
+    hmap_insert_at(HMAP, NODE, HASH, OVS_SOURCE_LOCATOR)
+
+static inline void hmap_insert_fast(struct hmap *,
+                                    struct hmap_node *, size_t hash);
+static inline void hmap_remove(struct hmap *, struct hmap_node *);
+
+void hmap_node_moved(struct hmap *, struct hmap_node *, struct hmap_node *);
+static inline void hmap_replace(struct hmap *, const struct hmap_node *old,
+                                struct hmap_node *new_node);
+
+struct hmap_node *hmap_random_node(const struct hmap *);
+
+/* Search.
+ *
+ * HMAP_FOR_EACH_WITH_HASH iterates NODE over all of the nodes in HMAP that
+ * have hash value equal to HASH.  HMAP_FOR_EACH_IN_BUCKET iterates NODE over
+ * all of the nodes in HMAP that would fall in the same bucket as HASH.  MEMBER
+ * must be the name of the 'struct hmap_node' member within NODE.
+ *
+ * These macros may be used interchangeably to search for a particular value in
+ * an hmap, see, e.g. shash_find() for an example.  Usually, using
+ * HMAP_FOR_EACH_WITH_HASH provides an optimization, because comparing a hash
+ * value is usually cheaper than comparing an entire hash map key.  But for
+ * simple hash map keys, it makes sense to use HMAP_FOR_EACH_IN_BUCKET because
+ * it avoids doing two comparisons when a single simple comparison suffices.
+ *
+ * The loop should not change NODE to point to a different node or insert or
+ * delete nodes in HMAP (unless it "break"s out of the loop to terminate
+ * iteration).
+ *
+ * HASH is only evaluated once.
+ *
+ * When the loop terminates normally, meaning the iteration has completed
+ * without using 'break', NODE will be NULL.  This is true for all of the
+ * HMAP_FOR_EACH_*() macros.
+ */
+#define HMAP_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, HMAP)               \
+    for (INIT_CONTAINER(NODE, hmap_first_with_hash(HMAP, HASH), MEMBER); \
+         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
+         ASSIGN_CONTAINER(NODE, hmap_next_with_hash(&(NODE)->MEMBER),   \
+                          MEMBER))
+#define HMAP_FOR_EACH_IN_BUCKET(NODE, MEMBER, HASH, HMAP)               \
+    for (INIT_CONTAINER(NODE, hmap_first_in_bucket(HMAP, HASH), MEMBER); \
+         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
+         ASSIGN_CONTAINER(NODE, hmap_next_in_bucket(&(NODE)->MEMBER), MEMBER))
+
+static inline struct hmap_node *hmap_first_with_hash(const struct hmap *,
+                                                     size_t hash);
+static inline struct hmap_node *hmap_next_with_hash(const struct hmap_node *);
+static inline struct hmap_node *hmap_first_in_bucket(const struct hmap *,
+                                                     size_t hash);
+static inline struct hmap_node *hmap_next_in_bucket(const struct hmap_node *);
+
+bool hmap_contains(const struct hmap *, const struct hmap_node *);
+
+/* Iteration.
+ *
+ * The *_INIT variants of these macros additionally evaluate the expressions
+ * supplied following the HMAP argument once during the loop initialization.
+ * This makes it possible for data structures that wrap around hmaps to insert
+ * additional initialization into their iteration macros without having to
+ * completely rewrite them.  In particular, it can be a good idea to insert
+ * BUILD_ASSERT_TYPE checks for map and node types that wrap hmap, since
+ * otherwise it is possible for clients to accidentally confuse two derived
+ * data structures that happen to use the same member names for struct hmap and
+ * struct hmap_node. */
+
+/* Iterates through every node in HMAP. */
+#define HMAP_FOR_EACH(NODE, MEMBER, HMAP) \
+    HMAP_FOR_EACH_INIT(NODE, MEMBER, HMAP, (void) 0)
+#define HMAP_FOR_EACH_INIT(NODE, MEMBER, HMAP, ...)                     \
+    for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER), __VA_ARGS__;   \
+         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
+         ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER))
+
+/* Safe when NODE may be freed (not needed when NODE may be removed from the
+ * hash map but its members remain accessible and intact). */
+#define HMAP_FOR_EACH_SAFE(NODE, NEXT, MEMBER, HMAP) \
+    HMAP_FOR_EACH_SAFE_INIT(NODE, NEXT, MEMBER, HMAP, (void) 0)
+#define HMAP_FOR_EACH_SAFE_INIT(NODE, NEXT, MEMBER, HMAP, ...)          \
+    for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER), __VA_ARGS__;   \
+         ((NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL) \
+          ? INIT_CONTAINER(NEXT, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), 1 \
+          : 0);                                                         \
+         (NODE) = (NEXT))
+
+/* Continues an iteration from just after NODE. */
+#define HMAP_FOR_EACH_CONTINUE(NODE, MEMBER, HMAP) \
+    HMAP_FOR_EACH_CONTINUE_INIT(NODE, MEMBER, HMAP, (void) 0)
+#define HMAP_FOR_EACH_CONTINUE_INIT(NODE, MEMBER, HMAP, ...)            \
+    for (ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), \
+         __VA_ARGS__;                                                   \
+         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
+         ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER))
+
+static inline struct hmap_node *
+hmap_pop_helper__(struct hmap *hmap, size_t *bucket) {
+
+    for (; *bucket <= hmap->mask; (*bucket)++) {
+        struct hmap_node *node = hmap->buckets[*bucket];
+
+        if (node) {
+            hmap_remove(hmap, node);
+            return node;
+        }
+    }
+
+    return NULL;
+}
+
+#define HMAP_FOR_EACH_POP(NODE, MEMBER, HMAP)                               \
+    for (size_t bucket__ = 0;                                               \
+         INIT_CONTAINER(NODE, hmap_pop_helper__(HMAP, &bucket__), MEMBER),  \
+         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL);)
+
+static inline struct hmap_node *hmap_first(const struct hmap *);
+static inline struct hmap_node *hmap_next(const struct hmap *,
+                                          const struct hmap_node *);
+
+struct hmap_position {
+    unsigned int bucket;
+    unsigned int offset;
+};
+
+struct hmap_node *hmap_at_position(const struct hmap *,
+                                   struct hmap_position *);
+
+/* Returns the number of nodes currently in 'hmap'. */
+static inline size_t
+hmap_count(const struct hmap *hmap)
+{
+    return hmap->n;
+}
+
+/* Returns the maximum number of nodes that 'hmap' may hold before it should be
+ * rehashed. */
+static inline size_t
+hmap_capacity(const struct hmap *hmap)
+{
+    return hmap->mask * 2 + 1;
+}
+
+/* Returns true if 'hmap' currently contains no nodes,
+ * false otherwise.
+ * Note: While hmap in general is not thread-safe without additional locking,
+ * hmap_is_empty() is. */
+static inline bool
+hmap_is_empty(const struct hmap *hmap)
+{
+    return hmap->n == 0;
+}
+
+/* Inserts 'node', with the given 'hash', into 'hmap'.  'hmap' is never
+ * expanded automatically. */
+static inline void
+hmap_insert_fast(struct hmap *hmap, struct hmap_node *node, size_t hash)
+{
+    struct hmap_node **bucket = &hmap->buckets[hash & hmap->mask];
+    node->hash = hash;
+    node->next = *bucket;
+    *bucket = node;
+    hmap->n++;
+}
+
+/* Inserts 'node', with the given 'hash', into 'hmap', and expands 'hmap' if
+ * necessary to optimize search performance.
+ *
+ * ('where' is used in debug logging.  Commonly one would use hmap_insert() to
+ * automatically provide the caller's source file and line number for
+ * 'where'.) */
+static inline void
+hmap_insert_at(struct hmap *hmap, struct hmap_node *node, size_t hash,
+               const char *where)
+{
+    hmap_insert_fast(hmap, node, hash);
+    if (hmap->n / 2 > hmap->mask) {
+        hmap_expand_at(hmap, where);
+    }
+}
+
+/* Removes 'node' from 'hmap'.  Does not shrink the hash table; call
+ * hmap_shrink() directly if desired. */
+static inline void
+hmap_remove(struct hmap *hmap, struct hmap_node *node)
+{
+    struct hmap_node **bucket = &hmap->buckets[node->hash & hmap->mask];
+    while (*bucket != node) {
+        bucket = &(*bucket)->next;
+    }
+    *bucket = node->next;
+    hmap->n--;
+}
+
+/* Puts 'new_node' in the position in 'hmap' currently occupied by 'old_node'.
+ * The 'new_node' must hash to the same value as 'old_node'.  The client is
+ * responsible for ensuring that the replacement does not violate any
+ * client-imposed invariants (e.g. uniqueness of keys within a map).
+ *
+ * Afterward, 'old_node' is not part of 'hmap', and the client is responsible
+ * for freeing it (if this is desirable). */
+static inline void
+hmap_replace(struct hmap *hmap,
+             const struct hmap_node *old_node, struct hmap_node *new_node)
+{
+    struct hmap_node **bucket = &hmap->buckets[old_node->hash & hmap->mask];
+    while (*bucket != old_node) {
+        bucket = &(*bucket)->next;
+    }
+    *bucket = new_node;
+    new_node->hash = old_node->hash;
+    new_node->next = old_node->next;
+}
+
+static inline struct hmap_node *
+hmap_next_with_hash__(const struct hmap_node *node, size_t hash)
+{
+    while (node != NULL && node->hash != hash) {
+        node = node->next;
+    }
+    return CONST_CAST(struct hmap_node *, node);
+}
+
+/* Returns the first node in 'hmap' with the given 'hash', or a null pointer if
+ * no nodes have that hash value. */
+static inline struct hmap_node *
+hmap_first_with_hash(const struct hmap *hmap, size_t hash)
+{
+    return hmap_next_with_hash__(hmap->buckets[hash & hmap->mask], hash);
+}
+
+/* Returns the first node in 'hmap' in the bucket in which the given 'hash'
+ * would land, or a null pointer if that bucket is empty. */
+static inline struct hmap_node *
+hmap_first_in_bucket(const struct hmap *hmap, size_t hash)
+{
+    return hmap->buckets[hash & hmap->mask];
+}
+
+/* Returns the next node in the same bucket as 'node', or a null pointer if
+ * there are no more nodes in that bucket.
+ *
+ * If the hash map has been reallocated since 'node' was visited, some nodes
+ * may be skipped; if new nodes with the same hash value have been added, they
+ * will be skipped.  (Removing 'node' from the hash map does not prevent
+ * calling this function, since node->next is preserved, although freeing
+ * 'node' of course does.) */
+static inline struct hmap_node *
+hmap_next_in_bucket(const struct hmap_node *node)
+{
+    return node->next;
+}
+
+/* Returns the next node in the same hash map as 'node' with the same hash
+ * value, or a null pointer if no more nodes have that hash value.
+ *
+ * If the hash map has been reallocated since 'node' was visited, some nodes
+ * may be skipped; if new nodes with the same hash value have been added, they
+ * will be skipped.  (Removing 'node' from the hash map does not prevent
+ * calling this function, since node->next is preserved, although freeing
+ * 'node' of course does.) */
+static inline struct hmap_node *
+hmap_next_with_hash(const struct hmap_node *node)
+{
+    return hmap_next_with_hash__(node->next, node->hash);
+}
+
+static inline struct hmap_node *
+hmap_next__(const struct hmap *hmap, size_t start)
+{
+    size_t i;
+    for (i = start; i <= hmap->mask; i++) {
+        struct hmap_node *node = hmap->buckets[i];
+        if (node) {
+            return node;
+        }
+    }
+    return NULL;
+}
+
+/* Returns the first node in 'hmap', in arbitrary order, or a null pointer if
+ * 'hmap' is empty. */
+static inline struct hmap_node *
+hmap_first(const struct hmap *hmap)
+{
+    return hmap_next__(hmap, 0);
+}
+
+/* Returns the next node in 'hmap' following 'node', in arbitrary order, or a
+ * null pointer if 'node' is the last node in 'hmap'.
+ *
+ * If the hash map has been reallocated since 'node' was visited, some nodes
+ * may be skipped or visited twice.  (Removing 'node' from the hash map does
+ * not prevent calling this function, since node->next is preserved, although
+ * freeing 'node' of course does.) */
+static inline struct hmap_node *
+hmap_next(const struct hmap *hmap, const struct hmap_node *node)
+{
+    return (node->next
+            ? node->next
+            : hmap_next__(hmap, (node->hash & hmap->mask) + 1));
+}
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* hmap.h */
diff --git a/include/openvswitch/json.h b/include/openvswitch/json.h
new file mode 100644 (file)
index 0000000..13f346c
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2009, 2010, 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.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef JSON_H
+#define JSON_H 1
+
+/* This is an implementation of JavaScript Object Notation (JSON) as specified
+ * by RFC 4627.  It is intended to fully comply with RFC 4627, with the
+ * following known exceptions and clarifications:
+ *
+ *      - Null bytes (\u0000) are not allowed in strings.
+ *
+ *      - Only UTF-8 encoding is supported (RFC 4627 allows for other Unicode
+ *        encodings).
+ *
+ *      - Names within an object must be unique (RFC 4627 says that they
+ *        "should" be unique).
+ */
+
+#include <stdio.h>
+#include "openvswitch/shash.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+struct ds;
+
+/* Type of a JSON value. */
+enum json_type {
+    JSON_NULL,                  /* null */
+    JSON_FALSE,                 /* false */
+    JSON_TRUE,                  /* true */
+    JSON_OBJECT,                /* {"a": b, "c": d, ...} */
+    JSON_ARRAY,                 /* [1, 2, 3, ...] */
+    JSON_INTEGER,               /* 123. */
+    JSON_REAL,                  /* 123.456. */
+    JSON_STRING,                /* "..." */
+    JSON_N_TYPES
+};
+
+const char *json_type_to_string(enum json_type);
+
+/* A JSON array. */
+struct json_array {
+    size_t n, n_allocated;
+    struct json **elems;
+};
+
+/* A JSON value. */
+struct json {
+    enum json_type type;
+    union {
+        struct shash *object;   /* Contains "struct json *"s. */
+        struct json_array array;
+        long long int integer;
+        double real;
+        char *string;
+    } u;
+};
+
+struct json *json_null_create(void);
+struct json *json_boolean_create(bool);
+struct json *json_string_create(const char *);
+struct json *json_string_create_nocopy(char *);
+struct json *json_integer_create(long long int);
+struct json *json_real_create(double);
+
+struct json *json_array_create_empty(void);
+void json_array_add(struct json *, struct json *element);
+void json_array_trim(struct json *);
+struct json *json_array_create(struct json **, size_t n);
+struct json *json_array_create_1(struct json *);
+struct json *json_array_create_2(struct json *, struct json *);
+struct json *json_array_create_3(struct json *, struct json *, struct json *);
+
+struct json *json_object_create(void);
+void json_object_put(struct json *, const char *name, struct json *value);
+void json_object_put_string(struct json *,
+                            const char *name, const char *value);
+
+const char *json_string(const struct json *);
+struct json_array *json_array(const struct json *);
+struct shash *json_object(const struct json *);
+bool json_boolean(const struct json *);
+double json_real(const struct json *);
+int64_t json_integer(const struct json *);
+
+struct json *json_clone(const struct json *);
+void json_destroy(struct json *);
+
+size_t json_hash(const struct json *, size_t basis);
+bool json_equal(const struct json *, const struct json *);
+\f
+/* Parsing JSON. */
+enum {
+    JSPF_TRAILER = 1 << 0       /* Check for garbage following input.  */
+};
+
+struct json_parser *json_parser_create(int flags);
+size_t json_parser_feed(struct json_parser *, const char *, size_t);
+bool json_parser_is_done(const struct json_parser *);
+struct json *json_parser_finish(struct json_parser *);
+void json_parser_abort(struct json_parser *);
+
+struct json *json_from_string(const char *string);
+struct json *json_from_file(const char *file_name);
+struct json *json_from_stream(FILE *stream);
+\f
+/* Serializing JSON. */
+
+enum {
+    JSSF_PRETTY = 1 << 0,       /* Multiple lines with indentation, if true. */
+    JSSF_SORT = 1 << 1          /* Object members in sorted order, if true. */
+};
+char *json_to_string(const struct json *, int flags);
+void json_to_ds(const struct json *, int flags, struct ds *);
+\f
+/* JSON string formatting operations. */
+
+bool json_string_unescape(const char *in, size_t in_len, char **outp);
+void json_string_escape(const char *in, struct ds *out);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* json.h */
diff --git a/include/openvswitch/shash.h b/include/openvswitch/shash.h
new file mode 100644 (file)
index 0000000..afc4823
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2009, 2010, 2011, 2016 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SHASH_H
+#define SHASH_H 1
+
+#include "openvswitch/hmap.h"
+#include "openvswitch/util.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+struct shash_node {
+    struct hmap_node node;
+    char *name;
+    void *data;
+};
+
+struct shash {
+    struct hmap map;
+};
+
+#define SHASH_INITIALIZER(SHASH) { HMAP_INITIALIZER(&(SHASH)->map) }
+
+#define SHASH_FOR_EACH(SHASH_NODE, SHASH)                               \
+    HMAP_FOR_EACH_INIT (SHASH_NODE, node, &(SHASH)->map,                \
+                        BUILD_ASSERT_TYPE(SHASH_NODE, struct shash_node *), \
+                        BUILD_ASSERT_TYPE(SHASH, struct shash *))
+
+#define SHASH_FOR_EACH_SAFE(SHASH_NODE, NEXT, SHASH)        \
+    HMAP_FOR_EACH_SAFE_INIT (                               \
+        SHASH_NODE, NEXT, node, &(SHASH)->map,              \
+        BUILD_ASSERT_TYPE(SHASH_NODE, struct shash_node *), \
+        BUILD_ASSERT_TYPE(NEXT, struct shash_node *),       \
+        BUILD_ASSERT_TYPE(SHASH, struct shash *))
+
+void shash_init(struct shash *);
+void shash_destroy(struct shash *);
+void shash_destroy_free_data(struct shash *);
+void shash_swap(struct shash *, struct shash *);
+void shash_moved(struct shash *);
+void shash_clear(struct shash *);
+void shash_clear_free_data(struct shash *);
+bool shash_is_empty(const struct shash *);
+size_t shash_count(const struct shash *);
+struct shash_node *shash_add(struct shash *, const char *, const void *);
+struct shash_node *shash_add_nocopy(struct shash *, char *, const void *);
+bool shash_add_once(struct shash *, const char *, const void *);
+void shash_add_assert(struct shash *, const char *, const void *);
+void *shash_replace(struct shash *, const char *, const void *data);
+void shash_delete(struct shash *, struct shash_node *);
+char *shash_steal(struct shash *, struct shash_node *);
+struct shash_node *shash_find(const struct shash *, const char *);
+struct shash_node *shash_find_len(const struct shash *, const char *, size_t);
+void *shash_find_data(const struct shash *, const char *);
+void *shash_find_and_delete(struct shash *, const char *);
+void *shash_find_and_delete_assert(struct shash *, const char *);
+struct shash_node *shash_first(const struct shash *);
+const struct shash_node **shash_sort(const struct shash *);
+bool shash_equal_keys(const struct shash *, const struct shash *);
+struct shash_node *shash_random_node(struct shash *);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif /* shash.h */
index 1a44cc090c8656a259faa79107370c9bcc708084..71c9d417b505e3971f6e38973b3e3b6c90f57738 100644 (file)
@@ -94,7 +94,6 @@ lib_libopenvswitch_la_SOURCES = \
        lib/hindex.c \
        lib/hindex.h \
        lib/hmap.c \
-       lib/hmap.h \
        lib/hmapx.c \
        lib/hmapx.h \
        lib/id-pool.c \
@@ -102,7 +101,6 @@ lib_libopenvswitch_la_SOURCES = \
        lib/jhash.c \
        lib/jhash.h \
        lib/json.c \
-       lib/json.h \
        lib/jsonrpc.c \
        lib/jsonrpc.h \
        lib/lacp.c \
@@ -219,7 +217,6 @@ lib_libopenvswitch_la_SOURCES = \
        lib/sha1.c \
        lib/sha1.h \
        lib/shash.c \
-       lib/shash.h \
        lib/simap.c \
        lib/simap.h \
        lib/smap.c \
index 9616c9003a26f6342ca0fabe1a2b9851538858d0..8dac9538fa9e6a69c9696ee6e5fa4955208dab55 100644 (file)
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -29,7 +29,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "flow.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "netdev.h"
 #include "odp-util.h"
index eaaf0681005ca7de65862ff86a5fb366fafde1f7..7fc02e204a76085c792f6b0924bdfec13bf29a4d 100644 (file)
@@ -31,6 +31,7 @@
 #include "openvswitch/ofp-util.h"
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(bundle);
 
index fb077de408e96b6cfdd5fcbf747fd3562c1387ed..7bc22e3bbec9ade261b5271f9700107a699bb54f 100644 (file)
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -27,7 +27,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "flow.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev.h"
 #include "ovs-atomic.h"
 #include "packets.h"
@@ -38,6 +38,7 @@
 #include "timeval.h"
 #include "unixctl.h"
 #include "openvswitch/vlog.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(cfm);
 
index 98d48b3c5386b3a4679a84f243835761802115a2..5710c99522a2b03f073e598cdb708351c6977b88 100644 (file)
--- a/lib/cfm.h
+++ b/lib/cfm.h
@@ -18,7 +18,7 @@
 
 #include <stdint.h>
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/types.h"
 #include "packets.h"
 
index 9f50c6c454eef63b8d6427588614797d702bcd25..02eb328e21ddbc09aab45e606298ff659fd49e27 100644 (file)
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "openvswitch/vlog.h"
 #include "ovsdb-data.h"
 #include "ovsdb-idl.h"
 #include "ovsdb-idl-provider.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "string.h"
 #include "table.h"
index f8f576b4ed2f97c9f66a285beb4865652d3920ed..0f4658e385c72be05897f4ae9dbb604022fc6996 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "compiler.h"
 #include "openvswitch/dynamic-string.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 
 struct ctl_context;
 struct option;
index 003602a3e569ae3db58e65342825f28b119a71da..76b701c3b79d39a092bffd6b110f25adbba63044 100644 (file)
@@ -42,7 +42,7 @@
 #include "openvswitch/ofpbuf.h"
 #include "ovs-numa.h"
 #include "packets.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "smap.h"
 #include "sset.h"
index e0107b721275d253e1cd949c65fd2ae68b1d86e7..d5d7b7e6e992e347ea70d6375f557b00b07d91dc 100644 (file)
@@ -62,7 +62,7 @@
 #include "pvector.h"
 #include "random.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "timeval.h"
 #include "tnl-neigh-cache.h"
index e2bea230916933bc729fd6fd031a41554d886b3d..d5440729ddf414f6ef21fc10e8197f2535d61973 100644 (file)
@@ -49,7 +49,7 @@
 #include "packets.h"
 #include "poll-loop.h"
 #include "random.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "timeval.h"
 #include "unaligned.h"
index 5f1be41c65865bf5784a1451dea14bfa77fc9ca3..bb2c4e634f3199ebe22491e217598d24b5a01b3b 100644 (file)
@@ -40,7 +40,7 @@
 #include "poll-loop.h"
 #include "route-table.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "timeval.h"
 #include "tnl-neigh-cache.h"
index 2f42b056340c037711d674ec90252d43fad1afc8..19b71490792407a6f1e4ebbb35c44983f8bc5eaa 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <errno.h>
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovs-thread.h"
 #include "random.h"
index 021c8698badcd85bebe3c5575d826847638e205f..7b9813dd5e64614a4c535591678db6c7f447cf56 100644 (file)
@@ -25,7 +25,7 @@
 #include <unistd.h>
 #include "ovs-thread.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "signals.h"
 #include "socket-util.h"
index 8842e8d78432ca662a954d644dacf316bd12182d..1fa3bf4596f3146f41b943fb51d669837b6ca2fb 100644 (file)
@@ -39,6 +39,7 @@
 #include "odp-util.h"
 #include "random.h"
 #include "unaligned.h"
+#include "util.h"
 
 COVERAGE_DEFINE(flow_extract);
 COVERAGE_DEFINE(miniflow_malloc);
index 9462c5ef87e409256dce8af08e5414cbfa074f8e..1ba4a5716a78b163600ce8f64c667543efa05d23 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <config.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include <stdint.h>
 #include <string.h>
 #include "coverage.h"
diff --git a/lib/hmap.h b/lib/hmap.h
deleted file mode 100644 (file)
index ea6c4e0..0000000
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 2010, 2012, 2013, 2015, 2016 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef HMAP_H
-#define HMAP_H 1
-
-#include <stdbool.h>
-#include <stdlib.h>
-#include "util.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/* A hash map node, to be embedded inside the data structure being mapped. */
-struct hmap_node {
-    size_t hash;                /* Hash value. */
-    struct hmap_node *next;     /* Next in linked list. */
-};
-
-/* Returns the hash value embedded in 'node'. */
-static inline size_t hmap_node_hash(const struct hmap_node *node)
-{
-    return node->hash;
-}
-
-#define HMAP_NODE_NULL ((struct hmap_node *) 1)
-#define HMAP_NODE_NULL_INITIALIZER { 0, HMAP_NODE_NULL }
-
-/* Returns true if 'node' has been set to null by hmap_node_nullify() and has
- * not been un-nullified by being inserted into an hmap. */
-static inline bool
-hmap_node_is_null(const struct hmap_node *node)
-{
-    return node->next == HMAP_NODE_NULL;
-}
-
-/* Marks 'node' with a distinctive value that can be tested with
- * hmap_node_is_null().  */
-static inline void
-hmap_node_nullify(struct hmap_node *node)
-{
-    node->next = HMAP_NODE_NULL;
-}
-
-/* A hash map. */
-struct hmap {
-    struct hmap_node **buckets; /* Must point to 'one' iff 'mask' == 0. */
-    struct hmap_node *one;
-    size_t mask;
-    size_t n;
-};
-
-/* Initializer for an empty hash map. */
-#define HMAP_INITIALIZER(HMAP) \
-    { (struct hmap_node **const) &(HMAP)->one, NULL, 0, 0 }
-
-/* Initializer for an immutable struct hmap 'HMAP' that contains a single
- * 'NODE'. */
-#define HMAP_CONST1(HMAP, NODE) {                                   \
-        CONST_CAST(struct hmap_node **, &(HMAP)->one), NODE, 0, 1 }
-#define HMAP_NODE_INIT(HASH) { HASH, NULL }
-
-/* Initialization. */
-void hmap_init(struct hmap *);
-void hmap_destroy(struct hmap *);
-void hmap_clear(struct hmap *);
-void hmap_swap(struct hmap *a, struct hmap *b);
-void hmap_moved(struct hmap *hmap);
-static inline size_t hmap_count(const struct hmap *);
-static inline bool hmap_is_empty(const struct hmap *);
-
-/* Adjusting capacity. */
-void hmap_expand_at(struct hmap *, const char *where);
-#define hmap_expand(HMAP) hmap_expand_at(HMAP, OVS_SOURCE_LOCATOR)
-
-void hmap_shrink_at(struct hmap *, const char *where);
-#define hmap_shrink(HMAP) hmap_shrink_at(HMAP, OVS_SOURCE_LOCATOR)
-
-void hmap_reserve_at(struct hmap *, size_t capacity, const char *where);
-#define hmap_reserve(HMAP, CAPACITY) \
-    hmap_reserve_at(HMAP, CAPACITY, OVS_SOURCE_LOCATOR)
-
-/* Insertion and deletion. */
-static inline void hmap_insert_at(struct hmap *, struct hmap_node *,
-                                  size_t hash, const char *where);
-#define hmap_insert(HMAP, NODE, HASH) \
-    hmap_insert_at(HMAP, NODE, HASH, OVS_SOURCE_LOCATOR)
-
-static inline void hmap_insert_fast(struct hmap *,
-                                    struct hmap_node *, size_t hash);
-static inline void hmap_remove(struct hmap *, struct hmap_node *);
-
-void hmap_node_moved(struct hmap *, struct hmap_node *, struct hmap_node *);
-static inline void hmap_replace(struct hmap *, const struct hmap_node *old,
-                                struct hmap_node *new_node);
-
-struct hmap_node *hmap_random_node(const struct hmap *);
-
-/* Search.
- *
- * HMAP_FOR_EACH_WITH_HASH iterates NODE over all of the nodes in HMAP that
- * have hash value equal to HASH.  HMAP_FOR_EACH_IN_BUCKET iterates NODE over
- * all of the nodes in HMAP that would fall in the same bucket as HASH.  MEMBER
- * must be the name of the 'struct hmap_node' member within NODE.
- *
- * These macros may be used interchangeably to search for a particular value in
- * an hmap, see, e.g. shash_find() for an example.  Usually, using
- * HMAP_FOR_EACH_WITH_HASH provides an optimization, because comparing a hash
- * value is usually cheaper than comparing an entire hash map key.  But for
- * simple hash map keys, it makes sense to use HMAP_FOR_EACH_IN_BUCKET because
- * it avoids doing two comparisons when a single simple comparison suffices.
- *
- * The loop should not change NODE to point to a different node or insert or
- * delete nodes in HMAP (unless it "break"s out of the loop to terminate
- * iteration).
- *
- * HASH is only evaluated once.
- *
- * When the loop terminates normally, meaning the iteration has completed
- * without using 'break', NODE will be NULL.  This is true for all of the
- * HMAP_FOR_EACH_*() macros.
- */
-#define HMAP_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, HMAP)               \
-    for (INIT_CONTAINER(NODE, hmap_first_with_hash(HMAP, HASH), MEMBER); \
-         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
-         ASSIGN_CONTAINER(NODE, hmap_next_with_hash(&(NODE)->MEMBER),   \
-                          MEMBER))
-#define HMAP_FOR_EACH_IN_BUCKET(NODE, MEMBER, HASH, HMAP)               \
-    for (INIT_CONTAINER(NODE, hmap_first_in_bucket(HMAP, HASH), MEMBER); \
-         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
-         ASSIGN_CONTAINER(NODE, hmap_next_in_bucket(&(NODE)->MEMBER), MEMBER))
-
-static inline struct hmap_node *hmap_first_with_hash(const struct hmap *,
-                                                     size_t hash);
-static inline struct hmap_node *hmap_next_with_hash(const struct hmap_node *);
-static inline struct hmap_node *hmap_first_in_bucket(const struct hmap *,
-                                                     size_t hash);
-static inline struct hmap_node *hmap_next_in_bucket(const struct hmap_node *);
-
-bool hmap_contains(const struct hmap *, const struct hmap_node *);
-
-/* Iteration.
- *
- * The *_INIT variants of these macros additionally evaluate the expressions
- * supplied following the HMAP argument once during the loop initialization.
- * This makes it possible for data structures that wrap around hmaps to insert
- * additional initialization into their iteration macros without having to
- * completely rewrite them.  In particular, it can be a good idea to insert
- * BUILD_ASSERT_TYPE checks for map and node types that wrap hmap, since
- * otherwise it is possible for clients to accidentally confuse two derived
- * data structures that happen to use the same member names for struct hmap and
- * struct hmap_node. */
-
-/* Iterates through every node in HMAP. */
-#define HMAP_FOR_EACH(NODE, MEMBER, HMAP) \
-    HMAP_FOR_EACH_INIT(NODE, MEMBER, HMAP, (void) 0)
-#define HMAP_FOR_EACH_INIT(NODE, MEMBER, HMAP, ...)                     \
-    for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER), __VA_ARGS__;   \
-         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
-         ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER))
-
-/* Safe when NODE may be freed (not needed when NODE may be removed from the
- * hash map but its members remain accessible and intact). */
-#define HMAP_FOR_EACH_SAFE(NODE, NEXT, MEMBER, HMAP) \
-    HMAP_FOR_EACH_SAFE_INIT(NODE, NEXT, MEMBER, HMAP, (void) 0)
-#define HMAP_FOR_EACH_SAFE_INIT(NODE, NEXT, MEMBER, HMAP, ...)          \
-    for (INIT_CONTAINER(NODE, hmap_first(HMAP), MEMBER), __VA_ARGS__;   \
-         ((NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL) \
-          ? INIT_CONTAINER(NEXT, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), 1 \
-          : 0);                                                         \
-         (NODE) = (NEXT))
-
-/* Continues an iteration from just after NODE. */
-#define HMAP_FOR_EACH_CONTINUE(NODE, MEMBER, HMAP) \
-    HMAP_FOR_EACH_CONTINUE_INIT(NODE, MEMBER, HMAP, (void) 0)
-#define HMAP_FOR_EACH_CONTINUE_INIT(NODE, MEMBER, HMAP, ...)            \
-    for (ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER), \
-         __VA_ARGS__;                                                   \
-         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \
-         ASSIGN_CONTAINER(NODE, hmap_next(HMAP, &(NODE)->MEMBER), MEMBER))
-
-static inline struct hmap_node *
-hmap_pop_helper__(struct hmap *hmap, size_t *bucket) {
-
-    for (; *bucket <= hmap->mask; (*bucket)++) {
-        struct hmap_node *node = hmap->buckets[*bucket];
-
-        if (node) {
-            hmap_remove(hmap, node);
-            return node;
-        }
-    }
-
-    return NULL;
-}
-
-#define HMAP_FOR_EACH_POP(NODE, MEMBER, HMAP)                               \
-    for (size_t bucket__ = 0;                                               \
-         INIT_CONTAINER(NODE, hmap_pop_helper__(HMAP, &bucket__), MEMBER),  \
-         (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL);)
-
-static inline struct hmap_node *hmap_first(const struct hmap *);
-static inline struct hmap_node *hmap_next(const struct hmap *,
-                                          const struct hmap_node *);
-
-struct hmap_position {
-    unsigned int bucket;
-    unsigned int offset;
-};
-
-struct hmap_node *hmap_at_position(const struct hmap *,
-                                   struct hmap_position *);
-
-/* Returns the number of nodes currently in 'hmap'. */
-static inline size_t
-hmap_count(const struct hmap *hmap)
-{
-    return hmap->n;
-}
-
-/* Returns the maximum number of nodes that 'hmap' may hold before it should be
- * rehashed. */
-static inline size_t
-hmap_capacity(const struct hmap *hmap)
-{
-    return hmap->mask * 2 + 1;
-}
-
-/* Returns true if 'hmap' currently contains no nodes,
- * false otherwise.
- * Note: While hmap in general is not thread-safe without additional locking,
- * hmap_is_empty() is. */
-static inline bool
-hmap_is_empty(const struct hmap *hmap)
-{
-    return hmap->n == 0;
-}
-
-/* Inserts 'node', with the given 'hash', into 'hmap'.  'hmap' is never
- * expanded automatically. */
-static inline void
-hmap_insert_fast(struct hmap *hmap, struct hmap_node *node, size_t hash)
-{
-    struct hmap_node **bucket = &hmap->buckets[hash & hmap->mask];
-    node->hash = hash;
-    node->next = *bucket;
-    *bucket = node;
-    hmap->n++;
-}
-
-/* Inserts 'node', with the given 'hash', into 'hmap', and expands 'hmap' if
- * necessary to optimize search performance.
- *
- * ('where' is used in debug logging.  Commonly one would use hmap_insert() to
- * automatically provide the caller's source file and line number for
- * 'where'.) */
-static inline void
-hmap_insert_at(struct hmap *hmap, struct hmap_node *node, size_t hash,
-               const char *where)
-{
-    hmap_insert_fast(hmap, node, hash);
-    if (hmap->n / 2 > hmap->mask) {
-        hmap_expand_at(hmap, where);
-    }
-}
-
-/* Removes 'node' from 'hmap'.  Does not shrink the hash table; call
- * hmap_shrink() directly if desired. */
-static inline void
-hmap_remove(struct hmap *hmap, struct hmap_node *node)
-{
-    struct hmap_node **bucket = &hmap->buckets[node->hash & hmap->mask];
-    while (*bucket != node) {
-        bucket = &(*bucket)->next;
-    }
-    *bucket = node->next;
-    hmap->n--;
-}
-
-/* Puts 'new_node' in the position in 'hmap' currently occupied by 'old_node'.
- * The 'new_node' must hash to the same value as 'old_node'.  The client is
- * responsible for ensuring that the replacement does not violate any
- * client-imposed invariants (e.g. uniqueness of keys within a map).
- *
- * Afterward, 'old_node' is not part of 'hmap', and the client is responsible
- * for freeing it (if this is desirable). */
-static inline void
-hmap_replace(struct hmap *hmap,
-             const struct hmap_node *old_node, struct hmap_node *new_node)
-{
-    struct hmap_node **bucket = &hmap->buckets[old_node->hash & hmap->mask];
-    while (*bucket != old_node) {
-        bucket = &(*bucket)->next;
-    }
-    *bucket = new_node;
-    new_node->hash = old_node->hash;
-    new_node->next = old_node->next;
-}
-
-static inline struct hmap_node *
-hmap_next_with_hash__(const struct hmap_node *node, size_t hash)
-{
-    while (node != NULL && node->hash != hash) {
-        node = node->next;
-    }
-    return CONST_CAST(struct hmap_node *, node);
-}
-
-/* Returns the first node in 'hmap' with the given 'hash', or a null pointer if
- * no nodes have that hash value. */
-static inline struct hmap_node *
-hmap_first_with_hash(const struct hmap *hmap, size_t hash)
-{
-    return hmap_next_with_hash__(hmap->buckets[hash & hmap->mask], hash);
-}
-
-/* Returns the first node in 'hmap' in the bucket in which the given 'hash'
- * would land, or a null pointer if that bucket is empty. */
-static inline struct hmap_node *
-hmap_first_in_bucket(const struct hmap *hmap, size_t hash)
-{
-    return hmap->buckets[hash & hmap->mask];
-}
-
-/* Returns the next node in the same bucket as 'node', or a null pointer if
- * there are no more nodes in that bucket.
- *
- * If the hash map has been reallocated since 'node' was visited, some nodes
- * may be skipped; if new nodes with the same hash value have been added, they
- * will be skipped.  (Removing 'node' from the hash map does not prevent
- * calling this function, since node->next is preserved, although freeing
- * 'node' of course does.) */
-static inline struct hmap_node *
-hmap_next_in_bucket(const struct hmap_node *node)
-{
-    return node->next;
-}
-
-/* Returns the next node in the same hash map as 'node' with the same hash
- * value, or a null pointer if no more nodes have that hash value.
- *
- * If the hash map has been reallocated since 'node' was visited, some nodes
- * may be skipped; if new nodes with the same hash value have been added, they
- * will be skipped.  (Removing 'node' from the hash map does not prevent
- * calling this function, since node->next is preserved, although freeing
- * 'node' of course does.) */
-static inline struct hmap_node *
-hmap_next_with_hash(const struct hmap_node *node)
-{
-    return hmap_next_with_hash__(node->next, node->hash);
-}
-
-static inline struct hmap_node *
-hmap_next__(const struct hmap *hmap, size_t start)
-{
-    size_t i;
-    for (i = start; i <= hmap->mask; i++) {
-        struct hmap_node *node = hmap->buckets[i];
-        if (node) {
-            return node;
-        }
-    }
-    return NULL;
-}
-
-/* Returns the first node in 'hmap', in arbitrary order, or a null pointer if
- * 'hmap' is empty. */
-static inline struct hmap_node *
-hmap_first(const struct hmap *hmap)
-{
-    return hmap_next__(hmap, 0);
-}
-
-/* Returns the next node in 'hmap' following 'node', in arbitrary order, or a
- * null pointer if 'node' is the last node in 'hmap'.
- *
- * If the hash map has been reallocated since 'node' was visited, some nodes
- * may be skipped or visited twice.  (Removing 'node' from the hash map does
- * not prevent calling this function, since node->next is preserved, although
- * freeing 'node' of course does.) */
-static inline struct hmap_node *
-hmap_next(const struct hmap *hmap, const struct hmap_node *node)
-{
-    return (node->next
-            ? node->next
-            : hmap_next__(hmap, (node->hash & hmap->mask) + 1));
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* hmap.h */
index f977d9eed28de10d6defc99a8ca87c28a27aed0f..06a6bbe67d469fa56d60de9dd51d90caed117c08 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef HMAPX_H
 #define HMAPX_H
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 
 struct hmapx_node {
     struct hmap_node hmap_node;
index f32c008c9620e11a2627a938053f6486da04f196..62a6b3311d732170664413a786f556dd174cb20f 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <config.h>
 #include "id-pool.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hash.h"
 
 struct id_node {
index 4ac250b6a33c69d25a03aaa50161808cf8facad1..995f3c219636da315123de1c3d87473f60653349 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <config.h>
 
-#include "json.h"
+#include "openvswitch/json.h"
 
 #include <ctype.h>
 #include <errno.h>
@@ -26,7 +26,7 @@
 
 #include "openvswitch/dynamic-string.h"
 #include "hash.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "unicode.h"
 #include "util.h"
 
diff --git a/lib/json.h b/lib/json.h
deleted file mode 100644 (file)
index 3497035..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, 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.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JSON_H
-#define JSON_H 1
-
-/* This is an implementation of JavaScript Object Notation (JSON) as specified
- * by RFC 4627.  It is intended to fully comply with RFC 4627, with the
- * following known exceptions and clarifications:
- *
- *      - Null bytes (\u0000) are not allowed in strings.
- *
- *      - Only UTF-8 encoding is supported (RFC 4627 allows for other Unicode
- *        encodings).
- *
- *      - Names within an object must be unique (RFC 4627 says that they
- *        "should" be unique).
- */
-
-#include "shash.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-struct ds;
-
-/* Type of a JSON value. */
-enum json_type {
-    JSON_NULL,                  /* null */
-    JSON_FALSE,                 /* false */
-    JSON_TRUE,                  /* true */
-    JSON_OBJECT,                /* {"a": b, "c": d, ...} */
-    JSON_ARRAY,                 /* [1, 2, 3, ...] */
-    JSON_INTEGER,               /* 123. */
-    JSON_REAL,                  /* 123.456. */
-    JSON_STRING,                /* "..." */
-    JSON_N_TYPES
-};
-
-const char *json_type_to_string(enum json_type);
-
-/* A JSON array. */
-struct json_array {
-    size_t n, n_allocated;
-    struct json **elems;
-};
-
-/* A JSON value. */
-struct json {
-    enum json_type type;
-    union {
-        struct shash *object;   /* Contains "struct json *"s. */
-        struct json_array array;
-        long long int integer;
-        double real;
-        char *string;
-    } u;
-};
-
-struct json *json_null_create(void);
-struct json *json_boolean_create(bool);
-struct json *json_string_create(const char *);
-struct json *json_string_create_nocopy(char *);
-struct json *json_integer_create(long long int);
-struct json *json_real_create(double);
-
-struct json *json_array_create_empty(void);
-void json_array_add(struct json *, struct json *element);
-void json_array_trim(struct json *);
-struct json *json_array_create(struct json **, size_t n);
-struct json *json_array_create_1(struct json *);
-struct json *json_array_create_2(struct json *, struct json *);
-struct json *json_array_create_3(struct json *, struct json *, struct json *);
-
-struct json *json_object_create(void);
-void json_object_put(struct json *, const char *name, struct json *value);
-void json_object_put_string(struct json *,
-                            const char *name, const char *value);
-
-const char *json_string(const struct json *);
-struct json_array *json_array(const struct json *);
-struct shash *json_object(const struct json *);
-bool json_boolean(const struct json *);
-double json_real(const struct json *);
-int64_t json_integer(const struct json *);
-
-struct json *json_clone(const struct json *);
-void json_destroy(struct json *);
-
-size_t json_hash(const struct json *, size_t basis);
-bool json_equal(const struct json *, const struct json *);
-\f
-/* Parsing JSON. */
-enum {
-    JSPF_TRAILER = 1 << 0       /* Check for garbage following input.  */
-};
-
-struct json_parser *json_parser_create(int flags);
-size_t json_parser_feed(struct json_parser *, const char *, size_t);
-bool json_parser_is_done(const struct json_parser *);
-struct json *json_parser_finish(struct json_parser *);
-void json_parser_abort(struct json_parser *);
-
-struct json *json_from_string(const char *string);
-struct json *json_from_file(const char *file_name);
-struct json *json_from_stream(FILE *stream);
-\f
-/* Serializing JSON. */
-
-enum {
-    JSSF_PRETTY = 1 << 0,       /* Multiple lines with indentation, if true. */
-    JSSF_SORT = 1 << 1          /* Object members in sorted order, if true. */
-};
-char *json_to_string(const struct json *, int flags);
-void json_to_ds(const struct json *, int flags, struct ds *);
-\f
-/* JSON string formatting operations. */
-
-bool json_string_unescape(const char *in, size_t in_len, char **outp);
-void json_string_escape(const char *in, struct ds *out);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* json.h */
index aba742c5aba7863a2fc20c311c3e7dab536336d1..1841568b55c908fa94843ab4c2e2850ced16ddbd 100644 (file)
@@ -23,7 +23,7 @@
 #include "byteq.h"
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "openvswitch/list.h"
 #include "openvswitch/ofpbuf.h"
 #include "ovs-thread.h"
index a9d6e1e0e2337754c9d57d1edfe3f5f2a1829021..ad6ef8efb5b5325506ddc0c7140638394aef3b2c 100644 (file)
 #include "connectivity.h"
 #include "openvswitch/dynamic-string.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "dp-packet.h"
 #include "ovs-atomic.h"
 #include "packets.h"
 #include "poll-loop.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "timer.h"
 #include "timeval.h"
 #include "unixctl.h"
 #include "openvswitch/vlog.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(lacp);
 
index b420fe5c3f494b780f1bd1255921c203afcf044b..82609e80cd69db322eaee03089550b19fd63a1e6 100644 (file)
@@ -27,7 +27,7 @@
 #include "classifier.h"
 #include "dp-packet.h"
 #include "flow.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "mac-learning.h"
 #include "openflow/openflow.h"
 #include "openvswitch/ofp-actions.h"
@@ -41,7 +41,7 @@
 #include "openvswitch/vlog.h"
 #include "poll-loop.h"
 #include "rconn.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "timeval.h"
 
index 864d3eff0906fe75f5a077bf4e5f911a6c83fae1..36728ff912d9ad139777783468b35783d1e88f21 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "coverage.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "ovs-thread.h"
 #include "timeval.h"
 #include "util.h"
index 0b62d09c026ac0d11747d64429e29ac2354b5ccf..d09e89552bde8b5faf58764f7ca32b53cdd4c80c 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <time.h>
 #include "heap.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovs-atomic.h"
 #include "ovs-thread.h"
index 84b9c57a95c85ef85d12de164abadf95f0f97eb5..af7fb937635de85e66a1cf5df0ac01f7b674c0b0 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <time.h>
 #include "dp-packet.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovs-atomic.h"
 #include "ovs-thread.h"
index af579a20db279e78db5a2261a324c167bd504b5b..503da0cb7267127abb8e6bdface52b7452386378 100644 (file)
@@ -30,7 +30,7 @@
 #include "ovs-thread.h"
 #include "packets.h"
 #include "random.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "socket-util.h"
 #include "tun-metadata.h"
 #include "unaligned.h"
index 30bab142336d4ab0444d30593d537822b2fefb6d..8a1d1fadcf74e6de1beb6956f0e4984e8b80b046 100644 (file)
@@ -29,6 +29,7 @@
 #include "openvswitch/ofp-errors.h"
 #include "openvswitch/ofp-util.h"
 #include "packets.h"
+#include "util.h"
 \f
 /* Checks that 'mp' is valid on flow.  Returns 0 if it is valid, otherwise an
  * OFPERR_*. */
index 869d54d350644aa0f3e98925ead8b6cdfc6922cf..f963c6e522759d7898efe73f509fcec85f4be609 100644 (file)
@@ -57,7 +57,7 @@
 #include "ovs-thread.h"
 #include "packets.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "socket-util.h"
 #include "svec.h"
 #include "util.h"
index 7fb6457af42e9c74a07427d1039063b4f9b26bb2..9a9ac454e31bd3d0c5c26d9ac6b96e48840b6bbd 100644 (file)
@@ -48,7 +48,7 @@
 #include "ovs-thread.h"
 #include "ovs-rcu.h"
 #include "packets.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 #include "sset.h"
 #include "unaligned.h"
index 2e7b7e9df36e4bb04904e550f8a9de67a559c454..a95f7bbf80a6195e8a0f936d2723aa544d50f212 100644 (file)
@@ -36,7 +36,7 @@
 #include "packets.h"
 #include "pcap-file.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "stream.h"
 #include "unaligned.h"
index 60ad38b9e361bcc199506f466aaafce3447686b8..c71a3df58ebe9835bbdb858f32ab331387a2d3fa 100644 (file)
@@ -55,7 +55,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev-provider.h"
 #include "netdev-vport.h"
 #include "netlink-notifier.h"
 #include "packets.h"
 #include "poll-loop.h"
 #include "rtnetlink.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "socket-util.h"
 #include "sset.h"
 #include "timer.h"
 #include "unaligned.h"
 #include "openvswitch/vlog.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(netdev_linux);
 
index c62dbd5a1e2d5e6beb421b92795bf66baf882f0f..915a5a550e4beffee99effa5d0dd04bf62b3b339 100644 (file)
@@ -25,7 +25,7 @@
 #include "ovs-numa.h"
 #include "packets.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 
 #ifdef  __cplusplus
index c21ffe78a9359857384dcee807092fa0d2ce626a..32184906d70fe66813c099ecaab675cec8bb715c 100644 (file)
@@ -27,7 +27,7 @@
 #include "openvswitch/ofpbuf.h"
 #include "packets.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "svec.h"
 #include "openvswitch/vlog.h"
 #include "odp-netlink.h"
index 405bf41ef71399235ae1beef0304772d53f26b05..31a6a460eafceba05494a98286b23b8d0e646281 100644 (file)
@@ -47,7 +47,7 @@
 #include "packets.h"
 #include "poll-loop.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 #include "sset.h"
 #include "svec.h"
index f75259c1b35a9d98c70c444f68d528854b8655c1..1263b2158dbf0c6134e9b49deb1e9d463a61638b 100644 (file)
@@ -21,7 +21,7 @@
 #include "compiler.h"
 #include "ct-dpif.h"
 #include "openvswitch/dynamic-string.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/ofpbuf.h"
 #include "timeval.h"
 #include "unixctl.h"
index 26d909b72e372188909da36049a6917fbe5d0807..7502764de006a824ac8b700554d00c54945d3cf5 100644 (file)
@@ -25,7 +25,7 @@
 #include "coverage.h"
 #include "openvswitch/dynamic-string.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netlink.h"
 #include "netlink-protocol.h"
 #include "odp-netlink.h"
index fbdb78e86faa1de7a4654602d6fc9040ff7e010f..4715d68d8b1d6a2babb9eccf40edda441a7284db 100644 (file)
@@ -27,6 +27,7 @@
 #include "timeval.h"
 #include "unaligned.h"
 #include "openvswitch/vlog.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(netlink);
 
index 505c6f9bcac3529a25f8ba649788bb8344455bf3..c71ff0d640dd92d4a179ba65340793bf1d04eaa9 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "classifier.h"
 #include "colors.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openflow/nicira-ext.h"
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/meta-flow.h"
@@ -32,7 +32,7 @@
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
 #include "packets.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "tun-metadata.h"
 #include "unaligned.h"
 #include "util.h"
index 50e52e49be67117daac1a9659dee00ed127fb446..a41bc763067f2203f91289aa84bbb6ecb0b2973e 100644 (file)
@@ -23,7 +23,7 @@
 #include <string.h>
 #include "flow.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "odp-netlink.h"
 #include "openflow/openflow.h"
 #include "util.h"
index 8e41f7c72275990b3803258910aefe6931f0e953..4900addb4009808509f16399728cfe86a28504cc 100644 (file)
@@ -22,7 +22,7 @@
 #include "colors.h"
 #include "compiler.h"
 #include "dummy.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "learn.h"
 #include "multipath.h"
 #include "nx-match.h"
index 815453928fe717add248cce8fa59d7159c5d3b28..f9660fc810347e46d90fd2411aa1faeab0dc143c 100644 (file)
@@ -17,7 +17,7 @@
 #include <config.h>
 #include "byte-order.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openflow/nicira-ext.h"
 #include "openflow/openflow.h"
 #include "openvswitch/dynamic-string.h"
@@ -25,6 +25,7 @@
 #include "openvswitch/ofpbuf.h"
 #include "openvswitch/vlog.h"
 #include "ovs-thread.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(ofp_msgs);
 
index 4af6d9ba2676308431c980174a45af5882d08f7b..370e3e54248c9b0578dc2270b7643cda3ffa6b1f 100644 (file)
@@ -38,6 +38,7 @@
 #include "packets.h"
 #include "simap.h"
 #include "socket-util.h"
+#include "util.h"
 
 /* Parses 'str' as an 8-bit unsigned integer into '*valuep'.
  *
index 4ae83df112183c67d272cb6dbedb919a6cf2d50a..6d73e694ae0325bc8429a57ec7cf0ffab6edd45b 100644 (file)
@@ -49,6 +49,7 @@
 #include "random.h"
 #include "tun-metadata.h"
 #include "unaligned.h"
+#include "util.h"
 #include "uuid.h"
 
 VLOG_DEFINE_THIS_MODULE(ofp_util);
index b5c3a48c9d4cce1397c1f2ddeb7835bbf21f1fd9..0e536e8c27c9dcd1cfa134a4fcd45776fcdce5a4 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <stdint.h>
 #include "dp-packet.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "lldp/lldpd.h"
 #include "ovs-atomic.h"
index 7652636416c559fe5b02c4806e8e65e5122a9d23..c8173e0b4a55a0ac5a1df3780bd56756ec7a270c 100644 (file)
@@ -28,7 +28,7 @@
 #endif /* __linux__ */
 
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovs-thread.h"
 #include "openvswitch/vlog.h"
index 8aef1f19371465c6af255f237ec13aebc8d40516..0614d988c60e2ec8e134a187863b64d2fa5f7ce3 100644 (file)
@@ -24,6 +24,7 @@
 #include "poll-loop.h"
 #include "seq.h"
 #include "timeval.h"
+#include "util.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(ovs_rcu);
index 22176cdb8c1b64f5fb73c4c2d8b38703052b2776..266a3e4cd8808072372c545b6bff0175317c7f3d 100644 (file)
 #include "ovs-thread.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
-#include "json.h"
-#include "shash.h"
+#include "openvswitch/json.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 #include "sort.h"
 #include "unicode.h"
+#include "util.h"
 
 static struct json *
 wrap_json(const char *name, struct json *wrapped)
index 278954079df4707317e54a3c231ad45d2f49dfe4..98633ef5f7b69b915b66318d417f9927eb36b93c 100644 (file)
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include "compiler.h"
 #include "ovsdb-types.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 
 struct ds;
 struct ovsdb_symbol_table;
index dbe8149ce45291f2c2ebbfd5f33c393dea5f386e..dfa424945a0a5348608dcb547dcd28d2d63ecb1c 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "backtrace.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "util.h"
 #include "openvswitch/vlog.h"
 
index 1f249c09af0f8eac71a5bfaae22c72ca17c6c53e..55ed79378c0f15dd5e1efacdc7fa271366aff722 100644 (file)
 #ifndef OVSDB_IDL_PROVIDER_H
 #define OVSDB_IDL_PROVIDER_H 1
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovsdb-idl.h"
 #include "ovsdb-map-op.h"
 #include "ovsdb-types.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "uuid.h"
 
 struct ovsdb_idl_row {
index f8e980b148db207fa2cfef6d77f81d7d461bea4a..15002fa5a792cd3938561f06b988b78a2544ca65 100644 (file)
@@ -26,7 +26,7 @@
 #include "coverage.h"
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb/ovsdb.h"
 #include "ovsdb/table.h"
@@ -35,7 +35,7 @@
 #include "ovsdb-idl-provider.h"
 #include "ovsdb-parser.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sset.h"
 #include "util.h"
 #include "openvswitch/vlog.h"
index 23fc5f526599ec3da8db9f0c35dc74b21dc36e28..7b90ba84f92e3f9f3fdb30d01c81bd0840d152bd 100644 (file)
@@ -17,7 +17,7 @@
 #include <config.h>
 #include "ovsdb-map-op.h"
 #include "util.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hash.h"
 
 /* Map Operation: a Partial Map Update */
index 2f9f483d1689d5958d08fb13518a367dfd5bc6c6..31c5a60c82a05ccf5ff30fdd694d57ce04d3c87d 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <stdbool.h>
 #include "compiler.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "sset.h"
 #include "util.h"
 
index 91d5216024db9f57afc4623709e31c0563c4b467..20a84440b0d12aacf253c2bb13f36ff72e284027 100644 (file)
 #include <limits.h>
 
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovs-thread.h"
 #include "ovsdb-data.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
+#include "util.h"
 
 const struct ovsdb_type ovsdb_type_integer =
     OVSDB_TYPE_SCALAR_INITIALIZER(OVSDB_BASE_INTEGER_INIT);
index b5b23a64dc0bdc492894e32ce4f765420cf4baad..1bf887e2269e1f0919fabb004595b6c073db50e8 100644 (file)
@@ -26,7 +26,7 @@
 #include "csum.h"
 #include "crc32c.h"
 #include "flow.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/dynamic-string.h"
 #include "ovs-thread.h"
 #include "odp-util.h"
index a850d217fb68f28ec29e4f4fc8257476f6293f4e..dd4d229303e312b97b1e406e2eff2a56f3969708 100644 (file)
 #include "compiler.h"
 #include "dp-packet.h"
 #include "flow.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "packets.h"
 #include "timeval.h"
 #include "unaligned.h"
+#include "util.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(pcap);
index c5144e7f79a654f331bfe2f619463a62eadfd8c5..da60df7e7f296c51cc3978bd9264dc199ecba42e 100644 (file)
@@ -28,7 +28,7 @@
 #include <asm/unistd.h>
 #include "openvswitch/dynamic-string.h"
 #include "perf-counter.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "util.h"
 
 static struct shash perf_counters = SHASH_INITIALIZER(&perf_counters);
index 925198f0c9dd4a8e60d08a2e09b0f1e107c1e2a4..4f32189a9e9944166cefb9251ce1f627ef5b308d 100644 (file)
@@ -30,7 +30,7 @@
 #include "socket-util.h"
 #include "timeval.h"
 #include "openvswitch/vlog.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hash.h"
 
 VLOG_DEFINE_THIS_MODULE(poll_loop);
index bab821ebb9e7eb3a3b40824f5b4eec459a6df4de..471fb7fc8d61639f31c4d916959540c0371fe772 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 
 #include "poll-loop.h"
+#include "util.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(reconnect);
index 6d5acfc4629d64164721a5879d27624702956c9e..27e8079b937400565ec4f1b99b34467809784731 100644 (file)
@@ -33,7 +33,7 @@
 #include "rstp.h"
 #include <stdbool.h>
 #include <stdint.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovs-atomic.h"
 #include "packets.h"
index b8b5b6529466dafab50394f44d6dbfb34935c17b..6e2f596ea15a13d0b1d0533a7671f09b4a7b7a6c 100644 (file)
--- a/lib/seq.c
+++ b/lib/seq.c
@@ -22,7 +22,7 @@
 
 #include "coverage.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "latch.h"
 #include "openvswitch/list.h"
 #include "ovs-thread.h"
index 4285c07451fba0b29b16efb90293d5928e134bca..3e94b172a65f1bb25d6518b0ee9e033452d697f5 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <config.h>
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "hash.h"
 
 static struct shash_node *shash_find__(const struct shash *,
diff --git a/lib/shash.h b/lib/shash.h
deleted file mode 100644 (file)
index 5f94725..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2009, 2010, 2011, 2016 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SHASH_H
-#define SHASH_H 1
-
-#include "hmap.h"
-#include "util.h"
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-struct shash_node {
-    struct hmap_node node;
-    char *name;
-    void *data;
-};
-
-struct shash {
-    struct hmap map;
-};
-
-#define SHASH_INITIALIZER(SHASH) { HMAP_INITIALIZER(&(SHASH)->map) }
-
-#define SHASH_FOR_EACH(SHASH_NODE, SHASH)                               \
-    HMAP_FOR_EACH_INIT (SHASH_NODE, node, &(SHASH)->map,                \
-                        BUILD_ASSERT_TYPE(SHASH_NODE, struct shash_node *), \
-                        BUILD_ASSERT_TYPE(SHASH, struct shash *))
-
-#define SHASH_FOR_EACH_SAFE(SHASH_NODE, NEXT, SHASH)        \
-    HMAP_FOR_EACH_SAFE_INIT (                               \
-        SHASH_NODE, NEXT, node, &(SHASH)->map,              \
-        BUILD_ASSERT_TYPE(SHASH_NODE, struct shash_node *), \
-        BUILD_ASSERT_TYPE(NEXT, struct shash_node *),       \
-        BUILD_ASSERT_TYPE(SHASH, struct shash *))
-
-void shash_init(struct shash *);
-void shash_destroy(struct shash *);
-void shash_destroy_free_data(struct shash *);
-void shash_swap(struct shash *, struct shash *);
-void shash_moved(struct shash *);
-void shash_clear(struct shash *);
-void shash_clear_free_data(struct shash *);
-bool shash_is_empty(const struct shash *);
-size_t shash_count(const struct shash *);
-struct shash_node *shash_add(struct shash *, const char *, const void *);
-struct shash_node *shash_add_nocopy(struct shash *, char *, const void *);
-bool shash_add_once(struct shash *, const char *, const void *);
-void shash_add_assert(struct shash *, const char *, const void *);
-void *shash_replace(struct shash *, const char *, const void *data);
-void shash_delete(struct shash *, struct shash_node *);
-char *shash_steal(struct shash *, struct shash_node *);
-struct shash_node *shash_find(const struct shash *, const char *);
-struct shash_node *shash_find_len(const struct shash *, const char *, size_t);
-void *shash_find_data(const struct shash *, const char *);
-void *shash_find_and_delete(struct shash *, const char *);
-void *shash_find_and_delete_assert(struct shash *, const char *);
-struct shash_node *shash_first(const struct shash *);
-const struct shash_node **shash_sort(const struct shash *);
-bool shash_equal_keys(const struct shash *, const struct shash *);
-struct shash_node *shash_random_node(struct shash *);
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* shash.h */
index 113db93849e1c77c70ca9df9297693654f6b6746..9486080f4ded9c08256c4e7b8db231eb8ed4f341 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef SIMAP_H
 #define SIMAP_H 1
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 
 #ifdef  __cplusplus
 extern "C" {
index 07dd23aeea304a347d628a1ce1d012ed6e63b6fb..aff7eb0b2b671428408342ce14f3ddbe3891704f 100644 (file)
@@ -18,7 +18,7 @@
 #include <strings.h>
 
 #include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "packets.h"
 #include "uuid.h"
 
index 038b7697aa1e28e99f311b7b09720b0f011a247b..29f99e69a6c9f44ed0ae51dbadc1b7092c6671e3 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <netinet/in.h>
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 
 struct json;
 struct uuid;
index c3b5e971d0c0868000dbbccbe7a188f57df0e5c3..768d0cf0a1f3c75df49cf3ace138f819a6fc0fa6 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef SSET_H
 #define SSET_H
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "util.h"
 
 #ifdef __cplusplus
index bf80fc8a481087e4e83f48816fc982053265994d..a5c32a12a7cff3b30cb365c5d9812fc7182eb6fa 100644 (file)
@@ -39,7 +39,7 @@
 #include "openflow/openflow.h"
 #include "packets.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "socket-util.h"
 #include "util.h"
 #include "stream-provider.h"
index a2cfe3d1b400c03c9e795ec326c47c774a2ad8e6..9158499bf7e17b06a2330b930549748cb43be7bf 100644 (file)
@@ -19,7 +19,7 @@
 #include "table.h"
 
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-data.h"
 #include "ovsdb-error.h"
 #include "timeval.h"
index 8e5f971c2d2e91a14390485851c1977da2143ed1..0e8709af1943189995af6a79915cbc36f43b2376 100644 (file)
@@ -30,7 +30,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "ovs-rcu.h"
 #include "ovs-thread.h"
 #include "signals.h"
index 7a2a84fca1f89a684ebc4c919a4c837552209538..36006e3ba34542466bb64f617b02f710f3a7015b 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "bitmap.h"
 #include "compiler.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/match.h"
 #include "nx-match.h"
 #include "odp-netlink.h"
@@ -29,6 +29,7 @@
 #include "ovs-rcu.h"
 #include "packets.h"
 #include "tun-metadata.h"
+#include "util.h"
 
 struct tun_meta_entry {
     struct hmap_node node;      /* In struct tun_table's key_hmap. */
index 935c1450cc0ffdac82141c89aeeee63818322881..5e5d26c68ba39fb1d7c5f23b9671c65a906e2278 100644 (file)
 #include "coverage.h"
 #include "dirs.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "openvswitch/list.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "stream.h"
 #include "stream-provider.h"
 #include "svec.h"
index e738c9fc934892c92f9d950635df5146106648fb..5049d159ef9db2c63d0a114c7d6905a7462d0ff5 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "compiler.h"
+#include "util.h"
 #include "openvswitch/util.h"
 
 extern char *program_name;
index 032b8f61da36ec7e3beff82987de4e29b7f0934b..1d0c3ce3f8881722e80782259e4dc0e92d040e2f 100644 (file)
@@ -27,7 +27,7 @@
 #include "coverage.h"
 #include "dp-packet.h"
 #include "flow.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "lacp.h"
 #include "netdev.h"
 #include "odp-util.h"
 #include "packets.h"
 #include "poll-loop.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "timeval.h"
 #include "unixctl.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(bond);
 
index 232cc15e0b69965c42f2378fa00440fc9ee79469..aa8e58cab32bdb426e95088b056cfb897b44d94b 100644 (file)
@@ -34,7 +34,7 @@
 #include "poll-loop.h"
 #include "pktbuf.h"
 #include "rconn.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "stream.h"
 #include "timeval.h"
index 0c48b7785d83307d3a9dbc30ceaf2c4d4ad8b28e..d70d9902cebd3acaced9a32108fdf5e7871c7398 100644 (file)
 #include "poll-loop.h"
 #include "pktbuf.h"
 #include "rconn.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "stream.h"
 #include "timeval.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(connmgr);
 static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
index 30e7ae52c81f8850519f11f942a06cb7b9f13b61..be4ce2894dd21b8dd1ec8e97c9dd7ec457a050a2 100644 (file)
@@ -18,7 +18,7 @@
 #define CONNMGR_H 1
 
 #include "classifier.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "openvswitch/match.h"
 #include "openvswitch/ofp-util.h"
index 5744abbcb08004f3001c87e1bf2660e76680c214..0128c91a64841b8bd4e6302f3c8605eac578a416 100644 (file)
@@ -21,7 +21,7 @@
 #include "collectors.h"
 #include "flow.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev.h"
 #include "openvswitch/list.h"
 #include "openvswitch/ofpbuf.h"
index 84b78458905fba47aad86ab92d57883e70903bcd..675adf300a1643acef80e5a8b592e82af373fb0a 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <errno.h>
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hmapx.h"
 #include "ofproto.h"
 #include "vlan-bitmap.h"
index 11d7a54ba1ce77f62db1ad2247fe2ded2841ad60..623d51706dddf1db778d157eb75d9e1fb8ecf347 100644 (file)
@@ -25,7 +25,7 @@
 #include "guarded-list.h"
 #include "hash.h"
 #include "heap.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "latch.h"
 #include "openvswitch/ofpbuf.h"
 #include "ofproto-dpif.h"
index 7d0aa36f026b5a14f64e29719ea7114710b7a3e3..8a19d15845bd66bd1f1e4d431505cc3b16d2f9b8 100644 (file)
@@ -26,7 +26,7 @@
 #include "compiler.h"
 #include "dpif.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev.h"
 #include "netlink.h"
 #include "openvswitch/ofpbuf.h"
index 3ff7a6b66316bdb4042530e30e8bb36b7fa85b15..160da5b9ddf1b148a0c054f207138d78ebec3e51 100644 (file)
@@ -59,6 +59,7 @@
 #include "tnl-neigh-cache.h"
 #include "tnl-ports.h"
 #include "tunnel.h"
+#include "util.h"
 
 COVERAGE_DEFINE(xlate_actions);
 COVERAGE_DEFINE(xlate_actions_oversize);
index ce9383ad4772a9212a452c1d6c5594681e3431aa..faff1c7572ea95997a22396c45283d6c7264f82a 100644 (file)
@@ -68,6 +68,7 @@
 #include "tunnel.h"
 #include "unaligned.h"
 #include "unixctl.h"
+#include "util.h"
 #include "vlan-bitmap.h"
 
 VLOG_DEFINE_THIS_MODULE(ofproto_dpif);
index ae6c08ddec72061da0c578679beee485aecfe58d..25f8dc0f4ba0bbfd14032c2b44c4034a9daf6d0c 100644 (file)
@@ -46,7 +46,7 @@
 #include "ovs-atomic.h"
 #include "ovs-rcu.h"
 #include "ovs-thread.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "timeval.h"
 
index 5f84aa1818a55adbd25e41b2ea2d7e2bfa25020c..dcb0a0847f312eddb3700fb120e8e0c9ca9d01d6 100644 (file)
@@ -31,7 +31,7 @@
 #include "coverage.h"
 #include "dp-packet.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev.h"
 #include "nx-match.h"
 #include "ofproto.h"
@@ -54,7 +54,7 @@
 #include "poll-loop.h"
 #include "random.h"
 #include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "smap.h"
 #include "sset.h"
@@ -62,6 +62,7 @@
 #include "tun-metadata.h"
 #include "unaligned.h"
 #include "unixctl.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(ofproto);
 
index ee252f4f9502218abd85f0713fde9e518f30eb37..51f176050384dd1f6fd5bd4e7e1af8ad4833a42f 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdlib.h>
 #include "flow.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/ofpbuf.h"
 #include "openflow/openflow.h"
 #include "poll-loop.h"
index 85a485cd2d5611332127b08ebb90927e7ac37f1e..9a69071c0f0044bacfbfefe37924f2a76c7561de 100644 (file)
@@ -24,7 +24,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "fat-rwlock.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "netdev.h"
 #include "odp-util.h"
 #include "openvswitch/ofpbuf.h"
index 65070d6a85c996189099d7c13568d037e0931988..9cbfadc71c0ffb2ef3f27e7caf16e6a0b63718ce 100644 (file)
@@ -16,7 +16,7 @@
 #include <config.h>
 #include "binding.h"
 
-#include "lib/shash.h"
+#include "openvswitch/shash.h"
 #include "lib/smap.h"
 #include "lib/util.h"
 #include "openvswitch/vlog.h"
index 9e11e28045706d787dd672930b1af266910a09d3..976e9336d22452acbfcda8be4f0163fdf08f9d72 100644 (file)
@@ -18,8 +18,8 @@
 #include "vtep.h"
 
 #include "lib/hash.h"
-#include "lib/hmap.h"
-#include "lib/shash.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/shash.h"
 #include "lib/smap.h"
 #include "lib/sset.h"
 #include "lib/util.h"
index 0dea828bac49c8e4e10d7ddb350ed4348c952335..e83c1d52b4c03b2bf2f71e508aa3ab61652f973f 100644 (file)
 #include "lport.h"
 
 #include "lib/bitmap.h"
-#include "lib/hmap.h"
 #include "lib/poll-loop.h"
 #include "lib/sset.h"
 #include "lib/util.h"
 #include "lib/vswitch-idl.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/vlog.h"
 #include "ovn/lib/ovn-sb-idl.h"
 #include "ovn-controller.h"
index d40181b72c05f0fcfbab0e2bf35d926ff0681131..502e74d509d1ba53915613ee1835dcb667b5495b 100644 (file)
@@ -24,6 +24,7 @@
 #include "openvswitch/vlog.h"
 #include "ovn/lib/ovn-sb-idl.h"
 #include "ovn-controller.h"
+#include "lib/util.h"
 
 VLOG_DEFINE_THIS_MODULE(chassis);
 
index bb8d8cd57c98e03c85b9beb244a2b682c865aa10..9e9c6d3a13e77ed9a9b34f9b3673b0766b8f832d 100644 (file)
@@ -17,7 +17,7 @@
 #define OVN_LPORT_H 1
 
 #include <stdint.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "uuid.h"
 
 struct ovsdb_idl;
index 5b55597d2a38f2382272ceec66662165e08e92f1..184e86fba08b2b43c37d452d87e51e2d2a9521a5 100644 (file)
 #include "flow.h"
 #include "hash.h"
 #include "hindex.h"
-#include "hmap.h"
 #include "ofctrl.h"
 #include "openflow/openflow.h"
 #include "openvswitch/dynamic-string.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "openvswitch/match.h"
 #include "openvswitch/ofp-actions.h"
index 72b1c482d67b1c5426bff1da1e68fb07a1a55642..dcab918ad538a98fbc2dedcc328d2a88905ce734 100644 (file)
@@ -32,7 +32,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "encaps.h"
 #include "fatal-signal.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "lflow.h"
 #include "lib/vswitch-idl.h"
 #include "lport.h"
index fa38f78a20ec53c1ad6ab6f9b8be2a1593a0ffff..707d08b016889766ca0ac40f09b8ec92f135f247 100644 (file)
@@ -19,9 +19,9 @@
 
 #include "hash.h"
 #include "lflow.h"
-#include "lib/hmap.h"
 #include "lib/vswitch-idl.h"
 #include "lport.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/vlog.h"
 #include "ovn-controller.h"
 
index 11b2c2b7d2777566221b7bfb672682be08baf4a2..a104e33471498f0be10ed569e99132f249806a27 100644 (file)
 #include "ovn/lib/ovn-sb-idl.h"
 #include "ovn/lib/ovn-util.h"
 #include "physical.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "smap.h"
 #include "sset.h"
+#include "util.h"
 #include "vswitch-idl.h"
 
 VLOG_DEFINE_THIS_MODULE(physical);
index dda89593561cf420462554c420bcfb33f1ed23bd..6e2bf933537448247737272ecaf1d03e47bbdeb8 100644 (file)
@@ -24,7 +24,7 @@
 #include "ovn-dhcp.h"
 #include "expr.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "lex.h"
 #include "logical-fields.h"
 #include "nx-match.h"
@@ -32,7 +32,7 @@
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/ofpbuf.h"
 #include "packets.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 
 /* Context maintained during actions_parse(). */
index 48f0140895a4dc7fcb0bf5a31f85f221700b1853..114c71e6723561e7b8b2e23e41c59a8ae571201d 100644 (file)
@@ -20,7 +20,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include "compiler.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/dynamic-string.h"
 #include "util.h"
 
index 8c0768d2cf1d1755723e72392f10e672d14f9efa..1c38b993000c28901ce95f7752711b89176d4496 100644 (file)
 #include <config.h>
 #include "byte-order.h"
 #include "expr.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "lex.h"
 #include "logical-fields.h"
 #include "openvswitch/dynamic-string.h"
 #include "openvswitch/match.h"
 #include "openvswitch/ofp-actions.h"
 #include "openvswitch/vlog.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "sset.h"
+#include "util.h"
 
 VLOG_DEFINE_THIS_MODULE(expr);
 \f
index ed5300f1d31a3dc25955f521a3e20b76db6f0a4d..d790c4959c9408a295d2aaeeffc889deac82b42c 100644 (file)
@@ -54,7 +54,7 @@
 
 #include "classifier.h"
 #include "lex.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "openvswitch/match.h"
 #include "openvswitch/meta-flow.h"
index 52c0946f944ebb47340dad0f47a22121877144ce..79aa2211513c6eb4a50633263d3c31f7b8bd1cbb 100644 (file)
@@ -20,7 +20,7 @@
 #include <errno.h>
 #include <stdarg.h>
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "packets.h"
 #include "util.h"
 \f
index 4da614bfcb0dd4ceb8df87f87f0c98af2778c59a..6750f9513854249cb80aa5515cad22d33f8d3a52 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef OVN_DHCP_H
 #define OVN_DHCP_H 1
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hash.h"
 
 struct dhcp_opts_map {
index e030a4f2f22de186f369f81beca02ef0018bfdfb..a3d16720089dfbbbefd7743b842fc7b7def91029 100644 (file)
@@ -24,8 +24,8 @@
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "hmap.h"
-#include "json.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/json.h"
 #include "ovn/lib/lex.h"
 #include "ovn/lib/ovn-nb-idl.h"
 #include "ovn/lib/ovn-sb-idl.h"
index 25916dabda42396f78bb1ddaec57cc8afa9ea9de..d523eec831396300c8f2341b3069ad8298ae91d1 100644 (file)
@@ -23,7 +23,7 @@
 #include "db-ctl-base.h"
 #include "dirs.h"
 #include "fatal-signal.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovn/lib/ovn-nb-idl.h"
 #include "packets.h"
 #include "poll-loop.h"
index 21ae98dd0911f2819c6dc14aba37ee57fa92fde3..85dab067cd8a39e68d37d5c4cee751d45e836808 100644 (file)
 #include "compiler.h"
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-data.h"
 #include "ovsdb-idl.h"
 #include "poll-loop.h"
 #include "process.h"
 #include "sset.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "stream-ssl.h"
 #include "stream.h"
 #include "table.h"
index b41df2e4ccddc0d65249d72beefb4fb6c9cd7a12..8838df3ebe8a47852e8fe29c206b8678983511fc 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "column.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
 #include "table.h"
index 39a09775214e5ee2cb16309ff8397aa8b7119187..6da3b08ad96880af751e6206b1328dfd86a22271 100644 (file)
 #include <limits.h>
 
 #include "column.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-error.h"
 #include "row.h"
+
+#include <string.h>
+
 #include "table.h"
+#include "util.h"
 
 struct ovsdb_error *
 ovsdb_function_from_string(const char *name, enum ovsdb_function *function)
index d3fc8b914b54ab81356b2204c586784fc2a3fff2..e972ce7ad7f30d87c562bb432d3965a670cdc1bd 100644 (file)
@@ -20,7 +20,7 @@
 #include "column.h"
 #include "condition.h"
 #include "file.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "mutation.h"
 #include "ovsdb-data.h"
 #include "ovsdb-error.h"
index 2894f30da5200da866b710ad737c4a3dedcb769a..7f8554ada418c79f84e19c63f3d8ca215fde9a1c 100644 (file)
@@ -24,7 +24,7 @@
 #include "bitmap.h"
 #include "column.h"
 #include "log.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "lockfile.h"
 #include "ovsdb.h"
 #include "ovsdb-error.h"
index 864fb0309fd101c5ce29623eff833e9b3de30263..bde91222728e491c2fac74b7671274ea699bb16c 100644 (file)
@@ -23,7 +23,7 @@
 #include "column.h"
 #include "openvswitch/dynamic-string.h"
 #include "monitor.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
@@ -39,6 +39,7 @@
 #include "timeval.h"
 #include "transaction.h"
 #include "trigger.h"
+#include "util.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(ovsdb_jsonrpc_server);
index 8004d3dce863b4b531bb5aef1ca3f608a3704d9d..380f5e93d46430b399dec35aeb8cdbbde008f603 100644 (file)
@@ -24,7 +24,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-#include "json.h"
+#include "openvswitch/json.h"
 #include "lockfile.h"
 #include "ovsdb.h"
 #include "ovsdb-error.h"
index 54c27c44833fdea502f2038c6804616c6bb0773f..99083e1a2911ec0db6fc223e1a16b3a6e2f99c04 100644 (file)
@@ -21,7 +21,7 @@
 #include "bitmap.h"
 #include "column.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
@@ -36,6 +36,7 @@
 #include "transaction.h"
 #include "jsonrpc-server.h"
 #include "monitor.h"
+#include "util.h"
 #include "openvswitch/vlog.h"
 
 VLOG_DEFINE_THIS_MODULE(ovsdb_monitor);
index 6a43e3423db91114903c66ad2340e7871c994bff..e5d192e15dea29a5892adaaf853d7154510e9f76 100644 (file)
 
 #include "column.h"
 #include "ovsdb-error.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "row.h"
+
+#include <string.h>
+
 #include "table.h"
+#include "util.h"
 
 struct ovsdb_error *
 ovsdb_mutator_from_string(const char *name, enum ovsdb_mutator *mutator)
index 4105d4741bf1bb99e7163270ec61d85b3517e3f1..7dcc07c949e7b24290b8bd7daa96eeee2c69229a 100644 (file)
@@ -32,7 +32,7 @@
 #include "dirs.h"
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "lib/table.h"
 #include "ovsdb.h"
index 11801188d37926c7ffa88e1ca58e4a0f1072fff2..239cca8ec2b5c8b06ca31e4ffcd027b643cf6d7f 100644 (file)
@@ -30,7 +30,7 @@
 #include "fatal-signal.h"
 #include "file.h"
 #include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "jsonrpc-server.h"
 #include "openvswitch/list.h"
@@ -45,7 +45,7 @@
 #include "replication.h"
 #include "row.h"
 #include "simap.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "stream-ssl.h"
 #include "stream.h"
 #include "sset.h"
index 37e219ff49306c198827350094960160cd3764ef..af83da201771c3a6d31cbe0babda722bed634135 100644 (file)
@@ -31,7 +31,7 @@
 #include "file.h"
 #include "lockfile.h"
 #include "log.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb.h"
 #include "ovsdb-data.h"
 #include "ovsdb-error.h"
index b7cc655daf782067c8da835bedbf01621d0465c5..03919004d95fa50f047f5d2020e0923af9e75e37 100644 (file)
@@ -18,7 +18,7 @@
 #include "ovsdb.h"
 
 #include "column.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
 #include "ovsdb-types.h"
index b3eaf15f02a642125f82848919bca84f38da98f0..418805c1562019c4bbfa69dbacaed2cc23206f66 100644 (file)
@@ -17,9 +17,9 @@
 #define OVSDB_OVSDB_H 1
 
 #include "compiler.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 
 struct json;
 struct ovsdb_log;
index 736771461ca5974771c2cd34fe64763e04acd6ac..52b708523f7a046e3e4ca90e68f964ef56a2ef09 100644 (file)
@@ -20,7 +20,7 @@
 #include "replication.h"
 
 #include "condition.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb.h"
 #include "ovsdb-error.h"
index 012ca09604b3c89ca5c87402eb681f1762c037f6..93ac22b22a0589af2711c8dc9c8c59ccf73937a3 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef REPLICATION_H
 #define REPLICATION_H 1
 
-#include "shash.h"
+#include "openvswitch/shash.h"
 
 struct db {
     /* Initialized in main(). */
index 572c10321e2bedecf97cd28708ec12ec610b2164..9c312947e53916a125f8404fd03d702face7eb45 100644 (file)
 #include <stddef.h>
 
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-error.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "sort.h"
 #include "table.h"
+#include "util.h"
 
 static struct ovsdb_row *
 allocate_row(const struct ovsdb_table *table)
index b1d1edd471041bcef13831b2aa02737089540436..83024bc0f32dd672b7fba4ccd1abc75b306c34fb 100644 (file)
@@ -19,7 +19,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include "column.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
 #include "ovsdb-data.h"
 
index 667fce992f4bc766d987516195d4d9b6fa612c31..c0bbb69ce3045fa9f58330f1b400f6ea29b1cce2 100644 (file)
@@ -16,9 +16,9 @@
 #ifndef SERVER_H
 #define SERVER_H 1
 
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "openvswitch/list.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 
 struct ovsdb;
 struct ovsdb_server;
index e7545ad31210f3fba8857bc41c7795cb4c33c7f1..7ec55d61f71a5438f66280c3855361211e998968 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <limits.h>
 
-#include "json.h"
+#include "openvswitch/json.h"
 #include "column.h"
 #include "ovsdb-error.h"
 #include "ovsdb-parser.h"
index 68a59add4150315e3c09e8cc9b50f72ba2d331af..f910d1880f7f17a4c5260dea7087b80a519ce1aa 100644 (file)
@@ -18,8 +18,8 @@
 
 #include <stdbool.h>
 #include "compiler.h"
-#include "hmap.h"
-#include "shash.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/shash.h"
 
 struct json;
 struct uuid;
index 9e12a622572fdc13bdfdbbd2cf9806a52a52abcd..865e9b6b2641190611c4dcfbb9ce96ae232be8e6 100644 (file)
@@ -20,8 +20,8 @@
 #include "bitmap.h"
 #include "openvswitch/dynamic-string.h"
 #include "hash.h"
-#include "hmap.h"
-#include "json.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/json.h"
 #include "openvswitch/list.h"
 #include "ovsdb-error.h"
 #include "ovsdb.h"
index 3392fb72f64b013a80c78a7e44b3fd6b3fe170c3..0fbe9490867bcd21dc64a7cea60451ade78563c9 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <limits.h>
 
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb.h"
 #include "poll-loop.h"
index c4e2af33f4f5adfd26f77ca57f4ecef831c08a5b..7067ce26aa57c10c0ad984d3cf88f562348eb351 100644 (file)
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include <openvswitch/lib/json.h>
+#include <openvswitch/json.h>
 #include "structmember.h"
 
 #if PY_MAJOR_VERSION >= 3
index 2f2cdd6722777050b4fd756d65b49874216993b4..4efe1b975558ededc61d7cb8518a5e9306c1531d 100644 (file)
@@ -27,7 +27,7 @@
 #include "command-line.h"
 #include "fat-rwlock.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "ovstest.h"
 #include "ovs-thread.h"
 #include "random.h"
index 05aba00fee541a668ae4ac43be15598adb7bd838..4cac7de9e170dce6875129be4eea9add25af775a 100644 (file)
@@ -27,7 +27,7 @@
 #include "command-line.h"
 #include "fat-rwlock.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "ovstest.h"
 #include "ovs-thread.h"
 #include "random.h"
index c63bd8022951ec9998a5a9ec4f71ea096a9dd8e5..9259b0b3fc428d1a13686f38edd91df4855e3ada 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <config.h>
 #undef NDEBUG
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include <assert.h>
 #include <string.h>
 #include "hash.h"
index 692013ecc2e18b9726184ed42a5dd6caa53a9358..2819210570797cd61bb8681432dd70d055f98bd6 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <config.h>
 #undef NDEBUG
-#include "json.h"
+#include "openvswitch/json.h"
 #include <ctype.h>
 #include <errno.h>
 #include <getopt.h>
index feac0b0afdec1adb8524ac043f865bb068dafcdc..be79064ad4f0efb0d6e96314b4352ad032abd785 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdlib.h>
 #include "command-line.h"
 #include "daemon.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovstest.h"
 #include "poll-loop.h"
 #include "stream-ssl.h"
index fd004c9e0618ad69d1e37f56898b52b1cbbbe4b6..26055bb036198e3788ca9d1c6a178d581b3a7e28 100644 (file)
@@ -32,7 +32,7 @@
 #include "ovn/lib/ovn-dhcp.h"
 #include "ovs-thread.h"
 #include "ovstest.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "simap.h"
 #include "util.h"
 
index 6357c9cd4e690063b46a7d068615eea8808f5d84..c21001e3a64238bdb43590cd3cc3fb960653937c 100644 (file)
@@ -26,7 +26,7 @@
 #include "byte-order.h"
 #include "command-line.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "jsonrpc.h"
 #include "ovsdb-data.h"
 #include "ovsdb-error.h"
index c98dd3f3ddd34c3bbaabc8b19e77839a33d02563..722dcd9fb50f89d840e92579b4569469a8870b66 100644 (file)
@@ -34,7 +34,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-data.h"
 #include "ovsdb-idl.h"
 #include "poll-loop.h"
index a5de84e443be222e0936e99518d9246c17fba9cd..03c50048f6a6e83515b50458057165bfbbc7d492 100644 (file)
@@ -29,7 +29,7 @@
 #include "dirs.h"
 #include "dpif.h"
 #include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
 #include "hmapx.h"
 #include "if-notifier.h"
 #include "jsonrpc.h"
@@ -55,7 +55,7 @@
 #include "seq.h"
 #include "sflow_api.h"
 #include "sha1.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 #include "socket-util.h"
 #include "stream.h"
index 129f0cf82ce798e24e5d89c796f7ec764301c0fb..49e541981937a536c3bb0e234db30600826848f6 100644 (file)
 #include "daemon.h"
 #include "dirs.h"
 #include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "latch.h"
 #include "openvswitch/ofpbuf.h"
 #include "ovs-rcu.h"
 #include "ovs-thread.h"
 #include "poll-loop.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
 #include "smap.h"
 #include "timeval.h"
 #include "openvswitch/vlog.h"
index 759150f1da72df69b193a871c73eb196a2e23a51..245ba0db10f0eae58980ab60690468bcfb53c2d7 100644 (file)
@@ -34,7 +34,7 @@
 #include "openvswitch/dynamic-string.h"
 #include "fatal-signal.h"
 #include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
 #include "ovsdb-data.h"
 #include "ovsdb-idl.h"
 #include "poll-loop.h"