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>
29 /* local socket path */
30 #define PPP_PATH "/var/run/pppconfd\0"
33 /* PPP message paquets */
35 u_int32_t m_type
; // type of the message
36 u_int32_t m_result
; // error code of notification message
37 u_int32_t m_cookie
; // user param
38 u_int32_t m_link
; // link for this message
39 u_int32_t m_len
; // len of the following data
43 u_int32_t m_type
; // type of the message
44 u_int32_t m_result
; // error code of notification message
45 u_int32_t m_cookie
; // user param, or error num for event
46 u_int32_t m_link
; // link for this message
47 u_int32_t m_len
; // len of the following data
48 u_char m_data
[1]; // msg data sent or received
53 /* codes for ppp messages */
55 /* API client commands */
70 // struct for an option
81 /* codes for options management */
84 PPP_OPT_DEV_NAME
= 1, // string
85 PPP_OPT_DEV_SPEED
, // 4 bytes
86 PPP_OPT_DEV_CONNECTSCRIPT
, // string
88 PPP_OPT_COMM_IDLETIMER
, // 4 bytes
89 PPP_OPT_COMM_REMOTEADDR
, // string
91 PPP_OPT_AUTH_PROTO
, // 4 bytes
92 PPP_OPT_AUTH_NAME
, // string
93 PPP_OPT_AUTH_PASSWD
, // string
95 PPP_OPT_LCP_HDRCOMP
, // 4 bytes
96 PPP_OPT_LCP_MRU
, // 4 bytes
97 PPP_OPT_LCP_MTU
, // 4 bytes
98 PPP_OPT_LCP_RCACCM
, // 4 bytes
99 PPP_OPT_LCP_TXACCM
, // 4 bytes
101 PPP_OPT_IPCP_HDRCOMP
, // 4 bytes
102 PPP_OPT_IPCP_LOCALADDR
, // 4 bytes
103 PPP_OPT_IPCP_REMOTEADDR
, // 4 bytes
105 PPP_OPT_LOGFILE
, // string
106 PPP_OPT_RESERVED
, // 4 bytes
107 PPP_OPT_REMINDERTIMER
, // 4 bytes (not implemented)
108 PPP_OPT_ALERTENABLE
, // 4 bytes (not implemented)
110 PPP_OPT_LCP_ECHO
, // struct ppp_opt_echo
112 PPP_OPT_COMM_CONNECTDELAY
, // 4 bytes
113 PPP_OPT_COMM_SESSIONTIMER
, // 4 bytes
114 PPP_OPT_COMM_TERMINALMODE
, // 4 bytes
115 PPP_OPT_COMM_TERMINALSCRIPT
, // string. Additionnal connection script, once modem is connected
116 PPP_OPT_DEV_CAPS
, // struct ppp_caps...
118 PPP_OPT_IPCP_USESERVERDNS
, // 4 bytes
119 PPP_OPT_COMM_CONNECTSPEED
, // 4 bytes, actual connection speed
120 PPP_OPT_SERVICEID
// string, name of the associated service in the store
126 // PPP_LCP_OPT_HDRCOMP -- option ppp addr/ctrl compression
128 PPP_LCP_HDRCOMP_NONE
= 0,
129 PPP_LCP_HDRCOMP_ADDR
= 1,
130 PPP_LCP_HDRCOMP_PROTO
= 2
134 PPP_COMM_TERM_NONE
= 0,
135 PPP_COMM_TERM_SCRIPT
,
140 PPP_IPCP_HDRCOMP_NONE
= 0,
144 // PPP_LCP_OPT_RCACCM -- option receive control asynchronous character map
146 PPP_LCP_ACCM_NONE
= 0,
147 PPP_LCP_ACCM_XONXOFF
= 0x000A0000,
148 PPP_LCP_ACCM_ALL
= 0xFFFFFFFF
176 PPP_EVT_DISCONNECTED
= 1,
177 PPP_EVT_CONNSCRIPT_STARTED
,
178 PPP_EVT_CONNSCRIPT_FINISHED
,
179 PPP_EVT_TERMSCRIPT_STARTED
,
180 PPP_EVT_TERMSCRIPT_FINISHED
,
181 PPP_EVT_LOWERLAYER_UP
,
182 PPP_EVT_LOWERLAYER_DOWN
,
187 PPP_EVT_AUTH_STARTED
,
189 PPP_EVT_AUTH_SUCCEDED
192 struct ppp_opt_echo
{ // 0 for the following value will cancel echo option
193 u_int16_t interval
; // delay in seconds between echo requests
194 u_int16_t failure
; // # of failure before declaring the link down
202 u_int32_t timeElapsed
;
203 u_int32_t timeRemaining
;
209 u_int32_t outPackets
;
212 struct disconnected
{
213 u_int32_t lastDiscCause
;
219 // from 0 to 255, we use bsd error codes from errno.h
221 // ppp speficic error codes
222 PPP_ERR_GEN_ERROR
= 256,
223 PPP_ERR_CONNSCRIPTFAILED
,
224 PPP_ERR_TERMSCRIPTFAILED
,
228 PPP_ERR_SESSIONTIMEOUT
,
231 PPP_ERR_DISCSCRIPTFAILED
,
233 // modem specific error codes
234 PPP_ERR_MOD_NOCARRIER
= 512,
236 PPP_ERR_MOD_NODIALTONE
,
240 #endif /* _PPP_MSG_H */