Chops Net IP
Loading...
Searching...
No Matches
dsr_args.hpp
Go to the documentation of this file.
1
17#ifndef DSR_ARGS_HPP_INCLUDED
18#define DSR_ARGS_HPP_INCLUDED
19
20#include <string>
21#include <cstddef> // std::size_t
22#include <vector>
23#include <chrono>
24
25namespace chops {
26namespace test {
27
29 std::string m_port;
30 std::string m_host;
31};
32
33// command line argument data for use by TCP DSR
35 std::string m_dsr_name; // name of this DSR instance
36 bool m_reply; // if true, incoming messages reflected back to sender
37 int m_modulus; // how often to send log msg to monitor, both outgoing and incoming messages
38 int m_send_count; // if 0, don't send any messages
39 std::chrono::milliseconds
40 m_delay;
41 std::vector<std::string>
42 m_acceptors; // 0 - N TCP acceptors, port for each entry
43 std::vector<connector_info>
44 m_connectors; // 0 - N TCP connectors, port and host for each entry
45 connector_info m_monitor; // monitor port, host
46};
47
48
49// besides filling in the command line parsing, decide on error handling - possibilities include
50// return std::optional<tcp_dsr_args>, or return std::expected<tcp_dsr_args>, or throwing an
51// exception
52inline tcp_dsr_args parse_command_line (int argc, char* argvp[]) {
53 tcp_dsr_args args { };
54 return args;
55}
56
57inline void print_help () {
58
59}
60
61
62} // end namespace test
63} // end namespace chops
64
65#endif
66
Definition dsr_args.hpp:28
Definition dsr_args.hpp:34