DtkNetworkManager
NetworkManager DBus interface binding for Qt
全部  文件 函数 变量 枚举 
dwiredsetting.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DWIREDSETTING_H
6#define DWIREDSETTING_H
7
8#include "dnmsetting.h"
9#include <QStringList>
10
11DNETWORKMANAGER_BEGIN_NAMESPACE
12
13class DWiredSettingPrivate;
14
16{
17public:
18 enum class PortType {
19 Unknown = 0,
20 Tp,
21 Aui,
22 Bnc,
23 Mii,
24 };
25
26 enum class DuplexType {
27 Unknown = 0,
28 Half,
29 Full,
30 };
31
32 enum class S390Nettype {
33 Undefined = 0,
34 Qeth,
35 Lcs,
36 Ctc,
37 };
38
39 enum class WakeOnLanFlag {
40 Phy = 1 << 1,
41 Unicast = 1 << 2,
42 Multicast = 1 << 3,
43 Broadcast = 1 << 4,
44 Arp = 1 << 5,
45 Magic = 1 << 6,
46 Default = 1 << 0,
47 Ignore = 1 << 15,
48 };
49
50 Q_DECLARE_FLAGS(WakeOnLanFlags, WakeOnLanFlag)
51 Q_FLAGS(WakeOnLanFlag)
52
54 explicit DWiredSetting(const QSharedPointer<DWiredSetting> &other);
55 ~DWiredSetting() override = default;
56
57 QString name() const override;
58
59 void setPort(PortType port);
60 PortType port() const;
61
62 void setSpeed(quint32 speed);
63 quint32 speed() const;
64
65 void setDuplexType(DuplexType type);
66 DuplexType duplexType() const;
67
68 void setAutoNegotiate(bool autoNegotiate);
69 bool autoNegotiate() const;
70
71 QString generateMacAddressMask() const;
72 void setGenerateMacAddressMask(const QString &mask);
73
74 void setMacAddress(const QByteArray &address);
75 QByteArray macAddress() const;
76
77 void setMacAddressBlacklist(const QStringList &list);
78 QStringList macAddressBlacklist() const;
79
80 void setMtu(quint32 mtu);
81 quint32 mtu() const;
82
83 void setS390Subchannels(const QStringList &channels);
84 QStringList s390Subchannels() const;
85
86 void setS390NetType(S390Nettype type);
87 S390Nettype s390NetType() const;
88
89 void setS390Options(const QMap<QString, QString> &options);
90 QMap<QString, QString> s390Options() const;
91
92 WakeOnLanFlags wakeOnLan() const;
93 void setWakeOnLan(WakeOnLanFlags wol);
94
95 QString wakeOnLanPassword() const;
96 void setWakeOnLanPassword(const QString &password);
97
98 QString assignedMacAddress() const;
99 void setAssignedMacAddress(const QString &assignedMacAddress);
100
101 void fromMap(const QVariantMap &setting) override;
102
103 QVariantMap toMap() const override;
104
105protected:
106 QScopedPointer<DWiredSettingPrivate> d_ptr;
107
108private:
109 Q_DECLARE_PRIVATE(DWiredSetting)
110};
111
112Q_DECLARE_OPERATORS_FOR_FLAGS(DWiredSetting::WakeOnLanFlags)
113
114DNETWORKMANAGER_END_NAMESPACE
115
116#endif
DNMSetting类
Definition: dnmsetting.h:26
Definition: dwiredsetting.h:16