summaryrefslogtreecommitdiffstats
path: root/include/netlink
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-19 11:22:12 (GMT)
committerThomas Haller <thaller@redhat.com>2015-03-19 11:26:53 (GMT)
commit860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21 (patch)
tree5a4b9b8b2219ccba47370a7daefa1d76f65d5d4a /include/netlink
parentff19c781d3b655aba3dcf07a68537c7bae2468b5 (diff)
downloadlibnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.zip
libnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.tar.gz
libnl-860ea27a466cfbe1fdc879ef9eb6e67fb5eaae21.tar.bz2
utils: add code comment about capability number assignment
Also reserve a range of capabilities (0x7000 to 0x7FFF) that we won't use upstream. Add a macro NL_CAPABILITY_IS_USER_RESERVED() to check if the capability is in that range. Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include/netlink')
-rw-r--r--include/netlink/utils.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/netlink/utils.h b/include/netlink/utils.h
index a172f3a..c609c6c 100644
--- a/include/netlink/utils.h
+++ b/include/netlink/utils.h
@@ -129,8 +129,15 @@ enum {
NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO = 6,
#define NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO NL_CAPABILITY_ROUTE_ADDR_COMPARE_CACHEINFO
- __NL_CAPABILITY_MAX
-#define NL_CAPABILITY_MAX (__NL_CAPABILITY_MAX - 1)
+ __NL_CAPABILITY_MAX,
+ NL_CAPABILITY_MAX = (__NL_CAPABILITY_MAX - 1),
+#define NL_CAPABILITY_MAX NL_CAPABILITY_MAX
+
+ /**
+ * The range 0x7000 to 0x7FFF is reserved for private capabilities. Upstream libnl3 will
+ * not register capabilities in this range. However, instead of adding private capabilities,
+ * better register their number with upstream libnl3. */
+#define NL_CAPABILITY_IS_USER_RESERVED(cap) ( ((cap) & ~0x0FFF) == 0x7000 )
};
int nl_has_capability (int capability);