Add support for apps to have IP addresses as command parameters Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- buildtools/dpdk-cmdline-gen.py | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/buildtools/dpdk-cmdline-gen.py b/buildtools/dpdk-cmdline-gen.py index 1ddd8b6bbb..c1f8a6f1da 100755 --- a/buildtools/dpdk-cmdline-gen.py +++ b/buildtools/dpdk-cmdline-gen.py @@ -49,6 +49,10 @@ def process_command(tokens, cfile): result_struct.append(f"\t{t_type.lower()}_t {t_name};") initializers.append(f"static cmdline_parse_token_num_t cmd_{name}_{t_name}_tok =\n" + f"\tTOKEN_NUM_INITIALIZER(struct cmd_{name}_result, {t_name}, RTE_{t_type});") + elif t_type in ['IP', 'IP_ADDR', 'IPADDR']: + result_struct.append(f"\tcmdline_ipaddr_t {t_name};") + initializers.append(f"cmdline_parse_token_ipaddr_t cmd_{name}_{t_name}_tok =\n" + + f"\tTOKEN_IPV4_INITIALIZER(struct cmd_{name}_result, {t_name});") else: print(f"Error: unknown token-type {t}", file=sys.stderr) sys.exit(1) @@ -96,6 +100,7 @@ def process_commands(infile, hfile, cfile, ctxname): print("#include <cmdline.h>") print("#include <cmdline_parse_string.h>") print("#include <cmdline_parse_num.h>") + print("#include <cmdline_parse_ipaddr.h>") print("") for line in infile.readlines(): -- 2.39.2