From 0a1c6b5565e20167d1f1f33a5a8b597f420b18b0 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Fri, 26 Jul 2019 23:20:30 +0200 Subject: [HICN-252] Add per-application policy framework to hicn-light forwarder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0531cd7a7de179581295ae34766c81cd9cf3e172 Signed-off-by: Jordan Augé Signed-off-by: Mauro Sardara Co-authored-by: Mauro Sardara --- hicn-light/src/hicn/config/controlAdd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'hicn-light/src/hicn/config/controlAdd.c') diff --git a/hicn-light/src/hicn/config/controlAdd.c b/hicn-light/src/hicn/config/controlAdd.c index 7667f467e..519e11e40 100644 --- a/hicn-light/src/hicn/config/controlAdd.c +++ b/hicn-light/src/hicn/config/controlAdd.c @@ -28,6 +28,9 @@ #include #include #include +#ifdef WITH_POLICY +#include +#endif /* WITH_POLICY */ // =================================================== @@ -60,18 +63,27 @@ static CommandReturn _controlAdd_HelpExecute(CommandParser *parser, CommandOps *ops_add_route = controlAddRoute_Create(NULL); CommandOps *ops_add_punting = controlAddPunting_Create(NULL); CommandOps *ops_add_listener = controlAddListener_Create(NULL); +#ifdef WITH_POLICY + CommandOps *ops_add_policy = controlAddPolicy_Create(NULL); +#endif /* WITH_POLICY */ printf("Available commands:\n"); printf(" %s\n", ops_add_connection->command); printf(" %s\n", ops_add_route->command); printf(" %s\n", ops_add_punting->command); printf(" %s\n", ops_add_listener->command); +#ifdef WITH_POLICIES + printf(" %s\n", ops_add_policy->command); +#endif /* WITH_POLICIES */ printf("\n"); commandOps_Destroy(&ops_add_connection); commandOps_Destroy(&ops_add_route); commandOps_Destroy(&ops_add_punting); commandOps_Destroy(&ops_add_listener); +#ifdef WITH_POLICY + commandOps_Destroy(&ops_add_policy); +#endif /* WITH_POLICY */ return CommandReturn_Success; } @@ -85,6 +97,10 @@ static void _controlAdd_Init(CommandParser *parser, CommandOps *ops) { controlState_RegisterCommand(state, controlAddRoute_Create(state)); controlState_RegisterCommand(state, controlAddPunting_Create(state)); controlState_RegisterCommand(state, controlAddPunting_HelpCreate(state)); +#ifdef WITH_POLICY + controlState_RegisterCommand(state, controlAddPolicy_HelpCreate(state)); + controlState_RegisterCommand(state, controlAddPolicy_Create(state)); +#endif /* WITH_POLICY */ } static CommandReturn _controlAdd_Execute(CommandParser *parser, CommandOps *ops, -- cgit 1.2.3-korg