Data Structures | |
struct | nl_dump_params |
Dumping parameters. More... | |
Enumerations | |
enum | nl_dump_type { NL_DUMP_LINE, NL_DUMP_DETAILS, NL_DUMP_STATS, NL_DUMP_ENV, __NL_DUMP_MAX } |
Dumping types (dp_type) More... | |
Functions | |
int | __nl_read_num_str_file (const char *path, int(*cb)(long, const char *)) |
Variables | |
int | nl_debug = 0 |
Debug level. More... | |
struct nl_dump_params | nl_debug_dp |
Probability Constants | |
#define | NL_PROB_MIN 0x0 |
Lower probability limit. More... | |
#define | NL_PROB_MAX 0xffffffff |
Upper probability limit. More... | |
Unit Pretty-Printing | |
double | nl_cancel_down_bytes (unsigned long long l, char **unit) |
Cancel down a byte counter. More... | |
double | nl_cancel_down_bits (unsigned long long l, char **unit) |
Cancel down a bit counter. More... | |
double | nl_cancel_down_us (uint32_t l, char **unit) |
Cancel down a micro second value. More... | |
Generic Unit Translations | |
long | nl_size2int (const char *str) |
Convert a character string to a size. More... | |
long | nl_prob2int (const char *str) |
Convert a character string to a probability. More... | |
Time Translations | |
int | nl_get_hz (void) |
Return the value of HZ. More... | |
uint32_t | nl_us2ticks (uint32_t us) |
Convert micro seconds to ticks. More... | |
uint32_t | nl_ticks2us (uint32_t ticks) |
Convert ticks to micro seconds. More... | |
int | nl_str2msec (const char *str, uint64_t *result) |
char * | nl_msec2str (uint64_t msec, char *buf, size_t len) |
Convert milliseconds to a character string. More... | |
Netlink Family Translations | |
char * | nl_nlfamily2str (int family, char *buf, size_t size) |
int | nl_str2nlfamily (const char *name) |
Link Layer Protocol Translations | |
char * | nl_llproto2str (int llproto, char *buf, size_t len) |
int | nl_str2llproto (const char *name) |
Ethernet Protocol Translations | |
char * | nl_ether_proto2str (int eproto, char *buf, size_t len) |
int | nl_str2ether_proto (const char *name) |
IP Protocol Translations | |
char * | nl_ip_proto2str (int proto, char *buf, size_t len) |
int | nl_str2ip_proto (const char *name) |
Dumping Helpers | |
void | nl_new_line (struct nl_dump_params *params) |
Handle a new line while dumping. More... | |
void | nl_dump (struct nl_dump_params *params, const char *fmt,...) |
Dump a formatted character string. More... | |
void | nl_dump_line (struct nl_dump_params *parms, const char *fmt,...) |
#define NL_PROB_MAX 0xffffffff |
Upper probability limit.
Referenced by nl_prob2int().
#define NL_PROB_MIN 0x0 |
Lower probability limit.
enum nl_dump_type |
int __nl_read_num_str_file | ( | const char * | path, |
int(*)(long, const char *) | cb | ||
) |
References buf, nl_syserr2nlerr(), NLE_INVAL, NLE_RANGE, and NULL.
Referenced by rtnl_route_read_protocol_names(), and rtnl_route_read_table_names().
double nl_cancel_down_bits | ( | unsigned long long | l, |
char ** | unit | ||
) |
Cancel down a bit counter.
Cancels downa bit counter until it reaches a reasonable unit. The chosen unit is assigned to unit.
double nl_cancel_down_bytes | ( | unsigned long long | l, |
char ** | unit | ||
) |
Cancel down a byte counter.
Cancels down a byte counter until it reaches a reasonable unit. The chosen unit is assigned to unit.
double nl_cancel_down_us | ( | uint32_t | l, |
char ** | unit | ||
) |
Cancel down a micro second value.
Cancels down a microsecond counter until it reaches a reasonable unit. The chosen unit is assigned to unit.
void nl_dump | ( | struct nl_dump_params * | params, |
const char * | fmt, | ||
... | |||
) |
Dump a formatted character string.
Dumps a printf style formatting string to the output device as specified by the dumping parameters.
Referenced by nfnl_nft_data_dump(), print_prefix(), and rtnl_ematch_tree_dump().
void nl_dump_line | ( | struct nl_dump_params * | parms, |
const char * | fmt, | ||
... | |||
) |
char* nl_ether_proto2str | ( | int | eproto, |
char * | buf, | ||
size_t | len | ||
) |
int nl_get_hz | ( | void | ) |
Return the value of HZ.
char* nl_ip_proto2str | ( | int | proto, |
char * | buf, | ||
size_t | len | ||
) |
References buf.
char* nl_llproto2str | ( | int | llproto, |
char * | buf, | ||
size_t | len | ||
) |
char* nl_msec2str | ( | uint64_t | msec, |
char * | buf, | ||
size_t | len | ||
) |
Convert milliseconds to a character string.
Converts milliseconds to a character string split up in days, hours, minutes, seconds, and milliseconds and stores it in the specified destination buffer.
References _SPLIT, ARRAY_SIZE, and buf.
void nl_new_line | ( | struct nl_dump_params * | params | ) |
Handle a new line while dumping.
This function must be called before dumping any onto a new line. It will ensure proper prefixing as specified by the dumping parameters.
References nl_dump_params::dp_buf, nl_dump_params::dp_buflen, nl_dump_params::dp_fd, nl_dump_params::dp_line, nl_dump_params::dp_nl_cb, and nl_dump_params::dp_prefix.
Referenced by nl_dump_line().
char* nl_nlfamily2str | ( | int | family, |
char * | buf, | ||
size_t | size | ||
) |
References __type2str(), and ARRAY_SIZE.
Referenced by main().
long nl_prob2int | ( | const char * | str | ) |
Convert a character string to a probability.
Converts the specified probability as character to the corresponding probability number.
Supported formats are:
References NL_PROB_MAX, NLE_INVAL, and NLE_RANGE.
long nl_size2int | ( | const char * | str | ) |
Convert a character string to a size.
Converts the specified size as character to the corresponding number of bytes.
Supported formats are:
References NLE_INVAL.
int nl_str2ether_proto | ( | const char * | name | ) |
References __str2type(), and ARRAY_SIZE.
Referenced by parse_proto().
int nl_str2ip_proto | ( | const char * | name | ) |
References NLE_OBJ_NOTFOUND.
Referenced by nl_cli_ct_parse_protocol().
int nl_str2llproto | ( | const char * | name | ) |
int nl_str2msec | ( | const char * | str, |
uint64_t * | result | ||
) |
References NLE_INVAL.
int nl_str2nlfamily | ( | const char * | name | ) |
uint32_t nl_ticks2us | ( | uint32_t | ticks | ) |
Convert ticks to micro seconds.
Referenced by rtnl_netem_get_delay(), and rtnl_netem_get_jitter().
uint32_t nl_us2ticks | ( | uint32_t | us | ) |
Convert micro seconds to ticks.
Referenced by rtnl_netem_set_delay(), and rtnl_netem_set_jitter().
int nl_debug = 0 |
Debug level.
struct nl_dump_params nl_debug_dp |