diff options
author | Filip Varga <filipvarga89@gmail.com> | 2019-07-31 12:45:48 +0200 |
---|---|---|
committer | Ole Trøan <otroan@employees.org> | 2019-07-31 17:43:33 +0000 |
commit | e6e09a4acef2c38bc31e89c05bd1f40f1829debb (patch) | |
tree | 17047be4ac050426ee113677a24b73644f714047 /src/plugins/nat/nat_api.c | |
parent | c343a17df5bba800ecd7cca92acdd2bd1f984ebf (diff) |
nat: elog rewrite for multi-worker support
Type: fix
Change-Id: I04f136a04bc022d223e4bcb5c59920bd1f1fd560
Signed-off-by: Filip Varga <filipvarga89@gmail.com>
Diffstat (limited to 'src/plugins/nat/nat_api.c')
-rw-r--r-- | src/plugins/nat/nat_api.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugins/nat/nat_api.c b/src/plugins/nat/nat_api.c index 63e1e756515..ff11a82f099 100644 --- a/src/plugins/nat/nat_api.c +++ b/src/plugins/nat/nat_api.c @@ -250,6 +250,33 @@ vl_api_nat_worker_dump_t_print (vl_api_nat_worker_dump_t * mp, void *handle) } static void +vl_api_nat_set_log_level_t_handler (vl_api_nat_set_log_level_t * mp) +{ + snat_main_t *sm = &snat_main; + vl_api_nat_set_log_level_reply_t *rmp; + int rv = 0; + + if (sm->log_level > NAT_LOG_DEBUG) + rv = VNET_API_ERROR_UNSUPPORTED; + else + sm->log_level = mp->log_level; + + REPLY_MACRO (VL_API_NAT_SET_WORKERS_REPLY); +} + +static void * +vl_api_nat_set_log_level_t_print (vl_api_nat_set_log_level_t * + mp, void *handle) +{ + u8 *s; + + s = format (0, "SCRIPT: nat_set_log_level "); + s = format (s, "log_level %d", mp->log_level); + + FINISH; +} + +static void vl_api_nat_ipfix_enable_disable_t_handler (vl_api_nat_ipfix_enable_disable_t * mp) { @@ -3524,6 +3551,7 @@ _(NAT_CONTROL_PING, nat_control_ping) \ _(NAT_SHOW_CONFIG, nat_show_config) \ _(NAT_SET_WORKERS, nat_set_workers) \ _(NAT_WORKER_DUMP, nat_worker_dump) \ +_(NAT_SET_LOG_LEVEL, nat_set_log_level) \ _(NAT_IPFIX_ENABLE_DISABLE, nat_ipfix_enable_disable) \ _(NAT_SET_REASS, nat_set_reass) \ _(NAT_GET_REASS, nat_get_reass) \ |