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