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

This commit is contained in:
"Vladimir N. Oleynik" 2005-09-23 11:25:29 +00:00
parent 53ad366fe7
commit b628409b1e
10 changed files with 35 additions and 20 deletions

View 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);

View 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;

View 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

View File

@ -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>

View 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 */

View 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);

View 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);

View File

@ -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...) */

View 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

View File

@ -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 */