libnl  3.2.24-rc1
Command Line Interface API

These modules provide an interface for text based applications. More...

Modules

 Addresses
 
 Classifiers
 
 Connection Tracking
 
 Expectation Tracking
 
 
 Neighbour
 
 Queueing Disciplines
 
 Routing
 
 Routing Rules
 
 Traffic Classes
 
 Traffic Control
 

Functions

uint32_t nl_cli_parse_u32 (const char *arg)
 Parse a text based 32 bit unsigned integer argument. More...
 
void nl_cli_print_version (void)
 
void nl_cli_fatal (int err, const char *fmt,...)
 Print error message and quit application. More...
 
int nl_cli_connect (struct nl_sock *sk, int protocol)
 
struct nl_sock * nl_cli_alloc_socket (void)
 
struct nl_addr * nl_cli_addr_parse (const char *str, int family)
 
int nl_cli_parse_dumptype (const char *str)
 
int nl_cli_confirm (struct nl_object *obj, struct nl_dump_params *params, int default_yes)
 
struct nl_cache * nl_cli_alloc_cache (struct nl_sock *sock, const char *name, int(*ac)(struct nl_sock *, struct nl_cache **))
 
void nl_cli_load_module (const char *prefix, const char *name)
 

Detailed Description

These modules provide an interface for text based applications.

The functions provided are wrappers for their libnl equivalent with added error handling. The functions check for allocation failures, invalid input, and unknown types and will print error messages accordingly via nl_cli_fatal().

Function Documentation

uint32_t nl_cli_parse_u32 ( const char *  arg)

Parse a text based 32 bit unsigned integer argument.

Parameters
argInteger in text form.

Tries to convert the number provided in arg to a uint32_t. Will call nl_cli_fatal() if the conversion fails.

Returns
32bit unsigned integer.

Definition at line 35 of file utils.c.

References nl_cli_fatal().

+ Here is the call graph for this function:

void nl_cli_fatal ( int  err,
const char *  fmt,
  ... 
)

Print error message and quit application.

Parameters
errError code.
fmtError message.

Prints the formatted error message to stderr and quits the application using the provided error code.

Definition at line 70 of file utils.c.

Referenced by nl_cli_parse_u32().

+ Here is the caller graph for this function: