12#ifndef OPENVPN_CLIENT_CLIHALT_H
13#define OPENVPN_CLIENT_CLIHALT_H
46 throw client_halt_error();
51 size_t reason_pos = 0;
52 if (
restart_ && sl[1].starts_with(
"[P]:"))
57 reason_ = sl[1].substr(reason_pos);
90 std::ostringstream
os;
99 Split::by_char_void<StringList, NullLex, Split::NullLimit>(sl,
msg,
',', 0, 1);
104 return !sl.empty() && sl[0] ==
"HALT";
109 return !sl.empty() && sl[0] ==
"RESTART";
std::string render() const
static bool match(const std::string &msg)
const std::string & reason() const
std::vector< std::string > StringList
static bool is_halt(const StringList &sl)
static bool is_restart(const StringList &sl)
ClientHalt(const std::string &msg, const bool unicode_filter)
OPENVPN_SIMPLE_EXCEPTION(client_halt_error)
static void parse_msg(StringList &sl, const std::string &msg)
STRING utf8_printable(const STRING &str, size_t max_len_flags)