svn commit: trunk/busybox/networking/udhcp

vodz at busybox.net vodz at busybox.net
Fri Sep 23 11:25:31 UTC 2005


Author: vodz
Date: 2005-09-23 04:25:29 -0700 (Fri, 23 Sep 2005)
New Revision: 11590

Log:
more make safe the exported namespace for udhcp. Move to bb-specific file for reduce change into udhcp-CVS

Modified:
   trunk/busybox/networking/udhcp/common.h
   trunk/busybox/networking/udhcp/dhcpc.c
   trunk/busybox/networking/udhcp/dhcpc.h
   trunk/busybox/networking/udhcp/libbb_udhcp.h
   trunk/busybox/networking/udhcp/options.c
   trunk/busybox/networking/udhcp/packet.h
   trunk/busybox/networking/udhcp/pidfile.h
   trunk/busybox/networking/udhcp/script.c
   trunk/busybox/networking/udhcp/script.h
   trunk/busybox/networking/udhcp/serverpacket.c


Changeset:
Modified: trunk/busybox/networking/udhcp/common.h
===================================================================
--- trunk/busybox/networking/udhcp/common.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/common.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -39,9 +39,6 @@
 #include <syslog.h>
 #endif
 
-#define background udhcp_background
-#define start_log_and_pid udhcp_start_log_and_pid
-
 long uptime(void);
 void background(const char *pidfile);
 void start_log_and_pid(const char *client_server, const char *pidfile);

Modified: trunk/busybox/networking/udhcp/dhcpc.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpc.c	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/dhcpc.c	2005-09-23 11:25:29 UTC (rev 11590)
@@ -34,6 +34,7 @@
 #include <net/if.h>
 #include <errno.h>
 
+#include "common.h"
 #include "dhcpd.h"
 #include "dhcpc.h"
 #include "options.h"
@@ -41,7 +42,6 @@
 #include "clientsocket.h"
 #include "script.h"
 #include "socket.h"
-#include "common.h"
 #include "signalpipe.h"
 
 static int state;

Modified: trunk/busybox/networking/udhcp/dhcpc.h
===================================================================
--- trunk/busybox/networking/udhcp/dhcpc.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/dhcpc.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -2,11 +2,10 @@
 #ifndef _DHCPC_H
 #define _DHCPC_H
 
+#ifndef DEFAULT_SCRIPT
 #define DEFAULT_SCRIPT  "/usr/share/udhcpc/default.script"
+#endif
 
-/* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
-#include "libbb_udhcp.h"
-
 #define INIT_SELECTING	0
 #define REQUESTING	1
 #define BOUND		2

Modified: trunk/busybox/networking/udhcp/libbb_udhcp.h
===================================================================
--- trunk/busybox/networking/udhcp/libbb_udhcp.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/libbb_udhcp.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -27,6 +27,35 @@
 
 #define xfopen bb_xfopen
 
+/* make safe the exported namespace */
+/* from common.h */
+#define background 		udhcp_background
+#define start_log_and_pid 	udhcp_start_log_and_pid
+/* from script.h */
+#define run_script 		udhcp_run_script
+/* from packet.h */
+#define init_header 		udhcp_init_header
+#define get_packet 		udhcp_get_packet
+#define checksum 		udhcp_checksum
+#define raw_packet 		udhcp_raw_packet
+#define kernel_packet 		udhcp_kernel_packet
+/* from pidfile.h */
+#define pidfile_acquire 	udhcp_pidfile_acquire
+#define pidfile_write_release 	udhcp_pidfile_write_release
+/* from options.h */
+#define get_option		udhcp_get_option
+#define end_option		udhcp_end_option
+#define add_option_string	udhcp_add_option_string
+#define add_simple_option	udhcp_add_simple_option
+#define option_lengths		udhcp_option_lengths
+/* from socket.h */
+#define listen_socket		udhcp_listen_socket
+#define read_interface		udhcp_read_interface
+/* from dhcpc.h */
+#define client_config		udhcp_client_config
+/* from dhcpd.h */
+#define server_config		udhcp_server_config
+
 #else /* ! BB_VER */
 
 #include <stdlib.h>

Modified: trunk/busybox/networking/udhcp/options.c
===================================================================
--- trunk/busybox/networking/udhcp/options.c	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/options.c	2005-09-23 11:25:29 UTC (rev 11590)
@@ -6,10 +6,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "common.h"
 #include "dhcpd.h"
 #include "options.h"
 #include "files.h"
-#include "common.h"
 
 
 /* supported options are easily added here */

Modified: trunk/busybox/networking/udhcp/packet.h
===================================================================
--- trunk/busybox/networking/udhcp/packet.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/packet.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -29,12 +29,6 @@
 	struct dhcpMessage data;
 };
 
-#define init_header udhcp_init_header
-#define get_packet udhcp_get_packet
-#define checksum udhcp_checksum
-#define raw_packet udhcp_raw_packet
-#define kernel_packet udhcp_kernel_packet
-
 void init_header(struct dhcpMessage *packet, char type);
 int get_packet(struct dhcpMessage *packet, int fd);
 uint16_t checksum(void *addr, int count);

Modified: trunk/busybox/networking/udhcp/pidfile.h
===================================================================
--- trunk/busybox/networking/udhcp/pidfile.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/pidfile.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -20,9 +20,6 @@
  */
 
 
-#define pidfile_acquire udhcp_pidfile_acquire
-#define pidfile_write_release udhcp_pidfile_write_release
-
 int pidfile_acquire(const char *pidfile);
 void pidfile_write_release(int pid_fd);
 

Modified: trunk/busybox/networking/udhcp/script.c
===================================================================
--- trunk/busybox/networking/udhcp/script.c	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/script.c	2005-09-23 11:25:29 UTC (rev 11590)
@@ -29,10 +29,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#include "common.h"
 #include "options.h"
 #include "dhcpd.h"
 #include "dhcpc.h"
-#include "common.h"
 #include "script.h"
 
 /* get a rough idea of how long an option will be (rounding up...) */

Modified: trunk/busybox/networking/udhcp/script.h
===================================================================
--- trunk/busybox/networking/udhcp/script.h	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/script.h	2005-09-23 11:25:29 UTC (rev 11590)
@@ -1,7 +1,6 @@
 #ifndef _SCRIPT_H
 #define _SCRIPT_H
 
-#define run_script udhcp_run_script
 extern void run_script(struct dhcpMessage *packet, const char *name);
 
 #endif

Modified: trunk/busybox/networking/udhcp/serverpacket.c
===================================================================
--- trunk/busybox/networking/udhcp/serverpacket.c	2005-09-23 10:44:02 UTC (rev 11589)
+++ trunk/busybox/networking/udhcp/serverpacket.c	2005-09-23 11:25:29 UTC (rev 11590)
@@ -25,10 +25,10 @@
 #include <string.h>
 #include <time.h>
 
+#include "common.h"
 #include "serverpacket.h"
 #include "dhcpd.h"
 #include "options.h"
-#include "common.h"
 #include "static_leases.h"
 
 /* send a packet to giaddr using the kernel ip stack */




More information about the busybox-cvs mailing list