184b580c4SWaldemar Kornewald/*
2abdb7d1aSWaldemar Kornewald * Copyright 2003-2005, Haiku Inc.
384b580c4SWaldemar Kornewald * Distributed under the terms of the MIT License.
484b580c4SWaldemar Kornewald */
5de2f76e1SWaldemar Kornewald
6de2f76e1SWaldemar Kornewald#ifndef _PPP_REPORT_DEFS__H
7de2f76e1SWaldemar Kornewald#define _PPP_REPORT_DEFS__H
8de2f76e1SWaldemar Kornewald
9e7452421SWaldemar Kornewald#include <OS.h>
10e7452421SWaldemar Kornewald
11de2f76e1SWaldemar Kornewald
124e0ad752SWaldemar Kornewald#define PPP_REPORT_TIMEOUT			100
13de2f76e1SWaldemar Kornewald
14de2f76e1SWaldemar Kornewald#define PPP_REPORT_DATA_LIMIT		128
15de2f76e1SWaldemar Kornewald	// how much optional data can be added to the report
16de2f76e1SWaldemar Kornewald#define PPP_REPORT_CODE				'_3PR'
17de2f76e1SWaldemar Kornewald	// the code of receive_data() must have this value
18de2f76e1SWaldemar Kornewald
193f3689bbSWaldemar Kornewald//!	Report flags.
20de2f76e1SWaldemar Kornewaldenum ppp_report_flags {
21abdb7d1aSWaldemar Kornewald	PPP_REMOVE_AFTER_REPORT = 0x01,
22abdb7d1aSWaldemar Kornewald	PPP_REGISTER_SUBITEMS = 0x02
23de2f76e1SWaldemar Kornewald};
24de2f76e1SWaldemar Kornewald
25de2f76e1SWaldemar Kornewald// report types
266cfb4dcaSWaldemar Kornewald// the first 15 report types are reserved for the interface manager
276cfb4dcaSWaldemar Kornewald#define PPP_INTERFACE_REPORT_TYPE_MIN	16
28de2f76e1SWaldemar Kornewaldenum ppp_report_type {
29de2f76e1SWaldemar Kornewald	PPP_ALL_REPORTS = -1,
30de2f76e1SWaldemar Kornewald		// used only when disabling reports
31e7452421SWaldemar Kornewald	PPP_MANAGER_REPORT = 1,
32de2f76e1SWaldemar Kornewald	PPP_DESTRUCTION_REPORT = 16,
33de2f76e1SWaldemar Kornewald		// the interface is being destroyed (no code is needed)
34de2f76e1SWaldemar Kornewald		// this report is sent even if it was not requested
35de2f76e1SWaldemar Kornewald	PPP_CONNECTION_REPORT = 17
36de2f76e1SWaldemar Kornewald};
37de2f76e1SWaldemar Kornewald
38e7452421SWaldemar Kornewald
39de2f76e1SWaldemar Kornewald// report codes (type-specific)
40e7452421SWaldemar Kornewaldenum ppp_manager_report_codes {
41e7452421SWaldemar Kornewald	// the interface id is added to the following reports
42e7452421SWaldemar Kornewald	PPP_REPORT_INTERFACE_CREATED = 0
43e7452421SWaldemar Kornewald};
44e7452421SWaldemar Kornewald
45e7452421SWaldemar Kornewald
46de2f76e1SWaldemar Kornewaldenum ppp_connection_report_codes {
4749c2f687SWaldemar Kornewald	// the interface id is added to the following reports
48de2f76e1SWaldemar Kornewald	PPP_REPORT_GOING_UP = 0,
49de2f76e1SWaldemar Kornewald	PPP_REPORT_UP_SUCCESSFUL = 1,
50de2f76e1SWaldemar Kornewald	PPP_REPORT_DOWN_SUCCESSFUL = 2,
51abdb7d1aSWaldemar Kornewald	PPP_REPORT_DEVICE_UP_FAILED = 3,
52abdb7d1aSWaldemar Kornewald	PPP_REPORT_AUTHENTICATION_REQUESTED = 4,
53abdb7d1aSWaldemar Kornewald	PPP_REPORT_AUTHENTICATION_FAILED = 5,
54abdb7d1aSWaldemar Kornewald	PPP_REPORT_CONNECTION_LOST = 6
55de2f76e1SWaldemar Kornewald};
56de2f76e1SWaldemar Kornewald
57de2f76e1SWaldemar Kornewald
583f3689bbSWaldemar Kornewald//!	This is the structure of a report message.
59de2f76e1SWaldemar Kornewaldtypedef struct ppp_report_packet {
60de2f76e1SWaldemar Kornewald	int32 type;
61de2f76e1SWaldemar Kornewald	int32 code;
62de2f76e1SWaldemar Kornewald	uint8 length;
633f3689bbSWaldemar Kornewald		//!< Length of the additional data.
64de2f76e1SWaldemar Kornewald	char data[PPP_REPORT_DATA_LIMIT];
65de2f76e1SWaldemar Kornewald} ppp_report_packet;
66de2f76e1SWaldemar Kornewald
67de2f76e1SWaldemar Kornewald
683f3689bbSWaldemar Kornewald//!	Private structure used for storing report requests.
69de2f76e1SWaldemar Kornewaldtypedef struct ppp_report_request {
70de2f76e1SWaldemar Kornewald	ppp_report_type type;
71de2f76e1SWaldemar Kornewald	thread_id thread;
72de2f76e1SWaldemar Kornewald	int32 flags;
73de2f76e1SWaldemar Kornewald} ppp_report_request;
74de2f76e1SWaldemar Kornewald
75de2f76e1SWaldemar Kornewald
76de2f76e1SWaldemar Kornewald#endif
77