Allow building WITHOUT_STATS
authorAlan T. DeKok <aland@freeradius.org>
Thu, 30 Sep 2010 07:42:16 +0000 (09:42 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 30 Sep 2010 07:42:16 +0000 (09:42 +0200)
src/include/radiusd.h
src/main/client.c
src/main/command.c
src/main/listen.c
src/main/radiusd.c

index dbb128d..0c625b0 100644 (file)
@@ -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);
 #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
 #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);
 
 /* event.c */
 int radius_event_init(CONF_SECTION *cs, int spawn_flag);
index 74875c7..35045df 100644 (file)
@@ -428,7 +428,9 @@ void client_delete(RADCLIENT_LIST *clients, RADCLIENT *client)
 
        client->dynamic = 2;    /* signal to client_free */
 
 
        client->dynamic = 2;    /* signal to client_free */
 
+#ifdef WITH_STATS
        rbtree_deletebydata(tree_num, client);
        rbtree_deletebydata(tree_num, client);
+#endif
        rbtree_deletebydata(clients->trees[client->prefix], client);
 }
 #endif
        rbtree_deletebydata(clients->trees[client->prefix], client);
 }
 #endif
index ea65905..351d1e6 100644 (file)
@@ -1521,6 +1521,7 @@ static int command_set_module_status(rad_listen_t *listener, int argc, char *arg
        return 1;               /* success */
 }
 
        return 1;               /* success */
 }
 
+#ifdef WITH_STATS
 static int command_print_stats(rad_listen_t *listener, fr_stats_t *stats,
                               int auth)
 {
 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;
 }
 
        return 1;
 }
 
-
 #ifdef WITH_DETAIL
 static FR_NAME_NUMBER state_names[] = {
        { "unopened", STATE_UNOPENED },
 #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);
 }
 
        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[])
 
 
 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] <ipaddr> "
 static fr_command_table_t command_table_stats[] = {
        { "client", FR_READ,
          "stats client [auth/acct] <ipaddr> "
@@ -1855,6 +1857,7 @@ static fr_command_table_t command_table_stats[] = {
 
        { NULL, 0, NULL, NULL, NULL }
 };
 
        { NULL, 0, NULL, NULL, NULL }
 };
+#endif
 
 static fr_command_table_t command_table[] = {
        { "add", FR_WRITE, NULL, NULL, command_table_add },
 
 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 },
          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 },
        { "stats",  FR_READ, NULL, NULL, command_table_stats },
+#endif
 
        { NULL, 0, NULL, NULL, NULL }
 };
 
        { NULL, 0, NULL, NULL, NULL }
 };
index 54dc3a6..b6e2b4d 100644 (file)
@@ -2445,6 +2445,7 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, const char *server)
        return this;
 }
 
        return this;
 }
 
+#ifdef WITH_PROXY
 static int is_loopback(const fr_ipaddr_t *ipaddr)
 {
        /*
 static int is_loopback(const fr_ipaddr_t *ipaddr)
 {
        /*
@@ -2464,6 +2465,7 @@ static int is_loopback(const fr_ipaddr_t *ipaddr)
 
        return 0;
 }
 
        return 0;
 }
+#endif
 
 /*
  *     Generate a list of listeners.  Takes an input list of
 
 /*
  *     Generate a list of listeners.  Takes an input list of
index dd4fec2..20ad58e 100644 (file)
@@ -374,7 +374,9 @@ int main(int argc, char *argv[])
                exit(0);
        }
 
                exit(0);
        }
 
+#ifdef WITH_STATS
        radius_stats_init(0);
        radius_stats_init(0);
+#endif
 
        /*
         *  Only write the PID file if we're running as a daemon.
 
        /*
         *  Only write the PID file if we're running as a daemon.