summaryrefslogtreecommitdiffstats
path: root/pathd/path_pcep_config.c
diff options
context:
space:
mode:
authorJavier Garcia <javier.garcia@voltanet.io>2021-01-22 10:38:12 +0100
committerJavier Garcia <javier.garcia@voltanet.io>2021-03-05 12:12:47 +0100
commit749714731ee9a59ae39be77e7db3915ce3ad0bd8 (patch)
tree2a50fcd5ce5c2f01ac381ba769c3d8f145768f9d /pathd/path_pcep_config.c
parentMerge pull request #8091 from mjstapp/fix_config_icc_diag (diff)
downloadfrr-749714731ee9a59ae39be77e7db3915ce3ad0bd8.tar.xz
frr-749714731ee9a59ae39be77e7db3915ce3ad0bd8.zip
pceplib: Integrate pcelib into frr
Signed-off-by: Brady Johnson <brady@voltanet.io> Co-authored-by: Javier Garcia <javier.garcia@voltanet.io> Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
Diffstat (limited to 'pathd/path_pcep_config.c')
-rw-r--r--pathd/path_pcep_config.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/pathd/path_pcep_config.c b/pathd/path_pcep_config.c
index 989223ebc..107475bec 100644
--- a/pathd/path_pcep_config.c
+++ b/pathd/path_pcep_config.c
@@ -19,7 +19,7 @@
#include <northbound.h>
#include <yang.h>
#include <printfrr.h>
-#include <pcep-objects.h>
+#include "pceplib/pcep_msg_objects.h"
#include "pathd/pathd.h"
#include "pathd/path_pcep.h"
#include "pathd/path_pcep_config.h"
@@ -45,14 +45,13 @@ status_int_to_ext(enum srte_policy_status status);
static enum pcep_sr_subobj_nai pcep_nai_type(enum srte_segment_nai_type type);
static enum srte_segment_nai_type srte_nai_type(enum pcep_sr_subobj_nai type);
-static int path_pcep_config_lookup_cb(struct thread *t)
+void path_pcep_refine_path(struct path *path)
{
- struct path *path = THREAD_ARG(t);
struct srte_candidate *candidate = lookup_candidate(&path->nbkey);
struct srte_lsp *lsp;
if (candidate == NULL)
- return 0;
+ return;
lsp = candidate->lsp;
@@ -65,16 +64,6 @@ static int path_pcep_config_lookup_cb(struct thread *t)
if ((path->update_origin == SRTE_ORIGIN_UNDEFINED)
&& (lsp->segment_list != NULL))
path->update_origin = lsp->segment_list->protocol_origin;
-
- return 0;
-}
-
-void path_pcep_config_lookup(struct path *path)
-{
- /*
- * Configuration access is strictly done via the main thread
- */
- thread_execute(master, path_pcep_config_lookup_cb, path, 0);
}
struct path *path_pcep_config_get_path(struct lsp_nb_key *key)
@@ -346,9 +335,11 @@ int path_pcep_config_update_path(struct path *path)
SET_FLAG(candidate->flags, F_CANDIDATE_MODIFIED);
for (metric = path->first_metric; metric != NULL; metric = metric->next)
- srte_lsp_set_metric(candidate->lsp, metric->type, metric->value,
- metric->enforce, metric->is_bound,
- metric->is_computed);
+ srte_lsp_set_metric(
+ candidate->lsp,
+ (enum srte_candidate_metric_type)metric->type,
+ metric->value, metric->enforce, metric->is_bound,
+ metric->is_computed);
if (path->has_bandwidth)
srte_lsp_set_bandwidth(candidate->lsp, path->bandwidth,