aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-23 11:25:29 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-23 11:25:29 +0000
commitb628409b1e18aa6cdcf485077a3a64276e817db9 (patch)
tree70ecbe991cb076b240d290633cb5e44ef1879cb5
parent53ad366fe73b3598af6cfd133357a9ceb643c167 (diff)
downloadbusybox-w32-b628409b1e18aa6cdcf485077a3a64276e817db9.tar.gz
busybox-w32-b628409b1e18aa6cdcf485077a3a64276e817db9.tar.bz2
busybox-w32-b628409b1e18aa6cdcf485077a3a64276e817db9.zip
more make safe the exported namespace for udhcp. Move to bb-specific file for reduce change into udhcp-CVS
-rw-r--r--networking/udhcp/common.h3
-rw-r--r--networking/udhcp/dhcpc.c2
-rw-r--r--networking/udhcp/dhcpc.h5
-rw-r--r--networking/udhcp/libbb_udhcp.h29
-rw-r--r--networking/udhcp/options.c2
-rw-r--r--networking/udhcp/packet.h6
-rw-r--r--networking/udhcp/pidfile.h3
-rw-r--r--networking/udhcp/script.c2
-rw-r--r--networking/udhcp/script.h1
-rw-r--r--networking/udhcp/serverpacket.c2
10 files changed, 35 insertions, 20 deletions
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index e474f5e97..efa8fd419 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -39,9 +39,6 @@ enum syslog_levels {
39#include <syslog.h> 39#include <syslog.h>
40#endif 40#endif
41 41
42#define background udhcp_background
43#define start_log_and_pid udhcp_start_log_and_pid
44
45long uptime(void); 42long uptime(void);
46void background(const char *pidfile); 43void background(const char *pidfile);
47void start_log_and_pid(const char *client_server, const char *pidfile); 44void start_log_and_pid(const char *client_server, const char *pidfile);
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 48923f697..d5c69db42 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -34,6 +34,7 @@
34#include <net/if.h> 34#include <net/if.h>
35#include <errno.h> 35#include <errno.h>
36 36
37#include "common.h"
37#include "dhcpd.h" 38#include "dhcpd.h"
38#include "dhcpc.h" 39#include "dhcpc.h"
39#include "options.h" 40#include "options.h"
@@ -41,7 +42,6 @@
41#include "clientsocket.h" 42#include "clientsocket.h"
42#include "script.h" 43#include "script.h"
43#include "socket.h" 44#include "socket.h"
44#include "common.h"
45#include "signalpipe.h" 45#include "signalpipe.h"
46 46
47static int state; 47static int state;
diff --git a/networking/udhcp/dhcpc.h b/networking/udhcp/dhcpc.h
index 4cc1c4cc1..e2e14feba 100644
--- a/networking/udhcp/dhcpc.h
+++ b/networking/udhcp/dhcpc.h
@@ -2,10 +2,9 @@
2#ifndef _DHCPC_H 2#ifndef _DHCPC_H
3#define _DHCPC_H 3#define _DHCPC_H
4 4
5#ifndef DEFAULT_SCRIPT
5#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script" 6#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
6 7#endif
7/* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
8#include "libbb_udhcp.h"
9 8
10#define INIT_SELECTING 0 9#define INIT_SELECTING 0
11#define REQUESTING 1 10#define REQUESTING 1
diff --git a/networking/udhcp/libbb_udhcp.h b/networking/udhcp/libbb_udhcp.h
index 51e157142..0dae40172 100644
--- a/networking/udhcp/libbb_udhcp.h
+++ b/networking/udhcp/libbb_udhcp.h
@@ -27,6 +27,35 @@
27 27
28#define xfopen bb_xfopen 28#define xfopen bb_xfopen
29 29
30/* make safe the exported namespace */
31/* from common.h */
32#define background udhcp_background
33#define start_log_and_pid udhcp_start_log_and_pid
34/* from script.h */
35#define run_script udhcp_run_script
36/* from packet.h */
37#define init_header udhcp_init_header
38#define get_packet udhcp_get_packet
39#define checksum udhcp_checksum
40#define raw_packet udhcp_raw_packet
41#define kernel_packet udhcp_kernel_packet
42/* from pidfile.h */
43#define pidfile_acquire udhcp_pidfile_acquire
44#define pidfile_write_release udhcp_pidfile_write_release
45/* from options.h */
46#define get_option udhcp_get_option
47#define end_option udhcp_end_option
48#define add_option_string udhcp_add_option_string
49#define add_simple_option udhcp_add_simple_option
50#define option_lengths udhcp_option_lengths
51/* from socket.h */
52#define listen_socket udhcp_listen_socket
53#define read_interface udhcp_read_interface
54/* from dhcpc.h */
55#define client_config udhcp_client_config
56/* from dhcpd.h */
57#define server_config udhcp_server_config
58
30#else /* ! BB_VER */ 59#else /* ! BB_VER */
31 60
32#include <stdlib.h> 61#include <stdlib.h>
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index e81d0a757..144345134 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -6,10 +6,10 @@
6#include <stdlib.h> 6#include <stdlib.h>
7#include <string.h> 7#include <string.h>
8 8
9#include "common.h"
9#include "dhcpd.h" 10#include "dhcpd.h"
10#include "options.h" 11#include "options.h"
11#include "files.h" 12#include "files.h"
12#include "common.h"
13 13
14 14
15/* supported options are easily added here */ 15/* supported options are easily added here */
diff --git a/networking/udhcp/packet.h b/networking/udhcp/packet.h
index b2be5d7f7..f5859e824 100644
--- a/networking/udhcp/packet.h
+++ b/networking/udhcp/packet.h
@@ -29,12 +29,6 @@ struct udp_dhcp_packet {
29 struct dhcpMessage data; 29 struct dhcpMessage data;
30}; 30};
31 31
32#define init_header udhcp_init_header
33#define get_packet udhcp_get_packet
34#define checksum udhcp_checksum
35#define raw_packet udhcp_raw_packet
36#define kernel_packet udhcp_kernel_packet
37
38void init_header(struct dhcpMessage *packet, char type); 32void init_header(struct dhcpMessage *packet, char type);
39int get_packet(struct dhcpMessage *packet, int fd); 33int get_packet(struct dhcpMessage *packet, int fd);
40uint16_t checksum(void *addr, int count); 34uint16_t checksum(void *addr, int count);
diff --git a/networking/udhcp/pidfile.h b/networking/udhcp/pidfile.h
index b1292a816..ea97d1de5 100644
--- a/networking/udhcp/pidfile.h
+++ b/networking/udhcp/pidfile.h
@@ -20,9 +20,6 @@
20 */ 20 */
21 21
22 22
23#define pidfile_acquire udhcp_pidfile_acquire
24#define pidfile_write_release udhcp_pidfile_write_release
25
26int pidfile_acquire(const char *pidfile); 23int pidfile_acquire(const char *pidfile);
27void pidfile_write_release(int pid_fd); 24void pidfile_write_release(int pid_fd);
28 25
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index e08d765bb..c04c69f7e 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -29,10 +29,10 @@
29#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/wait.h> 30#include <sys/wait.h>
31 31
32#include "common.h"
32#include "options.h" 33#include "options.h"
33#include "dhcpd.h" 34#include "dhcpd.h"
34#include "dhcpc.h" 35#include "dhcpc.h"
35#include "common.h"
36#include "script.h" 36#include "script.h"
37 37
38/* get a rough idea of how long an option will be (rounding up...) */ 38/* 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 ab2c9fba6..71003311c 100644
--- a/networking/udhcp/script.h
+++ b/networking/udhcp/script.h
@@ -1,7 +1,6 @@
1#ifndef _SCRIPT_H 1#ifndef _SCRIPT_H
2#define _SCRIPT_H 2#define _SCRIPT_H
3 3
4#define run_script udhcp_run_script
5extern void run_script(struct dhcpMessage *packet, const char *name); 4extern void run_script(struct dhcpMessage *packet, const char *name);
6 5
7#endif 6#endif
diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c
index 75d55bd92..c6a820909 100644
--- a/networking/udhcp/serverpacket.c
+++ b/networking/udhcp/serverpacket.c
@@ -25,10 +25,10 @@
25#include <string.h> 25#include <string.h>
26#include <time.h> 26#include <time.h>
27 27
28#include "common.h"
28#include "serverpacket.h" 29#include "serverpacket.h"
29#include "dhcpd.h" 30#include "dhcpd.h"
30#include "options.h" 31#include "options.h"
31#include "common.h"
32#include "static_leases.h" 32#include "static_leases.h"
33 33
34/* send a packet to giaddr using the kernel ip stack */ 34/* send a packet to giaddr using the kernel ip stack */