X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_pipeline%2Fpipeline%2Fpipeline_firewall_be.c;h=e7a8a4c5cc7dc8493151e47c9b106aaa84a09fcc;hb=3cd654213b24e79b731ec975bca2c839aba5f54a;hp=1c376f7eafcffc0af75fc7277bef35c01f5ea7d7;hpb=67ebdbef0c315cc4165e95e34e57362d894d2ce1;p=dpdk.git diff --git a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c index 1c376f7eaf..e7a8a4c5cc 100644 --- a/examples/ip_pipeline/pipeline/pipeline_firewall_be.c +++ b/examples/ip_pipeline/pipeline/pipeline_firewall_be.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2015 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2016 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ #include #include "pipeline_firewall_be.h" +#include "parser.h" struct pipeline_firewall { struct pipeline p; @@ -308,17 +309,26 @@ pipeline_firewall_parse_args(struct pipeline_firewall *p, char *arg_value = params->args_value[i]; if (strcmp(arg_name, "n_rules") == 0) { - if (n_rules_present) - return -1; + int status; + + PIPELINE_PARSE_ERR_DUPLICATE( + n_rules_present == 0, params->name, + arg_name); n_rules_present = 1; - p->n_rules = atoi(arg_value); + status = parser_read_uint32(&p->n_rules, + arg_value); + PIPELINE_PARSE_ERR_INV_VAL((status != -EINVAL), + params->name, arg_name, arg_value); + PIPELINE_PARSE_ERR_OUT_RNG((status != -ERANGE), + params->name, arg_name, arg_value); continue; } if (strcmp(arg_name, "pkt_type") == 0) { - if (pkt_type_present) - return -1; + PIPELINE_PARSE_ERR_DUPLICATE( + pkt_type_present == 0, params->name, + arg_name); pkt_type_present = 1; /* ipv4 */ @@ -351,11 +361,12 @@ pipeline_firewall_parse_args(struct pipeline_firewall *p, } /* other */ - return -1; + PIPELINE_PARSE_ERR_INV_VAL(0, params->name, + arg_name, arg_value); } /* other */ - return -1; + PIPELINE_PARSE_ERR_INV_ENT(0, params->name, arg_name); } return 0; @@ -439,7 +450,6 @@ pipeline_firewall_init(struct pipeline_params *params, .arg_create = pipeline_port_out_params_convert( ¶ms->port_out[i]), .f_action = NULL, - .f_action_bulk = NULL, .arg_ah = NULL, };