diff options
author | Susant Sahani <susant@redhat.com> | 2014-05-06 05:41:30 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-05-06 10:04:02 (GMT) |
commit | 8f6301426a00d992d00238c7ddd666e96aa63e28 (patch) | |
tree | 264d1e1d44daf9ce6ff5d2448538b55e0dfc0567 /doc | |
parent | adb9f5d8fa605a458dbd97411564fae2584af2f7 (diff) | |
download | libnl-8f6301426a00d992d00238c7ddd666e96aa63e28.zip libnl-8f6301426a00d992d00238c7ddd666e96aa63e28.tar.gz libnl-8f6301426a00d992d00238c7ddd666e96aa63e28.tar.bz2 |
ipvti: introduce vti tunnel support
Signed-off-by: Susant Sahani <susant@redhat.com>
[thaller@redhat.com: some whitespace fixes]
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/route.txt | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/doc/route.txt b/doc/route.txt index f70ad87..d87e79f 100644 --- a/doc/route.txt +++ b/doc/route.txt @@ -1081,6 +1081,66 @@ rtnl_link_put(link); ----- +[[link_ipvti]] +==== IPVTI + +[source,c] +----- +extern struct rtnl_link *rtnl_link_ipvti_alloc(void); +extern int rtnl_link_ipvti_add(struct nl_sock *sk, const char *name); + +extern int rtnl_link_ipvti_set_link(struct rtnl_link *link, uint32_t index); +extern uint32_t rtnl_link_ipvti_get_link(struct rtnl_link *link); + +extern int rtnl_link_ipvti_set_ikey(struct rtnl_link *link, uint32_t ikey); +extern uint32_t rtnl_link_get_ikey(struct rtnl_link *link); + +extern int rtnl_link_ipvti_set_okey(struct rtnl_link *link, uint32_t okey); +extern uint32_t rtnl_link_get_okey(struct rtnl_link *link) + +extern int rtnl_link_ipvti_set_local(struct rtnl_link *link, uint32_t addr); +extern uint32_t rtnl_link_ipvti_get_local(struct rtnl_link *link); + +extern int rtnl_link_ipvti_set_remote(struct rtnl_link *link, uint32_t addr); +extern uint32_t rtnl_link_ipvti_get_remote(struct rtnl_link *link); + +----- + +.Example: Add a ipvti tunnel device +[source,c] +----- +struct rtnl_link *link +struct in_addr addr + +/* allocate new link object of type vxlan */ +if(!(link = rtnl_link_ipvti_alloc())) + /* error */ + +/* set ipvti tunnel name */ +if ((err = rtnl_link_set_name(link, "ipvti-tun")) < 0) + /* error */ + +/* set link index */ +if ((err = rtnl_link_ipvti_set_link(link, if_index)) < 0) + /* error */ + +/* set local address */ +inet_pton(AF_INET, "192.168.254.12", &addr.s_addr); +if ((err = rtnl_link_ipvti_set_local(link, addr.s_addr)) < 0) + /* error */ + +/* set remote address */ +inet_pton(AF_INET, "192.168.254.13", &addr.s_addr +if ((err = rtnl_link_ipvti_set_remote(link, addr.s_addr)) < 0) + /* error */ + +if((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) + /* error */ + +rtnl_link_put(link); +----- + + == Neighbouring == Routing |