[PATCH 5/6] app/dumpcap: improve per interface arg parsing

Stephen Hemminger stephen at networkplumber.org
Wed Jan 4 04:04:18 CET 2023


On Mon,  2 Jan 2023 16:24:40 +0000
Ben Magistro <koncept1 at gmail.com> wrote:

> +
> +/* struct representing args for each interface */
> +struct interface_opts {
> +	const char *intf_arg;
> +	const char *filter_str;
> +	bool promiscuous_mode;
> +	uint32_t snaplen;
> +};
> +/* default parameters for interfaces */
> +static struct interface_opts interface_defaults = {
> +	.promiscuous_mode = true,
> +	.snaplen = RTE_MBUF_DEFAULT_BUF_SIZE
> +};
> +//TODO this can be specified per interface but there are a few places
> +// that need more review and possibly refactoring so leaving this one out
> +uint32_t snaplen = RTE_MBUF_DEFAULT_BUF_SIZE;
> +/* array of interface parameters */
> +static struct interface_opts interface_args[RTE_MAX_ETHPORTS];

There is no need to split the interface_opts into a new data structure.
See my fixes patch.



More information about the dev mailing list