diff options
author | Javier Garcia <javier.garcia@voltanet.io> | 2021-04-22 16:04:42 +0200 |
---|---|---|
committer | Javier Garcia <javier.garcia@voltanet.io> | 2021-05-10 15:24:59 +0200 |
commit | f2b9485d6f5aa1508334a7e92d26d95faf0e1733 (patch) | |
tree | 18d754185d84e48675820d0c4fb658b53e78d1e6 /pathd/path_nb_config.c | |
parent | pathd. TED support . Client to link State - [part 1/4] (diff) | |
download | frr-f2b9485d6f5aa1508334a7e92d26d95faf0e1733.tar.xz frr-f2b9485d6f5aa1508334a7e92d26d95faf0e1733.zip |
pathd. TED support . Validation of candidate path - [part 2/4]
- Explicit segment list nai will be resolved to corresponded sid.
- Dynamic segment list (from pce) will be validated.
- If segment list could not be resolved or validated won't be used.
- Now this new config is supported
segment-list sl-1
index 10 nai prefix 10.1.2.1/32 iface 1
index 30 nai adjacency 10.2.5.2 10.2.5.5
index 40 nai prefix 10.10.10.5/32 algorithm 0
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
Diffstat (limited to 'pathd/path_nb_config.c')
-rw-r--r-- | pathd/path_nb_config.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/pathd/path_nb_config.c b/pathd/path_nb_config.c index af54f5bce..5b0f5b44e 100644 --- a/pathd/path_nb_config.c +++ b/pathd/path_nb_config.c @@ -160,6 +160,22 @@ int pathd_srte_segment_list_segment_sid_value_modify( return NB_OK; } +int pathd_srte_segment_list_segment_sid_value_destroy( + struct nb_cb_destroy_args *args) +{ + struct srte_segment_entry *segment; + + if (args->event != NB_EV_APPLY) + return NB_OK; + + segment = nb_running_get_entry(args->dnode, NULL, true); + segment->sid_value = MPLS_LABEL_NONE; + SET_FLAG(segment->segment_list->flags, F_SEGMENT_LIST_MODIFIED); + + return NB_OK; +} + + int pathd_srte_segment_list_segment_nai_destroy(struct nb_cb_destroy_args *args) { struct srte_segment_entry *segment; @@ -184,6 +200,8 @@ void pathd_srte_segment_list_segment_nai_apply_finish( enum srte_segment_nai_type type; struct ipaddr local_addr, remote_addr; uint32_t local_iface = 0, remote_iface = 0; + uint8_t algo = 0, local_prefix_len = 0; + const char *algo_buf, *local_prefix_len_buf; segment = nb_running_get_entry(args->dnode, NULL, true); type = yang_dnode_get_enum(args->dnode, "./type"); @@ -207,12 +225,31 @@ void pathd_srte_segment_list_segment_nai_apply_finish( remote_iface = yang_dnode_get_uint32(args->dnode, "./remote-interface"); break; + case SRTE_SEGMENT_NAI_TYPE_IPV4_ALGORITHM: + algo_buf = yang_dnode_get_string(args->dnode, "./algorithm"); + algo = atoi(algo_buf); + local_prefix_len_buf = yang_dnode_get_string( + args->dnode, "./local-prefix-len"); + local_prefix_len = atoi(local_prefix_len_buf); + break; + case SRTE_SEGMENT_NAI_TYPE_IPV4_LOCAL_IFACE: + local_iface = + yang_dnode_get_uint32(args->dnode, "./local-interface"); + local_prefix_len_buf = yang_dnode_get_string( + args->dnode, "./local-prefix-len"); + local_prefix_len = atoi(local_prefix_len_buf); + break; default: break; } - srte_segment_entry_set_nai(segment, type, &local_addr, local_iface, - &remote_addr, remote_iface); + zlog_debug(" Segment list name (%d) index (%s) ", segment->index, + segment->segment_list->name); + if (srte_segment_entry_set_nai(segment, type, &local_addr, local_iface, + &remote_addr, remote_iface, algo, + local_prefix_len)) + SET_FLAG(segment->segment_list->flags, + F_SEGMENT_LIST_SID_CONFLICT); } /* |