|
version 1.1.1.1.2.15, 2010/05/20 08:18:41
|
version 1.2.2.1, 2010/06/04 11:46:40
|
|
Line 273 void cliNetInit(const char *csProg, int pty, struct te
|
Line 273 void cliNetInit(const char *csProg, int pty, struct te
|
| * @win = window size of tty |
* @win = window size of tty |
| * return: -1 error, 0 = exit w/^+D, 1 done. |
* return: -1 error, 0 = exit w/^+D, 1 done. |
| */ |
*/ |
| int cliNetExec(cliCommands_t *cmdList, const char *csPrompt, int sock, struct termios *term, struct winsize *win) | int |
| | cliNetExec(cliCommands_t *cmdList, const char *csPrompt, int sock, struct termios *term, struct winsize *win) |
| { |
{ |
| int pty, ret = 0, r, s, alen, attrlen, flg; |
int pty, ret = 0, r, s, alen, attrlen, flg; |
| fd_set fds; |
fd_set fds; |
|
Line 288 int cliNetExec(cliCommands_t *cmdList, const char *csP
|
Line 289 int cliNetExec(cliCommands_t *cmdList, const char *csP
|
| case 0: |
case 0: |
| close(sock); |
close(sock); |
| |
|
| // rl_prep_term_function = cli_Null_Prep_Term; |
|
| rl_getc_function = cli_Net_rl_GetCh; |
|
| |
|
| cliNetInit(getprogname(), STDIN_FILENO, term); |
|
| ret = cliExec(cmdList, csPrompt) < 0 ? 1 : 0; |
ret = cliExec(cmdList, csPrompt) < 0 ? 1 : 0; |
| /* spawn Shell mode */ |
/* spawn Shell mode */ |
| /* |
/* |
|
Line 299 int cliNetExec(cliCommands_t *cmdList, const char *csP
|
Line 296 int cliNetExec(cliCommands_t *cmdList, const char *csP
|
| */ |
*/ |
| _exit(ret); |
_exit(ret); |
| default: |
default: |
| rl_prep_term_function = cli_Null_Prep_Term; |
|
| |
|
| cliNetInit(getprogname(), pty, term); |
|
| |
|
| /* spawn Shell mode */ |
/* spawn Shell mode */ |
| /* |
|
| telnet_SetCmd(Attr + 0, DO, TELOPT_TTYPE); |
|
| telnet_SetCmd(Attr + 1, WILL, TELOPT_ECHO); |
|
| telnet_Set_SubOpt(Attr + 2, TELOPT_LFLOW, LFLOW_OFF, NULL, 0); |
|
| telnet_Set_SubOpt(Attr + 3, TELOPT_LFLOW, LFLOW_RESTART_XON, NULL, 0); |
|
| telnet_SetCmd(Attr + 4, DO, TELOPT_LINEMODE); |
|
| */ |
|
| telnet_SetCmd(Attr + 0, DO, TELOPT_TTYPE); |
telnet_SetCmd(Attr + 0, DO, TELOPT_TTYPE); |
| telnet_SetCmd(Attr + 1, WILL, TELOPT_ECHO); |
telnet_SetCmd(Attr + 1, WILL, TELOPT_ECHO); |
| telnet_Set_SubOpt(Attr + 2, TELOPT_LFLOW, LFLOW_OFF, NULL, 0); |
telnet_Set_SubOpt(Attr + 2, TELOPT_LFLOW, LFLOW_OFF, NULL, 0); |