#ifndef _PLUGIN_CONFIG_H_
#define _PLUGIN_CONFIG_H_

#include <libconfig.h++>
#include <string>

#define PLUGIN_CONFIG_STRING_PLUGIN_CONFIG "PLUGIN"

#define PLUGIN_CONFIG_STRING_INTERFACES "INTERFACES"
#define PLUGIN_CONFIG_STRING_INTERFACE_NGAP "NGAP"
#define PLUGIN_CONFIG_STRING_INTERFACE_SBI "SBI"
#define PLUGIN_CONFIG_STRING_INTERFACE_NRF "NRF"
#define PLUGIN_CONFIG_STRING_INTERFACE_NAME "INTERFACE_NAME"
#define PLUGIN_CONFIG_STRING_IPV4_ADDRESS "IPV4_ADDRESS"
#define PLUGIN_CONFIG_STRING_PORT "PORT"


using namespace libconfig;
namespace config {



typedef struct interface_cfg_s {
  std::string if_name;
  std::string addr4;
  unsigned int port;
} interface_cfg_t;

class plugin_config {
public:
  plugin_config();
  ~plugin_config();

   int load(const std::string &config_file);
   int getip(std::string &ip, std::string &ifname);
   int load_interface(const Setting &if_cfg, interface_cfg_t &cfg);
   void display();

   unsigned int instance;
   std::string pid_dir;
   interface_cfg_t n2;
   interface_cfg_t sbi;
   interface_cfg_t nrf;
   bool is_wrr;
   bool is_rr;
   bool is_omf;
   int  rrRate;
};
} // namespace config

#endif
