2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
27 #include <sys/types.h>
30 /* local socket path */
31 #define PPP_PATH "/var/run/pppconfd\0"
34 /* PPP message paquets */
36 u_int32_t m_type
; // type of the message
37 u_int32_t m_result
; // error code of notification message
38 u_int32_t m_cookie
; // user param
39 u_int32_t m_link
; // link for this message
40 u_int32_t m_len
; // len of the following data
44 u_int32_t m_type
; // type of the message
45 u_int32_t m_result
; // error code of notification message
46 u_int32_t m_cookie
; // user param, or error num for event
47 u_int32_t m_link
; // link for this message
48 u_int32_t m_len
; // len of the following data
49 u_char m_data
[1]; // msg data sent or received
54 /* codes for ppp messages */
56 /* API client commands */
71 // struct for an option
82 /* codes for options management */
85 PPP_OPT_DEV_NAME
= 1, // string
86 PPP_OPT_DEV_SPEED
, // 4 bytes
87 PPP_OPT_DEV_CONNECTSCRIPT
, // string
89 PPP_OPT_COMM_IDLETIMER
, // 4 bytes
90 PPP_OPT_COMM_REMOTEADDR
, // string
92 PPP_OPT_AUTH_PROTO
, // 4 bytes
93 PPP_OPT_AUTH_NAME
, // string
94 PPP_OPT_AUTH_PASSWD
, // string
96 PPP_OPT_LCP_HDRCOMP
, // 4 bytes
97 PPP_OPT_LCP_MRU
, // 4 bytes
98 PPP_OPT_LCP_MTU
, // 4 bytes
99 PPP_OPT_LCP_RCACCM
, // 4 bytes
100 PPP_OPT_LCP_TXACCM
, // 4 bytes
102 PPP_OPT_IPCP_HDRCOMP
, // 4 bytes
103 PPP_OPT_IPCP_LOCALADDR
, // 4 bytes
104 PPP_OPT_IPCP_REMOTEADDR
, // 4 bytes
106 PPP_OPT_LOGFILE
, // string
107 PPP_OPT_RESERVED
, // 4 bytes
108 PPP_OPT_REMINDERTIMER
, // 4 bytes (not implemented)
109 PPP_OPT_ALERTENABLE
, // 4 bytes (not implemented)
111 PPP_OPT_LCP_ECHO
, // struct ppp_opt_echo
113 PPP_OPT_COMM_CONNECTDELAY
, // 4 bytes
114 PPP_OPT_COMM_SESSIONTIMER
, // 4 bytes
115 PPP_OPT_COMM_TERMINALMODE
, // 4 bytes
116 PPP_OPT_COMM_TERMINALSCRIPT
, // string. Additionnal connection script, once modem is connected
117 PPP_OPT_DEV_CAPS
, // struct ppp_caps...
119 PPP_OPT_IPCP_USESERVERDNS
, // 4 bytes
120 PPP_OPT_COMM_CONNECTSPEED
, // 4 bytes, actual connection speed
121 PPP_OPT_SERVICEID
// string, name of the associated service in the cache
127 // PPP_LCP_OPT_HDRCOMP -- option ppp addr/ctrl compression
129 PPP_LCP_HDRCOMP_NONE
= 0,
130 PPP_LCP_HDRCOMP_ADDR
= 1,
131 PPP_LCP_HDRCOMP_PROTO
= 2
135 PPP_COMM_TERM_NONE
= 0,
136 PPP_COMM_TERM_SCRIPT
,
141 PPP_IPCP_HDRCOMP_NONE
= 0,
145 // PPP_LCP_OPT_RCACCM -- option receive control asynchronous character map
147 PPP_LCP_ACCM_NONE
= 0,
148 PPP_LCP_ACCM_XONXOFF
= 0x000A0000,
149 PPP_LCP_ACCM_ALL
= 0xFFFFFFFF
177 PPP_EVT_DISCONNECTED
= 1,
178 PPP_EVT_CONNSCRIPT_STARTED
,
179 PPP_EVT_CONNSCRIPT_FINISHED
,
180 PPP_EVT_TERMSCRIPT_STARTED
,
181 PPP_EVT_TERMSCRIPT_FINISHED
,
182 PPP_EVT_LOWERLAYER_UP
,
183 PPP_EVT_LOWERLAYER_DOWN
,
188 PPP_EVT_AUTH_STARTED
,
190 PPP_EVT_AUTH_SUCCEDED
193 struct ppp_opt_echo
{ // 0 for the following value will cancel echo option
194 u_int16_t interval
; // delay in seconds between echo requests
195 u_int16_t failure
; // # of failure before declaring the link down
203 u_int32_t timeElapsed
;
204 u_int32_t timeRemaining
;
210 u_int32_t outPackets
;
213 struct disconnected
{
214 u_int32_t lastDiscCause
;
220 // from 0 to 255, we use bsd error codes from errno.h
222 // ppp speficic error codes
223 PPP_ERR_GEN_ERROR
= 256,
224 PPP_ERR_CONNSCRIPTFAILED
,
225 PPP_ERR_TERMSCRIPTFAILED
,
229 PPP_ERR_SESSIONTIMEOUT
,
232 PPP_ERR_DISCSCRIPTFAILED
,
234 // modem specific error codes
235 PPP_ERR_MOD_NOCARRIER
= 512,
237 PPP_ERR_MOD_NODIALTONE
,
241 #endif /* _PPP_MSG_H */