summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces.h
authorbenmeyer <benmeyer>2002-10-25 19:34:32 (UTC)
committer benmeyer <benmeyer>2002-10-25 19:34:32 (UTC)
commitf16dd7fc272f3f8354dc696fcc881dfe74755a21 (patch) (side-by-side diff)
treeedaab125b322744d8684e6aee4d2c5955b68689b /noncore/settings/networksettings/interfaces.h
parent77347ba522a5913ff17561e6fd2c15981d42e86b (diff)
downloadopie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.zip
opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.gz
opie-f16dd7fc272f3f8354dc696fcc881dfe74755a21.tar.bz2
Moved Interfaces into a library
Diffstat (limited to 'noncore/settings/networksettings/interfaces.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces.h76
1 files changed, 0 insertions, 76 deletions
diff --git a/noncore/settings/networksettings/interfaces.h b/noncore/settings/networksettings/interfaces.h
deleted file mode 100644
index e09ea71..0000000
--- a/noncore/settings/networksettings/interfaces.h
+++ b/dev/null
@@ -1,76 +0,0 @@
-#ifndef INTERFACES_H
-#define INTERFACES_H
-
-#include <qstring.h>
-#include <qstringlist.h>
-
-#define INTERFACES_LOOPBACK "loopback"
-
-#define INTERFACES_FAMILY_INET "inet"
-#define INTERFACES_FAMILY_IPX "ipx"
-#define INTERFACES_FAMILY_INET6 "inet6"
-
-#define INTERFACES_METHOD_DHCP "dhcp"
-#define INTERFACES_METHOD_STATIC "static"
-#define INTERFACES_METHOD_PPP "ppp"
-
-/**
- * This class provides a clean frontend for parsing the network interfaces file.
- * It provides helper functions to minipulate the options within the file.
- * See the interfaces man page for the syntax rules.
- */
-class Interfaces {
-
-public:
- Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
- QStringList getInterfaceList();
-
- bool isAuto(QString interface);
- bool setAuto(QString interface, bool setAuto);
-
- bool removeInterface();
- bool addInterface(QString interface, QString family, QString method);
- bool copyInterface(QString oldInterface, QString newInterface);
- bool setInterface(QString interface);
- bool isInterfaceSet();
- QString getInterfaceName(bool &error);
- bool setInterfaceName(QString newName);
- QString getInterfaceFamily(bool &error);
- bool setInterfaceFamily(QString newName);
- QString getInterfaceMethod(bool &error);
- bool setInterfaceMethod(QString newName);
- QString getInterfaceOption(QString option, bool &error);
- bool setInterfaceOption(QString option, QString value);
- bool removeInterfaceOption(QString option, QString value);
- bool removeAllInterfaceOptions();
-
- bool setMapping(QString interface);
- bool removeMapping();
- void addMapping(QString options);
- bool setMap(QString map, QString value);
- bool removeMap(QString map, QString value);
- QString getMap(QString map, bool &error);
- bool setScript(QString);
- QString getScript(bool &error);
-
- bool write();
-
-private:
- bool setStanza(QString stanza, QString option,QStringList::Iterator &iterator);
- bool setOption(QStringList::Iterator start, QString option, QString value);
- bool removeOption(QStringList::Iterator start, QString option, QString value);
- QString getOption(QStringList::Iterator start, QString option, bool &error);
- bool removeAllOptions(QStringList::Iterator start);
-
- QString interfacesFile;
- QStringList interfaces;
- QStringList::Iterator currentIface;
- QStringList::Iterator currentMapping;
-
- QStringList acceptedFamily;
-};
-
-#endif
-
-// interfaces
-