diff --git a/src/pathcomp/backend/pathComp_sp.c b/src/pathcomp/backend/pathComp_sp.c index 9cbd29eff05f7108bfa8a73b46a21ce0649bb666..b6fd885e3fec7032993ef4d058df8256cc363965 100644 --- a/src/pathcomp/backend/pathComp_sp.c +++ b/src/pathcomp/backend/pathComp_sp.c @@ -1,4 +1,3 @@ -//////////////////////////////////////////////////////////////////////////////////////// /* * Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/) * @@ -203,34 +202,34 @@ void sp_execution_services(struct compRouteOutputList_t* oPathList) { //struct service_t* service = &(serviceList->services[i]); struct service_t* service = (struct service_t*)(listnode->data); - DEBUG_PC("Starting the Computation for ServiceId: %s [ContextId: %s]", service->serviceId.service_uuid, service->serviceId.contextId); - struct compRouteOutput_t* pathService = &(oPathList->compRouteConnection[i]); - // check endpoints of the service are different (PE devices/nodes are different) - if (same_src_dst_pe_nodeid(service) == 0) { - DEBUG_PC("PEs are the same... no path computation"); - comp_route_connection_issue_handler(pathService, service); - oPathList->numCompRouteConnList++; - continue; - } - - // get the graph associated to the contextId in the contextSet, if no then error - struct graph_t* g = get_graph_by_contextId(contextSet, service->serviceId.contextId); - if (g == NULL) { - DEBUG_PC("The targeted contextId is NOT in the ContextSet ... then NO graph"); - comp_route_connection_issue_handler(pathService, service); - oPathList->numCompRouteConnList++; - continue; - } - - computation_shortest_path(service, pathService, g); - oPathList->numCompRouteConnList++; - - // for each network connectivity service, a single computed path (out of the KCSP) is retuned - // If path is found, then the selected resources must be pre-assigned into the context information - if (pathService->noPathIssue == NO_PATH_CONS_ISSUE) { - continue; - } - struct path_t* path = &(pathService->paths[pathService->numPaths - 1]); + DEBUG_PC("Starting the Computation for ServiceId: %s [ContextId: %s]", service->serviceId.service_uuid, service->serviceId.contextId); + struct compRouteOutput_t* pathService = &(oPathList->compRouteConnection[i]); + // check endpoints of the service are different (PE devices/nodes are different) + if (same_src_dst_pe_nodeid(service) == 0) { + DEBUG_PC("PEs are the same... no path computation"); + comp_route_connection_issue_handler(pathService, service); + oPathList->numCompRouteConnList++; + continue; + } + + // get the graph associated to the contextId in the contextSet, if no then error + struct graph_t* g = get_graph_by_contextId(contextSet, service->serviceId.contextId); + if (g == NULL) { + DEBUG_PC("The targeted contextId is NOT in the ContextSet ... then NO graph"); + comp_route_connection_issue_handler(pathService, service); + oPathList->numCompRouteConnList++; + continue; + } + + computation_shortest_path(service, pathService, g); + oPathList->numCompRouteConnList++; + + // for each network connectivity service, a single computed path (out of the KCSP) is retuned + // If path is found, then the selected resources must be pre-assigned into the context information + if (pathService->noPathIssue == NO_PATH_CONS_ISSUE) { + continue; + } + struct path_t* path = &(pathService->paths[pathService->numPaths - 1]); //allocate_graph_resources(path, service, g); // LGR: crashes in some cases with assymetric topos //allocate_graph_reverse_resources(path, service, g); // LGR: crashes in some cases with assymetric topos print_graph(g); diff --git a/src/pathcomp/backend/pathComp_tools.c b/src/pathcomp/backend/pathComp_tools.c index e5d4ac846b42c7d0d18532a6d3555b8fc689f382..bd4f7df8ca460e3bab3bb3d9f75e7592f19268c7 100644 --- a/src/pathcomp/backend/pathComp_tools.c +++ b/src/pathcomp/backend/pathComp_tools.c @@ -14,7 +14,6 @@ * limitations under the License. */ - #include <stdio.h> #include <stdlib.h> #include <sys/types.h> diff --git a/src/pathcomp/backend/pathComp_tools.h b/src/pathcomp/backend/pathComp_tools.h index fde38f66b75506d16321911607df0ff9f05dcd9d..49280d543a52ede118a1baee988484671bc76f8d 100644 --- a/src/pathcomp/backend/pathComp_tools.h +++ b/src/pathcomp/backend/pathComp_tools.h @@ -14,7 +14,6 @@ * limitations under the License. */ - #ifndef _PATHCOMP_TOOLS_H #define _PATHCOMP_TOOLS_H