diff options
Diffstat (limited to 'hicn-plugin/src/strategies/dpo_rr.c')
-rw-r--r-- | hicn-plugin/src/strategies/dpo_rr.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/hicn-plugin/src/strategies/dpo_rr.c b/hicn-plugin/src/strategies/dpo_rr.c index 3fe506bd1..86b68186b 100644 --- a/hicn-plugin/src/strategies/dpo_rr.c +++ b/hicn-plugin/src/strategies/dpo_rr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Cisco and/or its affiliates. + * Copyright (c) 2021 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -28,6 +28,7 @@ static const hicn_dpo_vft_t hicn_dpo_rr_vft = { .hicn_dpo_get_type = &hicn_dpo_strategy_rr_get_type, .hicn_dpo_module_init = &hicn_dpo_strategy_rr_module_init, .hicn_dpo_create = &hicn_strategy_rr_ctx_create, + .hicn_dpo_update_type = &hicn_strategy_rr_update_ctx_type, .hicn_dpo_add_update_nh = &hicn_strategy_rr_ctx_add_nh, .hicn_dpo_del_nh = &hicn_strategy_rr_ctx_del_nh, .hicn_dpo_format = &hicn_strategy_rr_format_ctx @@ -117,11 +118,22 @@ hicn_strategy_rr_ctx_create (fib_protocol_t proto, *dpo_idx = hicn_strategy_dpo_ctx_get_index (hicn_strategy_ctx); - init_dpo_ctx (hicn_strategy_ctx, next_hop, nh_len, hicn_dpo_type_rr, proto); + init_dpo_ctx (hicn_strategy_ctx, next_hop, nh_len, hicn_dpo_type_rr, + (dpo_proto_t) proto); hicn_strategy_rr_ctx->current_nhop = 0; } +void +hicn_strategy_rr_update_ctx_type (hicn_dpo_ctx_t *hicn_strategy_ctx) +{ + hicn_strategy_rr_ctx_t *hicn_strategy_rr_ctx; + hicn_strategy_rr_ctx = (hicn_strategy_rr_ctx_t *) hicn_strategy_ctx->data; + + hicn_strategy_ctx->dpo_type = hicn_dpo_type_rr; + hicn_strategy_rr_ctx->current_nhop = 0; +} + int hicn_strategy_rr_ctx_add_nh (hicn_face_id_t nh, index_t dpo_idx) { |