xref: /haiku/src/add-ons/kernel/network/ppp/shared/libppp/headers/PPPInterface.h (revision 5c9e6a3953923a7c60c3d9c69c4f935492f26997)
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 _PPP_INTERFACE__H
9 #define _PPP_INTERFACE__H
10 
11 #include <KPPPManager.h>
12 
13 
14 class PPPInterface {
15 	public:
16 		PPPInterface(interface_id ID = PPP_UNDEFINED_INTERFACE_ID);
17 		PPPInterface(const PPPInterface& copy);
18 		~PPPInterface();
19 
20 		status_t InitCheck() const;
21 
22 		status_t SetTo(interface_id ID);
23 		interface_id ID() const
24 			{ return fID; }
25 
26 		status_t Control(uint32 op, void *data, size_t length) const;
27 
28 		bool GetInterfaceInfo(ppp_interface_info_t *info) const;
29 
30 		bool Up() const;
31 		bool Down() const;
32 
33 		bool EnableReports(ppp_report_type type, thread_id thread,
34 			int32 flags = PPP_NO_FLAGS) const;
35 		bool DisableReports(ppp_report_type type, thread_id thread) const;
36 
37 		PPPInterface& operator= (const PPPInterface& copy)
38 			{ SetTo(copy.ID()); return *this; }
39 		PPPInterface& operator= (interface_id ID)
40 			{ SetTo(ID); return *this; }
41 
42 	private:
43 		interface_id fID;
44 
45 		int fFD;
46 		ppp_interface_info_t fInfo;
47 };
48 
49 
50 #endif
51