summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEyal Birger <eyal.birger@gmail.com>2019-04-07 14:09:34 (GMT)
committerThomas Haller <thaller@redhat.com>2019-09-01 12:24:52 (GMT)
commitd147019c4bbb856be13042d89e95b859f01c808d (patch)
tree130c345e0b1ae464bcdf45dd7d699828f69613bc /doc
parent4b9370c6c994659360e5b14ef80f6afec75422f8 (diff)
downloadlibnl-d147019c4bbb856be13042d89e95b859f01c808d.zip
libnl-d147019c4bbb856be13042d89e95b859f01c808d.tar.gz
libnl-d147019c4bbb856be13042d89e95b859f01c808d.tar.bz2
xfrmi: introduce XFRM interfaces support
XFRM interfaces were introduced in kernel 4.19. This commit adds link support for these interfaces. Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/route.txt43
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/route.txt b/doc/route.txt
index 6a0dbb9..9d4c23a 100644
--- a/doc/route.txt
+++ b/doc/route.txt
@@ -1257,6 +1257,49 @@ rtnl_link_put(link);
-----
+[[link_xfrmi]]
+==== XFRMI
+
+[source,c]
+-----
+extern struct rtnl_link *rtnl_link_xfrmi_alloc(void);
+
+extern int rtnl_link_xfrmi_set_link(struct rtnl_link *link, uint32_t index);
+extern uint32_t rtnl_link_xfrmi_get_link(struct rtnl_link *link);
+
+extern int rtnl_link_xfrmi_set_if_id(struct rtnl_link *link, uint32_t if_id);
+extern uint32_t rtnl_link_xfrmi_get_if_id(struct rtnl_link *link);
+
+-----
+
+.Example: Add a xfrmi device
+[source,c]
+-----
+struct rtnl_link *link
+struct in_addr addr
+
+/* allocate new link object of type xfrmi */
+if(!(link = rtnl_link_xfrmi_alloc()))
+ /* error */
+
+/* set xfrmi name */
+if ((err = rtnl_link_set_name(link, "ipsec0")) < 0)
+ /* error */
+
+/* set link index */
+if ((err = rtnl_link_xfrmi_set_link(link, if_index)) < 0)
+ /* error */
+
+/* set if_id */
+if ((err = rtnl_link_xfrmi_set_if_id(link, 16)) < 0)
+ /* error */
+
+if((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0)
+ /* error */
+
+rtnl_link_put(link);
+-----
+
== Neighbouring
== Routing