1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** NetX Component                                                        */
17 /**                                                                       */
18 /**   Point-to-Point Protocol (PPP)                                       */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
27 /*                                                                        */
28 /*    nx_ppp.h                                            PORTABLE C      */
29 /*                                                           6.3.0        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Yuxin Zhou, Microsoft Corporation                                   */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the NetX Point-to-Point Protocol (PPP)            */
37 /*    component, including all data types and external references.        */
38 /*    It is assumed that nx_api.h and nx_port.h have already been         */
39 /*    included.                                                           */
40 /*                                                                        */
41 /*  RELEASE HISTORY                                                       */
42 /*                                                                        */
43 /*    DATE              NAME                      DESCRIPTION             */
44 /*                                                                        */
45 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
46 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
47 /*                                            resulting in version 6.1    */
48 /*  11-09-2020     Yuxin Zhou               Modified comment(s),          */
49 /*                                            improved packet length      */
50 /*                                            verification,               */
51 /*                                            resulting in version 6.1.2  */
52 /*  10-15-2021     Yuxin Zhou               Modified comment(s), included */
53 /*                                            necessary header file,      */
54 /*                                            resulting in version 6.1.9  */
55 /*  10-31-2023     Wenhui Xie               Modified comment(s), and      */
56 /*                                            supported processing        */
57 /*                                            compressed data,            */
58 /*                                            resulting in version 6.3.0  */
59 /*                                                                        */
60 /**************************************************************************/
61 
62 #ifndef NX_PPP_H
63 #define NX_PPP_H
64 
65 /* Determine if a C++ compiler is being used.  If so, ensure that standard
66    C is used to process the API information.  */
67 
68 #ifdef   __cplusplus
69 
70 /* Yes, C++ compiler is present.  Use standard C.  */
71 extern   "C" {
72 
73 #endif
74 
75 #include "nx_api.h"
76 
77 /* Define the PPP ID.  */
78 
79 #define NX_PPP_ID                                           0x50505020UL
80 
81 #define NX_PPP_SERIAL_BUFFER_ALERT_THRESHOLD                NX_PPP_SERIAL_BUFFER_SIZE/4
82 
83 /* Defined, support for transmitting PPP over Ethernet.  */
84 /*
85 #define NX_PPP_PPPOE_ENABLE
86 */
87 
88 /* If defined, this removes logic for compiling PPP transmit and receive statistics.
89 #define NX_PPP_DISABLE_INFO
90 */
91 
92 /* If defined, this enables PPP event logging.
93 #define NX_PPP_DEBUG_LOG_ENABLE
94 */
95 
96 /* If defined, this enables data saved to the PPP log to be printed out (printf).
97 #define NX_PPP_DEBUG_LOG_PRINT_ENABLE
98 */
99 
100 /* If defined, this disables CHAP authentication.
101 #define NX_PPP_DISABLE_CHAP
102 */
103 
104 /* If defined, this disables PAP authentication.
105 #define NX_PPP_DISABLE_PAP
106 */
107 
108 /* If defined, the primary DNS address request option is not set in NAKed list.
109 #define NX_PPP_DNS_OPTION_DISABLE
110 */
111 
112 /* Define how many times the PPP should try to request DNS address from the Peer. This
113    will have no effect if NX_PPP_DNS_OPTION_DISABLE is defined. */
114 #ifndef NX_PPP_DNS_ADDRESS_MAX_RETRIES
115 #define NX_PPP_DNS_ADDRESS_MAX_RETRIES                      2
116 #endif
117 
118 /* Define the thread time slice.  */
119 #ifndef NX_PPP_THREAD_TIME_SLICE
120 #define NX_PPP_THREAD_TIME_SLICE                            TX_NO_TIME_SLICE
121 #endif
122 
123 /* Set the link transfer size. */
124 #ifndef NX_PPP_MRU
125 #ifdef NX_PPP_PPPOE_ENABLE
126 #define NX_PPP_MRU                                          1480        /* Minimum value!  */
127 #else /* !NX_PPP_PPPOE_ENABLE  */
128 #define NX_PPP_MRU                                          1500        /* Minimum value!  */
129 #endif /* NX_PPP_PPPOE_ENABLE  */
130 #endif /* NX_PPP_MRU  */
131 
132 /* Minimum MRU to accept in  MRU parsed from received LCP configuration request. */
133 #ifndef NX_PPP_MINIMUM_MRU
134 #ifdef NX_PPP_PPPOE_ENABLE
135 #define NX_PPP_MINIMUM_MRU                                  1480
136 #else /* !NX_PPP_PPPOE_ENABLE  */
137 #define NX_PPP_MINIMUM_MRU                                  1500
138 #endif /* NX_PPP_PPPOE_ENABLE  */
139 #endif /* NX_PPP_MINIMUM_MRU  */
140 
141 /* Size of the receive character buffer. */
142 #ifndef NX_PPP_SERIAL_BUFFER_SIZE
143 #define NX_PPP_SERIAL_BUFFER_SIZE                           NX_PPP_MRU*2
144 #endif
145 
146 
147 /* User name buffer size for PAP login.  */
148 #ifndef NX_PPP_NAME_SIZE
149 #define NX_PPP_NAME_SIZE                                    32
150 #endif
151 
152 /* Password buffer size for PAP login.  */
153 #ifndef NX_PPP_PASSWORD_SIZE
154 #define NX_PPP_PASSWORD_SIZE                                32
155 #endif
156 
157 /* Buffer size of the random value to process the CHAP challenge name */
158 #ifndef NX_PPP_VALUE_SIZE
159 #define NX_PPP_VALUE_SIZE                                   32
160 #endif
161 
162 /* Buffer size of the hash value to process the CHAP challenge name */
163 #ifndef NX_PPP_HASHED_VALUE_SIZE
164 #define NX_PPP_HASHED_VALUE_SIZE                            16
165 #endif
166 
167 
168 /* The time period in timer ticks at which the PPP timer function executes and wakes up the PPP processing thread
169    to check for PPP events. */
170 #ifndef NX_PPP_BASE_TIMEOUT
171 #define NX_PPP_BASE_TIMEOUT                                 (NX_IP_PERIODIC_RATE * 1)        /* 1 second  */
172 #endif
173 
174 /* The time out in timer ticks on allocating packets for processing PPP data into IP packets either receiving or sending. */
175 #ifndef NX_PPP_TIMEOUT
176 #define NX_PPP_TIMEOUT                                      (NX_IP_PERIODIC_RATE * 4)       /* 4 seconds  */
177 #endif
178 
179 /* Number of times the PPP task times out waiting for another byte in the serial buffer. On reaching
180    this value, the PPP instance releases the packet and allocates a fresh packet for a new message.  */
181 #ifndef NX_PPP_RECEIVE_TIMEOUTS
182 #define NX_PPP_RECEIVE_TIMEOUTS                             4
183 #endif
184 
185 /* Timeout in seconds on the PPP task to receive a response to PPP protocol request.  */
186 #ifndef NX_PPP_PROTOCOL_TIMEOUT
187 #define NX_PPP_PROTOCOL_TIMEOUT                             4                            /* 4 seconds.  */
188 #endif
189 
190 /* Size of debug entry, this is also the wrap around index for debug output to overwrite oldest data. */
191 #ifndef NX_PPP_DEBUG_LOG_SIZE
192 #define NX_PPP_DEBUG_LOG_SIZE                               50
193 #endif
194 
195 /* Maximum amount of data to add to debug output from received packet. */
196 #ifndef NX_PPP_DEBUG_FRAME_SIZE
197 #define NX_PPP_DEBUG_FRAME_SIZE                             50
198 #endif
199 
200 /* Size of the NAK list. Not in use. */
201 #ifndef NX_PPP_OPTION_MESSAGE_LENGTH
202 #define NX_PPP_OPTION_MESSAGE_LENGTH                        64
203 #endif
204 
205 /* Number of instances the PPP instance resends another LCP configure request message without a response.
206    When this number is reached, the PPP instance aborts the PPP handshake, and the link status is down. */
207 #ifndef NX_PPP_MAX_LCP_PROTOCOL_RETRIES
208 #define NX_PPP_MAX_LCP_PROTOCOL_RETRIES                     20
209 #endif
210 
211 /* Number of instances the PPP instance resends another PAP authentication request message without a response.
212    When this number is reached, the PPP instance aborts the PPP handshake, and the link status is down. */
213 #ifndef NX_PPP_MAX_PAP_PROTOCOL_RETRIES
214 #define NX_PPP_MAX_PAP_PROTOCOL_RETRIES                     20
215 #endif
216 
217 /* Number of instances the PPP instance resends another CHAP challenge message without a response.
218    When this number is reached, the PPP instance aborts the PPP handshake, and the link status is down. */
219 #ifndef NX_PPP_MAX_CHAP_PROTOCOL_RETRIES
220 #define NX_PPP_MAX_CHAP_PROTOCOL_RETRIES                    20
221 #endif
222 
223 /* Number of instances the PPP instance times out before the IPCP part of the PPP handshake.
224    When this number is reached, the PPP instance aborts and the link is down. */
225 #ifndef NX_PPP_MAX_IPCP_PROTOCOL_RETRIES
226 #define NX_PPP_MAX_IPCP_PROTOCOL_RETRIES                    20
227 #endif
228 
229 /* Define the packet header.  */
230 #ifdef NX_PPP_PPPOE_ENABLE
231 #ifndef NX_PPP_PACKET
232 #define NX_PPP_PACKET                                       22  /* Ethernet Header(14) + (PPPoE Header(6) + 2), keep four-byte alignment for Ethernet.  */
233 #endif /* NX_PPP_PACKET  */
234 #else /* !NX_PPP_PPPOE_ENABLE  */
235 #define NX_PPP_PACKET                                       0
236 #endif /* NX_PPP_PPPOE_ENABLE  */
237 
238 /* Define the minimum PPP packet payload, the PPP commands (LCP, PAP, CHAP, IPCP) should be in one packet.  */
239 
240 #ifndef NX_PPP_MIN_PACKET_PAYLOAD
241 #define NX_PPP_MIN_PACKET_PAYLOAD                           (NX_PPP_PACKET + 128)
242 #endif
243 
244 /* Define PPP protocol types.  */
245 
246 #define NX_PPP_LCP_PROTOCOL                                 0xC021
247 #define NX_PPP_IPCP_PROTOCOL                                0x8021
248 #define NX_PPP_PAP_PROTOCOL                                 0xC023
249 #define NX_PPP_CHAP_PROTOCOL                                0xC223
250 #define NX_PPP_DATA                                         0x0021
251 
252 
253 /* Define PPP LCP codes and action.   */
254 
255 #define NX_PPP_LCP_CONFIGURE_REQUEST                        1
256 #define NX_PPP_LCP_CONFIGURE_ACK                            2
257 #define NX_PPP_LCP_CONFIGURE_NAK                            3
258 #define NX_PPP_LCP_CONFIGURE_REJECT                         4
259 #define NX_PPP_LCP_TERMINATE_REQUEST                        5
260 #define NX_PPP_LCP_TERMINATE_ACK                            6
261 #define NX_PPP_LCP_CODE_REJECT                              7
262 #define NX_PPP_LCP_PROTOCOL_REJECT                          8
263 #define NX_PPP_LCP_ECHO_REQUEST                             9
264 #define NX_PPP_LCP_ECHO_REPLY                               10
265 #define NX_PPP_LCP_DISCARD_REQUEST                          11
266 #define NX_PPP_LCP_TIMEOUT                                  99
267 
268 
269 /* Define PPP PAP codes and action.  */
270 
271 #define NX_PPP_PAP_AUTHENTICATE_REQUEST                     1
272 #define NX_PPP_PAP_AUTHENTICATE_ACK                         2
273 #define NX_PPP_PAP_AUTHENTICATE_NAK                         3
274 #define NX_PPP_PAP_AUTHENTICATE_TIMEOUT                     99
275 
276 
277 /* Define PPP CHAP codes and action.  */
278 
279 #define NX_PPP_CHAP_CHALLENGE_REQUEST                       1
280 #define NX_PPP_CHAP_CHALLENGE_RESPONSE                      2
281 #define NX_PPP_CHAP_CHALLENGE_SUCCESS                       3
282 #define NX_PPP_CHAP_CHALLENGE_FAILURE                       4
283 #define NX_PPP_CHAP_CHALLENGE_TIMEOUT                       99
284 
285 
286 /* Define PPP IPCP codes and action.   */
287 
288 #define NX_PPP_IPCP_CONFIGURE_REQUEST                       1
289 #define NX_PPP_IPCP_CONFIGURE_ACK                           2
290 #define NX_PPP_IPCP_CONFIGURE_NAK                           3
291 #define NX_PPP_IPCP_CONFIGURE_REJECT                        4
292 #define NX_PPP_IPCP_TERMINATE_REQUEST                       5
293 #define NX_PPP_IPCP_TERMINATE_ACK                           6
294 #define NX_PPP_IPCP_TIMEOUT                                 99
295 
296 
297 /* Define API return codes.  */
298 
299 #define NX_PPP_FAILURE                                      0xb0
300 #define NX_PPP_BUFFER_FULL                                  0xb1
301 #define NX_PPP_BAD_PACKET                                   0xb3
302 #define NX_PPP_ERROR                                        0xb4
303 #define NX_PPP_NOT_ESTABLISHED                              0xb5
304 #define NX_PPP_INVALID_PARAMETER                            0xb6
305 #define NX_PPP_ADDRESS_NOT_ESTABLISHED                      0xb7
306 #define NX_PPP_ALREADY_STOPPED                              0xb8
307 #define NX_PPP_ALREADY_STARTED                              0xb9
308 
309 /* Define PPP state machine states.  */
310 
311 #define NX_PPP_STOPPED                                      0
312 #define NX_PPP_STARTED                                      1
313 #define NX_PPP_ESTABLISHED                                  2
314 
315 
316 /* Define LCP state machine states.  */
317 
318 #define NX_PPP_LCP_INITIAL_STATE                            0
319 #define NX_PPP_LCP_START_STATE                              1
320 #define NX_PPP_LCP_CONFIGURE_REQUEST_SENT_STATE             2
321 #define NX_PPP_LCP_CONFIGURE_REQUEST_ACKED_STATE            3
322 #define NX_PPP_LCP_PEER_CONFIGURE_REQUEST_ACKED_STATE       4
323 #define NX_PPP_LCP_STOPPING_STATE                           5
324 #define NX_PPP_LCP_STOPPED_STATE                            6
325 #define NX_PPP_LCP_FAILED_STATE                             7
326 #define NX_PPP_LCP_COMPLETED_STATE                          8
327 
328 
329 /* Define PAP state machine states.  */
330 
331 #define NX_PPP_PAP_INITIAL_STATE                            0
332 #define NX_PPP_PAP_START_STATE                              1
333 #define NX_PPP_PAP_AUTHENTICATE_REQUEST_SENT_STATE          2
334 #define NX_PPP_PAP_AUTHENTICATE_REQUEST_WAIT_STATE          3
335 #define NX_PPP_PAP_FAILED_STATE                             4
336 #define NX_PPP_PAP_COMPLETED_STATE                          5
337 
338 
339 /* Define CHAP state machine states.  */
340 
341 #define NX_PPP_CHAP_INITIAL_STATE                           0
342 #define NX_PPP_CHAP_START_STATE                             1
343 #define NX_PPP_CHAP_CHALLENGE_REQUEST_SENT_STATE            2
344 #define NX_PPP_CHAP_CHALLENGE_REQUEST_SENT_BOTH_STATE       3
345 #define NX_PPP_CHAP_CHALLENGE_REQUEST_WAIT_STATE            4
346 #define NX_PPP_CHAP_CHALLENGE_REQUEST_SENT_RESPONDED_STATE  5
347 #define NX_PPP_CHAP_CHALLENGE_RESPONSE_WAIT_STATE           6
348 #define NX_PPP_CHAP_COMPLETED_NEW_STATE                     8
349 #define NX_PPP_CHAP_COMPLETED_NEW_SENT_STATE                9
350 #define NX_PPP_CHAP_CHALLENGE_FAILED_STATE                  10
351 #define NX_PPP_CHAP_COMPLETED_STATE                         11
352 
353 
354 /* Define IPCP state machine states.  */
355 
356 #define NX_PPP_IPCP_INITIAL_STATE                           0
357 #define NX_PPP_IPCP_START_STATE                             1
358 #define NX_PPP_IPCP_CONFIGURE_REQUEST_SENT_STATE            2
359 #define NX_PPP_IPCP_CONFIGURE_REQUEST_ACKED_STATE           3
360 #define NX_PPP_IPCP_PEER_CONFIGURE_REQUEST_ACKED_STATE      4
361 #define NX_PPP_IPCP_STOPPING_STATE                          5
362 #define NX_PPP_IPCP_STOPPED_STATE                           6
363 #define NX_PPP_IPCP_FAILED_STATE                            7
364 #define NX_PPP_IPCP_COMPLETED_STATE                         8
365 
366 
367 /* Define event flags for PPP thread control.  */
368 
369 #define NX_PPP_EVENT_START                                  0x01
370 #define NX_PPP_EVENT_STOP                                   0x02
371 #define NX_PPP_EVENT_PACKET_RECEIVE                         0x04
372 #define NX_PPP_EVENT_RAW_STRING_SEND                        0x08
373 #define NX_PPP_EVENT_IP_PACKET_SEND                         0x10
374 #define NX_PPP_EVENT_CHAP_CHALLENGE                         0x20
375 #define NX_PPP_EVENT_TIMEOUT                                0x40
376 #define NX_PPP_EVENT_PPPOE_PACKET_RECEIVE                   0x80
377 
378 
379 /* Define PPP status return values.  */
380 
381 #define NX_PPP_STATUS_LCP_IN_PROGRESS                       0
382 #define NX_PPP_STATUS_LCP_FAILED                            1
383 #define NX_PPP_STATUS_PAP_IN_PROGRESS                       2
384 #define NX_PPP_STATUS_PAP_FAILED                            3
385 #define NX_PPP_STATUS_CHAP_IN_PROGRESS                      4
386 #define NX_PPP_STATUS_CHAP_FAILED                           5
387 #define NX_PPP_STATUS_IPCP_IN_PROGRESS                      6
388 #define NX_PPP_STATUS_IPCP_FAILED                           7
389 #define NX_PPP_STATUS_ESTABLISHED                           8
390 
391 /* Define NAKed list options */
392 #define NX_PPP_IP_COMPRESSION_OPTION                        0x02
393 #define NX_PPP_IP_ADDRESS_OPTION                            0x03
394 #define NX_PPP_DNS_SERVER_OPTION                            0x81
395 #define NX_PPP_DNS_SECONDARY_SERVER_OPTION                  0x83
396 
397 /* Define the mark for the last octet of protocol field */
398 /* RFC 1661 https://www.rfc-editor.org/rfc/rfc1661#section-6.5:
399    The presence of a binary "1" as the LSB marks the last octet of the Protocol field. */
400 #define NX_PPP_PROTOCOL_LSB_MARK                            0x01
401 
402 
403 /* Define optional debug log.  This is used to capture the PPP traffic for debug
404    purposes.  */
405 
406 typedef struct NX_PPP_DEBUG_ENTRY_STRUCT
407 {
408 
409     ULONG           nx_ppp_debug_entry_time_stamp;
410     UCHAR           nx_ppp_debug_ppp_state;
411     UCHAR           nx_ppp_debug_lcp_state;
412     UCHAR           nx_ppp_debug_pap_state;
413     UCHAR           nx_ppp_debug_chap_state;
414     UCHAR           nx_ppp_debug_ipcp_state;
415     UCHAR           nx_ppp_debug_authenticated;
416     UCHAR           nx_ppp_debug_frame_type;
417     ULONG           nx_ppp_debug_packet_length;
418     UCHAR           nx_ppp_debug_frame[NX_PPP_DEBUG_FRAME_SIZE];
419 } NX_PPP_DEBUG_ENTRY;
420 
421 
422 
423 /* Define the main PPP data structure.  */
424 
425 typedef struct NX_PPP_STRUCT
426 {
427 
428     ULONG           nx_ppp_id;
429     CHAR            *nx_ppp_name;
430     NX_IP           *nx_ppp_ip_ptr;
431     NX_INTERFACE    *nx_ppp_interface_ptr;
432     UINT            nx_ppp_interface_index;
433     NX_PACKET_POOL  *nx_ppp_packet_pool_ptr;
434     UCHAR           nx_ppp_transmit_id;
435     UCHAR           nx_ppp_receive_id;
436     UCHAR           nx_ppp_lcp_echo_reply_id;
437     UCHAR           nx_ppp_reserved;
438     ULONG           nx_ppp_mru;
439     UINT            nx_ppp_server;
440     UINT            nx_ppp_state;
441     UINT            nx_ppp_lcp_state;
442     UINT            nx_ppp_pap_state;
443     UINT            nx_ppp_chap_state;
444     UINT            nx_ppp_ipcp_state;
445     UINT            nx_ppp_authenticated;
446     UINT            nx_ppp_generate_authentication_protocol;
447     UINT            nx_ppp_verify_authentication_protocol;
448     USHORT          nx_ppp_pap_enabled;
449     USHORT          nx_ppp_chap_enabled;
450     CHAR            nx_ppp_chap_challenger_name[NX_PPP_NAME_SIZE + 1];
451     CHAR            nx_ppp_chap_random_value[NX_PPP_VALUE_SIZE + 1];
452     UCHAR           nx_ppp_ipcp_local_ip[4];
453     UCHAR           nx_ppp_ipcp_peer_ip[4];
454     ULONG           nx_ppp_primary_dns_address;
455     ULONG           nx_ppp_secondary_dns_address;
456     UINT            nx_ppp_dns_address_retries;
457     UINT            nx_ppp_secondary_dns_address_retries;
458     ULONG           nx_ppp_timeout;
459     ULONG           nx_ppp_receive_timeouts;
460     ULONG           nx_ppp_protocol_retry_counter;
461 #ifndef NX_PPP_DISABLE_INFO
462     ULONG           nx_ppp_packet_allocate_timeouts;
463     ULONG           nx_ppp_frame_timeouts;
464     ULONG           nx_ppp_internal_errors;
465     ULONG           nx_ppp_frame_crc_errors;
466     ULONG           nx_ppp_packet_overflow;
467     ULONG           nx_ppp_bytes_received;
468     ULONG           nx_ppp_bytes_sent;
469     ULONG           nx_ppp_bytes_dropped;
470     ULONG           nx_ppp_bytes_invalid;
471     ULONG           nx_ppp_total_frames_received;
472     ULONG           nx_ppp_lcp_frames_received;
473     ULONG           nx_ppp_lcp_frames_sent;
474     ULONG           nx_ppp_lcp_configure_requests_sent;
475     ULONG           nx_ppp_lcp_configure_requests_received;
476     ULONG           nx_ppp_lcp_configure_acks_sent;
477     ULONG           nx_ppp_lcp_configure_acks_received;
478     ULONG           nx_ppp_lcp_configure_naks_sent;
479     ULONG           nx_ppp_lcp_configure_naks_received;
480     ULONG           nx_ppp_lcp_configure_rejects_sent;
481     ULONG           nx_ppp_lcp_configure_rejects_received;
482     ULONG           nx_ppp_lcp_terminate_requests_sent;
483     ULONG           nx_ppp_lcp_terminate_requests_received;
484     ULONG           nx_ppp_lcp_terminate_acks_sent;
485     ULONG           nx_ppp_lcp_terminate_acks_received;
486     ULONG           nx_ppp_lcp_code_rejects_sent;
487     ULONG           nx_ppp_lcp_code_rejects_received;
488     ULONG           nx_ppp_lcp_protocol_rejects_sent;
489     ULONG           nx_ppp_lcp_protocol_rejects_received;
490     ULONG           nx_ppp_lcp_echo_requests_sent;
491     ULONG           nx_ppp_lcp_echo_replies_received;
492     ULONG           nx_ppp_lcp_echo_requests_received;
493     ULONG           nx_ppp_lcp_echo_requests_dropped;
494     ULONG           nx_ppp_lcp_echo_replies_sent;
495     ULONG           nx_ppp_lcp_discard_requests_sent;
496     ULONG           nx_ppp_lcp_discard_requests_received;
497     ULONG           nx_ppp_lcp_unknown_requests_received;
498     ULONG           nx_ppp_lcp_state_machine_unhandled_requests;
499     ULONG           nx_ppp_lcp_state_machine_timeouts;
500 #ifndef NX_PPP_DISABLE_PAP
501     ULONG           nx_ppp_pap_frames_received;
502     ULONG           nx_ppp_pap_frames_sent;
503     ULONG           nx_ppp_pap_authenticate_requests_sent;
504     ULONG           nx_ppp_pap_authenticate_requests_received;
505     ULONG           nx_ppp_pap_authenticate_acks_sent;
506     ULONG           nx_ppp_pap_authenticate_acks_received;
507     ULONG           nx_ppp_pap_authenticate_naks_sent;
508     ULONG           nx_ppp_pap_authenticate_naks_received;
509     ULONG           nx_ppp_pap_unknown_requests_received;
510     ULONG           nx_ppp_pap_state_machine_unhandled_requests;
511     ULONG           nx_ppp_pap_state_machine_timeouts;
512 #endif
513 #ifndef NX_PPP_DISABLE_CHAP
514     ULONG           nx_ppp_chap_frames_received;
515     ULONG           nx_ppp_chap_frames_sent;
516     ULONG           nx_ppp_chap_challenge_requests_sent;
517     ULONG           nx_ppp_chap_challenge_requests_received;
518     ULONG           nx_ppp_chap_challenge_responses_sent;
519     ULONG           nx_ppp_chap_challenge_responses_received;
520     ULONG           nx_ppp_chap_challenge_successes_sent;
521     ULONG           nx_ppp_chap_challenge_successes_received;
522     ULONG           nx_ppp_chap_challenge_failures_sent;
523     ULONG           nx_ppp_chap_challenge_failures_received;
524     ULONG           nx_ppp_chap_unknown_requests_received;
525     ULONG           nx_ppp_chap_state_machine_unhandled_requests;
526     ULONG           nx_ppp_chap_state_machine_timeouts;
527 #endif
528     ULONG           nx_ppp_ipcp_frames_received;
529     ULONG           nx_ppp_ipcp_frames_sent;
530     ULONG           nx_ppp_ipcp_configure_requests_sent;
531     ULONG           nx_ppp_ipcp_configure_requests_received;
532     ULONG           nx_ppp_ipcp_configure_acks_sent;
533     ULONG           nx_ppp_ipcp_configure_acks_received;
534     ULONG           nx_ppp_ipcp_configure_naks_sent;
535     ULONG           nx_ppp_ipcp_configure_naks_received;
536     ULONG           nx_ppp_ipcp_configure_rejects_sent;
537     ULONG           nx_ppp_ipcp_configure_rejects_received;
538     ULONG           nx_ppp_ipcp_terminate_requests_sent;
539     ULONG           nx_ppp_ipcp_terminate_requests_received;
540     ULONG           nx_ppp_ipcp_terminate_acks_sent;
541     ULONG           nx_ppp_ipcp_terminate_acks_received;
542     ULONG           nx_ppp_ipcp_unknown_requests_received;
543     ULONG           nx_ppp_ipcp_state_machine_unhandled_requests;
544     ULONG           nx_ppp_ipcp_state_machine_timeouts;
545     ULONG           nx_ppp_ip_frames_received;
546     ULONG           nx_ppp_ip_frames_sent;
547     ULONG           nx_ppp_receive_frames_dropped;
548     ULONG           nx_ppp_transmit_frames_dropped;
549     ULONG           nx_ppp_invalid_frame_id;
550 #endif
551 
552     void            (*nx_ppp_byte_send)(UCHAR byte);
553 
554 #ifdef NX_PPP_PPPOE_ENABLE
555     void            (*nx_ppp_packet_send)(NX_PACKET *packet_ptr);
556 #endif /* NX_PPP_PPPOE_ENABLE  */
557 
558     void            (*nx_ppp_non_ppp_packet_handler)(NX_PACKET *packet_ptr);
559     void            (*nx_ppp_nak_authentication_notify)(void);
560 
561     void            (*nx_ppp_link_up_callback)(struct NX_PPP_STRUCT *ppp_ptr);
562     void            (*nx_ppp_link_down_callback)(struct NX_PPP_STRUCT *ppp_ptr);
563 
564     UINT            (*nx_ppp_pap_verify_login)(CHAR *name, CHAR *password);
565     UINT            (*nx_ppp_pap_generate_login)(CHAR *name, CHAR *password);
566 
567     UINT            (*nx_ppp_chap_get_challenge_values)(CHAR *rand_value, CHAR *id, CHAR *name);
568     UINT            (*nx_ppp_chap_get_responder_values)(CHAR *sys, CHAR *name, CHAR *secret);
569     UINT            (*nx_ppp_chap_get_verification_values)(CHAR *sys, CHAR *name, CHAR *secret);
570     TX_EVENT_FLAGS_GROUP
571                     nx_ppp_event;
572     TX_TIMER        nx_ppp_timer;
573 
574     UCHAR           nx_ppp_serial_buffer[NX_PPP_SERIAL_BUFFER_SIZE];
575     USHORT          nx_ppp_serial_buffer_write_index;
576     USHORT          nx_ppp_serial_buffer_read_index;
577     USHORT          nx_ppp_serial_buffer_byte_count;
578 
579     NX_PACKET       *nx_ppp_receive_partial_packet;
580     ULONG           nx_ppp_receive_buffer_size;
581     UCHAR           *nx_ppp_receive_buffer_ptr;
582 
583     NX_PACKET       *nx_ppp_head_packet;
584 
585 #ifdef NX_PPP_PPPOE_ENABLE
586 
587     /* Define the deferred packet processing queue for driver packet.  */
588     NX_PACKET       *nx_ppp_deferred_received_packet_head,
589                     *nx_ppp_deferred_received_packet_tail;
590 #endif /* NX_PPP_PPPOE_ENABLE  */
591 
592     NX_PACKET       *nx_ppp_raw_packet_queue_head;
593     NX_PACKET       *nx_ppp_raw_packet_queue_tail;
594     ULONG           nx_ppp_raw_packet_queue_count;
595 
596     NX_PACKET       *nx_ppp_ip_packet_queue_head;
597     NX_PACKET       *nx_ppp_ip_packet_queue_tail;
598     ULONG           nx_ppp_ip_packet_queue_count;
599 
600     TX_THREAD       nx_ppp_thread;
601     struct NX_PPP_STRUCT
602                     *nx_ppp_created_next,
603                     *nx_ppp_created_previous;
604 
605     UCHAR           nx_ppp_naked_list[NX_PPP_OPTION_MESSAGE_LENGTH];
606     UCHAR           nx_ppp_peer_naked_list[NX_PPP_OPTION_MESSAGE_LENGTH];
607     UCHAR           nx_ppp_rejected_list[NX_PPP_OPTION_MESSAGE_LENGTH];
608 
609 #ifdef NX_PPP_DEBUG_LOG_ENABLE
610     NX_PPP_DEBUG_ENTRY
611                     nx_ppp_debug_log[NX_PPP_DEBUG_LOG_SIZE];
612     UINT            nx_ppp_debug_log_oldest_index;
613 #endif
614 
615 } NX_PPP;
616 
617 
618 #ifndef NX_PPP_SOURCE_CODE
619 
620 /* Application caller is present, perform API mapping.  */
621 
622 /* Determine if error checking is desired.  If so, map API functions
623    to the appropriate error checking front-ends.  Otherwise, map API
624    functions to the core functions that actually perform the work.
625    Note: error checking is enabled by default.  */
626 
627 #ifdef NX_DISABLE_ERROR_CHECKING
628 
629 /* Services without error checking.  */
630 
631 #define nx_ppp_byte_receive                 _nx_ppp_byte_receive
632 #define nx_ppp_chap_challenge               _nx_ppp_chap_challenge
633 #define nx_ppp_chap_enable                  _nx_ppp_chap_enable
634 #define nx_ppp_create                       _nx_ppp_create
635 #define nx_ppp_delete                       _nx_ppp_delete
636 #define nx_ppp_dns_address_get              _nx_ppp_dns_address_get
637 #define nx_ppp_dns_address_set              _nx_ppp_dns_address_set
638 #define nx_ppp_secondary_dns_address_get    _nx_ppp_secondary_dns_address_get
639 #define nx_ppp_secondary_dns_address_set    _nx_ppp_secondary_dns_address_set
640 #define nx_ppp_driver                       _nx_ppp_driver
641 #define nx_ppp_interface_index_get          _nx_ppp_interface_index_get
642 #define nx_ppp_ip_address_assign            _nx_ppp_ip_address_assign
643 #define nx_ppp_link_down_notify             _nx_ppp_link_down_notify
644 #define nx_ppp_link_up_notify               _nx_ppp_link_up_notify
645 #define nx_ppp_nak_authentication_notify    _nx_ppp_nak_authentication_notify
646 #define nx_ppp_pap_enable                   _nx_ppp_pap_enable
647 #define nx_ppp_raw_string_send              _nx_ppp_raw_string_send
648 #define nx_ppp_start                        _nx_ppp_start
649 #define nx_ppp_stop                         _nx_ppp_stop
650 #define nx_ppp_restart                      _nx_ppp_restart
651 #define nx_ppp_status_get                   _nx_ppp_status_get
652 #define nx_ppp_ping_request                 _nx_ppp_ping_request
653 #ifdef NX_PPP_PPPOE_ENABLE
654 #define nx_ppp_packet_receive               _nx_ppp_packet_receive
655 #define nx_ppp_packet_send_set              _nx_ppp_packet_send_set
656 #endif /* NX_PPP_PPPOE_ENABLE  */
657 
658 #else
659 
660 /* Services with error checking.  */
661 
662 #define nx_ppp_byte_receive                 _nxe_ppp_byte_receive
663 #define nx_ppp_chap_challenge               _nxe_ppp_chap_challenge
664 #define nx_ppp_chap_enable                  _nxe_ppp_chap_enable
665 #define nx_ppp_create                       _nxe_ppp_create
666 #define nx_ppp_delete                       _nxe_ppp_delete
667 #define nx_ppp_dns_address_get              _nxe_ppp_dns_address_get
668 #define nx_ppp_dns_address_set              _nxe_ppp_dns_address_set
669 #define nx_ppp_secondary_dns_address_get    _nxe_ppp_secondary_dns_address_get
670 #define nx_ppp_secondary_dns_address_set    _nxe_ppp_secondary_dns_address_set
671 #define nx_ppp_driver                       _nx_ppp_driver
672 #define nx_ppp_interface_index_get          _nxe_ppp_interface_index_get
673 #define nx_ppp_ip_address_assign            _nxe_ppp_ip_address_assign
674 #define nx_ppp_link_down_notify             _nxe_ppp_link_down_notify
675 #define nx_ppp_link_up_notify               _nxe_ppp_link_up_notify
676 #define nx_ppp_nak_authentication_notify    _nxe_ppp_nak_authentication_notify
677 #define nx_ppp_pap_enable                   _nxe_ppp_pap_enable
678 #define nx_ppp_raw_string_send              _nxe_ppp_raw_string_send
679 #define nx_ppp_start                        _nxe_ppp_start
680 #define nx_ppp_stop                         _nxe_ppp_stop
681 #define nx_ppp_restart                      _nxe_ppp_restart
682 #define nx_ppp_status_get                   _nxe_ppp_status_get
683 #define nx_ppp_ping_request                 _nxe_ppp_ping_request
684 #ifdef NX_PPP_PPPOE_ENABLE
685 #define nx_ppp_packet_receive               _nxe_ppp_packet_receive
686 #define nx_ppp_packet_send_set              _nxe_ppp_packet_send_set
687 #endif /* NX_PPP_PPPOE_ENABLE  */
688 
689 #endif /* NX_DISABLE_ERROR_CHECKING */
690 
691 /* Define the prototypes accessible to the application software.  */
692 
693 UINT    nx_ppp_byte_receive(NX_PPP *ppp_ptr, UCHAR byte);
694 UINT    nx_ppp_chap_challenge(NX_PPP *ppp_ptr);
695 UINT    nx_ppp_chap_enable(NX_PPP *ppp_ptr,
696                UINT (*get_challenge_values)(CHAR *rand_value, CHAR *id, CHAR *name),
697                UINT (*get_responder_values)(CHAR *system, CHAR *name, CHAR *secret),
698                UINT (*get_verification_values)(CHAR *system, CHAR *name, CHAR *secret));
699 UINT    nx_ppp_create(NX_PPP *ppp_ptr, CHAR *name, NX_IP *ip_ptr,
700                VOID *stack_memory_ptr, ULONG stack_size, UINT thread_priority,
701                NX_PACKET_POOL *pool_ptr,
702                void (*ppp_non_ppp_packet_handler)(NX_PACKET *packet_ptr),
703                void (*ppp_byte_send)(UCHAR byte));
704 UINT    nx_ppp_delete(NX_PPP *ppp_ptr);
705 UINT    nx_ppp_dns_address_get(NX_PPP *ppp_ptr, ULONG *dns_address_ptr);
706 UINT    nx_ppp_dns_address_set(NX_PPP *ppp_ptr, ULONG dns_address);
707 UINT    nx_ppp_secondary_dns_address_get(NX_PPP *ppp_ptr, ULONG *secondary_dns_address_ptr);
708 UINT    nx_ppp_secondary_dns_address_set(NX_PPP *ppp_ptr, ULONG secondary_dns_address);
709 void    nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr);
710 UINT    nx_ppp_interface_index_get(NX_PPP *ppp_ptr, UINT *index_ptr);
711 UINT    nx_ppp_ip_address_assign(NX_PPP *ppp_ptr, ULONG local_ip_address, ULONG peer_ip_address);
712 UINT    nx_ppp_link_down_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_down_callback)(NX_PPP *ppp_ptr));
713 UINT    nx_ppp_link_up_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_up_callback)(NX_PPP *ppp_ptr));
714 UINT    nx_ppp_nak_authentication_notify(NX_PPP *ppp_ptr, void (*nak_authentication_notify)(void));
715 UINT    nx_ppp_pap_enable(NX_PPP *ppp_ptr, UINT (*generate_login)(CHAR *name, CHAR *password), UINT (*verify_login)(CHAR *name, CHAR *password));
716 UINT    nx_ppp_raw_string_send(NX_PPP *ppp_ptr, CHAR *string_ptr);
717 UINT    nx_ppp_start(NX_PPP *ppp_ptr);
718 UINT    nx_ppp_stop(NX_PPP *ppp_ptr);
719 UINT    nx_ppp_restart(NX_PPP *ppp_ptr);
720 UINT    nx_ppp_status_get(NX_PPP *ppp_ptr, UINT *status_ptr);
721 UINT    nx_ppp_ping_request(NX_PPP *ppp_ptr, CHAR *data_ptr, ULONG data_size,  ULONG wait_option);
722 #ifdef NX_PPP_PPPOE_ENABLE
723 UINT    nx_ppp_packet_receive(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
724 UINT    nx_ppp_packet_send_set(NX_PPP *ppp_ptr, void (*nx_ppp_packet_send)(NX_PACKET *packet_ptr));
725 #endif /* NX_PPP_PPPOE_ENABLE  */
726 
727 #else /* NX_PPP_SOURCE_CODE  */
728 
729 UINT    _nxe_ppp_byte_receive(NX_PPP *ppp_ptr, UCHAR byte);
730 UINT    _nx_ppp_byte_receive(NX_PPP *ppp_ptr, UCHAR byte);
731 UINT    _nxe_ppp_chap_challenge(NX_PPP *ppp_ptr);
732 UINT    _nx_ppp_chap_challenge(NX_PPP *ppp_ptr);
733 UINT    _nxe_ppp_chap_enable(NX_PPP *ppp_ptr,
734                UINT (*get_challenge_values)(CHAR *rand_value, CHAR *id, CHAR *name),
735                UINT (*get_responder_values)(CHAR *system, CHAR *name, CHAR *secret),
736                UINT (*get_verification_values)(CHAR *system, CHAR *name, CHAR *secret));
737 UINT    _nx_ppp_chap_enable(NX_PPP *ppp_ptr,
738                UINT (*get_challenge_values)(CHAR *rand_value, CHAR *id, CHAR *name),
739                UINT (*get_responder_values)(CHAR *system, CHAR *name, CHAR *secret),
740                UINT (*get_verification_values)(CHAR *system, CHAR *name, CHAR *secret));
741 UINT    _nxe_ppp_create(NX_PPP *ppp_ptr, CHAR *name, NX_IP *ip_ptr,
742                VOID *stack_memory_ptr, ULONG stack_size, UINT thread_priority,
743                NX_PACKET_POOL *pool_ptr,
744                void (*ppp_non_ppp_packet_handler)(NX_PACKET *packet_ptr),
745                void (*ppp_byte_send)(UCHAR byte));
746 UINT    _nx_ppp_create(NX_PPP *ppp_ptr, CHAR *name, NX_IP *ip_ptr,
747                VOID *stack_memory_ptr, ULONG stack_size, UINT thread_priority,
748                NX_PACKET_POOL *pool_ptr,
749                void (*ppp_non_ppp_packet_handler)(NX_PACKET *packet_ptr),
750                void (*ppp_byte_send)(UCHAR byte));
751 UINT    _nxe_ppp_delete(NX_PPP *ppp_ptr);
752 UINT    _nx_ppp_delete(NX_PPP *ppp_ptr);
753 UINT    _nxe_ppp_dns_address_get(NX_PPP *ppp_ptr, ULONG *dns_address_ptr);
754 UINT    _nx_ppp_dns_address_get(NX_PPP *ppp_ptr, ULONG *dns_address_ptr);
755 UINT    _nxe_ppp_dns_address_set(NX_PPP *ppp_ptr, ULONG dns_address);
756 UINT    _nx_ppp_dns_address_set(NX_PPP *ppp_ptr, ULONG dns_address);
757 UINT    _nxe_ppp_secondary_dns_address_get(NX_PPP *ppp_ptr, ULONG *secondary_dns_address_ptr);
758 UINT    _nx_ppp_secondary_dns_address_get(NX_PPP *ppp_ptr, ULONG *secondary_dns_address_ptr);
759 UINT    _nxe_ppp_secondary_dns_address_set(NX_PPP *ppp_ptr, ULONG secondary_dns_address);
760 UINT    _nx_ppp_secondary_dns_address_set(NX_PPP *ppp_ptr, ULONG secondary_dns_address);
761 UINT    _nxe_ppp_interface_index_get(NX_PPP *ppp_ptr, UINT *index_ptr);
762 UINT    _nx_ppp_interface_index_get(NX_PPP *ppp_ptr, UINT *index_ptr);
763 UINT    _nxe_ppp_ip_address_assign(NX_PPP *ppp_ptr, ULONG local_ip_address, ULONG peer_ip_address);
764 UINT    _nx_ppp_ip_address_assign(NX_PPP *ppp_ptr, ULONG local_ip_address, ULONG peer_ip_address);
765 UINT    _nxe_ppp_link_down_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_down_callback)(NX_PPP *ppp_ptr));
766 UINT    _nx_ppp_link_down_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_down_callback)(NX_PPP *ppp_ptr));
767 UINT    _nxe_ppp_link_up_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_up_callback)(NX_PPP *ppp_ptr));
768 UINT    _nx_ppp_link_up_notify(NX_PPP *ppp_ptr, VOID (*ppp_link_up_callback)(NX_PPP *ppp_ptr));
769 UINT    _nxe_ppp_nak_authentication_notify(NX_PPP *ppp_ptr, void (*nak_authentication_notify)(void));
770 UINT    _nx_ppp_nak_authentication_notify(NX_PPP *ppp_ptr, void (*nak_authentication_notify)(void));
771 UINT    _nxe_ppp_pap_enable(NX_PPP *ppp_ptr, UINT (*generate_login)(CHAR *name, CHAR *password), UINT (*verify_login)(CHAR *name, CHAR *password));
772 UINT    _nx_ppp_pap_enable(NX_PPP *ppp_ptr, UINT (*generate_login)(CHAR *name, CHAR *password), UINT (*verify_login)(CHAR *name, CHAR *password));
773 UINT    _nxe_ppp_raw_string_send(NX_PPP *ppp_ptr, CHAR *string_ptr);
774 UINT    _nx_ppp_raw_string_send(NX_PPP *ppp_ptr, CHAR *string_ptr);
775 UINT    _nxe_ppp_start(NX_PPP *ppp_ptr);
776 UINT    _nx_ppp_start(NX_PPP *ppp_ptr);
777 UINT    _nxe_ppp_stop(NX_PPP *ppp_ptr);
778 UINT    _nx_ppp_stop(NX_PPP *ppp_ptr);
779 UINT    _nxe_ppp_restart(NX_PPP *ppp_ptr);
780 UINT    _nx_ppp_restart(NX_PPP *ppp_ptr);
781 UINT    _nxe_ppp_status_get(NX_PPP *ppp_ptr, UINT *status_ptr);
782 UINT    _nx_ppp_status_get(NX_PPP *ppp_ptr, UINT *status_ptr);
783 UINT    _nxe_ppp_ping_request(NX_PPP *ppp_ptr, CHAR *data_ptr, ULONG data_size,  ULONG wait_option);
784 UINT    _nx_ppp_ping_request(NX_PPP *ppp_ptr, CHAR *data_ptr, ULONG data_size,  ULONG wait_option);
785 #ifdef NX_PPP_PPPOE_ENABLE
786 UINT    _nxe_ppp_packet_receive(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
787 UINT    _nx_ppp_packet_receive(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
788 UINT    _nxe_ppp_packet_send_set(NX_PPP *ppp_ptr, VOID (*nx_ppp_packet_send)(NX_PACKET *packet_ptr));
789 UINT    _nx_ppp_packet_send_set(NX_PPP *ppp_ptr, VOID (*nx_ppp_packet_send)(NX_PACKET *packet_ptr));
790 #endif /* NX_PPP_PPPOE_ENABLE  */
791 
792 /* Define internal PPP services. */
793 void    _nx_ppp_thread_entry(ULONG ppp_addr);
794 void    _nx_ppp_driver(NX_IP_DRIVER *driver_req_ptr);
795 void    _nx_ppp_receive_packet_get(NX_PPP *ppp_ptr, NX_PACKET **return_packet_ptr);
796 void    _nx_ppp_receive_packet_process(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
797 void    _nx_ppp_timeout(NX_PPP *ppp_ptr);
798 void    _nx_ppp_timer_entry(ULONG id);
799 void    _nx_ppp_netx_packet_transfer(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
800 void    _nx_ppp_process_deferred_raw_string_send(NX_PPP *ppp_ptr);
801 void    _nx_ppp_process_deferred_ip_packet_send(NX_PPP *ppp_ptr);
802 void    _nx_ppp_lcp_state_machine_update(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
803 void    _nx_ppp_lcp_code_reject(NX_PPP *ppp_ptr, UCHAR *lcp_ptr);
804 void    _nx_ppp_lcp_configure_reply_send(NX_PPP *ppp_ptr, UINT configure_status, UCHAR *lcp_ptr, UCHAR *naked_list, UCHAR *rejected_list);
805 void    _nx_ppp_lcp_configure_request_send(NX_PPP *ppp_ptr);
806 UINT    _nx_ppp_lcp_configuration_retrieve(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr, UCHAR *naked_list, UCHAR *rejected_list, UINT *configure_status);
807 void    _nx_ppp_lcp_nak_configure_list(NX_PPP *ppp_ptr, UCHAR *naked_list);
808 void    _nx_ppp_lcp_terminate_ack_send(NX_PPP *ppp_ptr);
809 void    _nx_ppp_lcp_terminate_request_send(NX_PPP *ppp_ptr);
810 void    _nx_ppp_pap_state_machine_update(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
811 void    _nx_ppp_pap_authentication_request(NX_PPP *ppp_ptr);
812 UINT    _nx_ppp_pap_login_valid(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
813 void    _nx_ppp_pap_authentication_ack(NX_PPP *ppp_ptr);
814 void    _nx_ppp_pap_authentication_nak(NX_PPP *ppp_ptr);
815 void    _nx_ppp_chap_state_machine_update(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
816 void    _nx_ppp_chap_challenge_send(NX_PPP *ppp_ptr);
817 void    _nx_ppp_chap_challenge_respond(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
818 UINT    _nx_ppp_chap_challenge_validate(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
819 void    _nx_ppp_ipcp_state_machine_update(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
820 UINT    _nx_ppp_ipcp_configure_check(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr, UCHAR *naked_list, UCHAR *rejected_list, UCHAR *good_data);
821 void    _nx_ppp_ipcp_configure_request_send(NX_PPP *ppp_ptr, UCHAR *negotiate_list);
822 void    _nx_ppp_ipcp_response_extract(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
823 void    _nx_ppp_ipcp_response_send(NX_PPP *ppp_ptr, UCHAR type, UCHAR *data, UCHAR length, NX_PACKET *cfg_packet_ptr);
824 void    _nx_ppp_ipcp_terminate_send(NX_PPP *ppp_ptr);
825 void    _nx_ppp_ipcp_terminate_ack_send(NX_PPP *ppp_ptr);
826 void    _nx_ppp_packet_transmit(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
827 UINT    _nx_ppp_check_crc(NX_PACKET *packet_ptr);
828 UINT    _nx_ppp_crc_append(NX_PACKET *packet_ptr, UCHAR crc[2]);
829 void    _nx_ppp_debug_log_capture(NX_PPP *ppp_ptr, UCHAR packet_type, NX_PACKET *packet_ptr);
830 void    _nx_ppp_debug_log_capture_protocol(NX_PPP *ppp_ptr);
831 void    _nx_ppp_hash_generator(unsigned char *hvalue,  unsigned char id, unsigned char *secret,  unsigned char *rand_value, UINT length);
832 void    _nx_ppp_lcp_ping_reply(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
833 void    _nx_ppp_lcp_ping_process_echo_reply(NX_PPP *ppp_ptr, NX_PACKET *packet_ptr);
834 
835 #endif /* NX_PPP_SOURCE_CODE */
836 
837 /* Determine if a C++ compiler is being used.  If so, complete the standard
838    C conditional started above.  */
839 #ifdef   __cplusplus
840         }
841 #endif
842 
843 #endif /* NX_PPP_H */
844