From 1147ab4f2843e6deee5fd07f2b716de7cbb1675b Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Thu, 30 Sep 2010 09:42:16 +0200 Subject: [PATCH] Allow building WITHOUT_STATS --- src/include/radiusd.h | 2 +- src/main/client.c | 2 ++ src/main/command.c | 7 ++++++- src/main/listen.c | 2 ++ src/main/radiusd.c | 2 ++ 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/include/radiusd.h b/src/include/radiusd.h index dbb128d..0c625b0 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -683,8 +683,8 @@ RADCLIENT *client_listener_find(const rad_listen_t *listener, #ifdef WITH_STATS RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr, int port); -rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port); #endif +rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port); /* event.c */ int radius_event_init(CONF_SECTION *cs, int spawn_flag); diff --git a/src/main/client.c b/src/main/client.c index 74875c7..35045df 100644 --- a/src/main/client.c +++ b/src/main/client.c @@ -428,7 +428,9 @@ void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client) client->dynamic = 2; /* signal to client_free */ +#ifdef WITH_STATS rbtree_deletebydata(tree_num, client); +#endif rbtree_deletebydata(clients->trees[client->prefix], client); } #endif diff --git a/src/main/command.c b/src/main/command.c index ea65905..351d1e6 100644 --- a/src/main/command.c +++ b/src/main/command.c @@ -1521,6 +1521,7 @@ static int command_set_module_status(rad_listen_t *listener, int argc, char *arg return 1; /* success */ } +#ifdef WITH_STATS static int command_print_stats(rad_listen_t *listener, fr_stats_t *stats, int auth) { @@ -1546,7 +1547,6 @@ static int command_print_stats(rad_listen_t *listener, fr_stats_t *stats, return 1; } - #ifdef WITH_DETAIL static FR_NAME_NUMBER state_names[] = { { "unopened", STATE_UNOPENED }, @@ -1700,6 +1700,7 @@ static int command_stats_client(rad_listen_t *listener, int argc, char *argv[]) return command_print_stats(listener, client->auth, auth); } +#endif /* WITH_STATS */ static int command_add_client_file(rad_listen_t *listener, int argc, char *argv[]) @@ -1833,6 +1834,7 @@ static fr_command_table_t command_table_set[] = { }; +#ifdef WITH_STATS static fr_command_table_t command_table_stats[] = { { "client", FR_READ, "stats client [auth/acct] " @@ -1855,6 +1857,7 @@ static fr_command_table_t command_table_stats[] = { { NULL, 0, NULL, NULL, NULL } }; +#endif static fr_command_table_t command_table[] = { { "add", FR_WRITE, NULL, NULL, command_table_add }, @@ -1876,7 +1879,9 @@ static fr_command_table_t command_table[] = { command_terminate, NULL }, { "set", FR_WRITE, NULL, NULL, command_table_set }, { "show", FR_READ, NULL, NULL, command_table_show }, +#ifdef WITH_STATS { "stats", FR_READ, NULL, NULL, command_table_stats }, +#endif { NULL, 0, NULL, NULL, NULL } }; diff --git a/src/main/listen.c b/src/main/listen.c index 54dc3a6..b6e2b4d 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -2445,6 +2445,7 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, const char *server) return this; } +#ifdef WITH_PROXY static int is_loopback(const fr_ipaddr_t *ipaddr) { /* @@ -2464,6 +2465,7 @@ static int is_loopback(const fr_ipaddr_t *ipaddr) return 0; } +#endif /* * Generate a list of listeners. Takes an input list of diff --git a/src/main/radiusd.c b/src/main/radiusd.c index dd4fec2..20ad58e 100644 --- a/src/main/radiusd.c +++ b/src/main/radiusd.c @@ -374,7 +374,9 @@ int main(int argc, char *argv[]) exit(0); } +#ifdef WITH_STATS radius_stats_init(0); +#endif /* * Only write the PID file if we're running as a daemon. -- 2.1.4