xref: /haiku/src/add-ons/kernel/network/ppp/shared/libppp/headers/PPPManager.h (revision 67bce78b48ed6d01b5a8eef89f5694c372b7e0a1)
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 		status_t ControlModule(const char *name, uint32 op, void *data,
28 			size_t length) const;
29 
30 		ppp_interface_id CreateInterface(const driver_settings *settings,
31 			const driver_settings *profile = NULL) const;
32 		ppp_interface_id CreateInterfaceWithName(const char *name,
33 			const driver_settings *profile = NULL) const;
34 		bool DeleteInterface(ppp_interface_id ID) const;
35 
36 		ppp_interface_id *Interfaces(int32 *count,
37 			ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const;
38 				// the user is responsible for deleting the returned array!
39 		int32 GetInterfaces(ppp_interface_id *interfaces, int32 count,
40 			ppp_interface_filter filter = PPP_REGISTERED_INTERFACES) const;
41 				// make sure interfaces has enough space for count items
42 		ppp_interface_id InterfaceWithSettings(const driver_settings *settings) const;
43 		ppp_interface_id InterfaceWithUnit(int32 if_unit) const;
44 		ppp_interface_id InterfaceWithName(const char *name) const;
45 		int32 CountInterfaces(ppp_interface_filter filter =
46 			PPP_REGISTERED_INTERFACES) const;
47 
48 		bool EnableReports(ppp_report_type type, thread_id thread,
49 			int32 flags = PPP_NO_FLAGS) const;
50 		bool DisableReports(ppp_report_type type, thread_id thread) const;
51 
52 	private:
53 		int fFD;
54 };
55 
56 
57 #endif
58