#include </home/clem/local/src/opie/noncore/settings/networksettings/interfaces/interfaces.h>
Collaboration diagram for Interfaces:

Public Member Functions | |
| Interfaces (QString useInterfacesFile="/etc/network/interfaces") | |
| QStringList | getInterfaceList () |
| bool | isAuto (const QString &interface) const |
| bool | setAuto (const QString &interface, bool setAuto) |
| bool | removeInterface () |
| bool | addInterface (const QString &interface, const QString &family, const QString &method) |
| bool | copyInterface (const QString &oldInterface, const QString &newInterface) |
| bool | setInterface (QString interface) |
| bool | isInterfaceSet () const |
| QString | getInterfaceName (bool &error) |
| bool | setInterfaceName (const QString &newName) |
| QString | getInterfaceFamily (bool &error) |
| bool | setInterfaceFamily (const QString &newName) |
| QString | getInterfaceMethod (bool &error) |
| bool | setInterfaceMethod (const QString &newName) |
| QString | getInterfaceOption (const QString &option, bool &error) |
| bool | setInterfaceOption (const QString &option, const QString &value) |
| bool | removeInterfaceOption (const QString &option) |
| bool | removeInterfaceOption (const QString &option, const QString &value) |
| bool | removeAllInterfaceOptions () |
| bool | setMapping (const QString &interface) |
| bool | removeMapping () |
| void | addMapping (const QString &options) |
| bool | setMap (const QString &map, const QString &value) |
| bool | removeMap (const QString &map, const QString &value) |
| QString | getMap (const QString &map, bool &error) |
| bool | setScript (const QString &argument) |
| QString | getScript (bool &error) |
| bool | write () |
Private Member Functions | |
| bool | setStanza (const QString &stanza, const QString &option, QStringList::Iterator &iterator) |
| bool | removeStanza (QStringList::Iterator &stanza) |
| bool | setOption (const QStringList::Iterator &start, const QString &option, const QString &value) |
| bool | removeAllOptions (const QStringList::Iterator &start) |
| bool | removeOption (const QStringList::Iterator &start, const QString &option) |
| bool | removeOption (const QStringList::Iterator &start, const QString &option, const QString &value) |
| QString | getOption (const QStringList::Iterator &start, const QString &option, bool &error) |
Private Attributes | |
| QString | interfacesFile |
| QStringList | interfaces |
| QStringList::Iterator | currentIface |
| QStringList::Iterator | currentMapping |
| QStringList | acceptedFamily |
Definition at line 22 of file interfaces.h.
|
|
Constructor. Reads in the interfaces file and then split the file up by the
Definition at line 21 of file interfaces.cpp. References acceptedFamily, QValueList< T >::append(), currentIface, currentMapping, QValueList< T >::end(), QTextStream::eof(), interfaces, INTERFACES_FAMILY_INET, INTERFACES_FAMILY_INET6, INTERFACES_FAMILY_IPX, interfacesFile, IO_ReadOnly, odebug, oendl, QFile::open(), QTextStream::readLine(), QStringList::split(), and stream. |
|
||||||||||||||||
|
Add a new interface of with the settings - family and method
Definition at line 156 of file interfaces.cpp. References acceptedFamily, QValueList< T >::append(), QValueList< T >::contains(), IFACE, interfaces, QString::latin1(), odebug, oendl, QString::replace(), and QString::simplifyWhiteSpace(). Referenced by copyInterface(), and InterfaceSetupImp::setProfile(). |
|
|
Adds a new Mapping to the interfaces file with interfaces.
Definition at line 400 of file interfaces.cpp. References QValueList< T >::append(), interfaces, and MAPPING. Referenced by InterfaceSetupImp::setProfile(). |
|
||||||||||||
|
Copies interface with name interface to name newInterface
Definition at line 172 of file interfaces.cpp. References addInterface(), AUTO, currentIface, QValueList< T >::end(), error(), getInterfaceFamily(), getInterfaceMethod(), IFACE, QValueList< T >::insert(), interfaces, QString::latin1(), MAPPING, odebug, oendl, and setInterface(). Referenced by InterfaceSetupImp::setProfile(). |
|
|
Gets the family name of the interface that is currently selected.
Definition at line 235 of file interfaces.cpp. References QString::find(), getInterfaceName(), IFACE, QString::length(), QString::mid(), name, and QString::simplifyWhiteSpace(). Referenced by copyInterface(), getInterfaceMethod(), setInterfaceMethod(), and setInterfaceName(). |
|
|
Get a list of all interfaces in the interface file. Useful for hardware that is not currently connected such as an 802.11b card not plugged in, but configured for when it is plugged in.
Definition at line 54 of file interfaces.cpp. References QValueList< T >::append(), QString::at(), QValueList< T >::begin(), QString::contains(), QValueList< T >::end(), QString::find(), IFACE, interfaces, QString::length(), list, QString::mid(), and QString::simplifyWhiteSpace(). Referenced by MainWindowImp::MainWindowImp(). |
|
|
Gets the method of the interface that is currently selected.
Definition at line 258 of file interfaces.cpp. References getInterfaceFamily(), getInterfaceName(), IFACE, QString::length(), QString::mid(), name, and QString::simplifyWhiteSpace(). Referenced by copyInterface(), InterfaceSetupImp::saveSettings(), setInterfaceFamily(), setInterfaceName(), and InterfaceSetupImp::setProfile(). |
|
|
Gets the hardware name of the interface that is currently selected.
Definition at line 213 of file interfaces.cpp. References currentIface, QValueList< T >::end(), QString::find(), IFACE, interfaces, QString::length(), QString::mid(), and QString::simplifyWhiteSpace(). Referenced by getInterfaceFamily(), getInterfaceMethod(), InterfaceSetupImp::saveChanges(), setInterfaceFamily(), setInterfaceMethod(), InterfaceSetupImp::setProfile(), and WLANImp::writeOpts(). |
|
||||||||||||
|
Get a value for an option in the currently selected interface. For example calling getInterfaceOption("address") on the following stanza would return 192.168.1.1. iface eth0 static address 192.168.1.1
Definition at line 332 of file interfaces.cpp. References currentIface, and getOption(). Referenced by WLANImp::parseOpts(), InterfaceSetupImp::setProfile(), and WLANImp::writeOpts(). |
|
||||||||||||
|
Get a map value within a mapping.
Definition at line 439 of file interfaces.cpp. References currentMapping, and getOption(). |
|
||||||||||||||||
|
Gets a value of an option in a stanza
Definition at line 654 of file interfaces.cpp. References AUTO, QValueList< T >::end(), QString::find(), IFACE, interfaces, QString::length(), MAPPING, QString::mid(), odebug, and oendl. Referenced by getInterfaceOption(), getMap(), and getScript(). |
|
|
Definition at line 456 of file interfaces.cpp. References currentMapping, and getOption(). |
|
|
Find out if interface is in an "auto" group or not. Report any duplicates such as eth0 being in two differnt auto's
Definition at line 77 of file interfaces.cpp. References AUTO, QValueList< T >::count(), QStringList::grep(), interfaces, odebug, and oendl. Referenced by setAuto(), and InterfaceSetupImp::setProfile(). |
|
|
A quick helper funtion to see if the current interface is set.
Definition at line 143 of file interfaces.cpp. References currentIface, QValueList< T >::end(), and interfaces. Referenced by WLANImp::parseOpts(), InterfaceSetupImp::saveSettings(), and WLANImp::writeOpts(). |
|
|
Removes all of the options from the currently selected interface.
Definition at line 379 of file interfaces.cpp. References currentIface, and removeAllOptions(). |
|
|
Removes all options in a stanza
Definition at line 629 of file interfaces.cpp. References AUTO, QValueList< T >::end(), IFACE, QValueList< T >::insert(), interfaces, MAPPING, and QValueList< T >::remove(). Referenced by removeAllInterfaceOptions(), and removeStanza(). |
|
|
Remove the currently selected interface and all of its options.
Definition at line 204 of file interfaces.cpp. References currentIface, and removeStanza(). Referenced by MainWindowImp::removeProfile(). |
|
||||||||||||
|
Removes a value for an option in the currently selected interface.
Definition at line 371 of file interfaces.cpp. References currentIface, and removeOption(). |
|
|
Removes a value for an option in the currently selected interface.
Definition at line 360 of file interfaces.cpp. References currentIface, and removeOption(). Referenced by InterfaceSetupImp::saveSettings(), setInterfaceOption(), and WLANImp::writeOpts(). |
|
||||||||||||
|
Removes a map option within a mapping.
Definition at line 429 of file interfaces.cpp. References currentMapping, and removeOption(). Referenced by MainWindowImp::removeProfile(). |
|
|
Remove the currently selected map and all of its options.
Definition at line 409 of file interfaces.cpp. References currentMapping, and removeStanza(). Referenced by MainWindowImp::removeProfile(). |
|
||||||||||||||||
|
Removes a option in a stanza
Definition at line 602 of file interfaces.cpp. References AUTO, QValueList< T >::end(), IFACE, interfaces, MAPPING, odebug, oendl, and QValueList< T >::remove(). |
|
||||||||||||
|
Removes a option in a stanza
Definition at line 574 of file interfaces.cpp. References AUTO, QValueList< T >::end(), IFACE, interfaces, MAPPING, odebug, oendl, and QValueList< T >::remove(). Referenced by removeInterfaceOption(), and removeMap(). |
|
|
Removes a stanza and all of its options
Definition at line 561 of file interfaces.cpp. References QValueList< T >::end(), interfaces, and removeAllOptions(). Referenced by removeInterface(), and removeMapping(). |
|
||||||||||||
|
Attempt to set the auto option for interface to setAuto.
Definition at line 91 of file interfaces.cpp. References QValueList< T >::append(), AUTO, QValueList< T >::begin(), QValueList< T >::end(), interfaces, and isAuto(). Referenced by InterfaceSetupImp::saveSettings(). |
|
|
Set the current interface to interface. This needs to be done before you can call getFamily(), getMethod, and get/setOption().
Definition at line 133 of file interfaces.cpp. References currentIface, IFACE, and setStanza(). Referenced by copyInterface(), MainWindowImp::removeProfile(), and InterfaceSetupImp::setProfile(). |
|
|
Sets the interface family to newName.
Definition at line 299 of file interfaces.cpp. References acceptedFamily, QValueList< T >::contains(), currentIface, QValueList< T >::end(), getInterfaceMethod(), getInterfaceName(), and interfaces. |
|
|
Sets the interface method to newName
Definition at line 314 of file interfaces.cpp. References currentIface, QValueList< T >::end(), getInterfaceFamily(), getInterfaceName(), and interfaces. Referenced by InterfaceSetupImp::saveSettings(). |
|
|
Sets the interface name to newName.
Definition at line 279 of file interfaces.cpp. References currentIface, QValueList< T >::end(), getInterfaceFamily(), getInterfaceMethod(), interfaces, QString::latin1(), name, odebug, oendl, QString::replace(), and QString::simplifyWhiteSpace(). |
|
||||||||||||
|
Set a value for an option in the currently selected interface. If option doesn't exist then it is added along with the value. If value isEmpty() then we will remove the option
Definition at line 346 of file interfaces.cpp. References currentIface, QString::latin1(), odebug, oendl, removeInterfaceOption(), setOption(), and QString::stripWhiteSpace(). Referenced by InterfaceSetupImp::saveSettings(), and WLANImp::writeOpts(). |
|
||||||||||||
|
Set a map option within a mapping.
Definition at line 419 of file interfaces.cpp. References currentMapping, and setOption(). Referenced by InterfaceSetupImp::setProfile(). |
|
|
Set the current map to interface's map. This needs to be done before you can call addMapping(), set/getMap(), and get/setScript().
Definition at line 390 of file interfaces.cpp. References currentMapping, MAPPING, QString::replace(), setStanza(), and QString::simplifyWhiteSpace(). Referenced by MainWindowImp::removeProfile(), and InterfaceSetupImp::setProfile(). |
|
||||||||||||||||
|
Sets a value of an option in a stanza
Definition at line 507 of file interfaces.cpp. References AUTO, QValueList< T >::end(), IFACE, QValueList< T >::insert(), interfaces, MAPPING, NULL, odebug, oendl, and p. Referenced by setInterfaceOption(), setMap(), and setScript(). |
|
|
Sets a script value of the current mapping to argument.
Definition at line 448 of file interfaces.cpp. References currentMapping, and setOption(). Referenced by InterfaceSetupImp::setProfile(). |
|
||||||||||||||||
|
Helper function used to parse through the QStringList and put pointers in the correct place.
Definition at line 470 of file interfaces.cpp. References QString::at(), QValueList< T >::begin(), QString::contains(), QValueList< T >::end(), QString::find(), interfaces, QString::length(), odebug, and oendl. Referenced by setInterface(), and setMapping(). |
|
|
Write out the interfaces file to the file passed into the constructor. Removes any excess blank lines over 1 line long.
Definition at line 687 of file interfaces.cpp. References QValueList< T >::begin(), QValueList< T >::end(), interfaces, interfacesFile, IO_ReadWrite, QString::length(), odebug, oendl, QFile::open(), QFile::remove(), QString::replace(), and stream. Referenced by MainWindowImp::removeProfile(), and InterfaceSetupImp::saveChanges(). |
|
|
Definition at line 73 of file interfaces.h. Referenced by addInterface(), Interfaces(), and setInterfaceFamily(). |
|
|
Definition at line 70 of file interfaces.h. Referenced by copyInterface(), getInterfaceName(), getInterfaceOption(), Interfaces(), isInterfaceSet(), removeAllInterfaceOptions(), removeInterface(), removeInterfaceOption(), setInterface(), setInterfaceFamily(), setInterfaceMethod(), setInterfaceName(), and setInterfaceOption(). |
|
|
Definition at line 71 of file interfaces.h. Referenced by getMap(), getScript(), Interfaces(), removeMap(), removeMapping(), setMap(), setMapping(), and setScript(). |
|
|
Definition at line 69 of file interfaces.h. Referenced by addInterface(), addMapping(), copyInterface(), getInterfaceList(), getInterfaceName(), getOption(), Interfaces(), isAuto(), isInterfaceSet(), removeAllOptions(), removeOption(), removeStanza(), setAuto(), setInterfaceFamily(), setInterfaceMethod(), setInterfaceName(), setOption(), setStanza(), and write(). |
|
|
Definition at line 68 of file interfaces.h. Referenced by Interfaces(), and write(). |
1.4.2