12 #ifndef NETLINK_UTILS_H_
13 #define NETLINK_UTILS_H_
15 #include <netlink/netlink.h>
16 #include <netlink/list.h>
31 #define NL_PROB_MIN 0x0
37 #define NL_PROB_MAX 0xffffffff
49 extern int nl_rate2str(
unsigned long long,
int,
char *,
size_t);
54 extern char *
nl_size2str(
const size_t,
char *,
const size_t);
62 extern int nl_str2msec(
const char *, uint64_t *);
63 extern char *
nl_msec2str(uint64_t,
char *,
size_t);
66 extern char * nl_llproto2str(
int,
char *,
size_t);
67 extern int nl_str2llproto(
const char *);
70 extern char * nl_ether_proto2str(
int,
char *,
size_t);
71 extern int nl_str2ether_proto(
const char *);
74 extern char * nl_ip_proto2str(
int,
char *,
size_t);
75 extern int nl_str2ip_proto(
const char *);
80 extern void nl_dump_line(
struct nl_dump_params *,
const char *, ...);
91 #define NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE NL_CAPABILITY_ROUTE_BUILD_MSG_SET_SCOPE
97 NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE = 2,
98 #define NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE NL_CAPABILITY_ROUTE_LINK_VETH_GET_PEER_OWN_REFERENCE
104 NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE = 3,
105 #define NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE NL_CAPABILITY_ROUTE_LINK_CLS_ADD_ACT_OWN_REFERENCE
113 NL_CAPABILITY_NL_CONNECT_RETRY_GENERATE_PORT_ON_ADDRINUSE = 4,
114 #define NL_CAPABILITY_NL_CONNECT_RETRY_GENERATE_PORT_ON_ADDRINUSE NL_CAPABILITY_NL_CONNECT_RETRY_GENERATE_PORT_ON_ADDRINUSE
117 #define NL_CAPABILITY_MAX (__NL_CAPABILITY_MAX - 1)
119 int nl_has_capability (
int capability);
int nl_get_user_hz(void)
Return the value of HZ.
void nl_new_line(struct nl_dump_params *)
Handle a new line while dumping.
long nl_size2int(const char *)
Convert a character string to a size.
double nl_cancel_down_bits(unsigned long long, char **)
Cancel down a bit counter.
char * nl_msec2str(uint64_t, char *, size_t)
Convert milliseconds to a character string.
char * nl_size2str(const size_t, char *, const size_t)
Convert a size toa character string.
rtnl_route_build_msg() no longer guesses the route scope if explicitly set to RT_SCOPE_NOWHERE.
double nl_cancel_down_bytes(unsigned long long, char **)
Cancel down a byte counter.
double nl_cancel_down_us(uint32_t, char **)
Cancel down a micro second value.
int nl_get_psched_hz(void)
Return the value of packet scheduler HZ.
uint32_t nl_ticks2us(uint32_t)
Convert ticks to micro seconds.
long nl_prob2int(const char *)
Convert a character string to a probability.
uint32_t nl_us2ticks(uint32_t)
Convert micro seconds to ticks.
void nl_dump(struct nl_dump_params *, const char *,...)
Dump a formatted character string.