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
13namespace NetworkManager
14{
15class IpTunnelDevicePrivate;
16
17/**
18 * A Ip Tunnel device interface
19 */
20class NETWORKMANAGERQT_EXPORT IpTunnelDevice : public Device
21{
22 Q_OBJECT
23 Q_PROPERTY(uchar encapsulationLimit READ encapsulationLimit NOTIFY encapsulationLimitChanged)
24 Q_PROPERTY(uint flowLabel READ flowLabel NOTIFY flowLabelChanged)
25 Q_PROPERTY(QString inputKey READ inputKey NOTIFY inputKeyChanged)
26 Q_PROPERTY(QString local READ local NOTIFY localChanged)
27 Q_PROPERTY(uint mode READ mode NOTIFY modeChanged)
28 Q_PROPERTY(QString outputKey READ outputKey NOTIFY outputKeyChanged)
29 Q_PROPERTY(NetworkManager::Device::Ptr parent READ parent NOTIFY parentChanged)
30 Q_PROPERTY(bool pathMtuDiscovery READ pathMtuDiscovery NOTIFY pathMtuDiscoveryChanged)
31 Q_PROPERTY(QString remote READ remote NOTIFY remoteChanged)
32 Q_PROPERTY(uchar tos READ tos NOTIFY tosChanged)
33 Q_PROPERTY(uchar ttl READ ttl NOTIFY ttlChanged)
34
35public:
36 typedef QSharedPointer<IpTunnelDevice> Ptr;
37 typedef QList<Ptr> List;
38 explicit IpTunnelDevice(const QString &path, QObject *parent = nullptr);
39 ~IpTunnelDevice() override;
40
41 Type type() const override;
42
43 /**
44 * How many additional levels of encapsulation are permitted to be prepended to packets.
45 * This property applies only to IPv6 tunnels.
46 */
47 uchar encapsulationLimit() const;
48 /**
49 * The flow label to assign to tunnel packets. This property applies only to IPv6 tunnels.
50 */
51 uint flowLabel() const;
52 /**
53 * The key used for incoming packets.
54 */
55 QString inputKey() const;
56 /**
57 * The local endpoint of the tunnel.
58 */
59 QString local() const;
60 /**
61 * The tunneling mode.
62 */
63 uint mode() const;
64 /**
65 * The key used for outgoing packets.
66 */
67 QString outputKey() const;
68 /**
69 * The object path of the parent device.
70 */
71 NetworkManager::Device::Ptr parent() const;
72 /**
73 * Whether path MTU discovery is enabled on this tunnel.
74 */
75 bool pathMtuDiscovery() const;
76 /**
77 * The remote endpoint of the tunnel.
78 */
79 QString remote() const;
80 /**
81 * The type of service (IPv4) or traffic class (IPv6) assigned to tunneled packets.
82 */
83 uchar tos() const;
84 /**
85 * The TTL assigned to tunneled packets. 0 is a special value meaning that packets inherit the TTL value
86 */
87 uchar ttl() const;
88
89Q_SIGNALS:
90 /**
91 * Emitted when the encapsulation limit has changed
92 */
93 void encapsulationLimitChanged(uchar limit);
94 /**
95 * Emitted when the flow label has changed
96 */
97 void flowLabelChanged(uint flowLabel);
98 /**
99 * Emitted when the key used for incoming packets has changed
100 */
101 void inputKeyChanged(const QString &inputKey);
102 /**
103 * Emitted when the local endpoint of the tunnel has changed
104 */
105 void localChanged(const QString &local);
106 /**
107 * Emitted when the tunneling mode has changed
108 */
109 void modeChanged(uint mode);
110 /**
111 * Emitted when the key used for outgoing packets has changed
112 */
113 void outputKeyChanged(const QString &outputKey);
114 /**
115 * Emitted when the parent of this device has changed
116 */
117 void parentChanged(const QString &parent);
118 /**
119 * Emitted when the path MTU discovery enablemened has changed
120 */
121 void pathMtuDiscoveryChanged(bool pathMtuDiscovery);
122 /**
123 * Emitted when the remote endpoint of the tunnel has changed
124 */
125 void remoteChanged(const QString &remote);
126 /**
127 * Emitted when the type of service or traffic class assigned to tunneled packets has changed
128 */
129 void tosChanged(uchar tos);
130 /**
131 * Emitted when the TTL assigned to tunneled packets has changed
132 */
133 void ttlChanged(uchar ttl);
134
135private:
136 Q_DECLARE_PRIVATE(IpTunnelDevice)
137};
138
139}
140
141#endif
142

source code of networkmanager-qt/src/iptunneldevice.h