File indexing completed on 2024-04-28 16:52:17
0001 // SPDX-License-Identifier: GPL-2.0-or-later 0002 // SPDX-FileCopyrightText: 2011 Craig Drummond <craig.p.drummond@gmail.com> 0003 // SPDX-FileCopyrightText: 2018 Alexis Lopes Zubeta <contact@azubieta.net> 0004 // SPDX-FileCopyrightText: 2020 Tomaz Canabrava <tcanabrava@kde.org> 0005 0006 #ifndef UFW_TYPES_H 0007 #define UFW_TYPES_H 0008 0009 /* 0010 * UFW KControl Module 0011 */ 0012 0013 #include <kcm_firewall_core_export.h> 0014 0015 #include <QString> 0016 #include <QVariant> 0017 0018 namespace Types 0019 { 0020 KCM_FIREWALL_CORE_EXPORT Q_NAMESPACE 0021 0022 enum LogLevel { 0023 LOG_OFF, 0024 LOG_LOW, 0025 LOG_MEDIUM, 0026 LOG_HIGH, 0027 LOG_FULL, 0028 0029 LOG_COUNT 0030 }; 0031 Q_ENUM_NS(LogLevel) 0032 0033 enum Logging { 0034 LOGGING_OFF, 0035 LOGGING_NEW, 0036 LOGGING_ALL, 0037 0038 LOGGING_COUNT 0039 }; 0040 Q_ENUM_NS(Logging) 0041 0042 enum Policy { 0043 POLICY_ALLOW, 0044 POLICY_DENY, 0045 POLICY_REJECT, 0046 POLICY_LIMIT, 0047 0048 POLICY_COUNT, 0049 POLICY_COUNT_DEFAULT = POLICY_COUNT - 1 // No 'Limit' for defaults... 0050 }; 0051 Q_ENUM_NS(Policy) 0052 0053 enum PredefinedPort { 0054 PP_AMULE, 0055 PP_DELUGE, 0056 PP_KTORRENT, 0057 PP_NICOTINE, 0058 PP_QBITTORRNET, 0059 PP_TRANSMISSION, 0060 PP_IM_ICQ, 0061 PP_IM_JABBER, 0062 PP_IM_WLM, 0063 PP_IM_YAHOO, 0064 0065 PP_FTP, 0066 PP_HTTP, 0067 PP_HTTPS, 0068 PP_IMAP, 0069 PP_IMAPS, 0070 PP_POP3, 0071 PP_POP3S, 0072 PP_SMTP, 0073 PP_NFS, 0074 PP_SAMBA, 0075 PP_SSH, 0076 PP_VNC, 0077 PP_ZEROCONF, 0078 PP_TELNET, 0079 PP_NTP, 0080 PP_CUPS, 0081 0082 PP_COUNT 0083 }; 0084 Q_ENUM_NS(PredefinedPort) 0085 0086 KCM_FIREWALL_CORE_EXPORT QString toString(LogLevel level, bool ui = false); 0087 KCM_FIREWALL_CORE_EXPORT LogLevel toLogLevel(const QString &str); 0088 KCM_FIREWALL_CORE_EXPORT QString toString(Logging log, bool ui = false); 0089 KCM_FIREWALL_CORE_EXPORT Logging toLogging(const QString &str); 0090 KCM_FIREWALL_CORE_EXPORT QString toString(Policy policy, bool ui = false); 0091 KCM_FIREWALL_CORE_EXPORT Policy toPolicy(const QString &str); 0092 KCM_FIREWALL_CORE_EXPORT QString toString(PredefinedPort pp, bool ui = false); 0093 KCM_FIREWALL_CORE_EXPORT PredefinedPort toPredefinedPort(const QString &str); 0094 0095 } 0096 0097 #endif