diff options
Diffstat (limited to 'apps')
42 files changed, 96 insertions, 12 deletions
diff --git a/apps/examples/discover/discover_main.c b/apps/examples/discover/discover_main.c index cd0cfc4e4..3995c475e 100644 --- a/apps/examples/discover/discover_main.c +++ b/apps/examples/discover/discover_main.c @@ -48,6 +48,7 @@ #include <debug.h> #include <net/if.h> +#include <netinet/in.h> #include <nuttx/net/arp.h> #include <apps/netutils/netlib.h> diff --git a/apps/examples/ftpd/ftpd_main.c b/apps/examples/ftpd/ftpd_main.c index bfd20b093..507d90e5f 100644 --- a/apps/examples/ftpd/ftpd_main.c +++ b/apps/examples/ftpd/ftpd_main.c @@ -44,6 +44,7 @@ #include <debug.h> #include <netinet/in.h> +#include <arpa/inet.h> #include <apps/netutils/netlib.h> #include <apps/netutils/ftpd.h> diff --git a/apps/examples/igmp/igmp.c b/apps/examples/igmp/igmp.c index 730edce97..61272bf3c 100644 --- a/apps/examples/igmp/igmp.c +++ b/apps/examples/igmp/igmp.c @@ -44,7 +44,10 @@ #include <unistd.h> #include <debug.h> +#include <arpa/inet.h> #include <net/if.h> +#include <netinet/in.h> + #include <apps/netutils/netlib.h> #include <apps/netutils/ipmsfilter.h> diff --git a/apps/examples/nettest/nettest.c b/apps/examples/nettest/nettest.c index b1596ec61..a24ce30f4 100644 --- a/apps/examples/nettest/nettest.c +++ b/apps/examples/nettest/nettest.c @@ -44,6 +44,9 @@ #include <debug.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> + #include <apps/netutils/netlib.h> #include "nettest.h" diff --git a/apps/examples/nettest/nettest.h b/apps/examples/nettest/nettest.h index 5021e05d6..c6ed3f1be 100644 --- a/apps/examples/nettest/nettest.h +++ b/apps/examples/nettest/nettest.h @@ -40,6 +40,8 @@ * Included Files ****************************************************************************/ +#include <arpa/inet.h> + #ifdef NETTEST_HOST #else # include <debug.h> diff --git a/apps/examples/nettest/nettest_client.c b/apps/examples/nettest/nettest_client.c index 8ab5b14d6..7686d0ac8 100644 --- a/apps/examples/nettest/nettest_client.c +++ b/apps/examples/nettest/nettest_client.c @@ -46,6 +46,8 @@ #include <string.h> #include <errno.h> +#include <arpa/inet.h> + #include "nettest.h" /**************************************************************************** diff --git a/apps/examples/nettest/nettest_server.c b/apps/examples/nettest/nettest_server.c index ffa021286..bdea83dc8 100644 --- a/apps/examples/nettest/nettest_server.c +++ b/apps/examples/nettest/nettest_server.c @@ -46,6 +46,8 @@ #include <unistd.h> #include <errno.h> +#include <arpa/inet.h> + #include "nettest.h" /**************************************************************************** diff --git a/apps/examples/poll/net_listener.c b/apps/examples/poll/net_listener.c index 4094753a5..841d7d95c 100644 --- a/apps/examples/poll/net_listener.c +++ b/apps/examples/poll/net_listener.c @@ -54,6 +54,8 @@ #include <debug.h> #include <net/if.h> +#include <netinet/in.h> + #include <apps/netutils/netlib.h> #include "poll_internal.h" diff --git a/apps/examples/poll/net_reader.c b/apps/examples/poll/net_reader.c index 812600d77..beecee275 100644 --- a/apps/examples/poll/net_reader.c +++ b/apps/examples/poll/net_reader.c @@ -54,6 +54,9 @@ #include <debug.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> + #include <apps/netutils/netlib.h> #include "poll_internal.h" diff --git a/apps/examples/poll/poll_listener.c b/apps/examples/poll/poll_listener.c index d7f4bf495..e253d59ff 100644 --- a/apps/examples/poll/poll_listener.c +++ b/apps/examples/poll/poll_listener.c @@ -51,6 +51,8 @@ #include <errno.h> #include <debug.h> +#include <arpa/inet.h> + #include "poll_internal.h" /**************************************************************************** diff --git a/apps/examples/sendmail/host.c b/apps/examples/sendmail/host.c index d603372ad..28af0d53c 100644 --- a/apps/examples/sendmail/host.c +++ b/apps/examples/sendmail/host.c @@ -43,6 +43,9 @@ #include <string.h> #include <errno.h> +#include <netinet/in.h> + +#include <nuttx/net/ip.h> #include <apps/netutils/smtp.h> /**************************************************************************** @@ -99,5 +102,6 @@ int main(int argc, char **argv, char **envp) g_msg_body, strlen(g_msg_body)); smtp_close(handle); } + return 0; } diff --git a/apps/examples/sendmail/hostdefs.h b/apps/examples/sendmail/hostdefs.h index e9860c22d..e29df7856 100644 --- a/apps/examples/sendmail/hostdefs.h +++ b/apps/examples/sendmail/hostdefs.h @@ -44,8 +44,10 @@ #include <stdbool.h> #include <stdio.h> +#include <arpa/inet.h> + /**************************************************************************** - * Preprocessor Defintiions + * Pre-processor Definitions *****************************************************************************/ #define HTONS(a) htons(a) diff --git a/apps/examples/sendmail/target.c b/apps/examples/sendmail/target.c index 4d7232b4d..684f2b742 100644 --- a/apps/examples/sendmail/target.c +++ b/apps/examples/sendmail/target.c @@ -45,6 +45,10 @@ #include <errno.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> + +#include <nuttx/net/ip.h> #include <apps/netutils/netlib.h> #include <apps/netutils/smtp.h> diff --git a/apps/examples/tcpecho/tcpecho_main.c b/apps/examples/tcpecho/tcpecho_main.c index cbcafcce5..9e9333e52 100644 --- a/apps/examples/tcpecho/tcpecho_main.c +++ b/apps/examples/tcpecho/tcpecho_main.c @@ -54,8 +54,9 @@ #include <unistd.h> #include <net/if.h> -#include <nuttx/net/arp.h> +#include <netinet/in.h> +#include <nuttx/net/arp.h> #include <apps/netutils/netlib.h> #ifdef CONFIG_EXAMPLES_TCPECHO_DHCPC diff --git a/apps/examples/telnetd/telnetd.c b/apps/examples/telnetd/telnetd.c index be3bbe98d..2541f96ef 100644 --- a/apps/examples/telnetd/telnetd.c +++ b/apps/examples/telnetd/telnetd.c @@ -46,6 +46,7 @@ #include <net/if.h> #include <arpa/inet.h> +#include <netinet/in.h> #include <apps/netutils/telnetd.h> #include <apps/netutils/netlib.h> diff --git a/apps/examples/thttpd/content/netstat/netstat.c b/apps/examples/thttpd/content/netstat/netstat.c index 19c8ca871..133831c4a 100644 --- a/apps/examples/thttpd/content/netstat/netstat.c +++ b/apps/examples/thttpd/content/netstat/netstat.c @@ -43,7 +43,9 @@ #include <stdlib.h> #include <unistd.h> +#include <netinet/in.h> #include <netinet/ether.h> + #include <nuttx/net/netconfig.h> #include <nuttx/net/netdev.h> diff --git a/apps/examples/thttpd/thttpd_main.c b/apps/examples/thttpd/thttpd_main.c index e847ebad3..c2e6325a7 100644 --- a/apps/examples/thttpd/thttpd_main.c +++ b/apps/examples/thttpd/thttpd_main.c @@ -49,6 +49,8 @@ #include <debug.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> #include <netinet/ether.h> #include <nuttx/net/arp.h> diff --git a/apps/examples/udp/target.c b/apps/examples/udp/target.c index 8b31fc8cd..ac76aec00 100644 --- a/apps/examples/udp/target.c +++ b/apps/examples/udp/target.c @@ -1,5 +1,5 @@ /**************************************************************************** - * examples/udp/nettest.c + * examples/udp/target.c * * Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> @@ -41,6 +41,9 @@ #include <stdio.h> #include <debug.h> +#include <arpa/inet.h> +#include <netinet/in.h> + #include <apps/netutils/netlib.h> #include "udp-internal.h" diff --git a/apps/examples/udp/udp-client.c b/apps/examples/udp/udp-client.c index 6b8473582..297cde5f5 100644 --- a/apps/examples/udp/udp-client.c +++ b/apps/examples/udp/udp-client.c @@ -39,7 +39,6 @@ #include <sys/types.h> #include <sys/socket.h> -#include <netinet/in.h> #include <stdio.h> #include <stdlib.h> @@ -47,6 +46,9 @@ #include <string.h> #include <errno.h> +#include <arpa/inet.h> +#include <netinet/in.h> + #include "udp-internal.h" /**************************************************************************** diff --git a/apps/examples/udp/udp-internal.h b/apps/examples/udp/udp-internal.h index da2be440a..49439aedb 100644 --- a/apps/examples/udp/udp-internal.h +++ b/apps/examples/udp/udp-internal.h @@ -45,6 +45,8 @@ # include <debug.h> #endif +#include <arpa/inet.h> + /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/apps/examples/udp/udp-server.c b/apps/examples/udp/udp-server.c index 191f89cc0..e16449b8d 100644 --- a/apps/examples/udp/udp-server.c +++ b/apps/examples/udp/udp-server.c @@ -45,6 +45,8 @@ #include <unistd.h> #include <errno.h> +#include <arpa/inet.h> + #include "udp-internal.h" /**************************************************************************** diff --git a/apps/examples/webserver/webserver_main.c b/apps/examples/webserver/webserver_main.c index 6b5f81127..58e8757ea 100644 --- a/apps/examples/webserver/webserver_main.c +++ b/apps/examples/webserver/webserver_main.c @@ -54,8 +54,9 @@ #include <debug.h> #include <net/if.h> -#include <nuttx/net/arp.h> +#include <netinet/in.h> +#include <nuttx/net/arp.h> #include <apps/netutils/netlib.h> #ifdef CONFIG_EXAMPLES_WEBSERVER_DHCPC diff --git a/apps/examples/wget/hostdefs.h b/apps/examples/wget/hostdefs.h index e9860c22d..e29df7856 100644 --- a/apps/examples/wget/hostdefs.h +++ b/apps/examples/wget/hostdefs.h @@ -44,8 +44,10 @@ #include <stdbool.h> #include <stdio.h> +#include <arpa/inet.h> + /**************************************************************************** - * Preprocessor Defintiions + * Pre-processor Definitions *****************************************************************************/ #define HTONS(a) htons(a) diff --git a/apps/examples/xmlrpc/xmlrpc_main.c b/apps/examples/xmlrpc/xmlrpc_main.c index 025185531..228855e1e 100644 --- a/apps/examples/xmlrpc/xmlrpc_main.c +++ b/apps/examples/xmlrpc/xmlrpc_main.c @@ -63,8 +63,9 @@ #include <unistd.h> #include <net/if.h> -#include <nuttx/net/arp.h> +#include <netinet/in.h> +#include <nuttx/net/arp.h> #include <apps/netutils/netlib.h> #include <apps/netutils/xmlrpc.h> diff --git a/apps/include/netutils/dhcpc.h b/apps/include/netutils/dhcpc.h index a6c53dc30..c982b7d9e 100644 --- a/apps/include/netutils/dhcpc.h +++ b/apps/include/netutils/dhcpc.h @@ -43,6 +43,7 @@ ****************************************************************************/ #include <stdint.h> +#include <netinet/in.h> /**************************************************************************** * Pre-processor Definitions diff --git a/apps/include/netutils/smtp.h b/apps/include/netutils/smtp.h index e33d914fb..2ca7f1e8c 100644 --- a/apps/include/netutils/smtp.h +++ b/apps/include/netutils/smtp.h @@ -45,6 +45,7 @@ ****************************************************************************/ #include <nuttx/net/netconfig.h> +#include <nuttx/net/ip.h> /**************************************************************************** * Type Definitions diff --git a/apps/include/netutils/tftp.h b/apps/include/netutils/tftp.h index 276073aad..2969fb700 100644 --- a/apps/include/netutils/tftp.h +++ b/apps/include/netutils/tftp.h @@ -57,13 +57,14 @@ #ifdef __cplusplus #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif -EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary); -EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary); +int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary); +int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary); #undef EXTERN #ifdef __cplusplus diff --git a/apps/netutils/dhcpc/dhcpc.c b/apps/netutils/dhcpc/dhcpc.c index 44f4d1747..879cab1f8 100644 --- a/apps/netutils/dhcpc/dhcpc.c +++ b/apps/netutils/dhcpc/dhcpc.c @@ -52,6 +52,8 @@ #include <errno.h> #include <debug.h> +#include <arpa/inet.h> + #include <apps/netutils/dhcpc.h> #include <apps/netutils/netlib.h> diff --git a/apps/netutils/dnsclient/dns_socket.c b/apps/netutils/dnsclient/dns_socket.c index 6b78169ea..a240b4392 100644 --- a/apps/netutils/dnsclient/dns_socket.c +++ b/apps/netutils/dnsclient/dns_socket.c @@ -58,6 +58,7 @@ #include <sys/socket.h> #include <arpa/inet.h> +#include <netinet/in.h> #include <apps/netutils/dnsclient.h> #include <apps/netutils/netlib.h> diff --git a/apps/netutils/ftpc/ftpc_connect.c b/apps/netutils/ftpc/ftpc_connect.c index 4fa8178a7..74598f931 100644 --- a/apps/netutils/ftpc/ftpc_connect.c +++ b/apps/netutils/ftpc/ftpc_connect.c @@ -45,6 +45,8 @@ #include <errno.h> #include <debug.h> +#include <arpa/inet.h> + #include <apps/ftpc.h> #include "ftpc_internal.h" diff --git a/apps/netutils/ftpc/ftpc_internal.h b/apps/netutils/ftpc/ftpc_internal.h index a2a6fffce..5bb683f50 100644 --- a/apps/netutils/ftpc/ftpc_internal.h +++ b/apps/netutils/ftpc/ftpc_internal.h @@ -51,6 +51,8 @@ #include <time.h> #include <wdog.h> +#include <netinet/in.h> + #include <apps/ftpc.h> /**************************************************************************** diff --git a/apps/netutils/smtp/smtp.c b/apps/netutils/smtp/smtp.c index add48de3c..095a1c495 100644 --- a/apps/netutils/smtp/smtp.c +++ b/apps/netutils/smtp/smtp.c @@ -48,6 +48,7 @@ #include <nuttx/config.h> +#include <sys/socket.h> #include <stdint.h> #include <stdbool.h> #include <stdio.h> @@ -55,8 +56,10 @@ #include <unistd.h> #include <string.h> #include <semaphore.h> -#include <sys/socket.h> +#include <arpa/inet.h> + +#include <nuttx/net/ip.h> #include <apps/netutils/smtp.h> /**************************************************************************** diff --git a/apps/netutils/tftpc/tftpc_get.c b/apps/netutils/tftpc/tftpc_get.c index 3847b2aad..4a4789c05 100644 --- a/apps/netutils/tftpc/tftpc_get.c +++ b/apps/netutils/tftpc/tftpc_get.c @@ -49,6 +49,8 @@ #include <errno.h> #include <debug.h> +#include <arpa/inet.h> + #include <nuttx/net/netconfig.h> #include <apps/netutils/tftp.h> diff --git a/apps/netutils/tftpc/tftpc_packets.c b/apps/netutils/tftpc/tftpc_packets.c index f2f1a0a22..8775ca3a2 100644 --- a/apps/netutils/tftpc/tftpc_packets.c +++ b/apps/netutils/tftpc/tftpc_packets.c @@ -50,6 +50,7 @@ #include <debug.h> #include <netinet/in.h> +#include <arpa/inet.h> #include <nuttx/net/netconfig.h> #include <apps/netutils/tftp.h> diff --git a/apps/netutils/thttpd/thttpd.c b/apps/netutils/thttpd/thttpd.c index 6f082fc23..6611b2e3b 100644 --- a/apps/netutils/thttpd/thttpd.c +++ b/apps/netutils/thttpd/thttpd.c @@ -53,6 +53,8 @@ #include <errno.h> #include <debug.h> +#include <arpa/inet.h> + #include <nuttx/compiler.h> #include <nuttx/binfmt/symtab.h> #include <apps/netutils/thttpd.h> diff --git a/apps/netutils/webserver/httpd.c b/apps/netutils/webserver/httpd.c index 29dd1f336..d1bbb103c 100644 --- a/apps/netutils/webserver/httpd.c +++ b/apps/netutils/webserver/httpd.c @@ -61,6 +61,8 @@ # include <pthread.h> #endif +#include <arpa/inet.h> + #include <apps/netutils/netlib.h> #include <apps/netutils/httpd.h> diff --git a/apps/nshlib/nsh_mntcmds.c b/apps/nshlib/nsh_mntcmds.c index de40c8e6c..584c1258a 100644 --- a/apps/nshlib/nsh_mntcmds.c +++ b/apps/nshlib/nsh_mntcmds.c @@ -50,6 +50,9 @@ #include <errno.h> #include <debug.h> +#include <netinet/in.h> +#include <arpa/inet.h> + #include <nuttx/fs/nfs.h> #include "nsh.h" diff --git a/apps/nshlib/nsh_netcmds.c b/apps/nshlib/nsh_netcmds.c index c5834f55c..93ed13237 100644 --- a/apps/nshlib/nsh_netcmds.c +++ b/apps/nshlib/nsh_netcmds.c @@ -55,12 +55,15 @@ #include <net/ethernet.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> #include <netinet/ether.h> -#include <nuttx/net/net.h> #include <nuttx/clock.h> +#include <nuttx/net/net.h> #include <nuttx/net/netdev.h> #include <nuttx/net/netstats.h> +#include <nuttx/net/ip.h> #if defined(CONFIG_NET_ICMP) && defined(CONFIG_NET_ICMP_PING) && \ !defined(CONFIG_DISABLE_CLOCK) && !defined(CONFIG_DISABLE_SIGNALS) diff --git a/apps/nshlib/nsh_netinit.c b/apps/nshlib/nsh_netinit.c index b59eaf571..ec502e796 100644 --- a/apps/nshlib/nsh_netinit.c +++ b/apps/nshlib/nsh_netinit.c @@ -45,6 +45,8 @@ #include <debug.h> #include <net/if.h> +#include <arpa/inet.h> +#include <netinet/in.h> #include <apps/netutils/netlib.h> #if defined(CONFIG_NSH_DHCPC) || defined(CONFIG_NSH_DNS) diff --git a/apps/nshlib/nsh_routecmds.c b/apps/nshlib/nsh_routecmds.c index 5ca96a5f4..b8a6c4784 100644 --- a/apps/nshlib/nsh_routecmds.c +++ b/apps/nshlib/nsh_routecmds.c @@ -43,6 +43,9 @@ #include <string.h> #include <net/route.h> +#include <netinet/in.h> +#include <arpa/inet.h> + #include <apps/netutils/netlib.h> #include "nsh.h" diff --git a/apps/nshlib/nsh_telnetd.c b/apps/nshlib/nsh_telnetd.c index 61a196601..bbb0393f7 100644 --- a/apps/nshlib/nsh_telnetd.c +++ b/apps/nshlib/nsh_telnetd.c @@ -45,6 +45,8 @@ #include <debug.h> #include <string.h> +#include <arpa/inet.h> + #include <apps/netutils/telnetd.h> #include "nsh.h" diff --git a/apps/system/mdio/mdio_main.c b/apps/system/mdio/mdio_main.c index 5df090b49..6d770102a 100644 --- a/apps/system/mdio/mdio_main.c +++ b/apps/system/mdio/mdio_main.c @@ -49,6 +49,7 @@ #include <netinet/in.h> #include <net/if.h> +#include <arpa/inet.h> /**************************************************************************** * Definitions |