summaryrefslogtreecommitdiffstats
path: root/lib/route
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-03-04 13:15:34 (GMT)
committerThomas Haller <thaller@redhat.com>2015-03-04 13:55:38 (GMT)
commite89aec9bc13c18f7da7b5683d02d7ddfc45edb92 (patch)
tree00457bf58985548cd73a60a2a3cfe61538a5cc1f /lib/route
parent4ff512b054560c66ca0dbbb2d602b4231f050315 (diff)
downloadlibnl-e89aec9bc13c18f7da7b5683d02d7ddfc45edb92.zip
libnl-e89aec9bc13c18f7da7b5683d02d7ddfc45edb92.tar.gz
libnl-e89aec9bc13c18f7da7b5683d02d7ddfc45edb92.tar.bz2
route/tc: add internal rtnl_tc_data_peek() function
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/route')
-rw-r--r--lib/route/tc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/route/tc.c b/lib/route/tc.c
index b24c06e..579405e 100644
--- a/lib/route/tc.c
+++ b/lib/route/tc.c
@@ -1026,6 +1026,19 @@ void rtnl_tc_unregister(struct rtnl_tc_ops *ops)
}
/**
+ * Returns the private data of the traffic control object.
+ * Contrary to rtnl_tc_data(), this returns NULL if the data is
+ * not yet allocated
+ * @arg tc traffic control object
+ *
+ * @return pointer to the private data or NULL if not allocated.
+ */
+void *rtnl_tc_data_peek(struct rtnl_tc *tc)
+{
+ return tc->tc_subdata ? nl_data_get(tc->tc_subdata) : NULL;
+}
+
+/**
* Return pointer to private data of traffic control object
* @arg tc traffic control object
*