static inline void to_echo(void) { /* if server requests ECHO, don't agree */ if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; } else if (G.telwish == DONT) return; if (G.telflags & UF_ECHO) { if (G.telwish == WILL) return; } else if (G.telwish == WONT) return; if (G.charmode != CHM_OFF) G.telflags ^= UF_ECHO; if (G.telflags & UF_ECHO) putiac2(DO, TELOPT_ECHO); else putiac2(DONT, TELOPT_ECHO); setConMode(); WriteCS(1, "\r\n"); /* sudden modec */ }
static void to_notsup(char c) { if (G.telwish == WILL) putiac2(DONT, c); else if (G.telwish == DO) putiac2(WONT, c); }
static void to_new_environ(void) { /* Tell server we will (or will not) do AUTOLOGIN */ if (G.autologin) putiac2(WILL, TELOPT_NEW_ENVIRON); else putiac2(WONT, TELOPT_NEW_ENVIRON); }
static void to_ttype(void) { /* Tell server we will (or won't) do TTYPE */ if (G.ttype) putiac2(WILL, TELOPT_TTYPE); else putiac2(WONT, TELOPT_TTYPE); }
static void do_linemode(void) { G.charmode = CHM_TRY; G.telflags &= ~(UF_ECHO | UF_SGA); setConMode(); putiac2(DONT, TELOPT_ECHO); putiac2(DONT, TELOPT_SGA); iacflush(); }
static void will_charmode(void) { G.charmode = CHM_TRY; G.telflags |= (UF_ECHO | UF_SGA); setConMode(); putiac2(DO, TELOPT_ECHO); putiac2(DO, TELOPT_SGA); iacflush(); }
static inline void to_ttype(void) { /* Tell server we will (or won't) do TTYPE */ if(ttype) putiac2(WILL, TELOPT_TTYPE); else putiac2(WONT, TELOPT_TTYPE); return; }
static void to_sga(void) { /* daemon always sends will/wont, client do/dont */ if (G.telflags & UF_SGA) { if (G.telwish == WILL) return; } else if (G.telwish == WONT) return; if ((G.telflags ^= UF_SGA) & UF_SGA) /* toggle */ putiac2(DO, TELOPT_SGA); else putiac2(DONT, TELOPT_SGA); }
static inline void to_naws(void) { /* Tell server we will do NAWS */ putiac2(WILL, TELOPT_NAWS); return; }
static void to_naws(void) { /* Tell server we will do NAWS */ putiac2(WILL, TELOPT_NAWS); }