diff options
author | Mauro Sardara <msardara@cisco.com> | 2023-01-16 20:18:23 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2023-01-18 09:08:39 +0000 |
commit | f904218765e58ab1cdf05b6dfd14912369cd9fe7 (patch) | |
tree | adb40251384a395a5ee791c246e4ed3b4acda4ee /hicn-plugin/src/strategies/dpo_mw.c | |
parent | 4d2e8310cbeacf1c20ec0adb3dc6cf06abcdcbb8 (diff) |
feat: local-remote strategy
Ticket: HICN-824
Change-Id: Iea285cb499b13c943a142fa39328ee36c91ae913
Signed-off-by: Mauro Sardara <msardara@cisco.com>
(cherry picked from commit 7560918629eb11aa7bdaee5f4856243b38c77f93)
Diffstat (limited to 'hicn-plugin/src/strategies/dpo_mw.c')
-rw-r--r-- | hicn-plugin/src/strategies/dpo_mw.c | 29 |
1 files changed, 9 insertions, 20 deletions
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; |