libsolidcontrol
networkipv4config.h
Go to the documentation of this file.00001 /* 00002 * Copyright 2008 Will Stephenson <wstephenson@kde.org> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License or (at your option) version 3 or any later version 00008 accepted by the membership of KDE e.V. (or its successor approved 00009 by the membership of KDE e.V.), which shall act as a proxy 00010 defined in Section 14 of version 3 of the license. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 00020 */ 00021 00022 #ifndef SOLID_CONTROL_NETWORKIPV4CONFIG_H 00023 #define SOLID_CONTROL_NETWORKIPV4CONFIG_H 00024 00025 #include <QtCore/QStringList> 00026 00027 #include "solid_control_export.h" 00028 00029 namespace Solid 00030 { 00031 namespace Control 00032 { 00033 00034 class SOLIDCONTROL_EXPORT IPv4Address 00035 { 00036 public: 00037 IPv4Address(quint32 address, quint32 netMask, quint32 gateway); 00038 IPv4Address(); 00039 ~IPv4Address(); 00040 IPv4Address(const IPv4Address&); 00041 quint32 address() const; 00042 quint32 netMask() const; 00043 quint32 gateway() const; 00044 IPv4Address &operator=(const IPv4Address&); 00045 bool isValid() const; 00046 private: 00047 class Private; 00048 Private * d; 00049 }; 00050 00051 class SOLIDCONTROL_EXPORT IPv4Route 00052 { 00053 public: 00054 IPv4Route(quint32 route, quint32 prefix, quint32 nextHop, quint32 metric); 00055 IPv4Route(); 00056 ~IPv4Route(); 00057 IPv4Route(const IPv4Route&); 00058 IPv4Route &operator=(const IPv4Route&); 00059 bool isValid() const; 00060 quint32 route() const; 00061 quint32 prefix() const; 00062 quint32 nextHop() const; 00063 quint32 metric() const; 00064 private: 00065 class Private; 00066 Private * d; 00067 }; 00068 00069 class SOLIDCONTROL_EXPORT IPv4Config 00070 { 00071 public: 00072 IPv4Config(const QList<IPv4Address> &addresses, 00073 const QList<quint32> &nameservers, 00074 const QStringList &domains, 00075 const QList<IPv4Route> &routes); 00076 IPv4Config(); 00077 ~IPv4Config(); 00078 IPv4Config(const IPv4Config&); 00082 QList<IPv4Address> addresses() const; 00083 QList<quint32> nameservers() const; 00084 QStringList domains() const; 00085 QList<IPv4Route> routes() const; 00086 IPv4Config &operator=(const IPv4Config&); 00087 bool isValid() const; 00088 private: 00089 class Private; 00090 Private * d; 00091 }; 00092 00093 } // namespace Control 00094 } // namespace Solid 00095 00096 #endif // NETWORKIPV4CONFIG_H