xref: /haiku/src/add-ons/kernel/network/ppp/shared/libkernelppp/headers/KPPPManager.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  Copyright (c) 2003 Waldemar Kornewald, Waldemar.Kornewald@web.de
6 //---------------------------------------------------------------------
7 
8 #ifndef _K_PPP_MANAGER__H
9 #define _K_PPP_MANAGER__H
10 
11 #include "net_module.h"
12 #include <PPPControl.h>
13 #include <PPPReportDefs.h>
14 
15 
16 #define PPP_INTERFACE_MODULE_NAME		 "network/interfaces/ppp"
17 
18 #define PPP_UNDEFINED_INTERFACE_ID	0
19 	// create_interface() returns this value on failure
20 
21 
22 typedef struct ppp_interface_module_info {
23 	kernel_net_module_info knminfo;
24 
25 	interface_id (*CreateInterface)(const driver_settings *settings,
26 		interface_id parentID = PPP_UNDEFINED_INTERFACE_ID);
27 			// you should always create interfaces using this function
28 	void (*DeleteInterface)(interface_id ID);
29 		// this marks the interface for deletion
30 	void (*RemoveInterface)(interface_id ID);
31 		// remove the interface from database (make sure you can delete it yourself!)
32 
33 	ifnet *(*RegisterInterface)(interface_id ID);
34 	bool (*UnregisterInterface)(interface_id ID);
35 
36 	status_t (*ControlInterface)(interface_id ID, uint32 op, void *data,
37 		size_t length);
38 
39 	int32 (*GetInterfaces)(interface_id *interfaces, int32 count,
40 		ppp_interface_filter filter = PPP_REGISTERED_INTERFACES);
41 			// make sure interfaces has enough space for count items
42 	int32 (*CountInterfaces)(ppp_interface_filter filter = PPP_REGISTERED_INTERFACES);
43 
44 	void (*EnableReports)(ppp_report_type type, thread_id thread,
45 		int32 flags = PPP_NO_FLAGS);
46 	void (*DisableReports)(ppp_report_type type, thread_id thread);
47 	bool (*DoesReport)(ppp_report_type type, thread_id thread);
48 } ppp_interface_module_info;
49 
50 
51 #endif
52