diff options
author | Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com> | 2017-09-25 03:36:02 +0530 |
---|---|---|
committer | Deepak S <deepak.s@linux.intel.com> | 2017-10-04 14:31:39 -0700 |
commit | c65d2e761955affbdb76fc31ebb188ac492c31ca (patch) | |
tree | 35224c83fa80c0f6dd297c9cee52f5894ade3c56 /VNFs/vCGNAPT/main.c | |
parent | 74c5414a1fc7bc2e72c8b727dea974643f3c1bbe (diff) |
REST_API: rest api client implementation
JIRA: SAMPLEVNF-78
This patch implements rest api's for VNF clients. This
comprises of
* vnf api's for common functionality
* vnf api's for CGNAPT
* vnf api's for VFW
Change-Id: I56d22c64bf3ee5b0a2e536da8169ac7583499041
Signed-off-by: Vishwesh M Rudramuni <vishwesh.m.rudramuni@intel.com>
Diffstat (limited to 'VNFs/vCGNAPT/main.c')
-rw-r--r-- | VNFs/vCGNAPT/main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/VNFs/vCGNAPT/main.c b/VNFs/vCGNAPT/main.c index 9ebf6fc3..83fc37ff 100644 --- a/VNFs/vCGNAPT/main.c +++ b/VNFs/vCGNAPT/main.c @@ -15,12 +15,14 @@ */ #include "app.h" +#include "pipeline_cgnapt.h" static struct app_params app; int main(int argc, char **argv) { + struct mg_context *ctx = NULL; rte_openlog_stream(stderr); /* Config */ @@ -28,6 +30,12 @@ main(int argc, char **argv) app_config_args(&app, argc, argv); + /* initialize the rest api */ + if (is_rest_support()) { + set_vnf_type("VCGNAPT"); + ctx = rest_api_init(&app); + } + app_config_preproc(&app); app_config_parse(&app, app.parser_file); @@ -40,11 +48,21 @@ main(int argc, char **argv) /* Init */ app_init(&app); + if (is_rest_support() && (ctx != NULL)) { + /* rest api's for cgnapt */ + rest_api_cgnapt_init(ctx, &app); + } + /* Run-time */ rte_eal_mp_remote_launch( app_thread, (void *) &app, CALL_MASTER); + if (is_rest_support() && (ctx != NULL)) { + mg_stop(ctx); + printf("Civet server stopped.\n"); + } + return 0; } |