return NULL;
}
-static void
+static int
app_pipeline_firewall_ls(
struct app_params *app,
uint32_t pipeline_id)
/* Check input arguments */
if (app == NULL)
- return;
+ return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
- return;
+ return -1;
n_rules = p->n_rules;
for (priority = 0; n_rules; priority++)
printf("Default rule: DROP\n");
printf("\n");
+
+ return 0;
}
static void*
return -1;
if (src_ip_depth)
- src_ip_netmask = (~0) << (32 - src_ip_depth);
+ src_ip_netmask = (~0U) << (32 - src_ip_depth);
if (dst_ip_depth)
- dst_ip_netmask = ((~0) << (32 - dst_ip_depth));
+ dst_ip_netmask = ((~0U) << (32 - dst_ip_depth));
key->key.ipv4_5tuple.src_ip &= src_ip_netmask;
key->key.ipv4_5tuple.dst_ip &= dst_ip_netmask;
(key->type != PIPELINE_FIREWALL_IPV4_5TUPLE))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
(key->type != PIPELINE_FIREWALL_IPV4_5TUPLE))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_firewall);
if (p == NULL)
return -1;
{
struct cmd_firewall_ls_result *params = parsed_result;
struct app_params *app = data;
+ int status;
- app_pipeline_firewall_ls(app, params->pipeline_id);
+ status = app_pipeline_firewall_ls(app, params->pipeline_id);
+
+ if (status != 0) {
+ printf("Command failed\n");
+ return;
+ }
}
cmdline_parse_token_string_t cmd_firewall_ls_p_string =