- unsigned int table_size = getTableSize();
-
- addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical);
-
- if (not linkTable_) {
- /* Create Cost, Predecessor and Link tables */
- costTable_ = new double[table_size * table_size]; /* link cost from host to host */
- predecessorTable_ = new int[table_size * table_size]; /* predecessor host numbers */
- linkTable_ = new RouteCreationArgs*[table_size * table_size]; /* actual link between src and dst */
-
- /* Initialize costs and predecessors */
- for (unsigned int i = 0; i < table_size; i++)
- for (unsigned int j = 0; j < table_size; j++) {
- TO_FLOYD_COST(i, j) = DBL_MAX;
- TO_FLOYD_PRED(i, j) = -1;
- TO_FLOYD_LINK(i, j) = nullptr;
- }
- }
+ unsigned int table_size = get_table_size();
+ init_tables(table_size);
+
+ add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);