diff options
author | Christophe Milard <christophe.milard@linaro.org> | 2016-04-14 17:45:03 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2016-05-23 15:06:59 +0300 |
commit | c359aa94e7e4bec115a70dc9f662cb7e28fd7f0e (patch) | |
tree | 1cf1dde2ad8f233c533b78a2b227ebf3235aef46 /example | |
parent | 2eba1284dfc33c3a970e6cdef97710cc543465cc (diff) |
example: ipsec: adding helper cmd line parsing
odp_ipsec now calls the helper command line parsing so that helper
can collect its options. Hence enabling process mode run.
Signed-off-by: Christophe Milard <christophe.milard@linaro.org>
Reviewed-by: Brian Brooks <brian.brooks@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r-- | example/ipsec/odp_ipsec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c index 4d08772c2..fb4385f6f 100644 --- a/example/ipsec/odp_ipsec.c +++ b/example/ipsec/odp_ipsec.c @@ -1381,7 +1381,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) int rc = 0; int i; - static struct option longopts[] = { + static const struct option longopts[] = { {"count", required_argument, NULL, 'c'}, {"interface", required_argument, NULL, 'i'}, /* return 'i' */ {"mode", required_argument, NULL, 'm'}, /* return 'm' */ @@ -1395,13 +1395,19 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args) {NULL, 0, NULL, 0} }; + static const char *shortopts = "+c:i:m:h:r:p:a:e:t:s:"; + + /* let helper collect its own arguments (e.g. --odph_proc) */ + odph_parse_options(argc, argv, shortopts, longopts); + printf("\nParsing command line options\n"); appl_args->mode = 0; /* turn off async crypto API by default */ + opterr = 0; /* do not issue errors on helper options */ + while (!rc) { - opt = getopt_long(argc, argv, "+c:i:m:h:r:p:a:e:t:s:", - longopts, &long_index); + opt = getopt_long(argc, argv, shortopts, longopts, &long_index); if (-1 == opt) break; /* No more options */ |