[RFC,v2,4/5] buildtools/dpdk-cmdline-gen: add IP address support
Checks
Commit Message
Add support for apps to have IP addresses as command parameters
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
buildtools/dpdk-cmdline-gen.py | 5 +++++
1 file changed, 5 insertions(+)
@@ -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():