struct app_pipeline_data {
void *be;
void *fe;
+ struct pipeline_type *ptype;
uint64_t timer_period;
uint32_t enabled;
};
"init error\n", params->name);
}
+ data->ptype = ptype;
+
data->timer_period = (rte_get_tsc_hz() * params->timer_period)
/ 1000;
}
}
static inline void *
-app_pipeline_data_fe(struct app_params *app, uint32_t id)
+app_pipeline_data_fe(struct app_params *app, uint32_t id, struct pipeline_type *ptype)
{
struct app_pipeline_data *pipeline_data;
if (pipeline_data == NULL)
return NULL;
+ if (strcmp(pipeline_data->ptype->name, ptype->name) != 0)
+ return NULL;
+
if (pipeline_data->enabled == 0)
return NULL;
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*
(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 =
(key == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_flow_classification);
if (p == NULL)
return -1;
(n_keys == 0))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_flow_classification);
if (p == NULL)
return -1;
(key == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_flow_classification);
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_flow_classification);
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_flow_classification);
if (p == NULL)
return -EINVAL;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_flow_classification);
if (p == NULL)
return -1;
struct pipeline_routing *p;
struct app_pipeline_routing_route *it;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
if (p == NULL)
return -EINVAL;
(data == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
if (p == NULL)
return -1;
(key == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
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_routing);
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_routing);
if (p == NULL)
return -1;
struct pipeline_routing *p;
struct app_pipeline_routing_arp_entry *it;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
if (p == NULL)
return -EINVAL;
(macaddr == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
if (p == NULL)
return -1;
(key == NULL))
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
if (p == NULL)
return -EINVAL;
if (app == NULL)
return -1;
- p = app_pipeline_data_fe(app, pipeline_id);
+ p = app_pipeline_data_fe(app, pipeline_id, &pipeline_routing);
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_routing);
if (p == NULL)
return -EINVAL;
struct app_params *app = data;
struct pipeline_routing *p;
- p = app_pipeline_data_fe(app, params->p);
+ p = app_pipeline_data_fe(app, params->p, &pipeline_routing);
if (p == NULL)
return;