Routing API: added ext_header_srh_update
This commit is contained in:
parent
25e07b7d23
commit
fdbd89d018
@ -1352,8 +1352,7 @@ uip_process(uint8_t flag)
|
||||
|
||||
LOG_DBG("Processing Routing header\n");
|
||||
if(UIP_ROUTING_BUF->seg_left > 0) {
|
||||
#if UIP_CONF_IPV6_RPL && RPL_WITH_NON_STORING
|
||||
if(rpl_ext_header_srh_update()) {
|
||||
if(NETSTACK_ROUTING.ext_header_srh_update()) {
|
||||
|
||||
/* With routing header, the detination address is us and will
|
||||
* be swapped later to the next hop. Because of this, the MTU
|
||||
@ -1381,7 +1380,6 @@ uip_process(uint8_t flag)
|
||||
|
||||
goto send; /* Proceed to forwarding */
|
||||
}
|
||||
#endif /* UIP_CONF_IPV6_RPL && RPL_WITH_NON_STORING */
|
||||
uip_icmp6_error_output(ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, UIP_IPH_LEN + uip_ext_len + 2);
|
||||
UIP_STAT(++uip_stat.ip.drop);
|
||||
LOG_ERR("unrecognized routing type");
|
||||
|
@ -87,6 +87,12 @@ ext_header_hbh_update(int uip_ext_opt_offset)
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
ext_header_srh_update(void)
|
||||
{
|
||||
return 0; /* Means SRH not found */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
ext_header_srh_get_next_hop(uip_ipaddr_t *ipaddr)
|
||||
{
|
||||
return 0;
|
||||
@ -102,6 +108,7 @@ const struct routing_driver nullrouting_driver = {
|
||||
ext_header_remove,
|
||||
ext_header_update,
|
||||
ext_header_hbh_update,
|
||||
ext_header_srh_update,
|
||||
ext_header_srh_get_next_hop,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -97,6 +97,12 @@ struct routing_driver {
|
||||
* 0 in case the packet must be dropped.
|
||||
*/
|
||||
int (* ext_header_hbh_update)(int uip_ext_opt_offset);
|
||||
/**
|
||||
* Process and update SRH in-place,
|
||||
* i.e. internal address swapping as per RFC6554
|
||||
* \return 1 if SRH found, 0 otherwise
|
||||
*/
|
||||
int (* ext_header_srh_update)(void);
|
||||
/**
|
||||
* Look for next hop from SRH of current uIP packet.
|
||||
*
|
||||
|
@ -381,6 +381,7 @@ const struct routing_driver rpl_classic_driver = {
|
||||
rpl_ext_header_remove,
|
||||
rpl_ext_header_update,
|
||||
rpl_ext_header_hbh_update,
|
||||
rpl_ext_header_srh_update,
|
||||
rpl_ext_header_srh_get_next_hop,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -203,6 +203,7 @@ const struct routing_driver rpl_lite_driver = {
|
||||
rpl_ext_header_remove,
|
||||
rpl_ext_header_update,
|
||||
rpl_ext_header_hbh_update,
|
||||
rpl_ext_header_srh_update,
|
||||
rpl_ext_header_srh_get_next_hop,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user