File indexing completed on 2024-10-13 12:19:55

0001 /*
0002     SPDX-FileCopyrightText: 2008, 2011 Will Stephenson <wstephenson@kde.org>
0003     SPDX-FileCopyrightText: 2013 Daniel Nicoletti <dantti12@gmail.com>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #ifndef NETWORKMANAGERQT_IPROUTE_H
0009 #define NETWORKMANAGERQT_IPROUTE_H
0010 
0011 #include "ipaddress.h"
0012 #include <networkmanagerqt/networkmanagerqt_export.h>
0013 
0014 #include <QNetworkAddressEntry>
0015 
0016 namespace NetworkManager
0017 {
0018 /**
0019  * This class represents IP route
0020  */
0021 class NETWORKMANAGERQT_EXPORT IpRoute : public QNetworkAddressEntry
0022 {
0023 public:
0024     /**
0025      * Constructs an empty IpRoute object.
0026      */
0027     IpRoute();
0028 
0029     /**
0030      * Constructs an IpRoute object that is a copy of the object @p other.
0031      */
0032     IpRoute(const IpRoute &other);
0033 
0034     /**
0035      * Destroys this IpRoute object.
0036      */
0037     ~IpRoute();
0038 
0039     /**
0040      * Returns true if the route IP is defined.
0041      */
0042     bool isValid() const;
0043 
0044     /**
0045      * Defines the next hop of the given route.
0046      */
0047     void setNextHop(const QHostAddress &nextHop) const;
0048 
0049     /**
0050      * Returns the next hop of the given route.
0051      */
0052     QHostAddress nextHop() const;
0053 
0054     /**
0055      * Defines the @p metric of the given route,
0056      * lower values have higher priority.
0057      */
0058     void setMetric(quint32 metric);
0059 
0060     /**
0061      * Returns the route metric number of the given route.
0062      */
0063     quint32 metric() const;
0064 
0065     /**
0066      * Makes a copy of the IpRoute object @p other.
0067      */
0068     IpRoute &operator=(const IpRoute &other);
0069 
0070 private:
0071     class Private;
0072     Private *const d;
0073 };
0074 typedef QList<IpRoute> IpRoutes;
0075 
0076 } // namespace NetworkManager
0077 
0078 #endif // NETWORKMANAGERQT_IPROUTE_H