Lines Matching refs:option
80 #define TS_WILL 5 /* will option negotiation */
232 * Begin option subnegotiation...
260 * Handle RFC 10xx Telnet linemode option additions
321 suboption(); /* handle sub-option */
356 * Telnet option processing state machine.
406 * peer probably should be buffering until this option state negotiation
411 send_do(int option, int init)
414 if ((do_dont_resp[option] == 0 && his_state_is_will(option)) ||
415 his_want_state_is_will(option))
422 if (option == TELOPT_TM)
423 set_his_want_state_wont(option);
425 set_his_want_state_will(option);
426 do_dont_resp[option]++;
428 (void) output_data("%c%c%c", IAC, DO, option);
430 DIAG(TD_OPTIONS, printoption("td: send do", option));
446 willoption(int option)
455 DIAG(TD_OPTIONS, printoption("td: recv will", option));
457 if (do_dont_resp[option]) {
458 do_dont_resp[option]--;
459 if (do_dont_resp[option] && his_state_is_will(option))
460 do_dont_resp[option]--;
462 if (do_dont_resp[option] == 0) {
463 if (his_want_state_is_wont(option)) {
464 switch (option) {
519 * option, then don't worry peer that we can't
570 set_his_want_state_will(option);
571 send_do(option, 0);
573 do_dont_resp[option]++;
574 send_dont(option, 0);
578 * Option processing that should happen when
582 switch (option) {
589 send_dont(option, 1);
636 set_his_state_will(option);
642 send_dont(int option, int init)
645 if ((do_dont_resp[option] == 0 && his_state_is_wont(option)) ||
646 his_want_state_is_wont(option))
648 set_his_want_state_wont(option);
649 do_dont_resp[option]++;
651 (void) output_data("%c%c%c", IAC, DONT, option);
653 DIAG(TD_OPTIONS, printoption("td: send dont", option));
657 wontoption(int option)
663 DIAG(TD_OPTIONS, printoption("td: recv wont", option));
665 if (do_dont_resp[option]) {
666 do_dont_resp[option]--;
667 if (do_dont_resp[option] && his_state_is_wont(option))
668 do_dont_resp[option]--;
670 if (do_dont_resp[option] == 0) {
671 if (his_want_state_is_will(option)) {
673 switch (option) {
713 * option, then let peer know that we can't
731 * option rather than responding to the request,
759 set_his_want_state_wont(option);
760 if (his_state_is_will(option))
761 send_dont(option, 0);
763 switch (option) {
785 set_his_state_wont(option);
790 send_will(int option, int init)
793 if ((will_wont_resp[option] == 0 && my_state_is_will(option))||
794 my_want_state_is_will(option))
796 set_my_want_state_will(option);
797 will_wont_resp[option]++;
799 (void) output_data("%c%c%c", IAC, WILL, option);
801 DIAG(TD_OPTIONS, printoption("td: send will", option));
816 dooption(int option)
824 DIAG(TD_OPTIONS, printoption("td: recv do", option));
826 if (will_wont_resp[option]) {
827 will_wont_resp[option]--;
828 if (will_wont_resp[option] && my_state_is_will(option))
829 will_wont_resp[option]--;
831 if ((will_wont_resp[option] == 0) && (my_want_state_is_wont(option))) {
832 switch (option) {
895 send_will(option, 0);
896 set_my_want_state_wont(option);
897 set_my_state_wont(option);
902 * When we get a LOGOUT option, respond
932 set_my_want_state_will(option);
933 send_will(option, 0);
935 will_wont_resp[option]++;
936 send_wont(option, 0);
939 set_my_state_will(option);
944 send_wont(int option, int init)
947 if ((will_wont_resp[option] == 0 && my_state_is_wont(option)) ||
948 my_want_state_is_wont(option))
950 set_my_want_state_wont(option);
951 will_wont_resp[option]++;
953 (void) output_data("%c%c%c", IAC, WONT, option);
955 DIAG(TD_OPTIONS, printoption("td: send wont", option));
959 dontoption(int option)
966 DIAG(TD_OPTIONS, printoption("td: recv dont", option));
968 if (will_wont_resp[option]) {
969 will_wont_resp[option]--;
970 if (will_wont_resp[option] && my_state_is_wont(option))
971 will_wont_resp[option]--;
973 if ((will_wont_resp[option] == 0) && (my_want_state_is_will(option))) {
974 switch (option) {
1021 set_my_want_state_wont(option);
1022 if (my_state_is_will(option))
1023 send_wont(option, 0);
1024 set_my_state_wont(option);
1026 send_will(option, 1);
1034 set_my_want_state_wont(option);
1035 if (my_state_is_will(option))
1036 send_wont(option, 0);
1038 set_my_state_wont(option);
1091 * Look at the sub-option buffer, and try to be helpful to the other
1113 if (his_state_is_wont(TELOPT_TSPEED)) /* Ignore if option disabled */
1137 if (his_state_is_wont(TELOPT_TTYPE)) /* Ignore if option disabled */
1164 if (his_state_is_wont(TELOPT_NAWS)) /* Ignore if option disabled */
1189 if (his_state_is_wont(TELOPT_LINEMODE)) /* Ignore if option disabled */
1362 * If the client has sent us a well-formed option,
1560 * because if we received a DO/WILL for an option that we