xref: /haiku/src/add-ons/kernel/network/ppp/shared/libkernelppp/headers/KPPPManager.h (revision 01b25646004ff628ecad0281a9795e5e90f71746)
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 class PPPInterface;
23 typedef struct ppp_interface_entry {
24 	PPPInterface *interface;
25 	vint32 accessing;
26 	bool deleting;
27 } ppp_interface_entry;
28 
29 
30 typedef struct ppp_interface_module_info {
31 	kernel_net_module_info knminfo;
32 
33 	interface_id (*CreateInterface)(const driver_settings *settings,
34 		interface_id parentID = PPP_UNDEFINED_INTERFACE_ID);
35 			// you should always create interfaces using this function
36 	bool (*DeleteInterface)(interface_id ID);
37 		// this marks the interface for deletion
38 	bool (*RemoveInterface)(interface_id ID);
39 		// remove the interface from database (make sure you can delete it yourself!)
40 
41 	ifnet *(*RegisterInterface)(interface_id ID);
42 	bool (*UnregisterInterface)(interface_id ID);
43 
44 	status_t (*ControlInterface)(interface_id ID, uint32 op, void *data,
45 		size_t length);
46 
47 	int32 (*GetInterfaces)(interface_id *interfaces, int32 count,
48 		ppp_interface_filter filter = PPP_REGISTERED_INTERFACES);
49 			// make sure interfaces has enough space for count items
50 	int32 (*CountInterfaces)(ppp_interface_filter filter = PPP_REGISTERED_INTERFACES);
51 
52 	void (*EnableReports)(ppp_report_type type, thread_id thread,
53 		int32 flags = PPP_NO_FLAGS);
54 	void (*DisableReports)(ppp_report_type type, thread_id thread);
55 	bool (*DoesReport)(ppp_report_type type, thread_id thread);
56 } ppp_interface_module_info;
57 
58 
59 #endif
60