| 1 |
/* SPDX-License-Identifier: LGPL-2.1-only */ |
| 2 |
/* |
| 3 |
* Copyright (c) 2003-2009 Thomas Graf <[email protected]> |
| 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 |
| 46 |
extern "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 |
|
| 57 |
extern uint32_t nl_cli_parse_u32(const char *); |
| 58 |
extern void nl_cli_print_version(void) |
| 59 |
__attribute__((noreturn)); |
| 60 |
extern void nl_cli_fatal(int, const char *, ...) |
| 61 |
__attribute__((noreturn)); |
| 62 |
extern struct nl_addr * nl_cli_addr_parse(const char *, int); |
| 63 |
extern int nl_cli_connect(struct nl_sock *, int); |
| 64 |
extern struct nl_sock * nl_cli_alloc_socket(void); |
| 65 |
extern int nl_cli_parse_dumptype(const char *); |
| 66 |
extern int nl_cli_confirm(struct nl_object *, |
| 67 |
struct nl_dump_params *, int); |
| 68 |
|
| 69 |
extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *, |
| 70 |
int (*ac)(struct nl_sock *, struct nl_cache **)); |
| 71 |
|
| 72 |
extern 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 |
|
| 76 |
extern void nl_cli_load_module(const char *, const char *); |
| 77 |
|
| 78 |
#ifdef __cplusplus |
| 79 |
} |
| 80 |
#endif |
| 81 |
|
| 82 |
#endif |