1 | /* |
2 | SPDX-FileCopyrightText: 2018 Pranav Gade <pranavgade20@gmail.com> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
5 | */ |
6 | |
7 | #ifndef NETWORKMANAGERQT_IPTUNNEL_SETTING_H |
8 | #define NETWORKMANAGERQT_IPTUNNEL_SETTING_H |
9 | |
10 | #include "setting.h" |
11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
12 | |
13 | namespace NetworkManager |
14 | { |
15 | class IpTunnelSettingPrivate; |
16 | |
17 | /*! |
18 | * \class NetworkManager::IpTunnelSetting |
19 | * \inheaderfile NetworkManagerQt/IpTunnelSetting |
20 | * \inmodule NetworkManagerQt |
21 | * |
22 | * \brief Represents IpTunnel setting. |
23 | */ |
24 | class NETWORKMANAGERQT_EXPORT IpTunnelSetting : public Setting |
25 | { |
26 | public: |
27 | /*! |
28 | * \typedef NetworkManager::IpTunnelSetting::Ptr |
29 | */ |
30 | typedef QSharedPointer<IpTunnelSetting> Ptr; |
31 | /*! |
32 | * \typedef NetworkManager::IpTunnelSetting::List |
33 | */ |
34 | typedef QList<Ptr> List; |
35 | /*! |
36 | * |
37 | * \value Unknown |
38 | * \value Ipip |
39 | * \value Gre |
40 | * \value Sit |
41 | * \value Isatap |
42 | * \value Vti |
43 | * \value Ip6ip6 |
44 | * \value Ipip6 |
45 | * \value Ip6gre |
46 | * \value Vti6 |
47 | */ |
48 | enum Mode { |
49 | Unknown = NM_IP_TUNNEL_MODE_UNKNOWN, |
50 | Ipip = NM_IP_TUNNEL_MODE_IPIP, |
51 | Gre = NM_IP_TUNNEL_MODE_GRE, |
52 | Sit = NM_IP_TUNNEL_MODE_SIT, |
53 | Isatap = NM_IP_TUNNEL_MODE_ISATAP, |
54 | Vti = NM_IP_TUNNEL_MODE_VTI, |
55 | Ip6ip6 = NM_IP_TUNNEL_MODE_IP6IP6, |
56 | Ipip6 = NM_IP_TUNNEL_MODE_IPIP6, |
57 | Ip6gre = NM_IP_TUNNEL_MODE_IP6GRE, |
58 | Vti6 = NM_IP_TUNNEL_MODE_VTI6, |
59 | }; |
60 | |
61 | /*! |
62 | * |
63 | * \value None |
64 | * \value Ip6IgnEncapLimit |
65 | * \value Ip6UseOrigTclass |
66 | * \value Ip6UseOrigFlowlabel |
67 | * \value Ip6Mip6Dev |
68 | * \value Ip6RcvDscpCopy |
69 | * \value Ip6UseOrigFwmark |
70 | */ |
71 | enum Flag { |
72 | None = 0x0, |
73 | Ip6IgnEncapLimit = 0x1, |
74 | Ip6UseOrigTclass = 0x2, |
75 | Ip6UseOrigFlowlabel = 0x4, |
76 | Ip6Mip6Dev = 0x8, |
77 | Ip6RcvDscpCopy = 0x10, |
78 | Ip6UseOrigFwmark = 0x20, |
79 | }; |
80 | Q_DECLARE_FLAGS(Flags, Flag) |
81 | |
82 | /*! |
83 | */ |
84 | IpTunnelSetting(); |
85 | /*! |
86 | */ |
87 | explicit IpTunnelSetting(const Ptr &other); |
88 | ~IpTunnelSetting() override; |
89 | |
90 | QString name() const override; |
91 | |
92 | /*! |
93 | */ |
94 | void setMode(Mode mode); |
95 | /*! |
96 | */ |
97 | Mode mode() const; |
98 | |
99 | /*! |
100 | */ |
101 | void setPathMtuDiscovery(bool discovery); |
102 | /*! |
103 | */ |
104 | bool pathMtuDiscovery() const; |
105 | |
106 | /*! |
107 | */ |
108 | void setEncapsulationLimit(quint32 limit); |
109 | /*! |
110 | */ |
111 | quint32 encapsulationLimit() const; |
112 | |
113 | /*! |
114 | */ |
115 | void setFlags(Flags flags); |
116 | /*! |
117 | */ |
118 | Flags flags() const; |
119 | |
120 | /*! |
121 | */ |
122 | void setFlowLabel(quint32 label); |
123 | /*! |
124 | */ |
125 | quint32 flowLabel() const; |
126 | |
127 | /*! |
128 | */ |
129 | void setMtu(quint32 mtu); |
130 | /*! |
131 | */ |
132 | quint32 mtu() const; |
133 | |
134 | /*! |
135 | */ |
136 | void setTos(quint32 tos); |
137 | /*! |
138 | */ |
139 | quint32 tos() const; |
140 | |
141 | /*! |
142 | */ |
143 | void setTtl(quint32 ttl); |
144 | /*! |
145 | */ |
146 | quint32 ttl() const; |
147 | |
148 | /*! |
149 | */ |
150 | void setInputKey(const QString &key); |
151 | /*! |
152 | */ |
153 | QString inputKey() const; |
154 | |
155 | /*! |
156 | */ |
157 | void setLocal(const QString &local); |
158 | /*! |
159 | */ |
160 | QString local() const; |
161 | |
162 | /*! |
163 | */ |
164 | void setParent(const QString &parent); |
165 | /*! |
166 | */ |
167 | QString parent() const; |
168 | |
169 | /*! |
170 | */ |
171 | void setOutputKey(const QString &key); |
172 | /*! |
173 | */ |
174 | QString outputKey() const; |
175 | |
176 | /*! |
177 | */ |
178 | void setRemote(const QString &remote); |
179 | /*! |
180 | */ |
181 | QString remote() const; |
182 | |
183 | void fromMap(const QVariantMap &setting) override; |
184 | |
185 | QVariantMap toMap() const override; |
186 | |
187 | protected: |
188 | IpTunnelSettingPrivate *d_ptr; |
189 | |
190 | private: |
191 | Q_DECLARE_PRIVATE(IpTunnelSetting) |
192 | }; |
193 | Q_DECLARE_OPERATORS_FOR_FLAGS(IpTunnelSetting::Flags) |
194 | |
195 | NETWORKMANAGERQT_EXPORT QDebug operator<<(QDebug dbg, const IpTunnelSetting &setting); |
196 | |
197 | } |
198 | |
199 | #endif // NETWORKMANAGERQT_IP_TUNNEL_SETTING_H |
200 | |