diff options
author | "Vladimir N. Oleynik" | 2005-09-23 11:25:29 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" | 2005-09-23 11:25:29 +0000 |
commit | b628409b1e18aa6cdcf485077a3a64276e817db9 (patch) | |
tree | 70ecbe991cb076b240d290633cb5e44ef1879cb5 /networking/udhcp | |
parent | 53ad366fe73b3598af6cfd133357a9ceb643c167 (diff) | |
download | busybox-b628409b1e18aa6cdcf485077a3a64276e817db9.zip busybox-b628409b1e18aa6cdcf485077a3a64276e817db9.tar.gz |
more make safe the exported namespace for udhcp. Move to bb-specific file for reduce change into udhcp-CVS
Diffstat (limited to 'networking/udhcp')
-rw-r--r-- | networking/udhcp/common.h | 3 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.c | 2 | ||||
-rw-r--r-- | networking/udhcp/dhcpc.h | 5 | ||||
-rw-r--r-- | networking/udhcp/libbb_udhcp.h | 29 | ||||
-rw-r--r-- | networking/udhcp/options.c | 2 | ||||
-rw-r--r-- | networking/udhcp/packet.h | 6 | ||||
-rw-r--r-- | networking/udhcp/pidfile.h | 3 | ||||
-rw-r--r-- | networking/udhcp/script.c | 2 | ||||
-rw-r--r-- | networking/udhcp/script.h | 1 | ||||
-rw-r--r-- | networking/udhcp/serverpacket.c | 2 |
10 files changed, 35 insertions, 20 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h index e474f5e..efa8fd4 100644 --- a/networking/udhcp/common.h +++ b/networking/udhcp/common.h @@ -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); diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c index 48923f6..d5c69db 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -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; diff --git a/networking/udhcp/dhcpc.h b/networking/udhcp/dhcpc.h index 4cc1c4c..e2e14fe 100644 --- a/networking/udhcp/dhcpc.h +++ b/networking/udhcp/dhcpc.h @@ -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 diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h index 51e1571..0dae401 100644 --- a/networking/udhcp/libbb_udhcp.h +++ b/networking/udhcp/libbb_udhcp.h @@ -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> diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c index e81d0a7..1443451 100644 --- a/networking/udhcp/options.c +++ b/networking/udhcp/options.c @@ -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 */ diff --git a/networking/udhcp/packet.h b/networking/udhcp/packet.h index b2be5d7..f5859e8 100644 --- a/networking/udhcp/packet.h +++ b/networking/udhcp/packet.h @@ -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); diff --git a/networking/udhcp/pidfile.h b/networking/udhcp/pidfile.h index b1292a8..ea97d1d 100644 --- a/networking/udhcp/pidfile.h +++ b/networking/udhcp/pidfile.h @@ -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); diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c index e08d765..c04c69f 100644 --- a/networking/udhcp/script.c +++ b/networking/udhcp/script.c @@ -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...) */ diff --git a/networking/udhcp/script.h b/networking/udhcp/script.h index ab2c9fb..7100331 100644 --- a/networking/udhcp/script.h +++ b/networking/udhcp/script.h @@ -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 diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c index 75d55bd..c6a8209 100644 --- a/networking/udhcp/serverpacket.c +++ b/networking/udhcp/serverpacket.c @@ -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 */ |