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