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 | #ifndef NETWORKMANAGERQT_IPROUTE_H |
9 | #define NETWORKMANAGERQT_IPROUTE_H |
10 | |
11 | #include "ipaddress.h" |
12 | #include <networkmanagerqt/networkmanagerqt_export.h> |
13 | |
14 | #include <QNetworkAddressEntry> |
15 | |
16 | namespace NetworkManager |
17 | { |
18 | /** |
19 | * This class represents IP route |
20 | */ |
21 | class NETWORKMANAGERQT_EXPORT IpRoute : public QNetworkAddressEntry |
22 | { |
23 | public: |
24 | /** |
25 | * Constructs an empty IpRoute object. |
26 | */ |
27 | IpRoute(); |
28 | |
29 | /** |
30 | * Constructs an IpRoute object that is a copy of the object @p other. |
31 | */ |
32 | IpRoute(const IpRoute &other); |
33 | |
34 | /** |
35 | * Destroys this IpRoute object. |
36 | */ |
37 | ~IpRoute(); |
38 | |
39 | /** |
40 | * Returns true if the route IP is defined. |
41 | */ |
42 | bool isValid() const; |
43 | |
44 | /** |
45 | * Defines the next hop of the given route. |
46 | */ |
47 | void setNextHop(const QHostAddress &nextHop) const; |
48 | |
49 | /** |
50 | * Returns the next hop of the given route. |
51 | */ |
52 | QHostAddress nextHop() const; |
53 | |
54 | /** |
55 | * Defines the @p metric of the given route, |
56 | * lower values have higher priority. |
57 | */ |
58 | void setMetric(quint32 metric); |
59 | |
60 | /** |
61 | * Returns the route metric number of the given route. |
62 | */ |
63 | quint32 metric() const; |
64 | |
65 | /** |
66 | * Makes a copy of the IpRoute object @p other. |
67 | */ |
68 | IpRoute &operator=(const IpRoute &other); |
69 | |
70 | private: |
71 | class Private; |
72 | Private *const d; |
73 | }; |
74 | typedef QList<IpRoute> IpRoutes; |
75 | |
76 | } // namespace NetworkManager |
77 | |
78 | #endif // NETWORKMANAGERQT_IPROUTE_H |
79 | |