void delete_relay_set_handler_for_ms_timeout(struct olsrv2 *olsr,
                         OLSR_LIST* retList)
{
  OLSR_LIST_ENTRY* ms_tmp = NULL;
  OLSR_MPR_SELECTOR_TUPLE* ms_data = NULL;
  OLSR_LIST *result = NULL;

  ms_tmp = retList->head;

  while(ms_tmp){
    ms_data = (OLSR_MPR_SELECTOR_TUPLE* )ms_tmp->data;


    result = OLSR_SearchList((void*)olsr,&olsr->relay_set,
                 (void* )&ms_data->MS_neighbor_if_addr,
                 &search_relay_set_handler);

    if(result){
      OLSR_DeleteList_Search(result);
      OLSR_DeleteListHandler((void*)olsr,&olsr->relay_set, (void* )&ms_data->MS_neighbor_if_addr,
                 &delete_relay_set_handler);
      olsr->change_relay_set = OLSR_TRUE;
    }
    ms_tmp = ms_tmp->next;
  }
}
Example #2
0
void delete_mpr_set_for_all_entry(struct olsrv2 *olsr,
                  union olsr_ip_addr* addr)
{
  OLSR_MPR_TUPLE todelete;

  todelete.local_iface_addr = *addr;

  OLSR_DeleteListHandler((void*)olsr,&olsr->mpr_set,
            &todelete, &delete_mpr_set_handler);
}
void delete_relay_set(struct olsrv2 *olsr,
              union olsr_ip_addr *neighbor_iface_addr)
{

  if(OLSR_DeleteListHandler((void*)olsr,&olsr->relay_set,
                (void* )neighbor_iface_addr,
                &delete_relay_set_handler))
  {
      olsr->change_relay_set = OLSR_TRUE;
  }
}
Example #4
0
void delete_routing_set_old(struct olsrv2 *olsr,
                union olsr_ip_addr *dest_iface_addr,
                const union olsr_ip_addr *next_iface_addr)
{
  OLSR_ROUTING_TUPLE todelete;

  olsr_ip_copy(olsr, &todelete.R_dest_iface_addr, dest_iface_addr);
  olsr_ip_copy(olsr, &todelete.R_next_iface_addr, next_iface_addr);

  OLSR_DeleteListHandler((void*)olsr,
             &olsr->routing_set_old[olsr_hashing(olsr,dest_iface_addr)].list,
             (void* )&todelete,
             &delete_routing_set_old_handler);
}
void delete_topology_set_for_same_entry(struct olsrv2 *olsr,
                                        const union olsr_ip_addr *orig_addr,
                                        olsr_u16_t ASSN)
{
    OLSR_TOPOLOGY_TUPLE todelete;

    olsr_ip_copy(olsr, &todelete.T_last_iface_addr, orig_addr);
    todelete.T_seq = ASSN;

    olsr->change_topology_set =
        OLSR_DeleteListHandler((void*)olsr,&olsr->topology_set[olsr_hashing(olsr,orig_addr)].list,
                               (void* )&todelete,
                               &delete_topology_set_for_same_entry_handler);
}
Example #6
0
void delete_proc_set_for_timeout(struct olsrv2 *olsr)
{
  olsr_time_t time;
  int i;
  get_current_time(olsr, &time);


  for (i = 0; i < HASHSIZE; i++)
  {
      if (OLSR_DeleteListHandler((void*)olsr,&olsr->proc_set[i].list, (void* )&time,
                &delete_proc_set_for_timeout_handler) == OLSR_TRUE)
      {
      olsr->change_proc_set = OLSR_TRUE;
      }
  }
}
void delete_association_set_for_addr(struct olsrv2 *olsr,
                     OLSR_LIST *iface_list){
  OLSR_LOCAL_INTERFACE_BLOCK_ENTRY *local_iface_data = NULL;
  OLSR_ASSOCIATION_TUPLE *associ_data = NULL, *associ_list_data = NULL;
  OLSR_LIST *retList = NULL;
  OLSR_LIST_ENTRY *entry = NULL,*list_entry = NULL;
  int i, tmp_index;

  entry = iface_list->head;
  while(entry){
    local_iface_data = (OLSR_LOCAL_INTERFACE_BLOCK_ENTRY *)entry->data;
    retList = search_association_set_for_addr(olsr,
                          &local_iface_data->iface_addr);

    if(retList){
      if(retList->numEntry != 1){
    olsr_error("delete_association_set_for_addr");
      }

      associ_data = (OLSR_ASSOCIATION_TUPLE *)retList->head->data;
      OLSR_DeleteList_Search(retList);

      for(i = 0; i < associ_data->num_NAlist; i++) {
    list_entry = (OLSR_LIST_ENTRY *)associ_data->NA_list[i];
    associ_list_data = (OLSR_ASSOCIATION_TUPLE *)list_entry->data;
    tmp_index = olsr_hashing(olsr,&associ_list_data->NA_iface_addr);
    free(associ_list_data->NA_list);
    OLSR_DeleteListEntry(&olsr->associ_set[tmp_index].list, list_entry);
      }
      free(associ_data->NA_list);
      if(OLSR_DeleteListHandler((void* )olsr,
                &olsr->associ_set[olsr_hashing(olsr,&associ_data->NA_iface_addr)].list,
                (void* )&local_iface_data->iface_addr,
                &delete_association_set_for_addr_handler)){

    olsr->change_associ_set = OLSR_TRUE;
      }

    }//if
    entry = entry->next;
  }//while

}
void delete_topology_set_for_timeout(struct olsrv2 *olsr)
{
    olsr_time_t time;
    int hash_index;
    olsr_bool deleted_flag = OLSR_FALSE;

    get_current_time(olsr, &time);

    for(hash_index = 0; hash_index < HASHSIZE; hash_index++)
    {
        if(OLSR_DeleteListHandler((void*)olsr,&olsr->topology_set[hash_index].list, (void* )&time,
                                  &delete_topology_set_for_timeout_handler) == OLSR_TRUE)
            deleted_flag = OLSR_TRUE;
    }
    if(deleted_flag)
    {
        olsr->change_topology_set = OLSR_TRUE;
    }
}
Example #9
0
void delete_mprN2(struct olsrv2* olsr, OLSR_LIST *list, union olsr_ip_addr *addr)
{
  OLSR_DeleteListHandler((void*)olsr,list, (void* )addr, &delete_mprN2_handler);
}
Example #10
0
void delete_routing_set_for_all_entry(struct olsrv2* olsr, OLSR_LIST *list)
{
  OLSR_DeleteListHandler((void*)olsr,list, NULL,
             &delete_routing_set_for_all_entry_handler);
}