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 \
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 \
--- /dev/null
+/*
+ * 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 */
--- /dev/null
+/*
+ * 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 */
--- /dev/null
+/*
+ * 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 */
lib/hindex.c \
lib/hindex.h \
lib/hmap.c \
- lib/hmap.h \
lib/hmapx.c \
lib/hmapx.h \
lib/id-pool.c \
lib/jhash.c \
lib/jhash.h \
lib/json.c \
- lib/json.h \
lib/jsonrpc.c \
lib/jsonrpc.h \
lib/lacp.c \
lib/sha1.c \
lib/sha1.h \
lib/shash.c \
- lib/shash.h \
lib/simap.c \
lib/simap.h \
lib/smap.c \
#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"
#include "openvswitch/ofp-util.h"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/vlog.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(bundle);
#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"
#include "timeval.h"
#include "unixctl.h"
#include "openvswitch/vlog.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(cfm);
#include <stdint.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "openvswitch/types.h"
#include "packets.h"
#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"
#include "compiler.h"
#include "openvswitch/dynamic-string.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
struct ctl_context;
struct option;
#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"
#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"
#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"
#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"
#include <errno.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "openvswitch/list.h"
#include "ovs-thread.h"
#include "random.h"
#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"
#include "odp-util.h"
#include "random.h"
#include "unaligned.h"
+#include "util.h"
COVERAGE_DEFINE(flow_extract);
COVERAGE_DEFINE(miniflow_malloc);
*/
#include <config.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include <stdint.h>
#include <string.h>
#include "coverage.h"
+++ /dev/null
-/*
- * 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 */
#ifndef HMAPX_H
#define HMAPX_H
-#include "hmap.h"
+#include "openvswitch/hmap.h"
struct hmapx_node {
struct hmap_node hmap_node;
#include <config.h>
#include "id-pool.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "hash.h"
struct id_node {
#include <config.h>
-#include "json.h"
+#include "openvswitch/json.h"
#include <ctype.h>
#include <errno.h>
#include "openvswitch/dynamic-string.h"
#include "hash.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
#include "unicode.h"
#include "util.h"
+++ /dev/null
-/*
- * 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 */
#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"
#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);
#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"
#include "openvswitch/vlog.h"
#include "poll-loop.h"
#include "rconn.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
#include "simap.h"
#include "timeval.h"
#include "coverage.h"
#include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "ovs-thread.h"
#include "timeval.h"
#include "util.h"
#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"
#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"
#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"
#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_*. */
#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"
#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"
#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"
#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);
#include "ovs-numa.h"
#include "packets.h"
#include "seq.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
#include "smap.h"
#ifdef __cplusplus
#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"
#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"
#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"
#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"
#include "timeval.h"
#include "unaligned.h"
#include "openvswitch/vlog.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(netlink);
#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"
#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"
#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"
#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"
#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"
#include "openvswitch/ofpbuf.h"
#include "openvswitch/vlog.h"
#include "ovs-thread.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(ofp_msgs);
#include "packets.h"
#include "simap.h"
#include "socket-util.h"
+#include "util.h"
/* Parses 'str' as an 8-bit unsigned integer into '*valuep'.
*
#include "random.h"
#include "tun-metadata.h"
#include "unaligned.h"
+#include "util.h"
#include "uuid.h"
VLOG_DEFINE_THIS_MODULE(ofp_util);
#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"
#endif /* __linux__ */
#include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "openvswitch/list.h"
#include "ovs-thread.h"
#include "openvswitch/vlog.h"
#include "poll-loop.h"
#include "seq.h"
#include "timeval.h"
+#include "util.h"
#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovs_rcu);
#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)
#include <stdlib.h>
#include "compiler.h"
#include "ovsdb-types.h"
-#include "shash.h"
+#include "openvswitch/shash.h"
struct ds;
struct ovsdb_symbol_table;
#include "backtrace.h"
#include "openvswitch/dynamic-string.h"
-#include "json.h"
+#include "openvswitch/json.h"
#include "util.h"
#include "openvswitch/vlog.h"
#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 {
#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"
#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"
#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 */
#include <stdbool.h>
#include "compiler.h"
-#include "json.h"
+#include "openvswitch/json.h"
#include "sset.h"
#include "util.h"
#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);
#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"
#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);
#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);
#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);
#include <stdlib.h>
#include "poll-loop.h"
+#include "util.h"
#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(reconnect);
#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"
#include "coverage.h"
#include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "latch.h"
#include "openvswitch/list.h"
#include "ovs-thread.h"
*/
#include <config.h>
-#include "shash.h"
+#include "openvswitch/shash.h"
#include "hash.h"
static struct shash_node *shash_find__(const struct shash *,
+++ /dev/null
-/*
- * 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 */
#ifndef SIMAP_H
#define SIMAP_H 1
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#ifdef __cplusplus
extern "C" {
#include <strings.h>
#include "hash.h"
-#include "json.h"
+#include "openvswitch/json.h"
#include "packets.h"
#include "uuid.h"
#include <netinet/in.h>
#include "hash.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
struct json;
struct uuid;
#ifndef SSET_H
#define SSET_H
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "util.h"
#ifdef __cplusplus
#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"
#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"
#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"
#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"
#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. */
#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"
#include <stdlib.h>
#include <string.h>
#include "compiler.h"
+#include "util.h"
#include "openvswitch/util.h"
extern char *program_name;
#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);
#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 "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);
#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"
#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"
#include <errno.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "hmapx.h"
#include "ofproto.h"
#include "vlan-bitmap.h"
#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"
#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"
#include "tnl-neigh-cache.h"
#include "tnl-ports.h"
#include "tunnel.h"
+#include "util.h"
COVERAGE_DEFINE(xlate_actions);
COVERAGE_DEFINE(xlate_actions_oversize);
#include "tunnel.h"
#include "unaligned.h"
#include "unixctl.h"
+#include "util.h"
#include "vlan-bitmap.h"
VLOG_DEFINE_THIS_MODULE(ofproto_dpif);
#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"
#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"
#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"
#include "tun-metadata.h"
#include "unaligned.h"
#include "unixctl.h"
+#include "util.h"
VLOG_DEFINE_THIS_MODULE(ofproto);
#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"
#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"
#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"
#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"
#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"
#include "openvswitch/vlog.h"
#include "ovn/lib/ovn-sb-idl.h"
#include "ovn-controller.h"
+#include "lib/util.h"
VLOG_DEFINE_THIS_MODULE(chassis);
#define OVN_LPORT_H 1
#include <stdint.h>
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "uuid.h"
struct ovsdb_idl;
#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"
#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"
#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"
#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);
#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"
#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(). */
#include <stdbool.h>
#include <stdint.h>
#include "compiler.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "openvswitch/dynamic-string.h"
#include "util.h"
#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
#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"
#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
#ifndef OVN_DHCP_H
#define OVN_DHCP_H 1
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "hash.h"
struct dhcp_opts_map {
#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"
#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"
#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"
#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"
#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)
#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"
#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"
#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"
#include "timeval.h"
#include "transaction.h"
#include "trigger.h"
+#include "util.h"
#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovsdb_jsonrpc_server);
#include <sys/stat.h>
#include <unistd.h>
-#include "json.h"
+#include "openvswitch/json.h"
#include "lockfile.h"
#include "ovsdb.h"
#include "ovsdb-error.h"
#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"
#include "transaction.h"
#include "jsonrpc-server.h"
#include "monitor.h"
+#include "util.h"
#include "openvswitch/vlog.h"
VLOG_DEFINE_THIS_MODULE(ovsdb_monitor);
#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)
#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"
#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"
#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"
#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"
#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"
#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;
#include "replication.h"
#include "condition.h"
-#include "json.h"
+#include "openvswitch/json.h"
#include "jsonrpc.h"
#include "ovsdb.h"
#include "ovsdb-error.h"
#ifndef REPLICATION_H
#define REPLICATION_H 1
-#include "shash.h"
+#include "openvswitch/shash.h"
struct db {
/* Initialized in main(). */
#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)
#include <stddef.h>
#include <stdint.h>
#include "column.h"
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include "openvswitch/list.h"
#include "ovsdb-data.h"
#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;
#include <limits.h>
-#include "json.h"
+#include "openvswitch/json.h"
#include "column.h"
#include "ovsdb-error.h"
#include "ovsdb-parser.h"
#include <stdbool.h>
#include "compiler.h"
-#include "hmap.h"
-#include "shash.h"
+#include "openvswitch/hmap.h"
+#include "openvswitch/shash.h"
struct json;
struct uuid;
#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"
#include <limits.h>
-#include "json.h"
+#include "openvswitch/json.h"
#include "jsonrpc.h"
#include "ovsdb.h"
#include "poll-loop.h"
#include "Python.h"
-#include <openvswitch/lib/json.h>
+#include <openvswitch/json.h>
#include "structmember.h"
#if PY_MAJOR_VERSION >= 3
#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"
#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"
#include <config.h>
#undef NDEBUG
-#include "hmap.h"
+#include "openvswitch/hmap.h"
#include <assert.h>
#include <string.h>
#include "hash.h"
#include <config.h>
#undef NDEBUG
-#include "json.h"
+#include "openvswitch/json.h"
#include <ctype.h>
#include <errno.h>
#include <getopt.h>
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#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"