1/*
2 * Copyright 2003-2004, Haiku Inc.
3 * Distributed under the terms of the MIT License.
4 */
5
6#ifndef _K_PPP_DEFS__H
7#define _K_PPP_DEFS__H
8
9#include <KernelExport.h>
10#include <PPPDefs.h>
11
12
13// debugging macros
14#define ERROR(format, args...)	dprintf(format, ## args)
15#ifdef DEBUG
16#define TRACE(format, args...)	dprintf(format, ## args)
17#else
18#define TRACE(format, args...)
19#endif
20
21
22extern struct core_module_info *core;
23	// needed by core quick-access function defines
24
25
26// various constants
27#define PPP_PULSE_RATE						500000
28	//!< Rate at which Pulse() is called (in microseconds).
29#define PPP_RESPONSE_TEST_CODE		'_3PT'
30	// private code used to test if ppp_up did not crash
31
32
33//!	Module key types used when loading a module.
34enum ppp_module_key_type {
35	PPP_UNDEFINED_KEY_TYPE = -1,
36	PPP_LOAD_MODULE_KEY_TYPE = 0,
37	PPP_DEVICE_KEY_TYPE,
38	PPP_PROTOCOL_KEY_TYPE,
39	PPP_AUTHENTICATOR_KEY_TYPE,
40	PPP_MULTILINK_KEY_TYPE
41};
42
43//!	PPP events as defined in RFC 1661 (with one exception: PPP_UP_FAILED_EVENT).
44enum ppp_event {
45	PPP_UP_FAILED_EVENT,
46	PPP_UP_EVENT,
47	PPP_DOWN_EVENT,
48	PPP_OPEN_EVENT,
49	PPP_CLOSE_EVENT,
50	PPP_TO_GOOD_EVENT,
51	PPP_TO_BAD_EVENT,
52	PPP_RCR_GOOD_EVENT,
53	PPP_RCR_BAD_EVENT,
54	PPP_RCA_EVENT,
55	PPP_RCN_EVENT,
56	PPP_RTR_EVENT,
57	PPP_RTA_EVENT,
58	PPP_RUC_EVENT,
59	PPP_RXJ_GOOD_EVENT,
60	PPP_RXJ_BAD_EVENT,
61	PPP_RXR_EVENT
62};
63
64//!	LCP protocol codes as defined in RFC 1661.
65enum ppp_lcp_code {
66	PPP_CONFIGURE_REQUEST = 1,
67	PPP_CONFIGURE_ACK = 2,
68	PPP_CONFIGURE_NAK = 3,
69	PPP_CONFIGURE_REJECT = 4,
70	PPP_TERMINATE_REQUEST = 5,
71	PPP_TERMINATE_ACK = 6,
72	PPP_CODE_REJECT = 7,
73	PPP_PROTOCOL_REJECT = 8,
74	PPP_ECHO_REQUEST = 9,
75	PPP_ECHO_REPLY = 10,
76	PPP_DISCARD_REQUEST = 11
77
78	// ToDo: add LCP extensions
79};
80
81#define PPP_MIN_LCP_CODE PPP_CONFIGURE_REQUEST
82#define PPP_MAX_LCP_CODE PPP_DISCARD_REQUEST
83
84
85#endif
86