networking stack is reconfigured automatically. * The previous default route is now removed before installing a new one. * "gateway" was missing in the driver settings to BMessage conversion template, and thus, it was only set to a default value in case there was no settings file. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19086 a95241bf-73f2-0310-859d-f6bbb57e9c96
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
/*
|
|
* Copyright 2006, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Axel Dörfler, [email protected]
|
|
*/
|
|
#ifndef SETTINGS_H
|
|
#define SETTINGS_H
|
|
|
|
|
|
#include <driver_settings.h>
|
|
#include <Message.h>
|
|
#include <Messenger.h>
|
|
|
|
class BPath;
|
|
|
|
|
|
struct settings_template {
|
|
uint32 type;
|
|
const char* name;
|
|
const settings_template* sub_template;
|
|
};
|
|
|
|
|
|
class Settings {
|
|
public:
|
|
Settings();
|
|
~Settings();
|
|
|
|
status_t GetNextInterface(uint32& cookie, BMessage& interface);
|
|
status_t StartMonitoring(const BMessenger& target);
|
|
status_t StopMonitoring(const BMessenger& target);
|
|
|
|
status_t Update(BMessage* message);
|
|
|
|
private:
|
|
status_t _Load();
|
|
status_t _GetPath(const char* name, BPath& path);
|
|
|
|
const settings_template* _FindSettingsTemplate(const settings_template* settingsTemplate,
|
|
const char* name);
|
|
status_t _ConvertFromDriverParameter(const driver_parameter& parameter,
|
|
const settings_template* settingsTemplate, BMessage& message);
|
|
status_t _ConvertFromDriverSettings(const driver_settings& settings,
|
|
const settings_template* settingsTemplate, BMessage& message);
|
|
status_t _ConvertFromDriverSettings(const char* path,
|
|
const settings_template* settingsTemplate, BMessage& message);
|
|
|
|
BMessenger fListener;
|
|
BMessage fInterfaces;
|
|
bool fUpdated;
|
|
};
|
|
|
|
static const uint32 kMsgInterfaceSettingsUpdated = 'SUif';
|
|
|
|
#endif // SETTINGS_H
|