Changes for clean build on ZDS

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1637 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-03-21 19:56:54 +00:00
parent d85dc1b75a
commit 5cc7066b41
7 changed files with 45 additions and 38 deletions
+1
View File
@@ -663,3 +663,4 @@
if it receives a port number of zero. if it receives a port number of zero.
* netutils/dhcpd: Corrrect for ZDS compiler. Fix issue with re-use of a * netutils/dhcpd: Corrrect for ZDS compiler. Fix issue with re-use of a
port number. Fix a number of broadcast-related problems. port number. Fix a number of broadcast-related problems.
* eZ80Acclaim!: Add a tiny webserver configuration
+2 -1
View File
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4"> <tr align="center" bgcolor="#e4e4e4">
<td> <td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1> <h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: March 18, 2009</p> <p>Last Updated: March 21, 2009</p>
</td> </td>
</tr> </tr>
</table> </table>
@@ -1354,6 +1354,7 @@ nuttx-0.4.4 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
if it receives a port number of zero. if it receives a port number of zero.
* netutils/dhcpd: Corrrect for ZDS compiler. Fix issue with re-use of a * netutils/dhcpd: Corrrect for ZDS compiler. Fix issue with re-use of a
port number. Fix a number of broadcast-related problems. port number. Fix a number of broadcast-related problems.
* eZ80Acclaim!: Add a tiny webserver configuration
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt; pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
+6 -6
View File
@@ -400,24 +400,24 @@ CONFIG_MMCSD_READONLY=n
# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates # CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates
CONFIG_NET=y CONFIG_NET=y
CONFIG_NET_IPv6=n CONFIG_NET_IPv6=n
CONFIG_NSOCKET_DESCRIPTORS=8 CONFIG_NSOCKET_DESCRIPTORS=16
CONFIG_NET_SOCKOPTS=y CONFIG_NET_SOCKOPTS=y
CONFIG_NET_BUFSIZE=420 CONFIG_NET_BUFSIZE=420
CONFIG_NET_TCP=n CONFIG_NET_TCP=y
CONFIG_NET_TCP_CONNS=8 CONFIG_NET_TCP_CONNS=16
CONFIG_NET_NTCP_READAHEAD_BUFFERS=8 CONFIG_NET_NTCP_READAHEAD_BUFFERS=8
CONFIG_NET_TCPBACKLOG=n CONFIG_NET_TCPBACKLOG=n
CONFIG_NET_MAX_LISTENPORTS=8 CONFIG_NET_MAX_LISTENPORTS=8
CONFIG_NET_UDP=y CONFIG_NET_UDP=n
CONFIG_NET_UDP_CHECKSUMS=y CONFIG_NET_UDP_CHECKSUMS=y
#CONFIG_NET_UDP_CONNS=10 #CONFIG_NET_UDP_CONNS=10
CONFIG_NET_ICMP=y CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_PING=n CONFIG_NET_ICMP_PING=n
#CONFIG_NET_PINGADDRCONF=0 #CONFIG_NET_PINGADDRCONF=0
CONFIG_NET_STATISTICS=n CONFIG_NET_STATISTICS=y
#CONFIG_NET_RECEIVE_WINDOW= #CONFIG_NET_RECEIVE_WINDOW=
#CONFIG_NET_ARPTAB_SIZE=8 #CONFIG_NET_ARPTAB_SIZE=8
CONFIG_NET_BROADCAST=y CONFIG_NET_BROADCAST=n
#CONFIG_NET_LLH_LEN=14 #CONFIG_NET_LLH_LEN=14
#CONFIG_NET_FWCACHE_SIZE=2 #CONFIG_NET_FWCACHE_SIZE=2
+6 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* examples/uip/main.c * examples/uip/main.c
* *
* Copyright (C) 2007 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Based on uIP which also has a BSD style license: * Based on uIP which also has a BSD style license:
@@ -191,6 +191,7 @@ int user_start(int argc, char *argv[])
/* Get an IP address */ /* Get an IP address */
printf("Getting IP address\n");
if (handle) if (handle)
{ {
struct dhcpc_state ds; struct dhcpc_state ds;
@@ -213,11 +214,14 @@ int user_start(int argc, char *argv[])
#endif #endif
#if defined(CONFIG_EXAMPLE_UIP_WEBSERVER) #if defined(CONFIG_EXAMPLE_UIP_WEBSERVER)
printf("Starting webserver\n");
httpd_init(); httpd_init();
httpd_listen(); httpd_listen();
#elif defined(CONFIG_EXAMPLE_UIP_TELNETD) #elif defined(CONFIG_EXAMPLE_UIP_TELNETD)
printf("Starting telnetd\n");
telnetd_init(); telnetd_init();
#elif defined(CONFIG_EXAMPLE_UIP_SMTP) #elif defined(CONFIG_EXAMPLE_UIP_SMTP)
printf("Sending mail\n");
uip_ipaddr(addr.s_addr, 127, 0, 0, 1); uip_ipaddr(addr.s_addr, 127, 0, 0, 1);
handle = smtp_open(); handle = smtp_open();
if (handle) if (handle)
@@ -228,6 +232,7 @@ int user_start(int argc, char *argv[])
smtp_close(handle); smtp_close(handle);
} }
#elif defined(CONFIG_EXAMPLE_UIP_WEBCLIENT) #elif defined(CONFIG_EXAMPLE_UIP_WEBCLIENT)
printf("Getting webpage\n");
webclient_init(); webclient_init();
addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_DNSADDR); addr.s_addr = HTONL(CONFIG_EXAMPLE_UIP_DNSADDR);
resolv_conf(&addr); resolv_conf(&addr);
+1 -1
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* net/socket.c * net/socket.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
+10 -10
View File
@@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* netutils/uiplib/uip_server.c * netutils/uiplib/uip_server.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -94,7 +94,7 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
listensd = socket(PF_INET, SOCK_STREAM, 0); listensd = socket(PF_INET, SOCK_STREAM, 0);
if (listensd < 0) if (listensd < 0)
{ {
dbg("socket failure: %d\n", errno); ndbg("socket failure: %d\n", errno);
return; return;
} }
@@ -104,7 +104,7 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
optval = 1; optval = 1;
if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0) if (setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, (void*)&optval, sizeof(int)) < 0)
{ {
dbg("setsockopt SO_REUSEADDR failure: %d\n", errno); ndbg("setsockopt SO_REUSEADDR failure: %d\n", errno);
goto errout_with_socket; goto errout_with_socket;
} }
#endif #endif
@@ -117,7 +117,7 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
if (bind(listensd, (struct sockaddr*)&myaddr, sizeof(struct sockaddr_in)) < 0) if (bind(listensd, (struct sockaddr*)&myaddr, sizeof(struct sockaddr_in)) < 0)
{ {
dbg("bind failure: %d\n", errno); ndbg("bind failure: %d\n", errno);
goto errout_with_socket; goto errout_with_socket;
} }
@@ -125,23 +125,23 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
if (listen(listensd, 5) < 0) if (listen(listensd, 5) < 0)
{ {
dbg("listen failure %d\n", errno); ndbg("listen failure %d\n", errno);
goto errout_with_socket; goto errout_with_socket;
} }
/* Begin accepting connections */ /* Begin accepting connections */
dbg("Accepting connections on port %d\n", ntohs(portno)); nvdbg("Accepting connections on port %d\n", ntohs(portno));
for (;;) for (;;)
{ {
addrlen = sizeof(struct sockaddr_in); addrlen = sizeof(struct sockaddr_in);
acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen); acceptsd = accept(listensd, (struct sockaddr*)&myaddr, &addrlen);
if (acceptsd < 0) if (acceptsd < 0)
{ {
dbg("accept failure: %d\n", errno); ndbg("accept failure: %d\n", errno);
break;; break;;
} }
dbg("Connection accepted -- spawning sd=%d\n", acceptsd); nvdbg("Connection accepted -- spawning sd=%d\n", acceptsd);
/* Configure to "linger" until all data is sent when the socket is closed */ /* Configure to "linger" until all data is sent when the socket is closed */
@@ -151,7 +151,7 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0) if (setsockopt(acceptsd, SOL_SOCKET, SO_LINGER, &ling, sizeof(struct linger)) < 0)
{ {
close(acceptsd); close(acceptsd);
dbg("setsockopt SO_LINGER failure: %d\n", errno); ndbg("setsockopt SO_LINGER failure: %d\n", errno);
break;; break;;
} }
#endif #endif
@@ -166,7 +166,7 @@ void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize)
if (pthread_create(&child, &attr, handler, (void*)acceptsd) != 0) if (pthread_create(&child, &attr, handler, (void*)acceptsd) != 0)
{ {
close(acceptsd); close(acceptsd);
dbg("create_create failed\n"); ndbg("create_create failed\n");
break; break;
} }
+18 -18
View File
@@ -2,7 +2,7 @@
* netutils/webserver/httpd.c * netutils/webserver/httpd.c
* httpd Web server * httpd Web server
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* *
* This is a leverage of similar logic from uIP: * This is a leverage of similar logic from uIP:
@@ -120,7 +120,7 @@ static const char g_httpheader404[] =
#ifdef CONFIG_NETUTILS_HTTPD_DUMPBUFFER #ifdef CONFIG_NETUTILS_HTTPD_DUMPBUFFER
static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes) static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes)
{ {
#ifdef CONFIG_DEBUG #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_NET)
char line[128]; char line[128];
int ch; int ch;
int i; int i;
@@ -148,7 +148,7 @@ static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes)
sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.'); sprintf(&line[strlen(line)], "%c", ch >= 0x20 && ch <= 0x7e ? ch : '.');
} }
} }
dbg("%s\n", line); nvdbg("%s\n", line);
} }
#endif #endif
} }
@@ -159,14 +159,14 @@ static void httpd_dumpbuffer(const char *buffer, ssize_t nbytes)
#ifdef CONFIG_NETUTILS_HTTPD_DUMPPSTATE #ifdef CONFIG_NETUTILS_HTTPD_DUMPPSTATE
static void httpd_dumppstate(struct httpd_state *pstate, const char *msg) static void httpd_dumppstate(struct httpd_state *pstate, const char *msg)
{ {
#ifdef CONFIG_DEBUG #if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_NET)
dbg("[%d] pstate(%p): [%s]\n", pstate->ht_sockfd, pstate, msg); nvdbg("[%d] pstate(%p): [%s]\n", pstate->ht_sockfd, pstate, msg);
dbg(" filename: [%s]\n", pstate->ht_filename); nvdbg(" filename: [%s]\n", pstate->ht_filename);
dbg(" htfile len: %d\n", pstate->ht_file.len); nvdbg(" htfile len: %d\n", pstate->ht_file.len);
dbg(" sockfd: %d\n", pstate->ht_sockfd); nvdbg(" sockfd: %d\n", pstate->ht_sockfd);
dbg(" scriptptr: %p\n", pstate->ht_scriptptr); nvdbg(" scriptptr: %p\n", pstate->ht_scriptptr);
dbg(" scriptlen: %d\n", pstate->ht_scriptlen); nvdbg(" scriptlen: %d\n", pstate->ht_scriptlen);
dbg(" sndlen: %d\n", pstate->ht_sndlen); nvdbg(" sndlen: %d\n", pstate->ht_sndlen);
#endif #endif
} }
#else #else
@@ -272,7 +272,7 @@ static int httpd_addchunk(struct httpd_state *pstate, const char *buffer, int le
{ {
chunklen = len; chunklen = len;
} }
vdbg("[%d] sndlen=%d len=%d newlen=%d chunklen=%d\n", nvdbg("[%d] sndlen=%d len=%d newlen=%d chunklen=%d\n",
pstate->ht_sockfd, pstate->ht_sndlen, len, newlen, chunklen); pstate->ht_sockfd, pstate->ht_sndlen, len, newlen, chunklen);
/* Copy that chunk into the send buffer */ /* Copy that chunk into the send buffer */
@@ -403,7 +403,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
recvlen = recv(pstate->ht_sockfd, pstate->ht_buffer, HTTPD_IOBUFFER_SIZE, 0); recvlen = recv(pstate->ht_sockfd, pstate->ht_buffer, HTTPD_IOBUFFER_SIZE, 0);
if (recvlen < 0) if (recvlen < 0)
{ {
dbg("[%d] recv failed: %d\n", pstate->ht_sockfd, errno); ndbg("[%d] recv failed: %d\n", pstate->ht_sockfd, errno);
return ERROR; return ERROR;
} }
httpd_dumpbuffer(pstate->ht_buffer, recvlen); httpd_dumpbuffer(pstate->ht_buffer, recvlen);
@@ -412,7 +412,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
if (strncmp(pstate->ht_buffer, g_httpcmdget, strlen(g_httpcmdget)) != 0) if (strncmp(pstate->ht_buffer, g_httpcmdget, strlen(g_httpcmdget)) != 0)
{ {
dbg("[%d] Unsupported command\n", pstate->ht_sockfd); ndbg("[%d] Unsupported command\n", pstate->ht_sockfd);
return ERROR; return ERROR;
} }
@@ -420,7 +420,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
if (pstate->ht_buffer[4] != ISO_slash) if (pstate->ht_buffer[4] != ISO_slash)
{ {
dbg("[%d] Missing path\n", pstate->ht_sockfd); ndbg("[%d] Missing path\n", pstate->ht_sockfd);
return ERROR; return ERROR;
} }
else if (pstate->ht_buffer[5] == ISO_space) else if (pstate->ht_buffer[5] == ISO_space)
@@ -437,7 +437,7 @@ static inline int httpd_cmd(struct httpd_state *pstate)
} }
pstate->ht_filename[i]='\0'; pstate->ht_filename[i]='\0';
} }
dbg("[%d] Filename: %s\n", pstate->ht_sockfd, pstate->ht_filename); nvdbg("[%d] Filename: %s\n", pstate->ht_sockfd, pstate->ht_filename);
/* Then send the file */ /* Then send the file */
@@ -460,7 +460,7 @@ static void *httpd_handler(void *arg)
int sockfd = (int)arg; int sockfd = (int)arg;
int ret = ERROR; int ret = ERROR;
dbg("[%d] Started\n", sockfd); nvdbg("[%d] Started\n", sockfd);
/* Verify that the state structure was successfully allocated */ /* Verify that the state structure was successfully allocated */
@@ -487,7 +487,7 @@ static void *httpd_handler(void *arg)
/* Exit the task */ /* Exit the task */
dbg("[%d] Exitting\n", sockfd); nvdbg("[%d] Exitting\n", sockfd);
close(sockfd); close(sockfd);
return NULL; return NULL;
} }