p-net
p-net copied to clipboard
Minimise configuration structure
The configuration structure contains fields which could be calculated in pnet_init(). Remove these fields from pnet_cfg_t as to simplify stack configuration for the user.
Fields which could removed from configuration:
- ip_cfg in pnet_if_cfg_t. Initialise by calling pnal_get_ip_address()/subnet()/gateway().
- Parts of im_x_data.
Handled in #333:
- eth_addr in pnet_netif_t. Initialise by calling pnal_get_macaddress().
- port_id in pnet_port_cfg_t. Initialise as "port-001", "port-002" etc.
It would also be better if the configuration structure was only used as a user-visible structure optimised for user ease-of-use. Currently, it serves a double purpose as it is also stored in the pnet_t instance structure where its members are read and written.