aboutsummaryrefslogtreecommitdiff
path: root/lib/libnet
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2016-09-19 21:08:26 +0200
committerAlexey Kardashevskiy <aik@ozlabs.ru>2016-10-10 17:30:54 +1100
commit3cca9577f7e3a150798186711e5bbe0df7cd6f01 (patch)
treecde8a1901abee35a3af130ca76091eb8dd53944c /lib/libnet
parentdc2eba87c19d47d6c96d68fae87d7ff5959bf7f8 (diff)
downloadSLOF-3cca9577f7e3a150798186711e5bbe0df7cd6f01.zip
SLOF-3cca9577f7e3a150798186711e5bbe0df7cd6f01.tar.gz
SLOF-3cca9577f7e3a150798186711e5bbe0df7cd6f01.tar.bz2
libnet: Make netapps.h includable from .code files
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> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libnet')
-rw-r--r--lib/libnet/netapps.h13
-rw-r--r--lib/libnet/netload.c3
-rw-r--r--lib/libnet/tftp.h5
3 files changed, 12 insertions, 9 deletions
diff --git a/lib/libnet/netapps.h b/lib/libnet/netapps.h
index 8fceba8..693de69 100644
--- a/lib/libnet/netapps.h
+++ b/lib/libnet/netapps.h
@@ -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
diff --git a/lib/libnet/netload.c b/lib/libnet/netload.c
index 7ded3e4..1b7c1bc 100644
--- a/lib/libnet/netload.c
+++ b/lib/libnet/netload.c
@@ -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;
diff --git a/lib/libnet/tftp.h b/lib/libnet/tftp.h
index 6b5996c..303feaf 100644
--- a/lib/libnet/tftp.h
+++ b/lib/libnet/tftp.h
@@ -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;