summaryrefslogtreecommitdiff
path: root/server/main.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1987-07-22 13:54:05 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1987-07-22 13:54:05 +0000
commit99ab103c200261b6a0401aa6564935d17a88f8c2 (patch)
treeebaa03af975724fc0edac980fb25e1cdf53c8576 /server/main.c
parent182a869647cd02bfa1d0e976e569570778cc6f06 (diff)
keep track of num of packets, uptime
Diffstat (limited to 'server/main.c')
-rw-r--r--server/main.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/server/main.c b/server/main.c
index c93fa7f..1245e55 100644
--- a/server/main.c
+++ b/server/main.c
@@ -16,11 +16,14 @@
#ifndef lint
#ifndef SABER
static char rcsid_main_c[] = "$Header$";
-static char copyright[] = "Copyright (c) 1987 Massachusetts Institute of Technology.\nPortions Copyright (c) 1986 Student Information Processing Board, Massachusetts Institute of Technology\n";
-static char version[] = "Zephyr Server (Prerelease) 0.5";
+char copyright[] = "Copyright (c) 1987 Massachusetts Institute of Technology.\nPortions Copyright (c) 1986 Student Information Processing Board, Massachusetts Institute of Technology\n";
#endif SABER
#endif lint
-
+#ifdef DEBUG
+char version[] = "Zephyr Server (Prerelease DEBUG) 0.6";
+#else
+char version[] = "Zephyr Server (Prerelease) 0.6";
+#endif DEBUG
/*
* Server loop for Zephyr.
*/
@@ -104,6 +107,8 @@ static ZAcl_t matchallacl = { MATCH_ALL_ACL };
#ifdef DEBUG
int zdebug = 0;
#endif DEBUG
+u_long npackets = 0; /* number of packets processed */
+long uptime; /* when we started operations */
main(argc,argv)
int argc;
@@ -189,6 +194,7 @@ char **argv;
#endif DEBUG
/* GO! */
+ uptime = NOW;
for EVER {
tvp = &nexthost_tv;
if (nexttimo != 0L) {
@@ -241,6 +247,7 @@ char **argv;
error_message(status));
continue;
}
+ npackets++;
if (status = ZParseNotice(input_packet,
input_len,
&new_notice,
@@ -272,6 +279,7 @@ char **argv;
}
}
if (whoisit.sin_port != hm_port &&
+ strcmp(new_notice.z_class,ZEPHYR_ADMIN_CLASS) &&
whoisit.sin_port != sock_sin.sin_port &&
new_notice.z_kind != CLIENTACK) {
syslog(LOG_ERR,
@@ -407,11 +415,13 @@ usage()
*/
static int
-bye()
+bye(sig)
+int sig;
{
server_shutdown(); /* tell other servers */
hostm_shutdown(); /* tell our hosts */
- syslog(LOG_INFO, "goodbye");
+ (void) dest_tkt();
+ syslog(LOG_INFO, "goodbye (sig %d)",sig);
exit(0);
/*NOTREACHED*/
}