p-net icon indicating copy to clipboard operation
p-net copied to clipboard

Minimise configuration structure

Open fredrikdanielmoller opened this issue 4 years ago • 1 comments

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.

fredrikdanielmoller avatar Jan 26 '21 14:01 fredrikdanielmoller

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.

fredrikdanielmoller avatar Feb 10 '21 11:02 fredrikdanielmoller