23 #ifndef BM_BM_SIM_OPTIONS_PARSE_H_
24 #define BM_BM_SIM_OPTIONS_PARSE_H_
29 #include <unordered_set>
31 #include "device_id.h"
39 using iterator = std::map<uint32_t, std::string>::iterator;
40 using const_iterator = std::map<uint32_t, std::string>::const_iterator;
43 void add(uint32_t port,
const std::string &iface) {
46 bool empty() {
return ifaces.empty(); }
47 void clear() { ifaces.clear(); }
49 iterator begin() {
return ifaces.begin(); }
50 const_iterator begin()
const {
return ifaces.begin(); }
51 iterator end() {
return ifaces.end(); }
52 const_iterator end()
const {
return ifaces.end(); }
53 iterator find(uint32_t port) {
return ifaces.find(port); }
54 const_iterator find(uint32_t port)
const {
return ifaces.find(port); }
57 std::map<uint32_t, std::string> ifaces{};
62 static constexpr
int default_max_port_count = 512;
64 void parse(
int argc,
char *argv[], TargetParserIface *tp,
66 std::ostream &outstream);
68 void parse(
int argc,
char *argv[], TargetParserIface *tp);
70 bool option_was_provided(
const std::string &option)
const;
72 std::string config_file_path{};
74 InterfaceList ifaces{};
76 std::string pcap_dir{};
78 device_id_t device_id{};
80 bool use_files{
false};
84 bool packet_in{
false};
85 std::string packet_in_addr{};
86 std::string event_logger_addr{};
87 std::string file_logger{};
88 bool console_logging{
false};
92 bool log_flush{
false};
93 std::string notifications_addr{};
95 std::string debugger_addr{};
96 std::string state_file_path{};
97 size_t dump_packet_data{0};
98 int max_port_count{default_max_port_count};
99 std::unordered_set<std::string> options_provided{};
104 #endif // BM_BM_SIM_OPTIONS_PARSE_H_