Lines Matching defs:tn

202   struct TELNET *tn;
204 tn = calloc(1, sizeof(struct TELNET));
205 if(!tn)
208 Curl_dyn_init(&tn->out, 0xffff);
209 data->req.p.telnet = tn; /* make us known */
211 tn->telrcv_state = CURL_TS_DATA;
214 CURL_SB_CLEAR(tn);
217 tn->us_preferred[CURL_TELOPT_SGA] = CURL_YES;
218 tn->him_preferred[CURL_TELOPT_SGA] = CURL_YES;
225 tn->us_preferred[CURL_TELOPT_BINARY] = CURL_YES;
226 tn->him_preferred[CURL_TELOPT_BINARY] = CURL_YES;
234 tn->him_preferred[CURL_TELOPT_ECHO] = CURL_YES;
247 tn->subnegotiation[CURL_TELOPT_NAWS] = CURL_YES;
254 struct TELNET *tn = data->req.p.telnet;
260 if(tn->us_preferred[i] == CURL_YES)
263 if(tn->him_preferred[i] == CURL_YES)
327 struct TELNET *tn = data->req.p.telnet;
329 switch(tn->him[option]) {
331 tn->him[option] = CURL_WANTYES;
340 switch(tn->himq[option]) {
343 tn->himq[option] = CURL_OPPOSITE;
352 switch(tn->himq[option]) {
357 tn->himq[option] = CURL_EMPTY;
364 switch(tn->him[option]) {
370 tn->him[option] = CURL_WANTNO;
375 switch(tn->himq[option]) {
380 tn->himq[option] = CURL_EMPTY;
386 switch(tn->himq[option]) {
388 tn->himq[option] = CURL_OPPOSITE;
401 struct TELNET *tn = data->req.p.telnet;
402 switch(tn->him[option]) {
404 if(tn->him_preferred[option] == CURL_YES) {
405 tn->him[option] = CURL_YES;
418 switch(tn->himq[option]) {
421 tn->him[option] = CURL_NO;
425 tn->him[option] = CURL_YES;
426 tn->himq[option] = CURL_EMPTY;
432 switch(tn->himq[option]) {
434 tn->him[option] = CURL_YES;
437 tn->him[option] = CURL_WANTNO;
438 tn->himq[option] = CURL_EMPTY;
449 struct TELNET *tn = data->req.p.telnet;
450 switch(tn->him[option]) {
456 tn->him[option] = CURL_NO;
461 switch(tn->himq[option]) {
463 tn->him[option] = CURL_NO;
467 tn->him[option] = CURL_WANTYES;
468 tn->himq[option] = CURL_EMPTY;
475 switch(tn->himq[option]) {
477 tn->him[option] = CURL_NO;
480 tn->him[option] = CURL_NO;
481 tn->himq[option] = CURL_EMPTY;
491 struct TELNET *tn = data->req.p.telnet;
493 switch(tn->us[option]) {
495 tn->us[option] = CURL_WANTYES;
504 switch(tn->usq[option]) {
507 tn->usq[option] = CURL_OPPOSITE;
516 switch(tn->usq[option]) {
521 tn->usq[option] = CURL_EMPTY;
528 switch(tn->us[option]) {
534 tn->us[option] = CURL_WANTNO;
539 switch(tn->usq[option]) {
544 tn->usq[option] = CURL_EMPTY;
550 switch(tn->usq[option]) {
552 tn->usq[option] = CURL_OPPOSITE;
565 struct TELNET *tn = data->req.p.telnet;
566 switch(tn->us[option]) {
568 if(tn->us_preferred[option] == CURL_YES) {
569 tn->us[option] = CURL_YES;
571 if(tn->subnegotiation[option] == CURL_YES)
575 else if(tn->subnegotiation[option] == CURL_YES) {
577 tn->us[option] = CURL_YES;
590 switch(tn->usq[option]) {
593 tn->us[option] = CURL_NO;
597 tn->us[option] = CURL_YES;
598 tn->usq[option] = CURL_EMPTY;
604 switch(tn->usq[option]) {
606 tn->us[option] = CURL_YES;
607 if(tn->subnegotiation[option] == CURL_YES) {
613 tn->us[option] = CURL_WANTNO;
614 tn->himq[option] = CURL_EMPTY;
625 struct TELNET *tn = data->req.p.telnet;
626 switch(tn->us[option]) {
632 tn->us[option] = CURL_NO;
637 switch(tn->usq[option]) {
639 tn->us[option] = CURL_NO;
643 tn->us[option] = CURL_WANTYES;
644 tn->usq[option] = CURL_EMPTY;
651 switch(tn->usq[option]) {
653 tn->us[option] = CURL_NO;
656 tn->us[option] = CURL_NO;
657 tn->usq[option] = CURL_EMPTY;
797 struct TELNET *tn = data->req.p.telnet;
809 beg = curl_slist_append(tn->telnet_vars, buffer);
811 curl_slist_free_all(tn->telnet_vars);
812 tn->telnet_vars = NULL;
815 tn->telnet_vars = beg;
816 tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
834 if(l < sizeof(tn->subopt_ttype)) {
835 strcpy(tn->subopt_ttype, arg);
836 tn->us_preferred[CURL_TELOPT_TTYPE] = CURL_YES;
847 if(l < sizeof(tn->subopt_xdisploc)) {
848 strcpy(tn->subopt_xdisploc, arg);
849 tn->us_preferred[CURL_TELOPT_XDISPLOC] = CURL_YES;
859 beg = curl_slist_append(tn->telnet_vars, arg);
864 tn->telnet_vars = beg;
865 tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;
881 tn->subopt_wsx = (unsigned short)x;
882 tn->subopt_wsy = (unsigned short)y;
883 tn->us_preferred[CURL_TELOPT_NAWS] = CURL_YES;
900 tn->us_preferred[CURL_TELOPT_BINARY] = CURL_NO;
901 tn->him_preferred[CURL_TELOPT_BINARY] = CURL_NO;
920 curl_slist_free_all(tn->telnet_vars);
921 tn->telnet_vars = NULL;
941 struct TELNET *tn = data->req.p.telnet;
944 printsub(data, '<', (unsigned char *)tn->subbuffer, CURL_SB_LEN(tn) + 2);
945 switch(CURL_SB_GET(tn)) {
947 len = strlen(tn->subopt_ttype) + 4 + 2;
950 CURL_TELQUAL_IS, tn->subopt_ttype, CURL_IAC, CURL_SE);
959 len = strlen(tn->subopt_xdisploc) + 4 + 2;
962 CURL_TELQUAL_IS, tn->subopt_xdisploc, CURL_IAC, CURL_SE);
976 for(v = tn->telnet_vars; v; v = v->next) {
1019 struct TELNET *tn = data->req.p.telnet;
1025 CURL_SB_CLEAR(tn);
1026 CURL_SB_ACCUM(tn, CURL_IAC);
1027 CURL_SB_ACCUM(tn, CURL_SB);
1028 CURL_SB_ACCUM(tn, CURL_TELOPT_NAWS);
1031 x = htons(tn->subopt_wsx);
1032 y = htons(tn->subopt_wsy);
1035 CURL_SB_ACCUM(tn, uc1[0]);
1036 CURL_SB_ACCUM(tn, uc1[1]);
1037 CURL_SB_ACCUM(tn, uc2[0]);
1038 CURL_SB_ACCUM(tn, uc2[1]);
1040 CURL_SB_ACCUM(tn, CURL_IAC);
1041 CURL_SB_ACCUM(tn, CURL_SE);
1042 CURL_SB_TERM(tn);
1045 printsub(data, '>', (unsigned char *)tn->subbuffer + 2,
1046 CURL_SB_LEN(tn)-2);
1049 bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer, 3);
1056 send_telnet_data(data, (char *)tn->subbuffer + 3, 4);
1058 bytes_written = swrite(conn->sock[FIRSTSOCKET], tn->subbuffer + 7, 2);
1077 struct TELNET *tn = data->req.p.telnet;
1099 switch(tn->telrcv_state) {
1101 tn->telrcv_state = CURL_TS_DATA;
1111 tn->telrcv_state = CURL_TS_IAC;
1116 tn->telrcv_state = CURL_TS_CR;
1125 tn->telrcv_state = CURL_TS_WILL;
1128 tn->telrcv_state = CURL_TS_WONT;
1131 tn->telrcv_state = CURL_TS_DO;
1134 tn->telrcv_state = CURL_TS_DONT;
1137 CURL_SB_CLEAR(tn);
1138 tn->telrcv_state = CURL_TS_SB;
1141 tn->telrcv_state = CURL_TS_DATA;
1148 tn->telrcv_state = CURL_TS_DATA;
1156 tn->please_negotiate = 1;
1158 tn->telrcv_state = CURL_TS_DATA;
1163 tn->please_negotiate = 1;
1165 tn->telrcv_state = CURL_TS_DATA;
1170 tn->please_negotiate = 1;
1172 tn->telrcv_state = CURL_TS_DATA;
1177 tn->please_negotiate = 1;
1179 tn->telrcv_state = CURL_TS_DATA;
1184 tn->telrcv_state = CURL_TS_SE;
1186 CURL_SB_ACCUM(tn, c);
1201 CURL_SB_ACCUM(tn, CURL_IAC);
1202 CURL_SB_ACCUM(tn, c);
1203 tn->subpointer -= 2;
1204 CURL_SB_TERM(tn);
1208 tn->telrcv_state = CURL_TS_IAC;
1211 CURL_SB_ACCUM(tn, c);
1212 tn->telrcv_state = CURL_TS_SB;
1215 CURL_SB_ACCUM(tn, CURL_IAC);
1216 CURL_SB_ACCUM(tn, CURL_SE);
1217 tn->subpointer -= 2;
1218 CURL_SB_TERM(tn);
1220 tn->telrcv_state = CURL_TS_DATA;
1239 struct TELNET *tn = data->req.p.telnet;
1241 DEBUGASSERT(tn);
1245 Curl_dyn_reset(&tn->out);
1248 result = Curl_dyn_addn(&tn->out, &buffer[i], 1);
1251 result = Curl_dyn_addn(&tn->out, "\xff", 1);
1254 outlen = Curl_dyn_len(&tn->out);
1255 outbuf = Curl_dyn_uptr(&tn->out);
1286 struct TELNET *tn = data->req.p.telnet;
1290 if(!tn)
1293 curl_slist_free_all(tn->telnet_vars);
1294 tn->telnet_vars = NULL;
1295 Curl_dyn_free(&tn->out);
1324 struct TELNET *tn;
1332 tn = data->req.p.telnet;
1492 if(tn->please_negotiate && !tn->already_negotiated) {
1494 tn->already_negotiated = 1;
1583 if(tn->please_negotiate && !tn->already_negotiated) {
1585 tn->already_negotiated = 1;