예제 #1
0
switchlink_db_status_t switchlink_db_interface_update(
    uint32_t ifindex, switchlink_db_interface_info_t *intf_info) {
  switchlink_db_intf_obj_t *obj;
  obj = tommy_trie_inplace_search(&switchlink_db_interface_obj_map, ifindex);
  if (!obj) {
    return SWITCHLINK_DB_STATUS_ITEM_NOT_FOUND;
  }
  memcpy(&(obj->intf_info), intf_info, sizeof(switchlink_db_interface_info_t));
  return SWITCHLINK_DB_STATUS_SUCCESS;
}
예제 #2
0
switchlink_db_status_t switchlink_db_bridge_update(
    uint32_t ifindex, switchlink_db_bridge_info_t *bridge) {
  switchlink_db_bridge_obj_t *obj;
  obj = tommy_trie_inplace_search(&switchlink_db_bridge_obj_map, ifindex);
  if (!obj) {
    return SWITCHLINK_DB_STATUS_ITEM_NOT_FOUND;
  } else {
    memcpy(&(obj->bridge), bridge, sizeof(switchlink_db_bridge_info_t));
  }
  return SWITCHLINK_DB_STATUS_SUCCESS;
}
예제 #3
0
switchlink_db_status_t switchlink_db_interface_get_info(
    uint32_t ifindex, switchlink_db_interface_info_t *intf_info) {
  assert(intf_info);
  switchlink_db_intf_obj_t *obj;
  obj = tommy_trie_inplace_search(&switchlink_db_interface_obj_map, ifindex);
  if (!obj) {
    return SWITCHLINK_DB_STATUS_ITEM_NOT_FOUND;
  }
  if (intf_info) {
    memcpy(
        intf_info, &(obj->intf_info), sizeof(switchlink_db_interface_info_t));
  }
  return SWITCHLINK_DB_STATUS_SUCCESS;
}
예제 #4
0
static void *
switchlink_db_handle_get_obj(switchlink_handle_t h) {
    void * obj;
    obj = tommy_trie_inplace_search(&switchlink_db_handle_obj_map, h);
    return obj;
}