summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-12-18 17:50:03 (GMT)
committerThomas Haller <thaller@redhat.com>2016-02-12 17:09:04 (GMT)
commita09b8558148b31e469d463907d103fa78d81612c (patch)
tree0ecd7ff2d09af28256b69d612beea3f0a6aff3ca /include
parent58396ae2ae7c91fb95d1de9654be5b12fd2343d2 (diff)
downloadlibnl-a09b8558148b31e469d463907d103fa78d81612c.zip
libnl-a09b8558148b31e469d463907d103fa78d81612c.tar.gz
libnl-a09b8558148b31e469d463907d103fa78d81612c.tar.bz2
lib: update ce-mask to uint64_t
lib/route/link.c already defines 32 attributes which fills the current uint32_t used for ce_mask. To accommodate more attributes the mask needs to be expanded. This patch updates the definition to uint64_t. The nl_object_diff API is maintained for ABI with existing users. A new nl_object_diff64 API is added for the expanded attribute list. The MSB of the 32-bit API is used to indicate if higher order attributes had a mismatch. (Suggested by Thomas). Note that LINK_ATTR_LINK_NETNSID changes. But since the attribute flags are not public API it shouldn't be a problem. http://lists.infradead.org/pipermail/libnl/2015-December/002078.html http://lists.infradead.org/pipermail/libnl/2015-December/002083.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/netlink-private/netlink.h2
-rw-r--r--include/netlink-private/object-api.h10
-rw-r--r--include/netlink-private/route/tc-api.h4
-rw-r--r--include/netlink/object.h2
4 files changed, 11 insertions, 7 deletions
diff --git a/include/netlink-private/netlink.h b/include/netlink-private/netlink.h
index 6d40ea5..befd301 100644
--- a/include/netlink-private/netlink.h
+++ b/include/netlink-private/netlink.h
@@ -71,7 +71,7 @@
#define NSEC_PER_SEC 1000000000L
struct trans_tbl {
- int i;
+ uint64_t i;
const char *a;
};
diff --git a/include/netlink-private/object-api.h b/include/netlink-private/object-api.h
index f4fd71e..517e672 100644
--- a/include/netlink-private/object-api.h
+++ b/include/netlink-private/object-api.h
@@ -126,6 +126,8 @@ extern "C" {
* #define MY_ATTR_FOO (1<<0)
* #define MY_ATTR_BAR (1<<1)
*
+ * // Bit 31 for attributes is reserved for 32-bit API.
+ *
* // When assigning an optional attribute to the object, make sure
* // to mark its availability.
* my_obj->foo = 123123;
@@ -189,7 +191,7 @@ extern "C" {
struct nl_list_head ce_list; \
int ce_msgtype; \
int ce_flags; \
- uint32_t ce_mask;
+ uint64_t ce_mask;
struct nl_object
{
@@ -258,7 +260,7 @@ struct nl_object
* @endcode
*/
#define ATTR_DIFF(LIST, ATTR, A, B, EXPR) \
-({ int diff = 0; \
+({ uint64_t diff = 0; \
if (((LIST) & (ATTR)) && ATTR_MISMATCH(A, B, ATTR, EXPR)) \
diff = ATTR; \
diff; })
@@ -333,8 +335,8 @@ struct nl_object_ops
* The function must return a bitmask with the relevant bit
* set for each attribute that mismatches.
*/
- int (*oo_compare)(struct nl_object *, struct nl_object *,
- uint32_t, int);
+ uint64_t (*oo_compare)(struct nl_object *, struct nl_object *,
+ uint64_t, int);
/**
diff --git a/include/netlink-private/route/tc-api.h b/include/netlink-private/route/tc-api.h
index fbfa2ab..7158ce5 100644
--- a/include/netlink-private/route/tc-api.h
+++ b/include/netlink-private/route/tc-api.h
@@ -110,9 +110,9 @@ extern void rtnl_tc_dump_details(struct nl_object *,
struct nl_dump_params *);
extern void rtnl_tc_dump_stats(struct nl_object *,
struct nl_dump_params *);
-extern int rtnl_tc_compare(struct nl_object *,
+extern uint64_t rtnl_tc_compare(struct nl_object *,
struct nl_object *,
- uint32_t, int);
+ uint64_t, int);
void * rtnl_tc_data_peek(struct rtnl_tc *tc);
extern void * rtnl_tc_data(struct rtnl_tc *);
diff --git a/include/netlink/object.h b/include/netlink/object.h
index a95feda..b0c32c9 100644
--- a/include/netlink/object.h
+++ b/include/netlink/object.h
@@ -43,6 +43,8 @@ extern int nl_object_identical(struct nl_object *,
struct nl_object *);
extern uint32_t nl_object_diff(struct nl_object *,
struct nl_object *);
+extern uint64_t nl_object_diff64(struct nl_object *,
+ struct nl_object *);
extern int nl_object_match_filter(struct nl_object *,
struct nl_object *);
extern char * nl_object_attrs2str(struct nl_object *,