MCPcopy Create free account
hub / github.com/F-Stack/f-stack / l2fwd_crypto_parse_args

Function l2fwd_crypto_parse_args

dpdk/examples/l2fwd-crypto/main.c:1651–1763  ·  view source on GitHub ↗

Parse the argument given in the command line of the application */

Source from the content-addressed store, hash-verified

1649
1650/* Parse the argument given in the command line of the application */
1651static int
1652l2fwd_crypto_parse_args(struct l2fwd_crypto_options *options,
1653 int argc, char **argv)
1654{
1655 int opt, retval, option_index;
1656 char **argvopt = argv, *prgname = argv[0];
1657
1658 static struct option lgopts[] = {
1659 { "sessionless", no_argument, 0, 0 },
1660
1661 { "cdev_type", required_argument, 0, 0 },
1662 { "chain", required_argument, 0, 0 },
1663
1664 { "cipher_algo", required_argument, 0, 0 },
1665 { "cipher_op", required_argument, 0, 0 },
1666 { "cipher_key", required_argument, 0, 0 },
1667 { "cipher_key_random_size", required_argument, 0, 0 },
1668 { "cipher_iv", required_argument, 0, 0 },
1669 { "cipher_iv_random_size", required_argument, 0, 0 },
1670 { "cipher_dataunit_len", required_argument, 0, 0},
1671
1672 { "auth_algo", required_argument, 0, 0 },
1673 { "auth_op", required_argument, 0, 0 },
1674 { "auth_key", required_argument, 0, 0 },
1675 { "auth_key_random_size", required_argument, 0, 0 },
1676 { "auth_iv", required_argument, 0, 0 },
1677 { "auth_iv_random_size", required_argument, 0, 0 },
1678
1679 { "aead_algo", required_argument, 0, 0 },
1680 { "aead_op", required_argument, 0, 0 },
1681 { "aead_key", required_argument, 0, 0 },
1682 { "aead_key_random_size", required_argument, 0, 0 },
1683 { "aead_iv", required_argument, 0, 0 },
1684 { "aead_iv_random_size", required_argument, 0, 0 },
1685
1686 { "aad", required_argument, 0, 0 },
1687 { "aad_random_size", required_argument, 0, 0 },
1688
1689 { "digest_size", required_argument, 0, 0 },
1690
1691 { "sessionless", no_argument, 0, 0 },
1692 { "cryptodev_mask", required_argument, 0, 0},
1693
1694 { "mac-updating", no_argument, 0, 0},
1695 { "no-mac-updating", no_argument, 0, 0},
1696
1697 { NULL, 0, 0, 0 }
1698 };
1699
1700 l2fwd_crypto_default_options(options);
1701
1702 while ((opt = getopt_long(argc, argvopt, "p:q:sT:", lgopts,
1703 &option_index)) != EOF) {
1704 switch (opt) {
1705 /* long options */
1706 case 0:
1707 retval = l2fwd_crypto_parse_args_long_options(options,
1708 lgopts, option_index);

Callers 1

mainFunction · 0.85

Calls 7

getopt_longFunction · 0.85
l2fwd_crypto_usageFunction · 0.85

Tested by

no test coverage detected