1 /* libbb_udhcp.h - busybox compatability wrapper */
3 /* bit of a hack, do this no matter what the order of the includes.
9 #ifdef CONFIG_INSTALL_NO_USR
10 # define DEFAULT_SCRIPT "/share/udhcpc/default.script"
12 # define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
18 #ifdef CONFIG_FEATURE_UDHCP_SYSLOG
22 #ifdef CONFIG_FEATURE_UDHCP_DEBUG
26 #define COMBINED_BINARY
29 #define xfopen bb_xfopen
31 /* make safe the exported namespace */
33 #define background udhcp_background
34 #define start_log_and_pid udhcp_start_log_and_pid
36 #define run_script udhcp_run_script
38 #define init_header udhcp_init_header
39 #define get_packet udhcp_get_packet
40 #define checksum udhcp_checksum
41 #define raw_packet udhcp_raw_packet
42 #define kernel_packet udhcp_kernel_packet
44 #define pidfile_acquire udhcp_pidfile_acquire
45 #define pidfile_write_release udhcp_pidfile_write_release
47 #define get_option udhcp_get_option
48 #define end_option udhcp_end_option
49 #define add_option_string udhcp_add_option_string
50 #define add_simple_option udhcp_add_simple_option
51 #define option_lengths udhcp_option_lengths
53 #define listen_socket udhcp_listen_socket
54 #define read_interface udhcp_read_interface
56 #define client_config udhcp_client_config
58 #define server_config udhcp_server_config
60 #else /* ! IN_BUSYBOX */
64 #include <sys/sysinfo.h>
66 #ifndef ATTRIBUTE_NORETURN
67 #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
68 #endif /* ATTRIBUTE_NORETURN */
70 #ifndef ATTRIBUTE_PACKED
71 #define ATTRIBUTE_PACKED __attribute__ ((__packed__))
72 #endif /* ATTRIBUTE_PACKED */
77 #define xmalloc malloc
78 #define xcalloc calloc
80 static inline FILE *xfopen(const char *file, const char *mode)
83 if (!(fp = fopen(file, mode))) {
84 perror("could not open input file");
90 #endif /* IN_BUSYBOX */
92 #endif /* _LIBBB_UDHCP_H */