@@ -13,14 +13,15 @@
#ifndef _NETAPPS_H_
#define _NETAPPS_H_
-#include <tftp.h>
-
#define F_IPV4 4
#define F_IPV6 6
-int netboot(int argc, char *argv[]);
-int netsave(int argc, char *argv[]);
-int ping(int argc, char *argv[]);
-int dhcp(char *ret_buffer, filename_ip_t * fn_ip, unsigned int retries, int flags);
+struct filename_ip;
+
+extern int netboot(int argc, char *argv[]);
+extern int netsave(int argc, char *argv[]);
+extern int ping(int argc, char *argv[]);
+extern int dhcp(char *ret_buffer, struct filename_ip *fn_ip,
+ unsigned int retries, int flags);
#endif
@@ -328,7 +328,8 @@ parse_args(const char *arg_str, obp_tftp_args_t *obp_tftp_args)
* @return ZERO - IP and configuration info obtained;
* NON ZERO - error condition occurs.
*/
-int dhcp(char *ret_buffer, filename_ip_t * fn_ip, unsigned int retries, int flags)
+int dhcp(char *ret_buffer, struct filename_ip *fn_ip, unsigned int retries,
+ int flags)
{
int i = (int) retries+1;
int rc = -1;
@@ -22,7 +22,7 @@ struct tftphdr {
uint16_t th_data;
};
-typedef struct {
+struct filename_ip {
uint32_t own_ip;
ip6_addr_t own_ip6;
uint32_t server_ip;
@@ -30,7 +30,8 @@ typedef struct {
ip6_addr_t dns_ip6;
int8_t filename[256];
int fd;
-} __attribute__ ((packed)) filename_ip_t ;
+} __attribute__ ((packed));
+typedef struct filename_ip filename_ip_t;
typedef struct {
uint32_t bad_tftp_packets;
Unfortunately netapps.h currently can't be included from .code Forth-to-C wrapper files - it includes tftp.h which in turn includes ipv6.h, and that header contains some constructs which can't be used in .code files. So let's make netapps.h independent from tftp.h and add some "extern" keywords like it is done with the other header files already that are included from .code files. Signed-off-by: Thomas Huth <thuth@redhat.com> --- lib/libnet/netapps.h | 13 +++++++------ lib/libnet/netload.c | 3 ++- lib/libnet/tftp.h | 5 +++-- 3 files changed, 12 insertions(+), 9 deletions(-)