From partner, with minor changes.
#include "list.h"
#include "openflow/openflow.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Number of bytes of fields in a rule. */
#define CLS_N_BYTES 31
char *cls_rule_to_string(const struct cls_rule *);
void cls_rule_print(const struct cls_rule *);
void cls_rule_moved(struct classifier *,
- struct cls_rule *old, struct cls_rule *new);
-void cls_rule_replace(struct classifier *, const struct cls_rule *old,
- struct cls_rule *new);
+ struct cls_rule *old_rule, struct cls_rule *new_rule);
+void cls_rule_replace(struct classifier *, const struct cls_rule *old_rule,
+ struct cls_rule *new_rule);
void classifier_init(struct classifier *);
void classifier_destroy(struct classifier *);
struct cls_rule *classifier_find_rule_exactly(const struct classifier *,
const flow_t *target);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* classifier.h */
/*
- * Copyright (c) 2008, 2009 Nicira Networks.
+ * Copyright (c) 2008, 2009, 2010 Nicira Networks.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <string.h>
#include "util.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This is the public domain lookup3 hash by Bob Jenkins from
* http://burtleburtle.net/bob/c/lookup3.c, modified for style. */
* quality. */
static inline uint32_t hash_boolean(bool x, uint32_t basis)
{
- enum { P0 = 0xc2b73583 }; /* This is hash_int(1, 0). */
- enum { P1 = 0xe90f1258 }; /* This is hash_int(2, 0). */
+ const uint32_t P0 = 0xc2b73583; /* This is hash_int(1, 0). */
+ const uint32_t P1 = 0xe90f1258; /* This is hash_int(2, 0). */
return (x ? P0 : P1) ^ HASH_ROT(basis, 1);
}
return hash_int((uint32_t) (uintptr_t) p, basis);
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* hash.h */
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);
+ struct hmap_node *new_node);
/* Search.
*