utils.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. #ifndef __NETLINK_CLI_UTILS_H_
  12. #define __NETLINK_CLI_UTILS_H_
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <stdlib.h>
  16. #include <stdarg.h>
  17. #include <limits.h>
  18. #include <inttypes.h>
  19. #include <errno.h>
  20. #include <stdint.h>
  21. #include <ctype.h>
  22. #include <getopt.h>
  23. #include <dlfcn.h>
  24. #include <sys/types.h>
  25. #include <sys/socket.h>
  26. #include <netlink/netlink.h>
  27. #include <netlink/utils.h>
  28. #include <netlink/addr.h>
  29. #include <netlink/list.h>
  30. #include <netlink/route/rtnl.h>
  31. #include <netlink/route/link.h>
  32. #include <netlink/route/addr.h>
  33. #include <netlink/route/neighbour.h>
  34. #include <netlink/route/neightbl.h>
  35. #include <netlink/route/route.h>
  36. #include <netlink/route/rule.h>
  37. #include <netlink/route/qdisc.h>
  38. #include <netlink/route/class.h>
  39. #include <netlink/route/classifier.h>
  40. #include <netlink/route/cls/ematch.h>
  41. #include <netlink/fib_lookup/lookup.h>
  42. #include <netlink/fib_lookup/request.h>
  43. #include <netlink/genl/genl.h>
  44. #include <netlink/genl/ctrl.h>
  45. #include <netlink/genl/mngt.h>
  46. #include <netlink/netfilter/ct.h>
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. #ifndef __init
  51. #define __init __attribute__((constructor))
  52. #endif
  53. #ifndef __exit
  54. #define __exit __attribute__((destructor))
  55. #endif
  56. extern uint32_t nl_cli_parse_u32(const char *);
  57. extern void nl_cli_print_version(void);
  58. extern void nl_cli_fatal(int, const char *, ...);
  59. extern struct nl_addr * nl_cli_addr_parse(const char *, int);
  60. extern int nl_cli_connect(struct nl_sock *, int);
  61. extern struct nl_sock * nl_cli_alloc_socket(void);
  62. extern int nl_cli_parse_dumptype(const char *);
  63. extern int nl_cli_confirm(struct nl_object *,
  64. struct nl_dump_params *, int);
  65. extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *,
  66. int (*ac)(struct nl_sock *, struct nl_cache **));
  67. extern void nl_cli_load_module(const char *, const char *);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif