| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2017 Jan Grulich <jgrulich@redhat.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_DEVICE_H |
| 8 | #define NETWORKMANAGERQT_IPTUNNEL_DEVICE_H |
| 9 | |
| 10 | #include "device.h" |
| 11 | #include <networkmanagerqt/networkmanagerqt_export.h> |
| 12 | |
| 13 | namespace NetworkManager |
| 14 | { |
| 15 | class IpTunnelDevicePrivate; |
| 16 | |
| 17 | /*! |
| 18 | * \class NetworkManager::IpTunnelDevice |
| 19 | * \inheaderfile NetworkManagerQt/IpTunnelDevice |
| 20 | * \inmodule NetworkManagerQt |
| 21 | * |
| 22 | * \brief A Ip Tunnel device interface. |
| 23 | */ |
| 24 | class NETWORKMANAGERQT_EXPORT IpTunnelDevice : public Device |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | |
| 28 | /*! |
| 29 | * \property NetworkManager::IpTunnelDevice::encapsulationLimit |
| 30 | */ |
| 31 | Q_PROPERTY(uchar encapsulationLimit READ encapsulationLimit NOTIFY encapsulationLimitChanged) |
| 32 | |
| 33 | /*! |
| 34 | * \property NetworkManager::IpTunnelDevice::flowLabel |
| 35 | */ |
| 36 | Q_PROPERTY(uint flowLabel READ flowLabel NOTIFY flowLabelChanged) |
| 37 | |
| 38 | /*! |
| 39 | * \property NetworkManager::IpTunnelDevice::inputKey |
| 40 | */ |
| 41 | Q_PROPERTY(QString inputKey READ inputKey NOTIFY inputKeyChanged) |
| 42 | |
| 43 | /*! |
| 44 | * \property NetworkManager::IpTunnelDevice::local |
| 45 | */ |
| 46 | Q_PROPERTY(QString local READ local NOTIFY localChanged) |
| 47 | |
| 48 | /*! |
| 49 | * \property NetworkManager::IpTunnelDevice::mode |
| 50 | */ |
| 51 | Q_PROPERTY(uint mode READ mode NOTIFY modeChanged) |
| 52 | |
| 53 | /*! |
| 54 | * \property NetworkManager::IpTunnelDevice::outputKey |
| 55 | */ |
| 56 | Q_PROPERTY(QString outputKey READ outputKey NOTIFY outputKeyChanged) |
| 57 | |
| 58 | /*! |
| 59 | * \property NetworkManager::IpTunnelDevice::parent |
| 60 | */ |
| 61 | Q_PROPERTY(NetworkManager::Device::Ptr parent READ parent NOTIFY parentChanged) |
| 62 | |
| 63 | /*! |
| 64 | * \property NetworkManager::IpTunnelDevice::pathMtuDiscovery |
| 65 | */ |
| 66 | Q_PROPERTY(bool pathMtuDiscovery READ pathMtuDiscovery NOTIFY pathMtuDiscoveryChanged) |
| 67 | |
| 68 | /*! |
| 69 | * \property NetworkManager::IpTunnelDevice::remote |
| 70 | */ |
| 71 | Q_PROPERTY(QString remote READ remote NOTIFY remoteChanged) |
| 72 | |
| 73 | /*! |
| 74 | * \property NetworkManager::IpTunnelDevice::tos |
| 75 | */ |
| 76 | Q_PROPERTY(uchar tos READ tos NOTIFY tosChanged) |
| 77 | |
| 78 | /*! |
| 79 | * \property NetworkManager::IpTunnelDevice::ttl |
| 80 | */ |
| 81 | Q_PROPERTY(uchar ttl READ ttl NOTIFY ttlChanged) |
| 82 | |
| 83 | public: |
| 84 | /*! |
| 85 | * \typedef NetworkManager::IpTunnelDevice::Ptr |
| 86 | */ |
| 87 | typedef QSharedPointer<IpTunnelDevice> Ptr; |
| 88 | /*! |
| 89 | * \typedef NetworkManager::IpTunnelDevice::List |
| 90 | */ |
| 91 | typedef QList<Ptr> List; |
| 92 | /*! |
| 93 | */ |
| 94 | explicit IpTunnelDevice(const QString &path, QObject *parent = nullptr); |
| 95 | ~IpTunnelDevice() override; |
| 96 | |
| 97 | Type type() const override; |
| 98 | |
| 99 | /*! |
| 100 | * How many additional levels of encapsulation are permitted to be prepended to packets. |
| 101 | * This property applies only to IPv6 tunnels. |
| 102 | */ |
| 103 | uchar encapsulationLimit() const; |
| 104 | /*! |
| 105 | * The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels. |
| 106 | */ |
| 107 | uint flowLabel() const; |
| 108 | /*! |
| 109 | * The key used for incoming packets. |
| 110 | */ |
| 111 | QString inputKey() const; |
| 112 | /*! |
| 113 | * The local endpoint of the tunnel. |
| 114 | */ |
| 115 | QString local() const; |
| 116 | /*! |
| 117 | * The tunneling mode. |
| 118 | */ |
| 119 | uint mode() const; |
| 120 | /*! |
| 121 | * The key used for outgoing packets. |
| 122 | */ |
| 123 | QString outputKey() const; |
| 124 | /*! |
| 125 | * The object path of the parent device. |
| 126 | */ |
| 127 | NetworkManager::Device::Ptr parent() const; |
| 128 | /*! |
| 129 | * Whether path MTU discovery is enabled on this tunnel. |
| 130 | */ |
| 131 | bool pathMtuDiscovery() const; |
| 132 | /*! |
| 133 | * The remote endpoint of the tunnel. |
| 134 | */ |
| 135 | QString remote() const; |
| 136 | /*! |
| 137 | * The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets. |
| 138 | */ |
| 139 | uchar tos() const; |
| 140 | /*! |
| 141 | * The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value |
| 142 | */ |
| 143 | uchar ttl() const; |
| 144 | |
| 145 | Q_SIGNALS: |
| 146 | /*! |
| 147 | * Emitted when the encapsulation limit has changed |
| 148 | */ |
| 149 | void encapsulationLimitChanged(uchar limit); |
| 150 | /*! |
| 151 | * Emitted when the flow label has changed |
| 152 | */ |
| 153 | void flowLabelChanged(uint flowLabel); |
| 154 | /*! |
| 155 | * Emitted when the key used for incoming packets has changed |
| 156 | */ |
| 157 | void inputKeyChanged(const QString &inputKey); |
| 158 | /*! |
| 159 | * Emitted when the local endpoint of the tunnel has changed |
| 160 | */ |
| 161 | void localChanged(const QString &local); |
| 162 | /*! |
| 163 | * Emitted when the tunneling mode has changed |
| 164 | */ |
| 165 | void modeChanged(uint mode); |
| 166 | /*! |
| 167 | * Emitted when the key used for outgoing packets has changed |
| 168 | */ |
| 169 | void outputKeyChanged(const QString &outputKey); |
| 170 | /*! |
| 171 | * Emitted when the parent of this device has changed |
| 172 | */ |
| 173 | void parentChanged(const QString &parent); |
| 174 | /*! |
| 175 | * Emitted when the path MTU discovery enablemened has changed |
| 176 | */ |
| 177 | void pathMtuDiscoveryChanged(bool pathMtuDiscovery); |
| 178 | /*! |
| 179 | * Emitted when the remote endpoint of the tunnel has changed |
| 180 | */ |
| 181 | void remoteChanged(const QString &remote); |
| 182 | /*! |
| 183 | * Emitted when the type of service or traffic class assigned to tunneled packets has changed |
| 184 | */ |
| 185 | void tosChanged(uchar tos); |
| 186 | /*! |
| 187 | * Emitted when the TTL assigned to tunneled packets has changed |
| 188 | */ |
| 189 | void ttlChanged(uchar ttl); |
| 190 | |
| 191 | private: |
| 192 | Q_DECLARE_PRIVATE(IpTunnelDevice) |
| 193 | }; |
| 194 | |
| 195 | } |
| 196 | |
| 197 | #endif |
| 198 | |