From a6527b34d909c2bc3fca1b6b2d87c388c4b43521 Mon Sep 17 00:00:00 2001 From: matsutsuka Date: Sat, 29 Sep 2007 03:54:18 +0000 Subject: [PATCH] When UIP_UDP is off, turn off udp functions more accurately. --- core/net/rawpacket-udp.c | 4 +++- core/net/resolv.c | 4 +++- core/net/tcpip.c | 12 +++++++++++- core/net/uaodv.c | 5 +++-- core/net/uip-udp-packet.c | 4 +++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/core/net/rawpacket-udp.c b/core/net/rawpacket-udp.c index 26d1bb5b7..64da44217 100644 --- a/core/net/rawpacket-udp.c +++ b/core/net/rawpacket-udp.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rawpacket-udp.c,v 1.1 2006/10/22 12:31:46 adamdunkels Exp $ + * $Id: rawpacket-udp.c,v 1.2 2007/09/29 03:54:18 matsutsuka Exp $ */ /** @@ -38,6 +38,7 @@ * Adam Dunkels */ +#if UIP_UDP #include "contiki-net.h" #include "net/rawpacket-udp.h" @@ -69,3 +70,4 @@ rawpacket_received(struct rawpacket_conn *c) return uip_newdata() && (struct uip_udp_conn *)c == uip_udp_conn; } /*---------------------------------------------------------------------------*/ +#endif /* UIP_UDP */ diff --git a/core/net/resolv.c b/core/net/resolv.c index c373e21cf..bcad4a8b0 100644 --- a/core/net/resolv.c +++ b/core/net/resolv.c @@ -57,12 +57,13 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: resolv.c,v 1.5 2007/01/07 13:52:25 oliverschmidt Exp $ + * $Id: resolv.c,v 1.6 2007/09/29 03:54:18 matsutsuka Exp $ * */ #include "net/tcpip.h" #include "net/resolv.h" +#if UIP_UDP #include @@ -500,6 +501,7 @@ resolv_found(char *name, u16_t *ipaddr) process_post(PROCESS_BROADCAST, resolv_event_found, name); } /*-----------------------------------------------------------------------------------*/ +#endif /* UIP_UDP */ /** @} */ /** @} */ diff --git a/core/net/tcpip.c b/core/net/tcpip.c index 898b65693..cb00a8fb2 100644 --- a/core/net/tcpip.c +++ b/core/net/tcpip.c @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: tcpip.c,v 1.8 2007/05/20 21:29:39 oliverschmidt Exp $ + * $Id: tcpip.c,v 1.9 2007/09/29 03:54:18 matsutsuka Exp $ */ #include "contiki-net.h" @@ -168,6 +168,7 @@ tcp_attach(struct uip_conn *conn, s->state = appstate; } /*---------------------------------------------------------------------------*/ +#if UIP_UDP void udp_attach(struct uip_udp_conn *conn, void *appstate) @@ -210,6 +211,7 @@ udp_broadcast_new(u16_t port, void *appstate) } return conn; } +#endif /* UIP_UDP */ /*---------------------------------------------------------------------------*/ static void eventhandler(process_event_t ev, process_data_t data) @@ -306,6 +308,7 @@ eventhandler(process_event_t ev, process_data_t data) } break; +#if UIP_UDP case UDP_POLL: if(data != NULL) { uip_udp_periodic_conn(data); @@ -314,6 +317,7 @@ eventhandler(process_event_t ev, process_data_t data) } } break; +#endif /* UIP_UDP */ case PACKET_INPUT: packet_input(); @@ -328,11 +332,13 @@ tcpip_input(void) uip_len = 0; } /*---------------------------------------------------------------------------*/ +#if UIP_UDP void tcpip_poll_udp(struct uip_udp_conn *conn) { process_post(&tcpip_process, UDP_POLL, conn); } +#endif /* UIP_UDP */ /*---------------------------------------------------------------------------*/ void tcpip_poll_tcp(struct uip_conn *conn) @@ -347,11 +353,15 @@ tcpip_uipcall(void) static unsigned char i; register struct listenport *l; +#if UIP_UDP if(uip_conn != NULL) { ts = &uip_conn->appstate; } else { ts = &uip_udp_conn->appstate; } +#else /* UIP_UDP */ + ts = &uip_conn->appstate; +#endif /* UIP_UDP */ /* If this is a connection request for a listening port, we must mark the connection with the right process ID. */ diff --git a/core/net/uaodv.c b/core/net/uaodv.c index 145014a49..0ddfa3d29 100644 --- a/core/net/uaodv.c +++ b/core/net/uaodv.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uaodv.c,v 1.31 2007/08/30 14:39:17 matsutsuka Exp $ + * $Id: uaodv.c,v 1.32 2007/09/29 03:54:18 matsutsuka Exp $ */ /** @@ -38,7 +38,7 @@ * Adam Dunkels */ - +#if UIP_UDP #include #include @@ -626,3 +626,4 @@ PROCESS_THREAD(uaodv_process, ev, data) PROCESS_END(); } /*---------------------------------------------------------------------------*/ +#endif /* UIP_UDP */ diff --git a/core/net/uip-udp-packet.c b/core/net/uip-udp-packet.c index 396b53e17..85c40ef10 100644 --- a/core/net/uip-udp-packet.c +++ b/core/net/uip-udp-packet.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: uip-udp-packet.c,v 1.3 2007/04/30 15:19:21 bg- Exp $ + * $Id: uip-udp-packet.c,v 1.4 2007/09/29 03:54:18 matsutsuka Exp $ */ /** @@ -38,6 +38,7 @@ * Adam Dunkels */ +#if UIP_UDP #include "net/uip-udp-packet.h" #include @@ -58,3 +59,4 @@ uip_udp_packet_send(struct uip_udp_conn *c, const void *data, int len) uip_slen = 0; } /*---------------------------------------------------------------------------*/ +#endif /* UIP_UDP */