NetworkManagerQt

wireguarddevice.h
1/*
2 SPDX-FileCopyrightText: 2019 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_WIREGUARD_DEVICE_H
8#define NETWORKMANAGERQT_WIREGUARD_DEVICE_H
9
10#include "device.h"
11#include <networkmanagerqt/networkmanagerqt_export.h>
12
13namespace NetworkManager
14{
15class WireGuardDevicePrivate;
16
17/**
18 * A WireGuard device interface
19 */
20class NETWORKMANAGERQT_EXPORT WireGuardDevice : public Device
21{
22 Q_OBJECT
23 Q_PROPERTY(QByteArray publicKey READ publicKey NOTIFY publicKeyChanged)
24 Q_PROPERTY(uint listenPort READ listenPort NOTIFY listenPortChanged)
25 Q_PROPERTY(uint fwMark READ fwMark NOTIFY fwMarkChanged)
26
27public:
29 typedef QList<Ptr> List;
30 explicit WireGuardDevice(const QString &path, QObject *parent = nullptr);
31 ~WireGuardDevice() override;
32
33 Type type() const override;
34
35 /**
36 * 32-byte public WireGuard key.
37 */
38 QByteArray publicKey() const;
39 /**
40 * Local UDP listening port.
41 */
42 uint listenPort() const;
43 /**
44 * Optional 32-bit mark used to set routing policy for outgoing encrypted packets. See: ip-rule(8)
45 */
46 uint fwMark() const;
47
48Q_SIGNALS:
49 /**
50 * Emitted when the public key of this device has changed
51 */
52 void publicKeyChanged(const QByteArray &publicKey);
53 /**
54 * Emitted when the listen port of this device has changed
55 */
56 void listenPortChanged(uint listenPort);
57 /**
58 * Emitted when the fwmark of this device have changed
59 */
60 void fwMarkChanged(uint fwMark);
61
62private:
63 Q_DECLARE_PRIVATE(WireGuardDevice)
64};
65
66}
67
68#endif
This class represents a common device interface.
Definition device.h:34
Type
Device type.
Definition device.h:191
A WireGuard device interface.
void fwMarkChanged(uint fwMark)
Emitted when the fwmark of this device have changed.
void publicKeyChanged(const QByteArray &publicKey)
Emitted when the public key of this device has changed.
void listenPortChanged(uint listenPort)
Emitted when the listen port of this device has changed.
This class allows querying the underlying system to discover the available network interfaces and rea...
Definition accesspoint.h:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.