xref: /haiku/src/add-ons/kernel/network/ppp/shared/libppp/headers/PPPManager.h (revision 9eb55bc1d104b8fda80898f8b25c94d8000c8255)
1 //-----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  Copyright (c) 2003-2004 Waldemar Kornewald, Waldemar.Kornewald@web.de
6 //-----------------------------------------------------------------------
7 
8 #ifndef _PPP_MANAGER__H
9 #define _PPP_MANAGER__H
10 
11 #include <KPPPManager.h>
12 
13 
14 class PPPManager {
15 	private:
16 		// copies are not allowed/needed
17 		PPPManager(const PPPManager& copy);
18 		PPPManager& operator= (const PPPManager& copy);
19 
20 	public:
21 		PPPManager();
22 		~PPPManager();
23 
24 		status_t InitCheck() const;
25 
26 		status_t Control(uint32 op, void *data, size_t length) const;
27 
28 		ppp_interface_id CreateInterface(const driver_settings *settings,
29 			const driver_settings *profile = NULL) const;
30 		ppp_interface_id CreateInterfaceWithName(const char *name,
31 			const driver_settings *profile = NULL) const;
32 		bool DeleteInterface(ppp_interface_id ID) const;
33 
34 		ppp_interface_id *Interfaces(int32 *count,
35 			ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const;
36 				// the user is responsible for deleting the returned array!
37 		int32 GetInterfaces(ppp_interface_id *interfaces, int32 count,
38 			ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const;
39 				// make sure interfaces has enough space for count items
40 		ppp_interface_id InterfaceWithSettings(const driver_settings *settings) const;
41 		ppp_interface_id InterfaceWithUnit(int32 if_unit) const;
42 		ppp_interface_id InterfaceWithName(const char *name) const;
43 		int32 CountInterfaces(ppp_interface_filter filter =
44 			PPP_REGISTERED_INTERFACES) const;
45 
46 		bool EnableReports(ppp_report_type type, thread_id thread,
47 			int32 flags = PPP_NO_FLAGS) const;
48 		bool DisableReports(ppp_report_type type, thread_id thread) const;
49 
50 	private:
51 		int fFD;
52 };
53 
54 
55 #endif
56