mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
Enabled external neighbor removal
This commit is contained in:
parent
55f780ec19
commit
4e0ceedc47
@ -151,6 +151,23 @@ neighbor_attr_add_neighbor(const rimeaddr_t *addr)
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
neighbor_attr_remove_neighbor(const rimeaddr_t *addr)
|
||||
{
|
||||
struct neighbor_addr *item = neighbor_attr_list_neighbors();
|
||||
|
||||
while(item != NULL) {
|
||||
if(rimeaddr_cmp(&item->addr, addr)) {
|
||||
memb_free(&neighbor_addr_mem, item);
|
||||
list_remove(neighbor_addrs, item);
|
||||
return 0;
|
||||
} else {
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void *
|
||||
neighbor_attr_get_data(struct neighbor_attr *def, const rimeaddr_t *addr)
|
||||
{
|
||||
|
@ -112,6 +112,12 @@ int neighbor_attr_has_neighbor(const rimeaddr_t * addr);
|
||||
*/
|
||||
int neighbor_attr_add_neighbor(const rimeaddr_t * addr);
|
||||
|
||||
/**
|
||||
* \brief Remove a neighbor entry to neighbor table
|
||||
* \retval -1 if unsuccessful, 0 if the neighbor was removed
|
||||
*/
|
||||
int neighbor_attr_remove_neighbor(const rimeaddr_t * addr);
|
||||
|
||||
/**
|
||||
* \brief Get pointer to neighbor table data specified by id
|
||||
* \param requested attribute
|
||||
|
Loading…
Reference in New Issue
Block a user