[Dhcp-agent-commits] dhcp-agent dhcp-client.h,NONE,1.1 dhcp-client.c,1.26,1.27
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-06-13 15:25:41
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv30574 Modified Files: dhcp-client.c Added Files: dhcp-client.h Log Message: added dhcp-client.h and moved some definitions there --- NEW FILE: dhcp-client.h --- /* $Header: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client.h,v 1.1 2002/06/13 15:25:36 actmodern Exp $ * * Copyright 2001 Thamer Alharbash <tm...@wh...> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * 3. The names of the authors may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * */ #ifndef DHCP_CLIENT_H #define DHCP_CLIENT_H typedef void (*client_command)(char *interface); typedef char *(*interface_lister)(void); /* client command codes: index to command array */ #define DO_VERSION 0 #define DO_KILL 1 #define DO_WAKE 2 #define DO_CLEAR 3 #define DO_CLIENT 4 #endif /* DHCP_CLIENT_H */ Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dhcp-client.c 11 Jun 2002 02:05:52 -0000 1.26 --- dhcp-client.c 13 Jun 2002 15:25:36 -0000 1.27 *************** *** 27,46 **** #include <dhcp-globconf.h> #include <dhcp-files.h> ! ! /* client command codes: index to command array */ ! ! #define DO_VERSION 0 ! #define DO_KILL 1 ! #define DO_WAKE 2 ! #define DO_CLEAR 3 ! #define DO_CLIENT 4 ! ! const char *command_string[] = { ! "version", "kill", ! "wake", "clear", "client" ! }; ! ! typedef void (*client_command)(char *interface); ! typedef char *(*interface_lister)(void); /* forward declarations of do_ routines. */ --- 27,31 ---- #include <dhcp-globconf.h> #include <dhcp-files.h> ! #include <dhcp-client.h> /* forward declarations of do_ routines. */ *************** *** 52,55 **** --- 37,46 ---- static void do_client(char *interface); + /* command to string table. */ + const char *command_string[] = { + "version", "kill", + "wake", "clear", "client" + }; + /* table of functions indexed by command codes. */ client_command commands[] = { *************** *** 443,447 **** do_client_dhcp_loop(0, dc, state); /* perform infinite waiting loop. */ ! exit(0); /* should never get here. */ } --- 434,438 ---- do_client_dhcp_loop(0, dc, state); /* perform infinite waiting loop. */ ! exit(0); } |