184b580c4SWaldemar Kornewald /* 2abdb7d1aSWaldemar Kornewald * Copyright 2003-2005, Haiku Inc. 384b580c4SWaldemar Kornewald * Distributed under the terms of the MIT License. 484b580c4SWaldemar Kornewald */ 54fbbad30SWaldemar Kornewald 64fbbad30SWaldemar Kornewald #ifndef _PPP_MANAGER__H 74fbbad30SWaldemar Kornewald #define _PPP_MANAGER__H 84fbbad30SWaldemar Kornewald 9*e3724c38Smshlyn #include <Directory.h> 104fbbad30SWaldemar Kornewald #include <KPPPManager.h> 11abdb7d1aSWaldemar Kornewald #include <String.h> 124fbbad30SWaldemar Kornewald 134fbbad30SWaldemar Kornewald 144fbbad30SWaldemar Kornewald class PPPManager { 154fbbad30SWaldemar Kornewald private: 164fbbad30SWaldemar Kornewald // copies are not allowed/needed 174fbbad30SWaldemar Kornewald PPPManager(const PPPManager& copy); 184fbbad30SWaldemar Kornewald PPPManager& operator= (const PPPManager& copy); 194fbbad30SWaldemar Kornewald 204fbbad30SWaldemar Kornewald public: 214fbbad30SWaldemar Kornewald PPPManager(); 224fbbad30SWaldemar Kornewald ~PPPManager(); 234fbbad30SWaldemar Kornewald 24abdb7d1aSWaldemar Kornewald static bool SetDefaultInterface(const BString name); 25abdb7d1aSWaldemar Kornewald static BString DefaultInterface(); 26abdb7d1aSWaldemar Kornewald static bool GetSettingsDirectory(BDirectory *settingsDirectory); 27abdb7d1aSWaldemar Kornewald 284fbbad30SWaldemar Kornewald status_t InitCheck() const; 294fbbad30SWaldemar Kornewald 304fbbad30SWaldemar Kornewald status_t Control(uint32 op, void *data, size_t length) const; 3153a2aa40SWaldemar Kornewald status_t ControlModule(const char *name, uint32 op, void *data, 3253a2aa40SWaldemar Kornewald size_t length) const; 334fbbad30SWaldemar Kornewald 34abdb7d1aSWaldemar Kornewald ppp_interface_id CreateInterface(const driver_settings *settings) const; 35abdb7d1aSWaldemar Kornewald ppp_interface_id CreateInterfaceWithName(const char *name) const; 366cfb4dcaSWaldemar Kornewald bool DeleteInterface(ppp_interface_id ID) const; 37*e3724c38Smshlyn bool DeleteInterface(const char* name) const; 384fbbad30SWaldemar Kornewald 396cfb4dcaSWaldemar Kornewald ppp_interface_id *Interfaces(int32 *count, 404fbbad30SWaldemar Kornewald ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const; 414fbbad30SWaldemar Kornewald // the user is responsible for deleting the returned array! 426cfb4dcaSWaldemar Kornewald int32 GetInterfaces(ppp_interface_id *interfaces, int32 count, 434fbbad30SWaldemar Kornewald ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const; 444fbbad30SWaldemar Kornewald // make sure interfaces has enough space for count items 456cfb4dcaSWaldemar Kornewald ppp_interface_id InterfaceWithSettings(const driver_settings *settings) const; 46683165b7SWaldemar Kornewald ppp_interface_id InterfaceWithUnit(int32 if_unit) const; 47683165b7SWaldemar Kornewald ppp_interface_id InterfaceWithName(const char *name) const; 484fbbad30SWaldemar Kornewald int32 CountInterfaces(ppp_interface_filter filter = 494fbbad30SWaldemar Kornewald PPP_REGISTERED_INTERFACES) const; 504fbbad30SWaldemar Kornewald 514fbbad30SWaldemar Kornewald bool EnableReports(ppp_report_type type, thread_id thread, 524fbbad30SWaldemar Kornewald int32 flags = PPP_NO_FLAGS) const; 534fbbad30SWaldemar Kornewald bool DisableReports(ppp_report_type type, thread_id thread) const; 544fbbad30SWaldemar Kornewald 554fbbad30SWaldemar Kornewald private: 564fbbad30SWaldemar Kornewald int fFD; 574fbbad30SWaldemar Kornewald }; 584fbbad30SWaldemar Kornewald 594fbbad30SWaldemar Kornewald 604fbbad30SWaldemar Kornewald #endif 61