mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 07:15:44 +00:00
systat -> sysconf
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: dhclient.c,v 1.41 1997/10/20 21:35:34 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhclient.c,v 1.42 1997/10/20 22:00:17 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -231,8 +231,8 @@ int main (argc, argv, envp)
|
|||||||
/* Set up the bootp packet handler... */
|
/* Set up the bootp packet handler... */
|
||||||
bootp_packet_handler = do_packet;
|
bootp_packet_handler = do_packet;
|
||||||
|
|
||||||
/* Start listening on the systat socket... */
|
/* Start listening on the sysconf socket... */
|
||||||
systat_startup (status_message);
|
sysconf_startup (status_message);
|
||||||
|
|
||||||
/* Start dispatching packets and timeouts... */
|
/* Start dispatching packets and timeouts... */
|
||||||
dispatch ();
|
dispatch ();
|
||||||
@@ -2015,7 +2015,7 @@ void write_client_pid_file ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void status_message (header, data)
|
void status_message (header, data)
|
||||||
struct systat_header *header;
|
struct sysconf_header *header;
|
||||||
void *data;
|
void *data;
|
||||||
{
|
{
|
||||||
switch (header -> type) {
|
switch (header -> type) {
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#define SYSCONF_SOCKET "/var/run/sysconf"
|
#define SYSCONF_SOCKET "/var/run/sysconf"
|
||||||
|
|
||||||
struct systat_header {
|
struct sysconf_header {
|
||||||
u_int32_t type; /* Type of status message... */
|
u_int32_t type; /* Type of status message... */
|
||||||
u_int32_t length; /* Length of message. */
|
u_int32_t length; /* Length of message. */
|
||||||
};
|
};
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: main.c,v 1.1 1997/09/16 18:20:53 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: main.c,v 1.2 1997/10/20 22:04:23 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -58,8 +58,8 @@ int main (argc, argv, envp)
|
|||||||
char **envp;
|
char **envp;
|
||||||
{
|
{
|
||||||
struct sockaddr_un name;
|
struct sockaddr_un name;
|
||||||
int systat_fd;
|
int sysconf_fd;
|
||||||
struct systat_header hdr;
|
struct sysconf_header hdr;
|
||||||
int status;
|
int status;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
@@ -83,31 +83,31 @@ int main (argc, argv, envp)
|
|||||||
else
|
else
|
||||||
error ("unknown status message type %s", argv [1]);
|
error ("unknown status message type %s", argv [1]);
|
||||||
|
|
||||||
systat_fd = socket (AF_UNIX, SOCK_STREAM, 0);
|
sysconf_fd = socket (AF_UNIX, SOCK_STREAM, 0);
|
||||||
if (systat_fd < 0)
|
if (sysconf_fd < 0)
|
||||||
error ("unable to create systat socket: %m");
|
error ("unable to create sysconf socket: %m");
|
||||||
|
|
||||||
/* XXX for now... */
|
/* XXX for now... */
|
||||||
name.sun_family = PF_UNIX;
|
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) +
|
name.sun_len = ((sizeof name) - (sizeof name.sun_path) +
|
||||||
strlen (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)
|
||||||
error ("can't connect to systat socket: %m");
|
error ("can't connect to sysconf socket: %m");
|
||||||
|
|
||||||
status = write (systat_fd, &hdr, sizeof hdr);
|
status = write (sysconf_fd, &hdr, sizeof hdr);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
error ("systat: %m");
|
error ("sysconf: %m");
|
||||||
if (status < sizeof (hdr))
|
if (status < sizeof (hdr))
|
||||||
error ("systat: short write");
|
error ("sysconf: short write");
|
||||||
|
|
||||||
if (hdr.length) {
|
if (hdr.length) {
|
||||||
status = write (systat_fd, buf, hdr.length);
|
status = write (sysconf_fd, buf, hdr.length);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
error ("systat payload write: %m");
|
error ("sysconf payload write: %m");
|
||||||
if (status != hdr.length)
|
if (status != hdr.length)
|
||||||
error ("systat payload: short write");
|
error ("sysconf payload: short write");
|
||||||
}
|
}
|
||||||
|
|
||||||
exit (0);
|
exit (0);
|
||||||
|
Reference in New Issue
Block a user