3#include "PluginWakeOnLan.h"
4#include "ConnecterWakeOnLan.h"
5#include <QLoggingCategory>
7#ifdef HAVE_PCAPPLUSPLUS
8 #include "PcapPlusPlusVersion.h"
9 #include "PcapDevice.h"
11 static Q_LOGGING_CATEGORY(logPcpp,
"WOL.PCPP")
12 void Pcpp_Logger(pcpp::Logger::LogLevel logLevel,
13 const std::
string& logMessage,
14 const std::
string& file,
15 const std::
string& method,
20 case pcpp::Logger::LogLevel::Debug:
21 qDebug(logPcpp) << logMessage.c_str();
23 case pcpp::Logger::LogLevel::Info:
24 qInfo(logPcpp) << logMessage.c_str();
26 case pcpp::Logger::LogLevel::Error:
27 qCritical(logPcpp) << logMessage.c_str();
33static Q_LOGGING_CATEGORY(log,
"WakeOnLan.Plugin")
37#ifdef HAVE_PCAPPLUSPLUS
38 pcpp::Logger::getInstance().setLogPrinter(Pcpp_Logger);
39 pcpp::Logger::getInstance().setAllModulesToLogLevel(
40 pcpp::Logger::LogLevel::Debug);
42 pcpp::Logger::getInstance().enableLogs();
43 pcpp::Logger::getInstance().setLogLevel(
44 pcpp::LogModule::PcapLogModuleLiveDevice, pcpp::Logger::Info);
48CPluginWakeOnLan::~CPluginWakeOnLan()
50 qDebug(log) <<
"CPluginWakeOnLan::~CPluginWakeOnLan()";
65 return tr(
"Wake on lan");
70 return tr(
"Wake on lan");
73const QIcon CPluginWakeOnLan::Icon()
const
75 return QIcon::fromTheme(
"lan");
80 return PluginWakeOnLan_VERSION;
86#ifdef HAVE_PCAPPLUSPLUS
87 szDetails =
"- PcapPlusPlus";
89 szDetails +=
" - " + tr(
"version: ")
90 + pcpp::getPcapPlusPlusVersionFull().c_str();
92 szDetails +=
" - " + tr(
"Pcap lib version info: ")
93 + pcpp::IPcapDevice::getPcapLibVersionInfo().c_str();
virtual const QString Id() const
ID. Default: Protocol() + ":" + Name()
virtual const QString Details() const override
Display more information in About dialog or log.
virtual const QString Protocol() const override
Plugin Protocol.
virtual CConnecter * CreateConnecter(const QString &szId) override
New CConnecter instance.
virtual const QString DisplayName() const override
The plugin display name.
virtual const QString Name() const override
This name must be the same as the project name (${PROJECT_NAME}). The translation file (${PROJECT_NAM...
virtual const QString Version() const override
Version.
virtual const QString Description() const override
Plugin description.