=== modified file 'plugin-helpers/mandos-client-iprouteadddel.c' --- plugin-helpers/mandos-client-iprouteadddel.c 2015-07-05 18:36:23 +0000 +++ plugin-helpers/mandos-client-iprouteadddel.c 2015-07-05 21:38:01 +0000 @@ -24,27 +24,50 @@ #define _GNU_SOURCE /* asprintf(), program_invocation_short_name */ -#include /* not, or, and */ #include /* bool, false, true */ -#include /* vfprintf(), stderr, stdout */ +#include /* fprintf(), stderr, FILE, vfprintf */ +#include /* program_invocation_short_name, + errno, perror(), EINVAL, ENOMEM */ #include /* va_list, va_start */ -#include /* perror(), errno, - program_invocation_short_name */ +#include /* EXIT_SUCCESS */ #include /* struct argp_option, error_t, struct - argp_state, struct argp, - argp_parse(), ARGP_KEY_ARG, - ARGP_KEY_END, ARGP_ERR_UNKNOWN */ + argp_state, ARGP_KEY_ARG, + argp_usage(), ARGP_KEY_END, + ARGP_ERR_UNKNOWN, struct argp, + argp_parse() */ +#include /* EX_USAGE, EX_OSERR */ +#include /* sa_family_t, AF_INET6, AF_INET */ #include /* PRIdMAX, intmax_t */ -#include /* EX_OSERR */ -/* #include */ -/* #include */ -/* #include */ -#include -#include -#include -#include /* libnl xxx */ -#include /* libnl xxx */ +#include /* struct nl_addr, nl_addr_parse(), + nl_geterror(), + nl_addr_get_family(), + nl_addr_put() */ +#include /* struct rtnl_route, + struct rtnl_nexthop, + rtnl_route_alloc(), + rtnl_route_set_family(), + rtnl_route_set_protocol(), + RTPROT_BOOT, + rtnl_route_set_scope(), + RT_SCOPE_LINK, + rtnl_route_set_type(), + RTN_UNICAST, + rtnl_route_set_dst(), + rtnl_route_set_table(), + RT_TABLE_MAIN, + rtnl_route_nh_alloc(), + rtnl_route_nh_set_ifindex(), + rtnl_route_add_nexthop(), + rtnl_route_add(), + rtnl_route_delete(), + rtnl_route_put(), + rtnl_route_nh_free() */ +#include /* struct nl_sock, nl_socket_alloc(), + nl_connect(), nl_socket_free() */ +#include /* rtnl_link_get_kernel(), + rtnl_link_get_ifindex(), + rtnl_link_put() */ bool debug = false; const char *argp_program_version = "mandos-client-iprouteadddel " VERSION; @@ -208,7 +231,7 @@ /* Create nexthop */ nexthop = rtnl_route_nh_alloc(); if(nexthop == NULL){ - fprintf_plus(stderr, "Failed to get netlink route nexthop:\n"); + fprintf_plus(stderr, "Failed to get netlink route nexthop\n"); exitcode = EX_OSERR; goto end; }