more make safe the exported namespace for udhcp. Move to bb-specific file for reduce...
author"Vladimir N. Oleynik" <dzo@simtreas.ru>
Fri, 23 Sep 2005 11:25:29 +0000 (11:25 -0000)
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>
Fri, 23 Sep 2005 11:25:29 +0000 (11:25 -0000)
networking/udhcp/common.h
networking/udhcp/dhcpc.c
networking/udhcp/dhcpc.h
networking/udhcp/libbb_udhcp.h
networking/udhcp/options.c
networking/udhcp/packet.h
networking/udhcp/pidfile.h
networking/udhcp/script.c
networking/udhcp/script.h
networking/udhcp/serverpacket.c

index e474f5e970fbf2f7c9d7c38d667a4daa9bfd2538..efa8fd419eafbcafa0e140b5f622dbe4f3ea8104 100644 (file)
@@ -39,9 +39,6 @@ enum syslog_levels {
 #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);
index 48923f69799e4ae302882bbc0f517c10914e972a..d5c69db42bccc783d7081aaf342bc1628939021e 100644 (file)
@@ -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;
index 4cc1c4cc1d7e181ba888c0e58595a2f0564f5824..e2e14feba7f96ab6f04bfab2b8d3bc74c6845c9b 100644 (file)
@@ -2,10 +2,9 @@
 #ifndef _DHCPC_H
 #define _DHCPC_H
 
+#ifndef DEFAULT_SCRIPT
 #define DEFAULT_SCRIPT  "/usr/share/udhcpc/default.script"
-
-/* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
-#include "libbb_udhcp.h"
+#endif
 
 #define INIT_SELECTING 0
 #define REQUESTING     1
index 51e157142131c1ed3a8c3825126d78b7d38e6827..0dae401727b2dba987d8eb8c6f538fab56807f30 100644 (file)
 
 #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>
index e81d0a7575d266a71afc338abefea217f562f9e5..1443451345ffe471d548e8d0516241ad9f50274c 100644 (file)
@@ -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 */
index b2be5d7f7b6cde5981eee5b2fa059aae4b0a62d6..f5859e8243e9f07edfe6d348ac637b00a82bf7bd 100644 (file)
@@ -29,12 +29,6 @@ struct udp_dhcp_packet {
        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);
index b1292a8163ff9562b9ff8cb8ae28df3869d2b5b5..ea97d1de5fce63ee28333db3f55a220a967cc0a5 100644 (file)
@@ -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);
 
index e08d765bbaf788edebf69db421e5d59acf253d46..c04c69f7eb1ecb7ed9cd6f51d52ef22a5cff8bbc 100644 (file)
 #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...) */
index ab2c9fba6a002899d8cb6502d74af656851d825d..71003311c341700e5612c9c1a5a9cb5eca1931c0 100644 (file)
@@ -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
index 75d55bd92343186f1f57d2f00980d962037de3a4..c6a82090999a5266527337095ac388a31468d98f 100644 (file)
 #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 */