NetworkManagerQt

iproute.cpp
1/*
2 SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
3 SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#include "ipconfig.h"
9
10namespace NetworkManager
11{
12class NetworkManager::IpRoute::Private
13{
14public:
15 Private()
16 : metric(0)
17 {
18 }
19 QHostAddress nextHop;
20 quint32 metric;
21};
22
23}
24
26 : d(new Private)
27{
28}
29
31{
32 delete d;
33}
34
37 , d(new Private)
38{
39 *this = other;
40}
41
43{
44 d->nextHop = nextHop;
45}
46
48{
49 return d->nextHop;
50}
51
53{
54 d->metric = metric;
55}
56
58{
59 return d->metric;
60}
61
63{
64 if (this == &other) {
65 return *this;
66 }
67
69 *d = *other.d;
70
71 return *this;
72}
73
75{
76 return !ip().isNull();
77}
This class represents IP route.
Definition iproute.h:22
~IpRoute()
Destroys this IpRoute object.
Definition iproute.cpp:30
IpRoute & operator=(const IpRoute &other)
Makes a copy of the IpRoute object other.
Definition iproute.cpp:62
IpRoute()
Constructs an empty IpRoute object.
Definition iproute.cpp:25
void setMetric(quint32 metric)
Defines the metric of the given route, lower values have higher priority.
Definition iproute.cpp:52
quint32 metric() const
Returns the route metric number of the given route.
Definition iproute.cpp:57
bool isValid() const
Returns true if the route IP is defined.
Definition iproute.cpp:74
void setNextHop(const QHostAddress &nextHop) const
Defines the next hop of the given route.
Definition iproute.cpp:42
QHostAddress nextHop() const
Returns the next hop of the given route.
Definition iproute.cpp:47
This class allows querying the underlying system to discover the available network interfaces and rea...
Definition accesspoint.h:21
QNetworkAddressEntry & operator=(const QNetworkAddressEntry &other)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.