2002-10-15 03:11:28 +05:30
|
|
|
/* libbb_udhcp.h - busybox compatability wrapper */
|
|
|
|
|
2003-12-19 03:55:38 +05:30
|
|
|
/* bit of a hack, do this no matter what the order of the includes.
|
|
|
|
* (for busybox) */
|
|
|
|
|
|
|
|
#ifdef CONFIG_INSTALL_NO_USR
|
2004-03-05 19:53:16 +05:30
|
|
|
#undef DEFAULT_SCRIPT
|
2003-12-19 03:55:38 +05:30
|
|
|
#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
|
|
|
|
#endif
|
|
|
|
|
2002-10-15 03:11:28 +05:30
|
|
|
#ifndef _LIBBB_UDHCP_H
|
|
|
|
#define _LIBBB_UDHCP_H
|
|
|
|
|
2002-12-12 04:13:37 +05:30
|
|
|
#ifdef IN_BUSYBOX
|
2003-12-16 07:58:20 +05:30
|
|
|
#include "busybox.h"
|
2002-10-15 03:11:28 +05:30
|
|
|
|
|
|
|
#ifdef CONFIG_FEATURE_UDHCP_SYSLOG
|
2003-12-19 03:55:38 +05:30
|
|
|
#define UDHCP_SYSLOG
|
2002-10-15 03:11:28 +05:30
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_FEATURE_UDHCP_DEBUG
|
2003-12-19 03:55:38 +05:30
|
|
|
#define UDHCP_DEBUG
|
2002-10-15 03:11:28 +05:30
|
|
|
#endif
|
|
|
|
|
|
|
|
#define COMBINED_BINARY
|
2002-11-06 01:40:21 +05:30
|
|
|
#include "version.h"
|
2002-10-15 03:11:28 +05:30
|
|
|
|
2003-12-16 07:58:20 +05:30
|
|
|
#define xfopen bb_xfopen
|
|
|
|
|
2005-09-23 16:55:29 +05:30
|
|
|
/* 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
|
|
|
|
|
2002-10-15 03:11:28 +05:30
|
|
|
#else /* ! BB_VER */
|
|
|
|
|
2003-12-16 07:58:20 +05:30
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2004-05-19 14:48:04 +05:30
|
|
|
#include <sys/sysinfo.h>
|
2003-12-16 07:58:20 +05:30
|
|
|
|
2002-10-15 03:11:28 +05:30
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
#define xmalloc malloc
|
2003-12-16 07:58:20 +05:30
|
|
|
#define xcalloc calloc
|
|
|
|
|
|
|
|
static inline FILE *xfopen(const char *file, const char *mode)
|
|
|
|
{
|
|
|
|
FILE *fp;
|
|
|
|
if (!(fp = fopen(file, mode))) {
|
|
|
|
perror("could not open input file");
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
return fp;
|
|
|
|
}
|
2002-10-15 03:11:28 +05:30
|
|
|
|
|
|
|
#endif /* BB_VER */
|
|
|
|
|
|
|
|
#endif /* _LIBBB_UDHCP_H */
|