1/*
2 * Copyright 2003-2005, Haiku Inc.
3 * Distributed under the terms of the MIT License.
4 */
5
6#ifndef _K_PPP_REPORT_MANAGER__H
7#define _K_PPP_REPORT_MANAGER__H
8
9#include <OS.h>
10
11#include <KPPPDefs.h>
12#include <PPPReportDefs.h>
13
14#include <TemplateList.h>
15
16#include <lock.h>
17#include <util/AutoLock.h>
18
19
20class KPPPReportManager {
21	public:
22		KPPPReportManager(mutex& lock);
23		~KPPPReportManager();
24
25		static bool SendReport(thread_id thread, const ppp_report_packet *report);
26			// returns false if reply was bad (or an error occured)
27
28		void EnableReports(ppp_report_type type, thread_id thread,
29				int32 flags = PPP_NO_FLAGS);
30		void DisableReports(ppp_report_type type, thread_id thread);
31		bool DoesReport(ppp_report_type type, thread_id thread);
32		bool Report(ppp_report_type type, int32 code, void *data, int32 length);
33			// returns false if reply was bad (or an error occured)
34
35	private:
36		mutex& fLock;
37		TemplateList<ppp_report_request*> fReportRequests;
38};
39
40
41#endif
42