2 * src/utils.h Utilities
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
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
12 #ifndef __SRC_UTILS_H_
13 #define __SRC_UTILS_H_
22 #include <sys/types.h>
23 #include <sys/socket.h>
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 #include <netlink/genl/genl.h>
42 #include <netlink/genl/ctrl.h>
43 #include <netlink/genl/mngt.h>
44 #include <netlink/netfilter/ct.h>
46 extern int nltool_init(int argc, char *argv[]);
47 extern int nltool_connect(struct nl_handle *nlh, int protocol);
48 extern struct nl_addr *nltool_addr_parse(const char *str);
49 extern int nltool_parse_dumptype(const char *str);
50 extern struct nl_handle *nltool_alloc_handle(void);
52 extern struct nl_cache *nltool_alloc_link_cache(struct nl_handle *nlh);
53 extern struct nl_cache *nltool_alloc_addr_cache(struct nl_handle *nlh);
54 extern struct nl_cache *nltool_alloc_neigh_cache(struct nl_handle *nlh);
55 extern struct nl_cache *nltool_alloc_neightbl_cache(struct nl_handle *nlh);
56 extern struct nl_cache *nltool_alloc_route_cache(struct nl_handle *nlh);
57 extern struct nl_cache *nltool_alloc_rule_cache(struct nl_handle *nlh);
58 extern struct nl_cache *nltool_alloc_qdisc_cache(struct nl_handle *nlh);
59 extern struct nl_cache *nltool_alloc_genl_family_cache(struct nl_handle *nlh);
61 #define arg_match(str) !strcasecmp(argv[idx], str)