Register generic handlers for ICMPv6 Echo Request / Reply
This commit is contained in:
parent
1d84962e80
commit
af43d2125b
3 changed files with 26 additions and 22 deletions
|
@ -119,8 +119,8 @@ uip_icmp6_register_input_handler(uip_icmp6_input_handler_t *handler)
|
|||
list_add(input_handler_list, handler);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_icmp6_echo_request_input(void)
|
||||
static void
|
||||
echo_request_input(void)
|
||||
{
|
||||
#if UIP_CONF_IPV6_RPL
|
||||
uint8_t temp_ext_len;
|
||||
|
@ -318,8 +318,8 @@ uip_icmp6_send(const uip_ipaddr_t *dest, int type, int code, int payload_len)
|
|||
tcpip_ipv6_output();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_icmp6_echo_reply_input(void)
|
||||
static void
|
||||
echo_reply_input(void)
|
||||
{
|
||||
int ttl;
|
||||
uip_ipaddr_t sender;
|
||||
|
@ -386,6 +386,8 @@ uip_icmp6_echo_reply_input(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
uip_len = 0;
|
||||
return;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -405,5 +407,18 @@ uip_icmp6_echo_reply_callback_rm(struct uip_icmp6_echo_reply_notification *n)
|
|||
list_remove(echo_reply_callback_list, n);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
UIP_ICMP6_HANDLER(echo_request_handler, ICMP6_ECHO_REQUEST,
|
||||
UIP_ICMP6_HANDLER_CODE_ANY, echo_request_input);
|
||||
UIP_ICMP6_HANDLER(echo_reply_handler, ICMP6_ECHO_REPLY,
|
||||
UIP_ICMP6_HANDLER_CODE_ANY, echo_reply_input);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
uip_icmp6_init()
|
||||
{
|
||||
/* Register Echo Request and Reply handlers */
|
||||
uip_icmp6_register_input_handler(&echo_request_handler);
|
||||
uip_icmp6_register_input_handler(&echo_reply_handler);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue