diff options
author | Yasunobu Chiba <yasu@dsl.gr.jp> | 2013-08-04 06:43:54 (GMT) |
---|---|---|
committer | Yasunobu Chiba <yasu@dsl.gr.jp> | 2013-08-04 06:43:54 (GMT) |
commit | 162c906bf2d323b69ab2044ea03545360e71da16 (patch) | |
tree | 7c9c3b91fb91f5ad76109a8fdbed3b2712063ae2 /doc | |
parent | b3fb89f445108677d405c62865b25aeea209d10a (diff) | |
download | libnl-162c906bf2d323b69ab2044ea03545360e71da16.zip libnl-162c906bf2d323b69ab2044ea03545360e71da16.tar.gz libnl-162c906bf2d323b69ab2044ea03545360e71da16.tar.bz2 |
Add VXLAN support.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/route.txt | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/doc/route.txt b/doc/route.txt index 6c97f7b..922ba7b 100644 --- a/doc/route.txt +++ b/doc/route.txt @@ -763,6 +763,101 @@ if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) rtnl_link_put(link); ----- +[[link_vxlan]] +==== VXLAN + +[source,c] +----- +extern struct rtnl_link *rtnl_link_vxlan_alloc(void); + +extern int rtnl_link_is_vxlan(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_id(struct rtnl_link *, uint32_t); +extern int rtnl_link_vxlan_get_id(struct rtnl_link *, uint32_t *); + +extern int rtnl_link_vxlan_set_group(struct rtnl_link *, struct nl_addr *); +extern int rtnl_link_vxlan_get_group(struct rtnl_link *, struct nl_addr **); + +extern int rtnl_link_vxlan_set_link(struct rtnl_link *, uint32_t); +extern int rtnl_link_vxlan_get_link(struct rtnl_link *, uint32_t *); + +extern int rtnl_link_vxlan_set_local(struct rtnl_link *, struct nl_addr *); +extern int rtnl_link_vxlan_get_local(struct rtnl_link *, struct nl_addr **); + +extern int rtnl_link_vxlan_set_ttl(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_ttl(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_tos(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_tos(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_learning(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_learning(struct rtnl_link *); +extern int rtnl_link_vxlan_enable_learning(struct rtnl_link *); +extern int rtnl_link_vxlan_disable_learning(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_ageing(struct rtnl_link *, uint32_t); +extern int rtnl_link_vxlan_get_ageing(struct rtnl_link *, uint32_t *); + +extern int rtnl_link_vxlan_set_limit(struct rtnl_link *, uint32_t); +extern int rtnl_link_vxlan_get_limit(struct rtnl_link *, uint32_t *); + +extern int rtnl_link_vxlan_set_port_range(struct rtnl_link *, + struct ifla_vxlan_port_range *); +extern int rtnl_link_vxlan_get_port_range(struct rtnl_link *, + struct ifla_vxlan_port_range *); + +extern int rtnl_link_vxlan_set_proxy(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_proxy(struct rtnl_link *); +extern int rtnl_link_vxlan_enable_proxy(struct rtnl_link *); +extern int rtnl_link_vxlan_disable_proxy(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_rsc(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_rsc(struct rtnl_link *); +extern int rtnl_link_vxlan_enable_rsc(struct rtnl_link *); +extern int rtnl_link_vxlan_disable_rsc(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_l2miss(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_l2miss(struct rtnl_link *); +extern int rtnl_link_vxlan_enable_l2miss(struct rtnl_link *); +extern int rtnl_link_vxlan_disable_l2miss(struct rtnl_link *); + +extern int rtnl_link_vxlan_set_l3miss(struct rtnl_link *, uint8_t); +extern int rtnl_link_vxlan_get_l3miss(struct rtnl_link *); +extern int rtnl_link_vxlan_enable_l3miss(struct rtnl_link *); +extern int rtnl_link_vxlan_disable_l3miss(struct rtnl_link *); +----- + +.Example: Add a VXLAN device +[source,c] +----- +struct rtnl_link *link; +struct nl_addr* addr; + +/* allocate new link object of type vxlan */ +link = rtnl_link_vxlan_alloc(); + +/* set interface name */ +rtnl_link_set_name(link, "vxlan128"); + +/* set VXLAN network identifier */ +if ((err = rtnl_link_vxlan_set_id(link, 128)) < 0) + /* error */ + +/* set multicast address to join */ +if ((err = nl_addr_parse("239.0.0.1", AF_INET, &addr)) < 0) + /* error */ + +if ((err = rtnl_link_set_group(link, addr)) < 0) + /* error */ + +nl_addr_put(addr); + +if ((err = rtnl_link_add(sk, link, NLM_F_CREATE)) < 0) + /* error */ + +rtnl_link_put(link); +----- + == Neighbouring == Routing |