generate_packets.py: Add a class to hold script configuration
Part of #43927. Move script configuration out of global state and into dedicated class. This helps group code together, and makes it easier for custom scripts to import and use generate_packets.py as a module.
Part of #43927. Move script configuration out of global state and into dedicated class. This helps group code together, and makes it easier for custom scripts to import and use generate_packets.py as a module.