The pnet_t struct contains a lot of variables belonging to many different sub-modules. This is not best programming practice. Suggestion: Group related variables into structs.