summaryrefslogtreecommitdiffstats
path: root/ax25ipd/ax25ipd.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2017-07-25 21:00:15 +0200
committerRalf Baechle <ralf@linux-mips.org>2017-07-25 21:00:15 +0200
commit6509abc16fd5726d1227fbcbbfb69c62df67a04b (patch)
treef9f57a9c1f801a30dc78f8adfbef52c255bb0d16 /ax25ipd/ax25ipd.c
parent6d230545e4b9ed1a2e20bd15ea2fa8b54e8a4245 (diff)
ax25ipd: Sort out prototypes for usr1_handler().
make usr1_handler() static, remove its prototype from the header and reorder code to avoid prototypes. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'ax25ipd/ax25ipd.c')
-rw-r--r--ax25ipd/ax25ipd.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/ax25ipd/ax25ipd.c b/ax25ipd/ax25ipd.c
index 28e5c38..b3fc2f9 100644
--- a/ax25ipd/ax25ipd.c
+++ b/ax25ipd/ax25ipd.c
@@ -60,12 +60,6 @@ static struct option options[] = {
{NULL, 0, NULL, 0}
};
-static void hupper(int i)
-{
- printf("\nSIGHUP!\n");
- longjmp(restart_env, 1);
-}
-
static void greet_world(void)
{
printf("\nax25ipd %s / %s\n", VERSION);
@@ -76,6 +70,61 @@ static void greet_world(void)
fflush(stdout);
}
+static void do_stats(void)
+{
+ int save_loglevel;
+
+/* save the old loglevel, and force at least loglevel 1 */
+ save_loglevel = loglevel;
+ loglevel = 1;
+
+ printf("\nSIGUSR1 signal: statistics and configuration report\n");
+
+ greet_world();
+
+ dump_config();
+ dump_routes();
+ dump_params();
+
+ printf("\nInput stats:\n");
+ printf("KISS input packets: %d\n", stats.kiss_in);
+ printf(" too big: %d\n", stats.kiss_toobig);
+ printf(" bad type: %d\n", stats.kiss_badtype);
+ printf(" too short: %d\n", stats.kiss_tooshort);
+ printf(" not for me: %d\n", stats.kiss_not_for_me);
+ printf(" I am destination: %d\n", stats.kiss_i_am_dest);
+ printf(" no route found: %d\n", stats.kiss_no_ip_addr);
+ printf("UDP input packets: %d\n", stats.udp_in);
+ printf("IP input packets: %d\n", stats.ip_in);
+ printf(" failed CRC test: %d\n", stats.ip_failed_crc);
+ printf(" too short: %d\n", stats.ip_tooshort);
+ printf(" not for me: %d\n", stats.ip_not_for_me);
+ printf(" I am destination: %d\n", stats.ip_i_am_dest);
+ printf("\nOutput stats:\n");
+ printf("KISS output packets: %d\n", stats.kiss_out);
+ printf(" beacons: %d\n", stats.kiss_beacon_outs);
+ printf("UDP output packets: %d\n", stats.udp_out);
+ printf("IP output packets: %d\n", stats.ip_out);
+ printf("\n");
+
+ fflush(stdout);
+
+/* restore the old loglevel */
+ loglevel = save_loglevel;
+}
+
+static void hupper(int i)
+{
+ printf("\nSIGHUP!\n");
+ longjmp(restart_env, 1);
+}
+
+static void usr1_handler(int i)
+{
+ printf("\nSIGUSR1!\n");
+ do_stats();
+}
+
int main(int argc, char **argv)
{
if (setjmp(restart_env) == 0) {
@@ -200,55 +249,6 @@ int main(int argc, char **argv)
return 0;
}
-static void do_stats(void)
-{
- int save_loglevel;
-
-/* save the old loglevel, and force at least loglevel 1 */
- save_loglevel = loglevel;
- loglevel = 1;
-
- printf("\nSIGUSR1 signal: statistics and configuration report\n");
-
- greet_world();
-
- dump_config();
- dump_routes();
- dump_params();
-
- printf("\nInput stats:\n");
- printf("KISS input packets: %d\n", stats.kiss_in);
- printf(" too big: %d\n", stats.kiss_toobig);
- printf(" bad type: %d\n", stats.kiss_badtype);
- printf(" too short: %d\n", stats.kiss_tooshort);
- printf(" not for me: %d\n", stats.kiss_not_for_me);
- printf(" I am destination: %d\n", stats.kiss_i_am_dest);
- printf(" no route found: %d\n", stats.kiss_no_ip_addr);
- printf("UDP input packets: %d\n", stats.udp_in);
- printf("IP input packets: %d\n", stats.ip_in);
- printf(" failed CRC test: %d\n", stats.ip_failed_crc);
- printf(" too short: %d\n", stats.ip_tooshort);
- printf(" not for me: %d\n", stats.ip_not_for_me);
- printf(" I am destination: %d\n", stats.ip_i_am_dest);
- printf("\nOutput stats:\n");
- printf("KISS output packets: %d\n", stats.kiss_out);
- printf(" beacons: %d\n", stats.kiss_beacon_outs);
- printf("UDP output packets: %d\n", stats.udp_out);
- printf("IP output packets: %d\n", stats.ip_out);
- printf("\n");
-
- fflush(stdout);
-
-/* restore the old loglevel */
- loglevel = save_loglevel;
-}
-
-void usr1_handler(int i)
-{
- printf("\nSIGUSR1!\n");
- do_stats();
-}
-
void int_handler(int i)
{
printf("\nSIGINT!\n");