#include <USBScanPage.hpp>
Public Member Functions | |
| USBScanPage () | |
| virtual | ~USBScanPage () |
Private Member Functions | |
| std::vector< USBDeviceInfo > | detect_usb_devices () |
| void | update_cards () |
| Gtk::Widget * | build_usb_card (const USBDeviceInfo &dev) |
| std::string | find_mountpoint (const std::string &devnode) |
| std::string | mount_partition (const std::string &devnode, bool &auto_mounted) |
| void | run_clamdscan_async (const std::string &devnode) |
| bool | try_start_scan (const std::string &uid) |
| void | show_scan_result (const std::string &text) |
| void | show_infected_dialog (const std::string &text) |
| std::string | build_scan_report (const std::string &raw) |
| void | write_log (const std::string &msg) |
| void | update_log_view () |
| std::string | get_log_path () |
| void | start_monitor_thread () |
| void | append_live_output (const std::string &line) |
| void | send_dbus_alert (const std::string &file, const std::string &family) |
Static Private Member Functions | |
| static std::string | human_readable_size (uint64_t bytes) |
Private Attributes | |
| Gtk::FlowBox | flowbox_devices_ |
| Gtk::Button | btn_refresh_ |
| Gtk::CheckButton | chk_auto_refresh_ |
| Gtk::Label | lbl_title_ |
| Gtk::Label | lbl_status_ |
| Gtk::TextView | txt_log_ |
| Gtk::ScrolledWindow | scroller_log_ |
| std::thread | monitor_thread_ |
| std::atomic< bool > | monitor_running_ {false} |
| bool | initial_scan_done_ {false} |
| bool | ignore_existing_devices_ {true} |
| std::mutex | scan_mtx_ |
| std::unordered_map< std::string, ScanState > | device_state_ |
| std::mutex | log_mtx_ |
| std::mutex | pending_log_mtx_ |
| std::vector< std::string > | pending_log_lines_ |
| sigc::connection | log_idle_connection_ |
| sigc::connection | auto_refresh_conn_ |
| class LiveScanDialog * | live_scan_dialog_ = nullptr |
| Gtk::TextView * | live_scan_textview_ = nullptr |
| BastionGuard::AliveFlag | alive_ = BastionGuard::make_alive_flag() |
Definition at line 51 of file USBScanPage.hpp.
| USBScanPage::USBScanPage | ( | ) |
Definition at line 114 of file USBScanPage.cpp.
References _, auto_refresh_conn_, btn_refresh_, chk_auto_refresh_, flowbox_devices_, ignore_existing_devices_, initial_scan_done_, load_usb_autoscan(), monitor_running_, save_usb_autoscan(), scroller_log_, start_monitor_thread(), txt_log_, update_cards(), update_log_view(), and write_log().
|
virtual |
Definition at line 104 of file USBScanPage.cpp.
References alive_, auto_refresh_conn_, log_idle_connection_, monitor_running_, and monitor_thread_.
|
private |
Definition at line 865 of file USBScanPage.cpp.
References alive_, live_scan_dialog_, and live_scan_textview_.
|
private |
Definition at line 627 of file USBScanPage.cpp.
References _.
|
private |
Definition at line 315 of file USBScanPage.cpp.
References _, USBDeviceInfo::devnode, human_readable_size(), USBDeviceInfo::name, resource(), run_clamdscan_async(), USBDeviceInfo::serial, USBDeviceInfo::size_bytes, and write_log().
Referenced by update_cards().
|
private |
Definition at line 229 of file USBScanPage.cpp.
References USBDeviceInfo::devnode, USBDeviceInfo::name, USBDeviceInfo::size_bytes, and USBDeviceInfo::uid.
Referenced by run_clamdscan_async(), start_monitor_thread(), and update_cards().
|
private |
Definition at line 374 of file USBScanPage.cpp.
Referenced by mount_partition().
|
private |
Definition at line 885 of file USBScanPage.cpp.
Referenced by update_log_view(), and write_log().
|
staticprivate |
Definition at line 82 of file USBScanPage.cpp.
Referenced by build_usb_card().
|
private |
Definition at line 388 of file USBScanPage.cpp.
References _, find_mountpoint(), and write_log().
Referenced by run_clamdscan_async().
|
private |
Definition at line 470 of file USBScanPage.cpp.
References _, alive_, detect_usb_devices(), device_state_, USBDeviceInfo::devnode, BastionGuard::if_alive(), mount_partition(), scan_mtx_, Scanning, show_infected_dialog(), show_scan_result(), try_start_scan(), USBDeviceInfo::uid, and write_log().
Referenced by build_usb_card(), and start_monitor_thread().
|
private |
Definition at line 599 of file USBScanPage.cpp.
References _, and write_log().
Referenced by show_infected_dialog().
|
private |
Definition at line 970 of file USBScanPage.cpp.
References send_dbus_alert(), and trim().
Referenced by run_clamdscan_async().
|
private |
Definition at line 672 of file USBScanPage.cpp.
References _, and resource().
Referenced by run_clamdscan_async().
|
private |
Definition at line 778 of file USBScanPage.cpp.
References _, alive_, detect_usb_devices(), initial_scan_done_, monitor_running_, monitor_thread_, run_clamdscan_async(), ScanPromptWindow::ScanPromptWindow(), update_cards(), update_log_view(), and write_log().
Referenced by USBScanPage().
|
private |
Definition at line 302 of file USBScanPage.cpp.
References device_state_, Mounting, scan_mtx_, and Scanning.
Referenced by run_clamdscan_async().
|
private |
Definition at line 361 of file USBScanPage.cpp.
References build_usb_card(), detect_usb_devices(), and flowbox_devices_.
Referenced by start_monitor_thread(), and USBScanPage().
|
private |
Definition at line 949 of file USBScanPage.cpp.
References _, get_log_path(), and txt_log_.
Referenced by start_monitor_thread(), and USBScanPage().
|
private |
Definition at line 890 of file USBScanPage.cpp.
References alive_, get_log_path(), log_idle_connection_, log_mtx_, pending_log_lines_, pending_log_mtx_, and txt_log_.
Referenced by build_usb_card(), mount_partition(), run_clamdscan_async(), send_dbus_alert(), start_monitor_thread(), and USBScanPage().
|
private |
Definition at line 107 of file USBScanPage.hpp.
Referenced by append_live_output(), run_clamdscan_async(), start_monitor_thread(), write_log(), and ~USBScanPage().
|
private |
Definition at line 100 of file USBScanPage.hpp.
Referenced by USBScanPage(), and ~USBScanPage().
|
private |
Definition at line 81 of file USBScanPage.hpp.
Referenced by USBScanPage().
|
private |
Definition at line 82 of file USBScanPage.hpp.
Referenced by USBScanPage().
|
private |
Definition at line 94 of file USBScanPage.hpp.
Referenced by run_clamdscan_async(), and try_start_scan().
|
private |
Definition at line 80 of file USBScanPage.hpp.
Referenced by update_cards(), and USBScanPage().
|
private |
Definition at line 91 of file USBScanPage.hpp.
Referenced by USBScanPage().
|
private |
Definition at line 90 of file USBScanPage.hpp.
Referenced by start_monitor_thread(), and USBScanPage().
|
private |
Definition at line 84 of file USBScanPage.hpp.
|
private |
Definition at line 83 of file USBScanPage.hpp.
|
private |
Definition at line 102 of file USBScanPage.hpp.
Referenced by append_live_output().
|
private |
Definition at line 103 of file USBScanPage.hpp.
Referenced by append_live_output().
|
private |
Definition at line 99 of file USBScanPage.hpp.
Referenced by write_log(), and ~USBScanPage().
|
private |
Definition at line 96 of file USBScanPage.hpp.
Referenced by write_log().
|
private |
Definition at line 89 of file USBScanPage.hpp.
Referenced by start_monitor_thread(), USBScanPage(), and ~USBScanPage().
|
private |
Definition at line 88 of file USBScanPage.hpp.
Referenced by start_monitor_thread(), and ~USBScanPage().
|
private |
Definition at line 98 of file USBScanPage.hpp.
Referenced by write_log().
|
private |
Definition at line 97 of file USBScanPage.hpp.
Referenced by write_log().
|
private |
Definition at line 93 of file USBScanPage.hpp.
Referenced by run_clamdscan_async(), and try_start_scan().
|
private |
Definition at line 86 of file USBScanPage.hpp.
Referenced by USBScanPage().
|
private |
Definition at line 85 of file USBScanPage.hpp.
Referenced by update_log_view(), USBScanPage(), and write_log().