oops
[libnl.git] / src / utils.h
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-2006 Thomas Graf <tgraf@suug.ch>
10  */
11
12 #ifndef __SRC_UTILS_H_
13 #define __SRC_UTILS_H_
14
15 #include <stdio.h>
16 #include <string.h>
17 #include <stdlib.h>
18 #include <inttypes.h>
19 #include <errno.h>
20 #include <stdint.h>
21 #include <getopt.h>
22 #include <sys/types.h>
23 #include <sys/socket.h>
24
25 #include <netlink-local.h>
26 #include <netlink/netlink.h>
27 #include <netlink/utils.h>
28 #include <netlink/addr.h>
29 #include <netlink/route/rtnl.h>
30 #include <netlink/route/link.h>
31 #include <netlink/route/addr.h>
32 #include <netlink/route/neighbour.h>
33 #include <netlink/route/neightbl.h>
34 #include <netlink/route/route.h>
35 #include <netlink/route/rule.h>
36 #include <netlink/route/qdisc.h>
37 #include <netlink/route/class.h>
38 #include <netlink/route/classifier.h>
39 #include <netlink/fib_lookup/lookup.h>
40 #include <netlink/fib_lookup/request.h>
41
42 extern int nltool_init(int argc, char *argv[]);
43 extern int nltool_connect(struct nl_handle *nlh, int protocol);
44 extern struct nl_addr *nltool_addr_parse(const char *str);
45 extern int nltool_parse_dumptype(const char *str);
46
47 extern struct nl_cache *nltool_alloc_link_cache(struct nl_handle *nlh);
48 extern struct nl_cache *nltool_alloc_addr_cache(struct nl_handle *nlh);
49 extern struct nl_cache *nltool_alloc_neigh_cache(struct nl_handle *nlh);
50 extern struct nl_cache *nltool_alloc_neightbl_cache(struct nl_handle *nlh);
51 extern struct nl_cache *nltool_alloc_route_cache(struct nl_handle *nlh);
52 extern struct nl_cache *nltool_alloc_rule_cache(struct nl_handle *nlh);
53 extern struct nl_cache *nltool_alloc_qdisc_cache(struct nl_handle *nlh);
54
55 extern int nltool_cbset;
56
57 #define arg_match(str) !strcasecmp(argv[idx], str)
58
59 #endif