2002-10-14 21:41:28 +00:00
|
|
|
/* libbb_udhcp.h - busybox compatability wrapper */
|
|
|
|
|
2003-12-18 22:25:38 +00:00
|
|
|
/* bit of a hack, do this no matter what the order of the includes.
|
|
|
|
* (for busybox) */
|
|
|
|
|
|
|
|
#ifdef CONFIG_INSTALL_NO_USR
|
2004-03-05 14:23:16 +00:00
|
|
|
#undef DEFAULT_SCRIPT
|
2003-12-18 22:25:38 +00:00
|
|
|
#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
|
|
|
|
#endif
|
|
|
|
|
2002-10-14 21:41:28 +00:00
|
|
|
#ifndef _LIBBB_UDHCP_H
|
|
|
|
#define _LIBBB_UDHCP_H
|
|
|
|
|
2002-12-11 22:43:37 +00:00
|
|
|
#ifdef IN_BUSYBOX
|
2003-12-16 02:28:20 +00:00
|
|
|
#include "busybox.h"
|
2002-10-14 21:41:28 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_FEATURE_UDHCP_SYSLOG
|
2003-12-18 22:25:38 +00:00
|
|
|
#define UDHCP_SYSLOG
|
2002-10-14 21:41:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_FEATURE_UDHCP_DEBUG
|
2003-12-18 22:25:38 +00:00
|
|
|
#define UDHCP_DEBUG
|
2002-10-14 21:41:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define COMBINED_BINARY
|
2002-11-05 20:10:21 +00:00
|
|
|
#include "version.h"
|
2002-10-14 21:41:28 +00:00
|
|
|
|
2003-12-16 02:28:20 +00:00
|
|
|
#define xfopen bb_xfopen
|
|
|
|
|
2002-10-14 21:41:28 +00:00
|
|
|
#else /* ! BB_VER */
|
|
|
|
|
2003-12-16 02:28:20 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
2004-05-19 09:18:04 +00:00
|
|
|
#include <sys/sysinfo.h>
|
2003-12-16 02:28:20 +00:00
|
|
|
|
2002-10-14 21:41:28 +00:00
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
#define xmalloc malloc
|
2003-12-16 02:28:20 +00:00
|
|
|
#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-14 21:41:28 +00:00
|
|
|
|
|
|
|
#endif /* BB_VER */
|
|
|
|
|
|
|
|
#endif /* _LIBBB_UDHCP_H */
|