Changeset 48cdb95a in rtems
- Timestamp:
- 04/10/03 16:20:38 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 0d6849e7
- Parents:
- bbd88004
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/libnetworking/ChangeLog
rbbd88004 r48cdb95a 1 2003-04-10 Joel Sherrill <joel@OARcorp.com> 2 3 PR 371/pppd 4 * pppd/auth.c, pppd/chat.c, pppd/demand.c, pppd/fsm.c, pppd/lcp.c, 5 pppd/options.c, pppd/pppd.h, pppd/rtemsmain.c, pppd/rtemspppd.c: 6 Change many symbols to static. There are still global symbols in 7 rtemspppd.h which might need to be changed or converted into member 8 of a structure which is dereferenced with a pointer that is managed 9 as a per task variable. But this patch should avoid many conflicts. 10 1 11 2003-03-18 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 12 -
c/src/libnetworking/pppd/auth.c
rbbd88004 r48cdb95a 250 250 int unit; 251 251 { 252 if (p hase == PHASE_DEAD)252 if (pppd_phase == PHASE_DEAD) 253 253 return; 254 254 if (pap_logout_hook) { … … 284 284 num_np_open = 0; 285 285 num_np_up = 0; 286 if (p hase != PHASE_DEAD)286 if (pppd_phase != PHASE_DEAD) 287 287 new_phase(PHASE_TERMINATE); 288 288 } … … 324 324 warn("peer refused to authenticate: terminating link"); 325 325 lcp_close(unit, "peer refused to authenticate"); 326 status = EXIT_PEER_AUTH_FAILED;326 pppd_status = EXIT_PEER_AUTH_FAILED; 327 327 return; 328 328 } … … 426 426 */ 427 427 lcp_close(unit, "Authentication failed"); 428 status = EXIT_PEER_AUTH_FAILED;428 pppd_status = EXIT_PEER_AUTH_FAILED; 429 429 } 430 430 … … 484 484 */ 485 485 lcp_close(unit, "Failed to authenticate ourselves to peer"); 486 status = EXIT_AUTH_TOPEER_FAILED;486 pppd_status = EXIT_AUTH_TOPEER_FAILED; 487 487 } 488 488 … … 532 532 * At this point we consider that the link has come up successfully. 533 533 */ 534 status = EXIT_OK;534 pppd_status = EXIT_OK; 535 535 unsuccess = 0; 536 536 new_phase(PHASE_RUNNING); … … 604 604 lcp_close(0, "Link inactive"); 605 605 need_holdoff = 0; 606 status = EXIT_IDLE_TIMEOUT;606 pppd_status = EXIT_IDLE_TIMEOUT; 607 607 } else { 608 608 TIMEOUT(check_idle, NULL, tlim); … … 619 619 info("Connect time expired"); 620 620 lcp_close(0, "Connect time expired"); /* Close connection */ 621 status = EXIT_CONNECT_TIME;621 pppd_status = EXIT_CONNECT_TIME; 622 622 } 623 623 -
c/src/libnetworking/pppd/chat.c
rbbd88004 r48cdb95a 141 141 /*************** Micro getopt() *********************************************/ 142 142 143 char *program_name;144 145 143 #define MAX_ABORTS 16 146 144 #define MAX_REPORTS 16 … … 148 146 #define MAX_TIMEOUTS 10 149 147 150 int echo = 0; 151 int quiet = 0; 152 int report = 0; 153 int use_env = 0; 154 int exit_code = 0; 155 char *report_file = (char *) 0; 156 char *chat_file = (char *) 0; 157 char *phone_num = (char *) 0; 158 char *phone_num2 = (char *) 0; 148 static int echo = 0; 149 static int quiet = 0; 150 static int use_env = 0; 151 static int exit_code = 0; 152 static char *phone_num = (char *) 0; 153 static char *phone_num2 = (char *) 0; 159 154 static int ttyfd; 160 155 static int timeout = DEFAULT_CHAT_TIMEOUT; -
c/src/libnetworking/pppd/demand.c
rbbd88004 r48cdb95a 46 46 static const char rcsid[] = RCSID; 47 47 48 char *frame;49 int framelen;50 int framemax;51 int escape_flag;52 int flush_flag;53 int fcs;48 static char *frame; 49 static int framelen; 50 static int framemax; 51 static int escape_flag; 52 static int flush_flag; 53 static int fcs; 54 54 55 55 struct packet { -
c/src/libnetworking/pppd/fsm.c
rbbd88004 r48cdb95a 46 46 #define PROTO_NAME(f) ((f)->callbacks->proto_name) 47 47 48 int peer_mru[NUM_PPP];48 static int peer_mru[NUM_PPP]; 49 49 50 50 -
c/src/libnetworking/pppd/lcp.c
rbbd88004 r48cdb95a 39 39 * LCP-related command-line options. 40 40 */ 41 int lcp_echo_interval = 0; /* Interval between LCP echo-requests */42 int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */43 bool lax_recv = 0; /* accept control chars in asyncmap */41 static int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ 42 static int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ 43 static bool lax_recv = 0; /* accept control chars in asyncmap */ 44 44 45 45 static int setescape __P((char **)); … … 336 336 fsm *f = &lcp_fsm[unit]; 337 337 338 if (p hase != PHASE_DEAD)338 if (pppd_phase != PHASE_DEAD) 339 339 new_phase(PHASE_TERMINATE); 340 340 if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { … … 1064 1064 notice("Serial line is looped back."); 1065 1065 lcp_close(f->unit, "Loopback detected"); 1066 status = EXIT_LOOPBACK;1066 pppd_status = EXIT_LOOPBACK; 1067 1067 } 1068 1068 } else … … 1816 1816 notice("Serial link appears to be disconnected."); 1817 1817 lcp_close(f->unit, "Peer not responding"); 1818 status = EXIT_PEER_DEAD;1818 pppd_status = EXIT_PEER_DEAD; 1819 1819 } 1820 1820 } -
c/src/libnetworking/pppd/options.c
rbbd88004 r48cdb95a 624 624 if ((opt->flags & OPT_PREPASS) == 0 && prepass) 625 625 return 1; 626 if ((opt->flags & OPT_INITONLY) && p hase != PHASE_INITIALIZE) {626 if ((opt->flags & OPT_INITONLY) && pppd_phase != PHASE_INITIALIZE) { 627 627 option_error("it's too late to use the %s option", opt->name); 628 628 return 0; … … 778 778 usage() 779 779 { 780 if (p hase == PHASE_INITIALIZE)780 if (pppd_phase == PHASE_INITIALIZE) 781 781 fprintf(stderr, usage_string, VERSION, PATCHLEVEL, IMPLEMENTATION, 782 progname);782 "rtems_pppd"); 783 783 } 784 784 … … 786 786 * option_error - print a message about an error in an option. 787 787 * The message is logged, and also sent to 788 * stderr if p hase == PHASE_INITIALIZE.788 * stderr if pppd_phase == PHASE_INITIALIZE. 789 789 */ 790 790 void … … 1323 1323 } 1324 1324 1325 if (p hase != PHASE_INITIALIZE) {1325 if (pppd_phase != PHASE_INITIALIZE) { 1326 1326 option_error("device name cannot be changed after initialization"); 1327 1327 return -1; -
c/src/libnetworking/pppd/pppd.h
rbbd88004 r48cdb95a 138 138 */ 139 139 140 extern int kill_link; /* Signal to terminate processing loop */140 extern int pppd_kill_link; /* Signal to terminate processing loop */ 141 141 extern int hungup; /* Physical layer has disconnected */ 142 142 extern int pppifunit; /* Interface unit number */ … … 145 145 extern char hostname[]; /* Our hostname */ 146 146 extern u_char outpacket_buf[]; /* Buffer for outgoing packets */ 147 extern int p hase; /* Current state of link - see values below */147 extern int pppd_phase; /* Current state of link - see values below */ 148 148 extern int baud_rate; /* Current link speed in bits/sec */ 149 extern char *progname; /* Name of this program */150 149 extern int redirect_stderr;/* Connector's stderr should go to file */ 151 150 extern char peer_authname[];/* Authenticated name of peer */ … … 160 159 extern int log_to_fd; /* logging to this fd as well as syslog */ 161 160 extern char *no_ppp_msg; /* message to print if ppp not in kernel */ 162 extern volatile int status; /* exit status for pppd */161 extern volatile int pppd_status; /* exit status for pppd */ 163 162 extern int devnam_fixed; /* can no longer change devnam */ 164 163 extern int unsuccess; /* # unsuccessful connection attempts */ -
c/src/libnetworking/pppd/rtemsmain.c
rbbd88004 r48cdb95a 75 75 int pppifunit; /* Interface unit number */ 76 76 77 char *progname; /* Name of this program */78 77 char hostname[MAXNAMELEN]; /* Our hostname */ 79 78 static char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ … … 88 87 int prepass = 0; /* doing prepass to find device name */ 89 88 int devnam_fixed; /* set while in options.ttyxx file */ 90 volatile int status; /* exit status for pppd */89 volatile int pppd_status; /* exit status for pppd */ 91 90 int unsuccess; /* # unsuccessful connection attempts */ 92 91 int do_callback; /* != 0 if we should do callback next */ … … 103 102 static int real_ttyfd; /* fd for actual serial port (not pty) */ 104 103 105 int p hase; /* where the link is at */106 int kill_link;104 int pppd_phase; /* where the link is at */ 105 int pppd_kill_link; 107 106 int open_ccp_flag; 108 107 … … 196 195 #endif 197 196 198 progname = *argv;199 200 197 201 198 if (!ppp_available()) { … … 238 235 ttyfd = -1; 239 236 real_ttyfd = -1; 240 status = EXIT_OK;237 pppd_status = EXIT_OK; 241 238 ++unsuccess; 242 239 doing_callback = do_callback; … … 261 258 */ 262 259 hungup = 0; 263 kill_link = 0;260 pppd_kill_link = 0; 264 261 connector = doing_callback? callback_script: connect_script; 265 262 if (devnam[0] != 0) { … … 276 273 if (err != EINTR) { 277 274 error("Failed to open %s: %m", devnam); 278 status = EXIT_OPEN_FAILED;275 pppd_status = EXIT_OPEN_FAILED; 279 276 } 280 277 if (!persist || err != EINTR) … … 314 311 if (device_script(ttyfd, DIALER_INIT, initializer) < 0) { 315 312 error("Initializer script failed"); 316 status = EXIT_INIT_FAILED;313 pppd_status = EXIT_INIT_FAILED; 317 314 goto fail; 318 315 } 319 if ( kill_link)316 if (pppd_kill_link) 320 317 goto disconnect; 321 318 … … 326 323 if (device_script(ttyfd, DIALER_CONNECT, connector) < 0) { 327 324 error("Connect script failed"); 328 status = EXIT_CONNECT_FAILED;325 pppd_status = EXIT_CONNECT_FAILED; 329 326 goto fail; 330 327 } 331 if ( kill_link)328 if (pppd_kill_link) 332 329 goto disconnect; 333 330 … … 351 348 if (errno != EINTR) { 352 349 error("Failed to reopen %s: %m", devnam); 353 status = EXIT_OPEN_FAILED;350 pppd_status = EXIT_OPEN_FAILED; 354 351 } 355 if (!persist || errno != EINTR || hungup || kill_link)352 if (!persist || errno != EINTR || hungup || pppd_kill_link) 356 353 goto fail; 357 354 } … … 371 368 fd_ppp = establish_ppp(ttyfd); 372 369 if (fd_ppp < 0) { 373 status = EXIT_FATAL_ERROR;370 pppd_status = EXIT_FATAL_ERROR; 374 371 goto disconnect; 375 372 } … … 391 388 392 389 open_ccp_flag = 0; 393 status = EXIT_NEGOTIATION_FAILED;390 pppd_status = EXIT_NEGOTIATION_FAILED; 394 391 new_phase(PHASE_ESTABLISH); 395 while (p hase != PHASE_DEAD) {392 while (pppd_phase != PHASE_DEAD) { 396 393 wait_input(timeleft(&timo)); 397 394 calltimeout(); 398 395 get_input(); 399 396 400 if ( kill_link) {397 if (pppd_kill_link) { 401 398 lcp_close(0, "User request"); 402 kill_link = 0;399 pppd_kill_link = 0; 403 400 } 404 401 if (open_ccp_flag) { 405 if (p hase == PHASE_NETWORK ||phase == PHASE_RUNNING) {402 if (pppd_phase == PHASE_NETWORK || pppd_phase == PHASE_RUNNING) { 406 403 ccp_fsm[0].flags = OPT_RESTART; /* clears OPT_SILENT */ 407 404 (*ccp_protent.open)(0); … … 451 448 break; 452 449 453 kill_link = 0;450 pppd_kill_link = 0; 454 451 if (demand) 455 452 demand_discard(); … … 464 461 465 462 calltimeout(); 466 if ( kill_link) {467 kill_link = 0;463 if (pppd_kill_link) { 464 pppd_kill_link = 0; 468 465 new_phase(PHASE_DORMANT); /* allow signal to end holdoff */ 469 466 } 470 } while (p hase == PHASE_HOLDOFF);467 } while (pppd_phase == PHASE_HOLDOFF); 471 468 if (!persist) 472 469 break; … … 474 471 } 475 472 476 die( status);477 return status;473 die(pppd_status); 474 return pppd_status; 478 475 } 479 476 … … 592 589 notice("Modem hangup"); 593 590 hungup = 1; 594 status = EXIT_HANGUP;591 pppd_status = EXIT_HANGUP; 595 592 lcp_lowerdown(0); /* serial link is no longer available */ 596 593 link_terminated(0); … … 622 619 * except LCP, LQR and authentication packets. 623 620 */ 624 if (p hase <= PHASE_AUTHENTICATE621 if (pppd_phase <= PHASE_AUTHENTICATE 625 622 && !(protocol == PPP_LCP || protocol == PPP_LQR 626 623 || protocol == PPP_PAP || protocol == PPP_CHAP)) { 627 624 MAINDEBUG(("get_input: discarding proto 0x%x in phase %d", 628 protocol, p hase));625 protocol, pppd_phase)); 629 626 return; 630 627 } … … 664 661 int p; 665 662 { 666 p hase = p;663 pppd_phase = p; 667 664 if (new_phase_hook) 668 665 (*new_phase_hook)(p); -
c/src/libnetworking/pppd/rtemspppd.c
rbbd88004 r48cdb95a 178 178 179 179 /* save current phase value */ 180 prevPhase = p hase;181 p hase = PHASE_INITIALIZE;180 prevPhase = pppd_phase; 181 pppd_phase = PHASE_INITIALIZE; 182 182 183 183 /* process option and reset phase value */ 184 184 iReturn = options_from_list(&option, 1); 185 p hase = prevPhase;185 pppd_phase = prevPhase; 186 186 } 187 187 … … 201 201 /* set pppd global variables to disconnect */ 202 202 persist = 0; 203 kill_link = 1;203 pppd_kill_link = 1; 204 204 } 205 205 -
cpukit/pppd/auth.c
rbbd88004 r48cdb95a 250 250 int unit; 251 251 { 252 if (p hase == PHASE_DEAD)252 if (pppd_phase == PHASE_DEAD) 253 253 return; 254 254 if (pap_logout_hook) { … … 284 284 num_np_open = 0; 285 285 num_np_up = 0; 286 if (p hase != PHASE_DEAD)286 if (pppd_phase != PHASE_DEAD) 287 287 new_phase(PHASE_TERMINATE); 288 288 } … … 324 324 warn("peer refused to authenticate: terminating link"); 325 325 lcp_close(unit, "peer refused to authenticate"); 326 status = EXIT_PEER_AUTH_FAILED;326 pppd_status = EXIT_PEER_AUTH_FAILED; 327 327 return; 328 328 } … … 426 426 */ 427 427 lcp_close(unit, "Authentication failed"); 428 status = EXIT_PEER_AUTH_FAILED;428 pppd_status = EXIT_PEER_AUTH_FAILED; 429 429 } 430 430 … … 484 484 */ 485 485 lcp_close(unit, "Failed to authenticate ourselves to peer"); 486 status = EXIT_AUTH_TOPEER_FAILED;486 pppd_status = EXIT_AUTH_TOPEER_FAILED; 487 487 } 488 488 … … 532 532 * At this point we consider that the link has come up successfully. 533 533 */ 534 status = EXIT_OK;534 pppd_status = EXIT_OK; 535 535 unsuccess = 0; 536 536 new_phase(PHASE_RUNNING); … … 604 604 lcp_close(0, "Link inactive"); 605 605 need_holdoff = 0; 606 status = EXIT_IDLE_TIMEOUT;606 pppd_status = EXIT_IDLE_TIMEOUT; 607 607 } else { 608 608 TIMEOUT(check_idle, NULL, tlim); … … 619 619 info("Connect time expired"); 620 620 lcp_close(0, "Connect time expired"); /* Close connection */ 621 status = EXIT_CONNECT_TIME;621 pppd_status = EXIT_CONNECT_TIME; 622 622 } 623 623 -
cpukit/pppd/chat.c
rbbd88004 r48cdb95a 141 141 /*************** Micro getopt() *********************************************/ 142 142 143 char *program_name;144 145 143 #define MAX_ABORTS 16 146 144 #define MAX_REPORTS 16 … … 148 146 #define MAX_TIMEOUTS 10 149 147 150 int echo = 0; 151 int quiet = 0; 152 int report = 0; 153 int use_env = 0; 154 int exit_code = 0; 155 char *report_file = (char *) 0; 156 char *chat_file = (char *) 0; 157 char *phone_num = (char *) 0; 158 char *phone_num2 = (char *) 0; 148 static int echo = 0; 149 static int quiet = 0; 150 static int use_env = 0; 151 static int exit_code = 0; 152 static char *phone_num = (char *) 0; 153 static char *phone_num2 = (char *) 0; 159 154 static int ttyfd; 160 155 static int timeout = DEFAULT_CHAT_TIMEOUT; -
cpukit/pppd/demand.c
rbbd88004 r48cdb95a 46 46 static const char rcsid[] = RCSID; 47 47 48 char *frame;49 int framelen;50 int framemax;51 int escape_flag;52 int flush_flag;53 int fcs;48 static char *frame; 49 static int framelen; 50 static int framemax; 51 static int escape_flag; 52 static int flush_flag; 53 static int fcs; 54 54 55 55 struct packet { -
cpukit/pppd/fsm.c
rbbd88004 r48cdb95a 46 46 #define PROTO_NAME(f) ((f)->callbacks->proto_name) 47 47 48 int peer_mru[NUM_PPP];48 static int peer_mru[NUM_PPP]; 49 49 50 50 -
cpukit/pppd/lcp.c
rbbd88004 r48cdb95a 39 39 * LCP-related command-line options. 40 40 */ 41 int lcp_echo_interval = 0; /* Interval between LCP echo-requests */42 int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */43 bool lax_recv = 0; /* accept control chars in asyncmap */41 static int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ 42 static int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ 43 static bool lax_recv = 0; /* accept control chars in asyncmap */ 44 44 45 45 static int setescape __P((char **)); … … 336 336 fsm *f = &lcp_fsm[unit]; 337 337 338 if (p hase != PHASE_DEAD)338 if (pppd_phase != PHASE_DEAD) 339 339 new_phase(PHASE_TERMINATE); 340 340 if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { … … 1064 1064 notice("Serial line is looped back."); 1065 1065 lcp_close(f->unit, "Loopback detected"); 1066 status = EXIT_LOOPBACK;1066 pppd_status = EXIT_LOOPBACK; 1067 1067 } 1068 1068 } else … … 1816 1816 notice("Serial link appears to be disconnected."); 1817 1817 lcp_close(f->unit, "Peer not responding"); 1818 status = EXIT_PEER_DEAD;1818 pppd_status = EXIT_PEER_DEAD; 1819 1819 } 1820 1820 } -
cpukit/pppd/options.c
rbbd88004 r48cdb95a 624 624 if ((opt->flags & OPT_PREPASS) == 0 && prepass) 625 625 return 1; 626 if ((opt->flags & OPT_INITONLY) && p hase != PHASE_INITIALIZE) {626 if ((opt->flags & OPT_INITONLY) && pppd_phase != PHASE_INITIALIZE) { 627 627 option_error("it's too late to use the %s option", opt->name); 628 628 return 0; … … 778 778 usage() 779 779 { 780 if (p hase == PHASE_INITIALIZE)780 if (pppd_phase == PHASE_INITIALIZE) 781 781 fprintf(stderr, usage_string, VERSION, PATCHLEVEL, IMPLEMENTATION, 782 progname);782 "rtems_pppd"); 783 783 } 784 784 … … 786 786 * option_error - print a message about an error in an option. 787 787 * The message is logged, and also sent to 788 * stderr if p hase == PHASE_INITIALIZE.788 * stderr if pppd_phase == PHASE_INITIALIZE. 789 789 */ 790 790 void … … 1323 1323 } 1324 1324 1325 if (p hase != PHASE_INITIALIZE) {1325 if (pppd_phase != PHASE_INITIALIZE) { 1326 1326 option_error("device name cannot be changed after initialization"); 1327 1327 return -1; -
cpukit/pppd/pppd.h
rbbd88004 r48cdb95a 138 138 */ 139 139 140 extern int kill_link; /* Signal to terminate processing loop */140 extern int pppd_kill_link; /* Signal to terminate processing loop */ 141 141 extern int hungup; /* Physical layer has disconnected */ 142 142 extern int pppifunit; /* Interface unit number */ … … 145 145 extern char hostname[]; /* Our hostname */ 146 146 extern u_char outpacket_buf[]; /* Buffer for outgoing packets */ 147 extern int p hase; /* Current state of link - see values below */147 extern int pppd_phase; /* Current state of link - see values below */ 148 148 extern int baud_rate; /* Current link speed in bits/sec */ 149 extern char *progname; /* Name of this program */150 149 extern int redirect_stderr;/* Connector's stderr should go to file */ 151 150 extern char peer_authname[];/* Authenticated name of peer */ … … 160 159 extern int log_to_fd; /* logging to this fd as well as syslog */ 161 160 extern char *no_ppp_msg; /* message to print if ppp not in kernel */ 162 extern volatile int status; /* exit status for pppd */161 extern volatile int pppd_status; /* exit status for pppd */ 163 162 extern int devnam_fixed; /* can no longer change devnam */ 164 163 extern int unsuccess; /* # unsuccessful connection attempts */ -
cpukit/pppd/rtemsmain.c
rbbd88004 r48cdb95a 75 75 int pppifunit; /* Interface unit number */ 76 76 77 char *progname; /* Name of this program */78 77 char hostname[MAXNAMELEN]; /* Our hostname */ 79 78 static char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ … … 88 87 int prepass = 0; /* doing prepass to find device name */ 89 88 int devnam_fixed; /* set while in options.ttyxx file */ 90 volatile int status; /* exit status for pppd */89 volatile int pppd_status; /* exit status for pppd */ 91 90 int unsuccess; /* # unsuccessful connection attempts */ 92 91 int do_callback; /* != 0 if we should do callback next */ … … 103 102 static int real_ttyfd; /* fd for actual serial port (not pty) */ 104 103 105 int p hase; /* where the link is at */106 int kill_link;104 int pppd_phase; /* where the link is at */ 105 int pppd_kill_link; 107 106 int open_ccp_flag; 108 107 … … 196 195 #endif 197 196 198 progname = *argv;199 200 197 201 198 if (!ppp_available()) { … … 238 235 ttyfd = -1; 239 236 real_ttyfd = -1; 240 status = EXIT_OK;237 pppd_status = EXIT_OK; 241 238 ++unsuccess; 242 239 doing_callback = do_callback; … … 261 258 */ 262 259 hungup = 0; 263 kill_link = 0;260 pppd_kill_link = 0; 264 261 connector = doing_callback? callback_script: connect_script; 265 262 if (devnam[0] != 0) { … … 276 273 if (err != EINTR) { 277 274 error("Failed to open %s: %m", devnam); 278 status = EXIT_OPEN_FAILED;275 pppd_status = EXIT_OPEN_FAILED; 279 276 } 280 277 if (!persist || err != EINTR) … … 314 311 if (device_script(ttyfd, DIALER_INIT, initializer) < 0) { 315 312 error("Initializer script failed"); 316 status = EXIT_INIT_FAILED;313 pppd_status = EXIT_INIT_FAILED; 317 314 goto fail; 318 315 } 319 if ( kill_link)316 if (pppd_kill_link) 320 317 goto disconnect; 321 318 … … 326 323 if (device_script(ttyfd, DIALER_CONNECT, connector) < 0) { 327 324 error("Connect script failed"); 328 status = EXIT_CONNECT_FAILED;325 pppd_status = EXIT_CONNECT_FAILED; 329 326 goto fail; 330 327 } 331 if ( kill_link)328 if (pppd_kill_link) 332 329 goto disconnect; 333 330 … … 351 348 if (errno != EINTR) { 352 349 error("Failed to reopen %s: %m", devnam); 353 status = EXIT_OPEN_FAILED;350 pppd_status = EXIT_OPEN_FAILED; 354 351 } 355 if (!persist || errno != EINTR || hungup || kill_link)352 if (!persist || errno != EINTR || hungup || pppd_kill_link) 356 353 goto fail; 357 354 } … … 371 368 fd_ppp = establish_ppp(ttyfd); 372 369 if (fd_ppp < 0) { 373 status = EXIT_FATAL_ERROR;370 pppd_status = EXIT_FATAL_ERROR; 374 371 goto disconnect; 375 372 } … … 391 388 392 389 open_ccp_flag = 0; 393 status = EXIT_NEGOTIATION_FAILED;390 pppd_status = EXIT_NEGOTIATION_FAILED; 394 391 new_phase(PHASE_ESTABLISH); 395 while (p hase != PHASE_DEAD) {392 while (pppd_phase != PHASE_DEAD) { 396 393 wait_input(timeleft(&timo)); 397 394 calltimeout(); 398 395 get_input(); 399 396 400 if ( kill_link) {397 if (pppd_kill_link) { 401 398 lcp_close(0, "User request"); 402 kill_link = 0;399 pppd_kill_link = 0; 403 400 } 404 401 if (open_ccp_flag) { 405 if (p hase == PHASE_NETWORK ||phase == PHASE_RUNNING) {402 if (pppd_phase == PHASE_NETWORK || pppd_phase == PHASE_RUNNING) { 406 403 ccp_fsm[0].flags = OPT_RESTART; /* clears OPT_SILENT */ 407 404 (*ccp_protent.open)(0); … … 451 448 break; 452 449 453 kill_link = 0;450 pppd_kill_link = 0; 454 451 if (demand) 455 452 demand_discard(); … … 464 461 465 462 calltimeout(); 466 if ( kill_link) {467 kill_link = 0;463 if (pppd_kill_link) { 464 pppd_kill_link = 0; 468 465 new_phase(PHASE_DORMANT); /* allow signal to end holdoff */ 469 466 } 470 } while (p hase == PHASE_HOLDOFF);467 } while (pppd_phase == PHASE_HOLDOFF); 471 468 if (!persist) 472 469 break; … … 474 471 } 475 472 476 die( status);477 return status;473 die(pppd_status); 474 return pppd_status; 478 475 } 479 476 … … 592 589 notice("Modem hangup"); 593 590 hungup = 1; 594 status = EXIT_HANGUP;591 pppd_status = EXIT_HANGUP; 595 592 lcp_lowerdown(0); /* serial link is no longer available */ 596 593 link_terminated(0); … … 622 619 * except LCP, LQR and authentication packets. 623 620 */ 624 if (p hase <= PHASE_AUTHENTICATE621 if (pppd_phase <= PHASE_AUTHENTICATE 625 622 && !(protocol == PPP_LCP || protocol == PPP_LQR 626 623 || protocol == PPP_PAP || protocol == PPP_CHAP)) { 627 624 MAINDEBUG(("get_input: discarding proto 0x%x in phase %d", 628 protocol, p hase));625 protocol, pppd_phase)); 629 626 return; 630 627 } … … 664 661 int p; 665 662 { 666 p hase = p;663 pppd_phase = p; 667 664 if (new_phase_hook) 668 665 (*new_phase_hook)(p); -
cpukit/pppd/rtemspppd.c
rbbd88004 r48cdb95a 178 178 179 179 /* save current phase value */ 180 prevPhase = p hase;181 p hase = PHASE_INITIALIZE;180 prevPhase = pppd_phase; 181 pppd_phase = PHASE_INITIALIZE; 182 182 183 183 /* process option and reset phase value */ 184 184 iReturn = options_from_list(&option, 1); 185 p hase = prevPhase;185 pppd_phase = prevPhase; 186 186 } 187 187 … … 201 201 /* set pppd global variables to disconnect */ 202 202 persist = 0; 203 kill_link = 1;203 pppd_kill_link = 1; 204 204 } 205 205
Note: See TracChangeset
for help on using the changeset viewer.