13#include "nl-default.h"
17#include <netlink/cli/utils.h>
18#include <netlink/cli/link.h>
31struct nl_cache *nl_cli_link_alloc_cache_family_flags(
struct nl_sock *sock,
35 struct nl_cache *cache;
47struct nl_cache *nl_cli_link_alloc_cache_family(
struct nl_sock *sock,
int family)
49 return nl_cli_link_alloc_cache_family_flags(sock, family, 0);
52struct nl_cache *nl_cli_link_alloc_cache(
struct nl_sock *sock)
54 return nl_cli_link_alloc_cache_family(sock, AF_UNSPEC);
57struct nl_cache *nl_cli_link_alloc_cache_flags(
struct nl_sock *sock,
60 return nl_cli_link_alloc_cache_family_flags(sock, AF_UNSPEC, flags);
63void nl_cli_link_parse_family(
struct rtnl_link *link,
char *arg)
67 if ((family = nl_str2af(arg)) < 0)
69 "Unable to translate address family \"%s\"", arg);
74void nl_cli_link_parse_name(
struct rtnl_link *link,
char *arg)
79void nl_cli_link_parse_mtu(
struct rtnl_link *link,
char *arg)
85void nl_cli_link_parse_ifindex(
struct rtnl_link *link,
char *arg)
91void nl_cli_link_parse_txqlen(
struct rtnl_link *link,
char *arg)
97void nl_cli_link_parse_weight(
struct rtnl_link *link,
char *arg)
101void nl_cli_link_parse_ifalias(
struct rtnl_link *link,
char *arg)
103 if (strlen(arg) > IFALIASZ)
105 "Link ifalias too big, must not exceed %u in length.",
void nl_cache_mngt_provide(struct nl_cache *cache)
Provide a cache for global use.
void nl_cli_fatal(int err, const char *fmt,...)
Print error message and quit application.
uint32_t nl_cli_parse_u32(const char *arg)
Parse a text based 32 bit unsigned integer argument.
void rtnl_link_set_mtu(struct rtnl_link *link, unsigned int mtu)
Set Maximum Transmission Unit of link object.
struct rtnl_link * rtnl_link_alloc(void)
Allocate link object.
void rtnl_link_set_ifalias(struct rtnl_link *link, const char *alias)
Set alias name of link object (SNMP IfAlias)
void rtnl_link_set_name(struct rtnl_link *link, const char *name)
Set name of link object.
int rtnl_link_alloc_cache_flags(struct nl_sock *sk, int family, struct nl_cache **result, unsigned int flags)
Allocate link cache and fill in all configured links.
void rtnl_link_set_family(struct rtnl_link *link, int family)
Set address family of link object.
void rtnl_link_set_txqlen(struct rtnl_link *link, unsigned int txqlen)
Set transmission queue length.
void rtnl_link_set_ifindex(struct rtnl_link *link, int ifindex)
Set interface index of link object.