#ifndef UTILS_H
#define UTILS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "pnet_api.h"
#include "osal.h"

typedef struct utils_netif_name
{
   char name[PNET_INTERFACE_NAME_MAX_SIZE];
} utils_netif_name_t;

typedef struct utils_netif_namelist
{
   utils_netif_name_t netif[PNET_MAX_PHYSICAL_PORTS + 1];
} utils_netif_namelist_t;

/**
 * Update network configuration from a string
 * defining a list of network interfaces examples:
 * "eth0" or "br0,eth0,eth1"
 *
 * Read IP, netmask etc from operating system.
 *
 * @param netif_list_str      In:  Comma separated string of network ifs
 * @param if_list             Out: Array of network ifs
 * @param number_of_ports     Out: Number of ports
 * @param if_cfg              Out: P-Net network configuration to be updated
 * @param default_mau_type    
 * @return 0 on success, -1 on error
 */
int utils_pnet_cfg_init_netifs (
   const char * netif_list_str,
   utils_netif_namelist_t * if_list,
   uint16_t * number_of_ports,
   pnet_if_cfg_t * if_cfg,
   uint16_t default_mau_type);

#ifdef __cplusplus
}
#endif

#endif