libnl 3.7.0
utils.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef __NETLINK_CLI_UTILS_H_
7#define __NETLINK_CLI_UTILS_H_
8
9#include <stdio.h>
10#include <string.h>
11#include <stdlib.h>
12#include <stdarg.h>
13#include <limits.h>
14#include <inttypes.h>
15#include <errno.h>
16#include <stdint.h>
17#include <ctype.h>
18#include <getopt.h>
19#include <sys/types.h>
20#include <sys/socket.h>
21#include <sys/select.h>
22
23#include <netlink/netlink.h>
24#include <netlink/utils.h>
25#include <netlink/addr.h>
26#include <netlink/list.h>
27#include <netlink/route/rtnl.h>
28#include <netlink/route/link.h>
29#include <netlink/route/addr.h>
30#include <netlink/route/neighbour.h>
31#include <netlink/route/neightbl.h>
32#include <netlink/route/route.h>
33#include <netlink/route/rule.h>
34#include <netlink/route/qdisc.h>
35#include <netlink/route/class.h>
36#include <netlink/route/classifier.h>
37#include <netlink/route/cls/ematch.h>
38#include <netlink/fib_lookup/lookup.h>
39#include <netlink/fib_lookup/request.h>
40#include <netlink/genl/genl.h>
41#include <netlink/genl/ctrl.h>
42#include <netlink/genl/mngt.h>
43#include <netlink/netfilter/ct.h>
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49#ifndef __init
50#define __init __attribute__((constructor))
51#endif
52
53#ifndef __exit
54#define __exit __attribute__((destructor))
55#endif
56
57extern uint32_t nl_cli_parse_u32(const char *);
58extern void nl_cli_print_version(void)
59 __attribute__((noreturn));
60extern void nl_cli_fatal(int, const char *, ...)
61 __attribute__((noreturn));
62extern struct nl_addr * nl_cli_addr_parse(const char *, int);
63extern int nl_cli_connect(struct nl_sock *, int);
64extern struct nl_sock * nl_cli_alloc_socket(void);
65extern int nl_cli_parse_dumptype(const char *);
66extern int nl_cli_confirm(struct nl_object *,
67 struct nl_dump_params *, int);
68
69extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *,
70 int (*ac)(struct nl_sock *, struct nl_cache **));
71
72extern struct nl_cache *nl_cli_alloc_cache_flags(struct nl_sock *, const char *,
73 unsigned int flags,
74 int (*ac)(struct nl_sock *, struct nl_cache **, unsigned int));
75
76extern void nl_cli_load_module(const char *, const char *);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
void nl_cli_fatal(int, const char *,...) __attribute__((noreturn))
Print error message and quit application.
Definition: utils.c:71
uint32_t nl_cli_parse_u32(const char *)
Parse a text based 32 bit unsigned integer argument.
Definition: utils.c:36
Dumping parameters.
Definition: types.h:28