libnl: Command Line Interface API

libnl 3.7.0

Modules | Functions
Command Line Interface API

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

## Modules
| Addresses
| Classifiers
| Connection Tracking
| Expectation Tracking
| Links
| 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 **))
struct nl_cache * | nl_cli_alloc_cache_flags (struct nl_sock *sock, const char *name, unsigned int flags, int(*ac)(struct nl_sock *, struct nl_cache **, unsigned int))
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

## ◆ nl_cli_parse_u32()

uint32_t nl_cli_parse_u32 | ( | const char * | arg | ) |

Parse a text based 32 bit unsigned integer argument.

Parameters

  arg | Integer 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 36 of file utils.c.

References nl_cli_fatal().

Here is the call graph for this function:

## ◆ nl_cli_fatal()

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

Print error message and quit application.

Parameters

  err | Error code.
  fmt | Error message.

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

Definition at line 71 of file utils.c.

Referenced by nl_cli_parse_u32().

Here is the caller graph for this function: