]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
systat -> sysconf
authorTed Lemon <source@isc.org>
Mon, 20 Oct 1997 22:11:44 +0000 (22:11 +0000)
committerTed Lemon <source@isc.org>
Mon, 20 Oct 1997 22:11:44 +0000 (22:11 +0000)
Makefile.dist
common/Makefile.dist
common/sysconf.c
configure
includes/dhcpd.h
sysconfd/Makefile.dist
sysconfd/sysconfd.c

index f8e802e4c44fb2e829e1193179a1bda3da4e4905..724b9b0618fd536460028da6045c0462b0ba0fd9 100644 (file)
@@ -30,7 +30,7 @@
 # OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-SUBDIRS=       common server client relay statmsg systatd
+SUBDIRS=       common server client relay statmsg sysconfd
 
 all:
        @for dir in ${SUBDIRS}; do \
index dd32df0db15b47cc0444310acc52661b79ac1ca7..81f8969c8f545597061e8d665d4e15e342c4ec97 100644 (file)
 SRC    = raw.c parse.c nit.c icmp.c dispatch.c conflex.c upf.c bpf.c socket.c \
         packet.c memory.c print.c options.c inet.c convert.c \
         tree.c tables.c hash.c alloc.c errwarn.c inet_addr.c dns.c \
-        resolv.c systat.c
+        resolv.c sysconf.c
 OBJ    = raw.o parse.o nit.o icmp.o dispatch.o conflex.o upf.o bpf.o socket.o \
         packet.o memory.o print.o options.o inet.o convert.o \
         tree.o tables.o hash.o alloc.o errwarn.o inet_addr.o dns.o \
-        resolv.o systat.o
+        resolv.o sysconf.o
 
 DEBUG  = -g
 INCLUDES = -I.. -I../includes
index fac3c06de0fd4f3872dcf54f93b6c0c8e7601c0e..2795d006d3ead5ce73b28a983e24fce445095fac 100644 (file)
@@ -1,4 +1,4 @@
-/* systat.c
+/* sysconf.c
 
    System status watcher...
 
 
 #ifndef lint
 static char copyright[] =
-"$Id: sysconf.c,v 1.1 1997/09/16 18:15:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: sysconf.c,v 1.2 1997/10/20 22:10:59 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
 
-int systat_initialized;
-int systat_fd;
+int sysconf_initialized;
+int sysconf_fd;
 
-void systat_startup (handler)
-       void (*handler) PROTO ((struct systat_header *, void *));
+void sysconf_startup (handler)
+       void (*handler) PROTO ((struct sysconf_header *, void *));
 {
        struct sockaddr_un name;
        static int once;
 
-       /* Only initialize systat once. */
-       if (systat_initialized)
-               error ("attempted to reinitialize systat protocol");
-       systat_initialized = 1;
+       /* Only initialize sysconf once. */
+       if (sysconf_initialized)
+               error ("attempted to reinitialize sysconf protocol");
+       sysconf_initialized = 1;
 
-       systat_fd = socket (AF_UNIX, SOCK_STREAM, 0);
-       if (systat_fd < 0)
-               error ("unable to create systat socket: %m");
+       sysconf_fd = socket (AF_UNIX, SOCK_STREAM, 0);
+       if (sysconf_fd < 0)
+               error ("unable to create sysconf socket: %m");
 
        /* XXX for now... */
        name.sun_family = PF_UNIX;
-       strcpy (name.sun_path, "/var/run/systat");
+       strcpy (name.sun_path, "/var/run/sysconf");
        name.sun_len = ((sizeof name) - (sizeof name.sun_path) +
                        strlen (name.sun_path));
 
-       if (connect (systat_fd, (struct sockaddr *)&name, name.sun_len) < 0) {
+       if (connect (sysconf_fd, (struct sockaddr *)&name, name.sun_len) < 0) {
                if (!once)
-                       warn ("can't connect to systat socket: %m");
+                       warn ("can't connect to sysconf socket: %m");
                once = 1;
-               close (systat_fd);
-               systat_initialized = 0;
-               add_timeout (cur_time + 60, systat_restart, handler);
+               close (sysconf_fd);
+               sysconf_initialized = 0;
+               add_timeout (cur_time + 60, sysconf_restart, handler);
        } else
-               add_protocol ("systat", systat_fd, systat_message, handler);
+               add_protocol ("sysconf", sysconf_fd, sysconf_message, handler);
 }
 
-void systat_restart (v)
+void sysconf_restart (v)
        void *v;
 {
-       void (*handler) PROTO ((struct systat_header *, void *)) = v;
+       void (*handler) PROTO ((struct sysconf_header *, void *)) = v;
 
-       systat_startup (handler);
+       sysconf_startup (handler);
 }
 
-void systat_message (proto)
+void sysconf_message (proto)
        struct protocol *proto;
 {
-       struct systat_header hdr;
+       struct sysconf_header hdr;
        int status;
        char *buf;
-       void (*handler) PROTO ((struct systat_header *, void *));
+       void (*handler) PROTO ((struct sysconf_header *, void *));
 
-       status = read (systat_fd, &hdr, sizeof hdr);
+       status = read (sysconf_fd, &hdr, sizeof hdr);
        if (status < 0) {
-               warn ("systat_message: %m");
+               warn ("sysconf_message: %m");
              lose:
-               add_timeout (cur_time + 60, systat_restart, proto -> local);
+               add_timeout (cur_time + 60, sysconf_restart, proto -> local);
                remove_protocol (proto);
                return;
        }
        if (status < sizeof (hdr)) {
-               warn ("systat_message: short message");
+               warn ("sysconf_message: short message");
                goto lose;
        }
 
        if (hdr.length) {
                buf = malloc (hdr.length);
                if (!buf)
-                       error ("systat_message: can't buffer payload");
-               status = read (systat_fd, buf, hdr.length);
+                       error ("sysconf_message: can't buffer payload");
+               status = read (sysconf_fd, buf, hdr.length);
                if (status < 0)
-                       error ("systat_message payload read: %m");
+                       error ("sysconf_message payload read: %m");
                if (status != hdr.length)
-                       error ("systat_message payload: short read");
+                       error ("sysconf_message payload: short read");
        } else
                buf = (char *)0;
 
index 29a931e33a13a8f1fd8fe63cc6d25798b96c28ef..81d94898222073151434a0b932be109b5c7ad4cc 100755 (executable)
--- a/configure
+++ b/configure
@@ -68,7 +68,7 @@ fi
 
 echo "System Type: $sysname"
 
-for foo in . client server relay statmsg systatd common; do
+for foo in . client server relay statmsg sysconfd common; do
         (sed -e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
                <Makefile.conf; cat $foo/Makefile.dist) \
                                >$foo/Makefile
index b9433f651910c5793ed1755edbba81782c3db627..202b17121db295ee98e8216ea9d7fcdb7c40472f 100644 (file)
@@ -66,7 +66,7 @@
 #include "tree.h"
 #include "hash.h"
 #include "inet.h"
-#include "systat.h"
+#include "sysconf.h"
 
 struct option_data {
        int len;
@@ -825,7 +825,7 @@ int script_go PROTO ((struct interface_info *));
 struct client_lease *packet_to_lease PROTO ((struct packet *));
 void go_daemon PROTO ((void));
 void write_client_pid_file PROTO ((void));
-void status_message PROTO ((struct systat_header *, void *));
+void status_message PROTO ((struct sysconf_header *, void *));
 void client_location_changed PROTO ((void));
 
 /* db.c */
@@ -934,7 +934,7 @@ struct sockaddr_in *pick_name_server PROTO ((void));
 int inet_aton PROTO ((char *, struct in_addr *));
 #endif
 
-/* systat.c */
-void systat_startup PROTO ((void (*) (struct systat_header *, void *)));
-void systat_restart PROTO ((void *));
-void systat_message PROTO ((struct protocol *proto));
+/* sysconf.c */
+void sysconf_startup PROTO ((void (*) (struct sysconf_header *, void *)));
+void sysconf_restart PROTO ((void *));
+void sysconf_message PROTO ((struct protocol *proto));
index 57eb8985590e1ffbd9264ea66ac799f1ef307834..169e8ed9ed40e59c8ddba2ed0fccb66661e767c9 100644 (file)
@@ -31,9 +31,9 @@
 #
 
 CATMANPAGES =
-SRCS   = systatd.c
-OBJS   = systatd.o
-PROG   = systatd
+SRCS   = sysconfd.c
+OBJS   = sysconfd.o
+PROG   = sysconfd
 MAN    = 
 
 DEBUG  = -g
@@ -44,14 +44,14 @@ CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS)
 all:   $(PROG) $(CATMANPAGES)
 
 install: $(PROG) $(CATMANPAGES)
-       $(INSTALL) systatd $(BINDIR)
-       $(CHMOD) 755 $(BINDIR)/systatd
+       $(INSTALL) sysconfd $(BINDIR)
+       $(CHMOD) 755 $(BINDIR)/sysconfd
        if [ ! -d $(ADMMANDIR) ]; then \
          mkdir $(ADMMANDIR); \
          chmod 755 $(ADMMANDIR); \
         fi
-#      $(MANINSTALL) $(MANFROM) systatd.cat8 $(MANTO) \
-#                              $(ADMMANDIR)/systatd$(ADMMANEXT)
+#      $(MANINSTALL) $(MANFROM) sysconfd.cat8 $(MANTO) \
+#                              $(ADMMANDIR)/sysconfd$(ADMMANEXT)
 
 clean:
        -rm -f $(OBJS)
@@ -66,10 +66,10 @@ distclean: realclean
 # macros aren't available on older unices.   Catted man pages are
 # provided in the distribution so that this doesn't become a problem.
 
-systatd.cat8:  systatd.8
+sysconfd.cat8: sysconfd.8
        sed -e "s#ETCDIR#$(ETC)#" -e "s#DBDIR#$(VARDB)#" \
-               -e "s#RUNDIR#$(VARRUN)#" < systatd.8 \
-                       | nroff -man >systatd.cat8
+               -e "s#RUNDIR#$(VARRUN)#" < sysconfd.8 \
+                       | nroff -man >sysconfd.cat8
 
 $(PROG):       $(OBJS) $(DHCPLIB)
        $(CC) $(LFLAGS) -o $(PROG) $(OBJS) $(DHCPLIB) $(LIBS)
index caedb7f316a2490740a8f0949f1a6a5876b9ce7f..5d59816efdf12cddc9e2a8e152665777d1b426ba 100644 (file)
@@ -1,6 +1,6 @@
 /* main.c
 
-   System status daemon...
+   System configuration status daemon...
 
    !!!Boy, howdy, is this ever not guaranteed not to change!!! */
 
 
 #ifndef lint
 static char copyright[] =
-"$Id: sysconfd.c,v 1.1 1997/09/16 18:21:11 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: sysconfd.c,v 1.2 1997/10/20 22:11:44 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
 
-int systat_fd;
+int sysconf_fd;
 
-struct systat_client {
-       struct systat_client *next;
+struct sysconf_client {
+       struct sysconf_client *next;
        int fd;
 } *clients;
 
@@ -73,14 +73,14 @@ int main (argc, argv, envp)
        char **envp;
 {
        struct sockaddr_un name;
-       int systat_fd;
+       int sysconf_fd;
        int pid;
 
 #ifdef SYSLOG_4_2
-       openlog ("systatd", LOG_NDELAY);
+       openlog ("sysconfd", LOG_NDELAY);
        log_priority = LOG_DAEMON;
 #else
-       openlog ("systatd", LOG_NDELAY, LOG_DAEMON);
+       openlog ("sysconfd", LOG_NDELAY, LOG_DAEMON);
 #endif
 
 #if !(defined (DEBUG) || defined (SYSLOG_4_2) || defined (__CYGWIN32__))
@@ -88,24 +88,24 @@ int main (argc, argv, envp)
 #endif 
 
        /* Make a socket... */
-       systat_fd = socket (AF_UNIX, SOCK_STREAM, 0);
-       if (systat_fd < 0)
-               error ("unable to create systat socket: %m");
+       sysconf_fd = socket (AF_UNIX, SOCK_STREAM, 0);
+       if (sysconf_fd < 0)
+               error ("unable to create sysconf socket: %m");
 
        /* XXX for now... */
        name.sun_family = PF_UNIX;
-       strcpy (name.sun_path, "/var/run/systat");
+       strcpy (name.sun_path, "/var/run/sysconf");
        name.sun_len = ((sizeof name) - (sizeof name.sun_path) +
                        strlen (name.sun_path));
        unlink (name.sun_path);
 
        /* Bind to it... */
-       if (bind (systat_fd, (struct sockaddr *)&name, name.sun_len) < 0)
-               error ("can't bind to systat socket: %m");
+       if (bind (sysconf_fd, (struct sockaddr *)&name, name.sun_len) < 0)
+               error ("can't bind to sysconf socket: %m");
 
        /* Listen for connections... */
-       if (listen (systat_fd, 1) < 0)
-               error ("can't listen on systat socket: %m");
+       if (listen (sysconf_fd, 1) < 0)
+               error ("can't listen on sysconf socket: %m");
 
        /* Stop logging to stderr... */
        log_perror = 0;
@@ -120,7 +120,7 @@ int main (argc, argv, envp)
        (void)setsid ();
 
        /* Set up a protocol structure for it... */
-       add_protocol ("listener", systat_fd, new_connection, 0);
+       add_protocol ("listener", sysconf_fd, new_connection, 0);
 
        /* Kernel status stuff goes here... */
 
@@ -135,10 +135,10 @@ void new_connection (proto)
 {
        struct sockaddr_un name;
        int namelen;
-       struct systat_client *tmp;
+       struct sysconf_client *tmp;
        int new_fd;
 
-       tmp = (struct systat_client *)malloc (sizeof *tmp);
+       tmp = (struct sysconf_client *)malloc (sizeof *tmp);
        if (tmp < 0)
                error ("Can't find memory for new client!");
        memset (tmp, 0, sizeof *tmp);
@@ -158,11 +158,11 @@ void new_connection (proto)
 void client_input (proto)
        struct protocol *proto;
 {
-       struct systat_header hdr;
+       struct sysconf_header hdr;
        int status;
        char *buf;
-       void (*handler) PROTO ((struct systat_header *, void *));
-       struct systat_client *client;
+       void (*handler) PROTO ((struct sysconf_header *, void *));
+       struct sysconf_client *client;
 
        status = read (proto -> fd, &hdr, sizeof hdr);
        if (status < 0) {