[dhcp-agent-commits] dhcp-agent/src dhcp-client.c,1.35,1.36 dhcp-libutil.h,1.28,1.29 dhcp-server.c,1
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2003-07-08 07:01:45
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv17895/src Modified Files: dhcp-client.c dhcp-libutil.h dhcp-server.c Removed Files: dhcp-daemon.h Log Message: daemon prototypes moved to dhcp-libutil.h Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-client.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** dhcp-client.c 6 Jul 2003 17:14:43 -0000 1.35 --- dhcp-client.c 8 Jul 2003 07:01:41 -0000 1.36 *************** *** 35,39 **** #include "dhcp-client.h" #include "dhcp-client-guile.h" - #include "dhcp-daemon.h" /* forward declarations of do_ routines. */ --- 35,38 ---- Index: dhcp-libutil.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-libutil.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** dhcp-libutil.h 2 Jul 2003 15:18:22 -0000 1.28 --- dhcp-libutil.h 8 Jul 2003 07:01:42 -0000 1.29 *************** *** 305,308 **** --- 305,313 ---- extern int conf_get_line_no(conf_t *conf); + /* daemon routines. */ + + extern void go_background(char *dir); + extern void setup_interrupt_handlers(void); + /* constants. */ Index: dhcp-server.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-server.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-server.c 6 Jul 2003 05:37:44 -0000 1.3 --- dhcp-server.c 8 Jul 2003 07:01:42 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- #include "dhcp-libutil.h" #include "dhcp-librawnet.h" + #include "dhcp-daemon.h" #include "dhcp-lease.h" *************** *** 60,63 **** --- 61,69 ---- }; + server_state server_states[] = { + NULL, + server_shutdown, + }; + /* print usage info. */ static void usage(char *s) *************** *** 85,96 **** } ! static void do_server(char *interface_name) { dhcp_server_control_t *dhcp_server_control; ! dhcp_server_control = dhcp_server_control_create(interface_name); ! INFO_MESSAGE("not implemented yet."); ! return; } --- 91,116 ---- } ! static void do_server(char *interface) { dhcp_server_control_t *dhcp_server_control; ! INFO_MESSAGE("DHCP server starting"); ! /* we go into the background immediately. */ ! if(want_background) { ! ! INFO_MESSAGE("going into the background"); ! go_background(work_dir); ! ! } ! ! dhcp_server_control = dhcp_server_control_create(interface); ! ! if(file_create_pid(interface)) { ! ERROR_MESSAGE("could not create PID file for interface: %s", interface); ! server_states[STATE_SHUTDOWN](dhcp_server_control); ! } ! ! server_states[STATE_SHUTDOWN](dhcp_server_control); } *************** *** 154,157 **** --- 174,179 ---- list_destroy(interface_list, xfree); } + + do_change_work_dir(work_dir); /* now that we have an active interface name, go ahead --- dhcp-daemon.h DELETED --- |