1/*
2 * src/utils.h		Utilities
3 *
4 *	This library is free software; you can redistribute it and/or
5 *	modify it under the terms of the GNU Lesser General Public
6 *	License as published by the Free Software Foundation version 2.1
7 *	of the License.
8 *
9 * Copyright (c) 2003-2009 Thomas Graf <tgraf@suug.ch>
10 */
11
12#ifndef __NETLINK_CLI_UTILS_H_
13#define __NETLINK_CLI_UTILS_H_
14
15#include <stdio.h>
16#include <string.h>
17#include <stdlib.h>
18#include <stdarg.h>
19#include <limits.h>
20#include <inttypes.h>
21#include <errno.h>
22#include <stdint.h>
23#include <ctype.h>
24#include <getopt.h>
25#include <dlfcn.h>
26#include <sys/types.h>
27#include <sys/socket.h>
28
29#include <netlink/netlink.h>
30#include <netlink/utils.h>
31#include <netlink/addr.h>
32#include <netlink/list.h>
33#include <netlink/route/rtnl.h>
34#include <netlink/route/link.h>
35#include <netlink/route/addr.h>
36#include <netlink/route/neighbour.h>
37#include <netlink/route/neightbl.h>
38#include <netlink/route/route.h>
39#include <netlink/route/rule.h>
40#include <netlink/route/qdisc.h>
41#include <netlink/route/class.h>
42#include <netlink/route/classifier.h>
43#include <netlink/route/cls/ematch.h>
44#include <netlink/fib_lookup/lookup.h>
45#include <netlink/fib_lookup/request.h>
46#include <netlink/genl/genl.h>
47#include <netlink/genl/ctrl.h>
48#include <netlink/genl/mngt.h>
49#include <netlink/netfilter/ct.h>
50
51#ifdef __cplusplus
52extern "C" {
53#endif
54
55#ifndef __init
56#define __init __attribute__((constructor))
57#endif
58
59#ifndef __exit
60#define __exit __attribute__((destructor))
61#endif
62
63extern uint32_t		nl_cli_parse_u32(const char *);
64extern void		nl_cli_print_version(void);
65extern void		nl_cli_fatal(int, const char *, ...);
66extern struct nl_addr *	nl_cli_addr_parse(const char *, int);
67extern int		nl_cli_connect(struct nl_sock *, int);
68extern struct nl_sock *	nl_cli_alloc_socket(void);
69extern int		nl_cli_parse_dumptype(const char *);
70extern int		nl_cli_confirm(struct nl_object *,
71				       struct nl_dump_params *, int);
72
73extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *,
74			     int (*ac)(struct nl_sock *, struct nl_cache **));
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif
81