core/net/uip-ds6: Make uip_ds6_maddr_add() and uip_ds6_maddr_lookup() const-correct.

This commit is contained in:
Robert Quattlebaum 2013-01-16 20:33:17 -08:00
parent 1d113f52ad
commit 97e16760c3
2 changed files with 6 additions and 6 deletions

View file

@ -592,11 +592,11 @@ uip_ds6_get_global(int8_t state)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
uip_ds6_maddr_t * uip_ds6_maddr_t *
uip_ds6_maddr_add(uip_ipaddr_t *ipaddr) uip_ds6_maddr_add(const uip_ipaddr_t *ipaddr)
{ {
if(uip_ds6_list_loop if(uip_ds6_list_loop
((uip_ds6_element_t *)uip_ds6_if.maddr_list, UIP_DS6_MADDR_NB, ((uip_ds6_element_t *)uip_ds6_if.maddr_list, UIP_DS6_MADDR_NB,
sizeof(uip_ds6_maddr_t), ipaddr, 128, sizeof(uip_ds6_maddr_t), (void*)ipaddr, 128,
(uip_ds6_element_t **)&locmaddr) == FREESPACE) { (uip_ds6_element_t **)&locmaddr) == FREESPACE) {
locmaddr->isused = 1; locmaddr->isused = 1;
uip_ipaddr_copy(&locmaddr->ipaddr, ipaddr); uip_ipaddr_copy(&locmaddr->ipaddr, ipaddr);
@ -617,11 +617,11 @@ uip_ds6_maddr_rm(uip_ds6_maddr_t *maddr)
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
uip_ds6_maddr_t * uip_ds6_maddr_t *
uip_ds6_maddr_lookup(uip_ipaddr_t *ipaddr) uip_ds6_maddr_lookup(const uip_ipaddr_t *ipaddr)
{ {
if(uip_ds6_list_loop if(uip_ds6_list_loop
((uip_ds6_element_t *)uip_ds6_if.maddr_list, UIP_DS6_MADDR_NB, ((uip_ds6_element_t *)uip_ds6_if.maddr_list, UIP_DS6_MADDR_NB,
sizeof(uip_ds6_maddr_t), ipaddr, 128, sizeof(uip_ds6_maddr_t), (void*)ipaddr, 128,
(uip_ds6_element_t **)&locmaddr) == FOUND) { (uip_ds6_element_t **)&locmaddr) == FOUND) {
return locmaddr; return locmaddr;
} }

View file

@ -315,9 +315,9 @@ uip_ds6_addr_t *uip_ds6_get_global(int8_t state);
/** \name Multicast address list basic routines */ /** \name Multicast address list basic routines */
/** @{ */ /** @{ */
uip_ds6_maddr_t *uip_ds6_maddr_add(uip_ipaddr_t *ipaddr); uip_ds6_maddr_t *uip_ds6_maddr_add(const uip_ipaddr_t *ipaddr);
void uip_ds6_maddr_rm(uip_ds6_maddr_t *maddr); void uip_ds6_maddr_rm(uip_ds6_maddr_t *maddr);
uip_ds6_maddr_t *uip_ds6_maddr_lookup(uip_ipaddr_t *ipaddr); uip_ds6_maddr_t *uip_ds6_maddr_lookup(const uip_ipaddr_t *ipaddr);
/** @} */ /** @} */