Skip to content

Commit

Permalink
When UIP_UDP is off, turn off udp functions more accurately.
Browse files Browse the repository at this point in the history
  • Loading branch information
matsutsuka committed Sep 29, 2007
1 parent 87e32f0 commit a6527b3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
4 changes: 3 additions & 1 deletion core/net/rawpacket-udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
*/

/**
Expand All @@ -38,6 +38,7 @@
* Adam Dunkels <[email protected]>
*/

#if UIP_UDP
#include "contiki-net.h"

#include "net/rawpacket-udp.h"
Expand Down Expand Up @@ -69,3 +70,4 @@ rawpacket_received(struct rawpacket_conn *c)
return uip_newdata() && (struct uip_udp_conn *)c == uip_udp_conn;
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_UDP */
4 changes: 3 additions & 1 deletion core/net/resolv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -500,6 +501,7 @@ resolv_found(char *name, u16_t *ipaddr)
process_post(PROCESS_BROADCAST, resolv_event_found, name);
}
/*-----------------------------------------------------------------------------------*/
#endif /* UIP_UDP */

/** @} */
/** @} */
12 changes: 11 additions & 1 deletion core/net/tcpip.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* Author: Adam Dunkels <[email protected]>
*
* $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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand All @@ -314,6 +317,7 @@ eventhandler(process_event_t ev, process_data_t data)
}
}
break;
#endif /* UIP_UDP */

case PACKET_INPUT:
packet_input();
Expand All @@ -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)
Expand All @@ -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. */
Expand Down
5 changes: 3 additions & 2 deletions core/net/uaodv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
*/

/**
Expand All @@ -38,7 +38,7 @@
* Adam Dunkels <[email protected]>
*/


#if UIP_UDP
#include <stdio.h>
#include <stdarg.h>

Expand Down Expand Up @@ -626,3 +626,4 @@ PROCESS_THREAD(uaodv_process, ev, data)
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_UDP */
4 changes: 3 additions & 1 deletion core/net/uip-udp-packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
*/

/**
Expand All @@ -38,6 +38,7 @@
* Adam Dunkels <[email protected]>
*/

#if UIP_UDP
#include "net/uip-udp-packet.h"

#include <string.h>
Expand All @@ -58,3 +59,4 @@ uip_udp_packet_send(struct uip_udp_conn *c, const void *data, int len)
uip_slen = 0;
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_UDP */

0 comments on commit a6527b3

Please sign in to comment.