Public Member Functions | |
| Impl (UIServer *owner) | |
| ~Impl () | |
| bool | start (const std::string &socketPath) |
| void | stop () |
| void | accept_loop () |
| bool | read_exact (int fd, std::uint8_t *buf, std::size_t n) |
| void | client_session (int fd) |
| bool | send_frame (const std::string &payload) |
| void | flush_pending_notifs () |
| void | send_reply (ReplyAction action) |
| void | queue_notification (int type, const std::string &data) |
| void | dispatch_connected () |
| void | dispatch_disconnected () |
| void | dispatch_new_connection (const ConnectionInfo &info) |
| void | dispatch_alert (const AlertInfo &a) |
Public Attributes | |
| UIServer * | owner_ |
| int | listen_fd_ {-1} |
| std::string | socket_file_ |
| std::atomic_int | client_fd_ {-1} |
| std::thread | accept_thread_ |
| std::atomic_bool | running_ {false} |
| std::thread | reader_thread_ |
| std::mutex | write_mutex_ |
| std::atomic_uint64_t | next_id_ {1} |
| std::mutex | notif_mutex_ |
| std::deque< json > | pending_notifs_ |
| std::mutex | reply_mutex_ |
| std::condition_variable | reply_cv_ |
| bool | reply_ready_ {false} |
| ReplyAction | reply_action_ {ReplyAction::DENY_ONCE} |
| std::uint64_t | current_ask_id_ {0} |
Definition at line 63 of file UIServer.cpp.
|
inline |
Definition at line 65 of file UIServer.cpp.
References owner_, and UIServer::UIServer().
|
inline |
|
inline |
Definition at line 168 of file UIServer.cpp.
References client_fd_, client_session(), listen_fd_, reader_thread_, and running_.
Referenced by start().
|
inline |
Definition at line 201 of file UIServer.cpp.
References AlertInfo::action, ALLOW_ALWAYS, ALLOW_ONCE, client_fd_, AlertInfo::connection, connection_info_from_json(), current_ask_id_, DENY_ALWAYS, DENY_ONCE, ConnectionInfo::dest_host, ConnectionInfo::dest_ip, ConnectionInfo::dest_port, dispatch_alert(), dispatch_connected(), dispatch_disconnected(), dispatch_new_connection(), display_app_name(), flush_pending_notifs(), bsc::proto::frame_peek_length(), AlertInfo::has_connection, AlertInfo::id, bsc::proto::msg::kAlert, bsc::proto::msg::kAskRule, bsc::proto::msg::kAskRuleReply, bsc::proto::msg::kHello, bsc::proto::kMaxFrameSize, bsc::proto::msg::kPing, bsc::proto::msg::kPong, AlertInfo::priority, ConnectionInfo::protocol, read_exact(), reply_action_, reply_cv_, reply_mutex_, reply_ready_, AlertInfo::rule_name, running_, send_frame(), AlertInfo::text, AlertInfo::type, and AlertInfo::what.
Referenced by accept_loop().
|
inline |
Definition at line 408 of file UIServer.cpp.
References owner_, and UIServer::signal_alert.
Referenced by client_session().
|
inline |
Definition at line 403 of file UIServer.cpp.
References owner_, and UIServer::signal_daemon_connected.
Referenced by client_session().
|
inline |
Definition at line 404 of file UIServer.cpp.
References owner_, and UIServer::signal_daemon_disconnected.
Referenced by client_session().
|
inline |
Definition at line 405 of file UIServer.cpp.
References owner_, and UIServer::signal_new_connection.
Referenced by client_session().
|
inline |
Definition at line 352 of file UIServer.cpp.
References notif_mutex_, pending_notifs_, and send_frame().
Referenced by client_session().
|
inline |
Definition at line 380 of file UIServer.cpp.
References client_fd_, bsc::proto::msg::kNotification, next_id_, notif_mutex_, pending_notifs_, and send_frame().
|
inline |
Definition at line 190 of file UIServer.cpp.
Referenced by client_session().
|
inline |
Definition at line 337 of file UIServer.cpp.
References client_fd_, bsc::proto::frame_encode(), and write_mutex_.
Referenced by client_session(), flush_pending_notifs(), and queue_notification().
|
inline |
Definition at line 369 of file UIServer.cpp.
References reply_action_, reply_cv_, reply_mutex_, and reply_ready_.
|
inline |
Definition at line 103 of file UIServer.cpp.
References accept_loop(), accept_thread_, listen_fd_, bsc::proto::resolve_socket_path(), running_, and socket_file_.
|
inline |
Definition at line 144 of file UIServer.cpp.
References accept_thread_, client_fd_, listen_fd_, reader_thread_, reply_cv_, reply_mutex_, reply_ready_, running_, and socket_file_.
Referenced by ~Impl().
| std::thread UIServer::Impl::accept_thread_ |
Definition at line 78 of file UIServer.cpp.
| std::atomic_int UIServer::Impl::client_fd_ {-1} |
Definition at line 75 of file UIServer.cpp.
Referenced by accept_loop(), client_session(), queue_notification(), send_frame(), and stop().
| std::uint64_t UIServer::Impl::current_ask_id_ {0} |
Definition at line 99 of file UIServer.cpp.
Referenced by client_session().
| int UIServer::Impl::listen_fd_ {-1} |
Definition at line 71 of file UIServer.cpp.
Referenced by accept_loop(), start(), and stop().
| std::atomic_uint64_t UIServer::Impl::next_id_ {1} |
Definition at line 88 of file UIServer.cpp.
Referenced by queue_notification().
| std::mutex UIServer::Impl::notif_mutex_ |
Definition at line 91 of file UIServer.cpp.
Referenced by flush_pending_notifs(), and queue_notification().
| UIServer* UIServer::Impl::owner_ |
Definition at line 68 of file UIServer.cpp.
Referenced by dispatch_alert(), dispatch_connected(), dispatch_disconnected(), dispatch_new_connection(), and Impl().
| std::deque<json> UIServer::Impl::pending_notifs_ |
Definition at line 92 of file UIServer.cpp.
Referenced by flush_pending_notifs(), and queue_notification().
| std::thread UIServer::Impl::reader_thread_ |
Definition at line 82 of file UIServer.cpp.
Referenced by accept_loop(), and stop().
| ReplyAction UIServer::Impl::reply_action_ {ReplyAction::DENY_ONCE} |
Definition at line 98 of file UIServer.cpp.
Referenced by client_session(), and send_reply().
| std::condition_variable UIServer::Impl::reply_cv_ |
Definition at line 96 of file UIServer.cpp.
Referenced by client_session(), send_reply(), and stop().
| std::mutex UIServer::Impl::reply_mutex_ |
Definition at line 95 of file UIServer.cpp.
Referenced by client_session(), send_reply(), and stop().
| bool UIServer::Impl::reply_ready_ {false} |
Definition at line 97 of file UIServer.cpp.
Referenced by client_session(), send_reply(), and stop().
| std::atomic_bool UIServer::Impl::running_ {false} |
Definition at line 79 of file UIServer.cpp.
Referenced by accept_loop(), client_session(), start(), and stop().
| std::string UIServer::Impl::socket_file_ |
Definition at line 72 of file UIServer.cpp.
| std::mutex UIServer::Impl::write_mutex_ |
Definition at line 85 of file UIServer.cpp.
Referenced by send_frame().