From f904218765e58ab1cdf05b6dfd14912369cd9fe7 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 16 Jan 2023 20:18:23 +0000 Subject: feat: local-remote strategy Ticket: HICN-824 Change-Id: Iea285cb499b13c943a142fa39328ee36c91ae913 Signed-off-by: Mauro Sardara (cherry picked from commit 7560918629eb11aa7bdaee5f4856243b38c77f93) --- hicn-plugin/src/strategies/dpo_mw.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'hicn-plugin/src/strategies/dpo_mw.c') diff --git a/hicn-plugin/src/strategies/dpo_mw.c b/hicn-plugin/src/strategies/dpo_mw.c index 1a7d2e495..9283f6a43 100644 --- a/hicn-plugin/src/strategies/dpo_mw.c +++ b/hicn-plugin/src/strategies/dpo_mw.c @@ -31,7 +31,13 @@ static const hicn_dpo_vft_t hicn_dpo_mw_vft = { .hicn_dpo_update_type = &hicn_strategy_mw_update_ctx_type, .hicn_dpo_add_update_nh = &hicn_strategy_mw_ctx_add_nh, .hicn_dpo_del_nh = &hicn_strategy_mw_ctx_del_nh, - .hicn_dpo_format = &hicn_strategy_mw_format_ctx + .hicn_dpo_format = &hicn_dpo_strategy_mw_format +}; + +const static dpo_vft_t dpo_strategy_mw_ctx_vft = { + .dv_lock = &hicn_strategy_dpo_ctx_lock, + .dv_unlock = &hicn_strategy_dpo_ctx_unlock, + .dv_format = &hicn_strategy_dpo_format }; int @@ -60,27 +66,10 @@ hicn_dpo_strategy_mw_get_type (void) ////////////////////////////////////////////////////////////////////////////////////////////////// u8 * -hicn_strategy_mw_format_ctx (u8 *s, int n, ...) +hicn_dpo_strategy_mw_format (u8 *s, hicn_dpo_ctx_t *dpo_ctx, u32 indent) { - va_list args; - va_start (args, n); - s = format_hicn_strategy_mw_ctx (s, &args); - return s; -} - -u8 * -format_hicn_strategy_mw_ctx (u8 *s, va_list *ap) -{ - int i = 0; - index_t index = va_arg (*ap, index_t); - hicn_dpo_ctx_t *dpo_ctx = NULL; hicn_strategy_mw_ctx_t *mw_dpo_ctx = NULL; - u32 indent = va_arg (*ap, u32); - ; - - dpo_ctx = hicn_strategy_dpo_ctx_get (index); - if (dpo_ctx == NULL) - return s; + int i = 0; mw_dpo_ctx = (hicn_strategy_mw_ctx_t *) dpo_ctx->data; -- cgit 1.2.3-korg