When UIP_UDP is off, turn off udp functions more accurately.

This commit is contained in:
matsutsuka 2007-09-29 03:54:18 +00:00
parent 87e32f037e
commit a6527b34d9
5 changed files with 23 additions and 6 deletions

View File

@ -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 <adam@sics.se>
*/
#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 */

View File

@ -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 <string.h>
@ -500,6 +501,7 @@ resolv_found(char *name, u16_t *ipaddr)
process_post(PROCESS_BROADCAST, resolv_event_found, name);
}
/*-----------------------------------------------------------------------------------*/
#endif /* UIP_UDP */
/** @} */
/** @} */

View File

@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $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. */

View File

@ -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 <adam@sics.se>
*/
#if UIP_UDP
#include <stdio.h>
#include <stdarg.h>
@ -626,3 +626,4 @@ PROCESS_THREAD(uaodv_process, ev, data)
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_UDP */

View File

@ -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 <adam@sics.se>
*/
#if UIP_UDP
#include "net/uip-udp-packet.h"
#include <string.h>
@ -58,3 +59,4 @@ uip_udp_packet_send(struct uip_udp_conn *c, const void *data, int len)
uip_slen = 0;
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_UDP */