NetworkManagerQt

iproute.cpp
1 /*
2  SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <[email protected]>
3  SPDX-FileCopyrightText: 2013 Daniel Nicoletti <[email protected]>
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 
10 namespace NetworkManager
11 {
12 class NetworkManager::IpRoute::Private
13 {
14 public:
15  Private()
16  : metric(0)
17  {
18  }
20  quint32 metric;
21 };
22 
23 }
24 
26  : d(new Private)
27 {
28 }
29 
31 {
32  delete d;
33 }
34 
36  : QNetworkAddressEntry(other)
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 allows querying the underlying system to discover the available network interfaces and rea...
Definition: accesspoint.h:20
void setMetric(quint32 metric)
Defines the metric of the given route, lower values have higher priority.
Definition: iproute.cpp:52
QNetworkAddressEntry & operator=(const QNetworkAddressEntry &other)
void setNextHop(const QHostAddress &nextHop) const
Defines the next hop of the given route.
Definition: iproute.cpp:42
quint32 metric() const
Returns the route metric number of the given route.
Definition: iproute.cpp:57
QHostAddress nextHop() const
Returns the next hop of the given route.
Definition: iproute.cpp:47
bool isValid() const
Returns true if the route IP is defined.
Definition: iproute.cpp:74
~IpRoute()
Destroys this IpRoute object.
Definition: iproute.cpp:30
IpRoute()
Constructs an empty IpRoute object.
Definition: iproute.cpp:25
This class represents IP route.
Definition: iproute.h:21
IpRoute & operator=(const IpRoute &other)
Makes a copy of the IpRoute object other.
Definition: iproute.cpp:62
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:06:33 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.