Changed to use separate Contiki event type for ICMP6 notifications

This commit is contained in:
nifi 2010-02-05 12:43:36 +00:00
parent 32c5fcb583
commit a1199721a6
2 changed files with 19 additions and 3 deletions

View File

@ -29,7 +29,7 @@
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* *
* $Id: tcpip.c,v 1.22 2010/01/25 13:37:05 adamdunkels Exp $ * $Id: tcpip.c,v 1.23 2010/02/05 12:43:36 nifi Exp $
*/ */
/** /**
* \file * \file
@ -73,6 +73,9 @@ void uip_log(char *msg);
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) #define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
process_event_t tcpip_event; process_event_t tcpip_event;
#if UIP_CONF_ICMP6
process_event_t tcpip_icmp6_event;
#endif /* UIP_CONF_ICMP6 */
/*static struct tcpip_event_args ev_args;*/ /*static struct tcpip_event_args ev_args;*/
@ -338,7 +341,9 @@ void
tcpip_icmp6_call(u8_t type) tcpip_icmp6_call(u8_t type)
{ {
if(uip_icmp6_conns.appstate.p != PROCESS_NONE) { if(uip_icmp6_conns.appstate.p != PROCESS_NONE) {
process_post_synch(uip_icmp6_conns.appstate.p, type, 0); /* XXX: This is a hack that needs to be updated. Passing a pointer (&type)
like this only works with process_post_synch. */
process_post_synch(uip_icmp6_conns.appstate.p, tcpip_icmp6_event, &type);
} }
return; return;
} }
@ -743,6 +748,9 @@ PROCESS_THREAD(tcpip_process, ev, data)
#endif #endif
tcpip_event = process_alloc_event(); tcpip_event = process_alloc_event();
#if UIP_CONF_ICMP6
tcpip_icmp6_event = process_alloc_event();
#endif /* UIP_CONF_ICMP6 */
etimer_set(&periodic, CLOCK_SECOND/2); etimer_set(&periodic, CLOCK_SECOND/2);
uip_init(); uip_init();

View File

@ -62,7 +62,7 @@
* *
* Author: Adam Dunkels <adam@sics.se> * Author: Adam Dunkels <adam@sics.se>
* *
* $Id: tcpip.h,v 1.15 2009/03/17 20:28:44 nvt-se Exp $ * $Id: tcpip.h,v 1.16 2010/02/05 12:43:37 nifi Exp $
*/ */
#ifndef __TCPIP_H__ #ifndef __TCPIP_H__
#define __TCPIP_H__ #define __TCPIP_H__
@ -282,6 +282,14 @@ CCIF void tcpip_poll_udp(struct uip_udp_conn *conn);
*/ */
#if UIP_CONF_ICMP6 #if UIP_CONF_ICMP6
/**
* The ICMP6 event.
*
* This event is posted to a process whenever a uIP ICMP event has occurred.
*/
CCIF extern process_event_t tcpip_icmp6_event;
/** /**
* \brief register an ICMPv6 callback * \brief register an ICMPv6 callback
* \return 0 if success, 1 if failure (one application already registered) * \return 0 if success, 1 if failure (one application already registered)