Dropped ITN support

This commit is contained in:
Michiel Broek
2003-11-08 18:42:37 +00:00
parent e894feadfd
commit f9c6ee79b5
12 changed files with 24 additions and 289 deletions

View File

@@ -175,8 +175,6 @@ int call(faddr *addr)
tcp_mode = TCPMODE_IBN;
} else if (strcmp(protocol, "fido") == 0) {
tcp_mode = TCPMODE_IFC;
} else if (strcmp(protocol, "telnet") == 0) {
tcp_mode = TCPMODE_ITN;
} else {
Syslog('+', "No common TCP/IP protocols for node %s", nlent->name);
free(inetaddr);

View File

@@ -85,11 +85,11 @@ void usage(void)
fprintf(stderr,"-a<inetaddr> <node>\n");
fprintf(stderr,"-n<phone> forced phone number\n");
fprintf(stderr,"-l<ttydevice> forced tty device\n");
fprintf(stderr,"-t<tcpmode> must be one of ifc|itn|ibn, forces TCP/IP\n");
fprintf(stderr,"-t<tcpmode> must be one of ifc|ibn, forces TCP/IP\n");
fprintf(stderr,"-a<inetaddr> supply internet hostname if not in nodelist\n");
fprintf(stderr," <node> should be in domain form, e.g. f11.n22.z3\n");
fprintf(stderr," (this implies master mode)\n");
fprintf(stderr,"\n or: %s tsync|yoohoo|**EMSI_INQC816|-t ibn|-t ifc|-t itn\n",myname);
fprintf(stderr,"\n or: %s tsync|yoohoo|**EMSI_INQC816|-t ibn|-t ifc\n",myname);
fprintf(stderr," (this implies slave mode)\n");
}
@@ -243,9 +243,6 @@ int main(int argc, char *argv[])
if (strncmp(p, "ifc", 3) == 0) {
tcp_mode = TCPMODE_IFC;
protocol = xstrcpy((char *)"fido");
} else if (strncmp(p, "itn", 3) == 0) {
tcp_mode = TCPMODE_ITN;
protocol = xstrcpy((char *)"telnet");
} else if (strncmp(p, "ibn", 3) == 0) {
tcp_mode = TCPMODE_IBN;
protocol = xstrcpy((char *)"binkp");

View File

@@ -44,7 +44,7 @@
#define BINKPORT 24554
#define TELNPORT 23
// #define TELNPORT 23
#define FIDOPORT 60179 /* Eugene G. Crossers birthday */
@@ -59,19 +59,6 @@ extern int carrier;
extern long sentbytes;
extern long rcvdbytes;
extern int Loaded;
char telnet_options[256];
char do_dont_resp[256];
char will_wont_resp[256];
void tel_enter_binary(int rw);
void tel_leave_binary(int rw);
void send_do(register int);
void send_dont(register int);
void send_will(register int);
void send_wont(register int);
static int tcp_is_open = FALSE;
@@ -90,7 +77,6 @@ int opentcp(char *name)
Syslog('+', "Open TCP connection to \"%s\"", MBSE_SS(name));
tcp_is_open = FALSE;
memset(&telnet_options, 0, sizeof(telnet_options));
server.sin_family = AF_INET;
/*
@@ -117,11 +103,6 @@ int opentcp(char *name)
else
server.sin_port = htons(FIDOPORT);
break;
case TCPMODE_ITN: if ((se = getservbyname("telnet", "tcp")))
server.sin_port = se->s_port;
else
server.sin_port = htons(TELNPORT);
break;
case TCPMODE_IBN: if ((se = getservbyname("binkd", "tcp")))
server.sin_port = se->s_port;
else
@@ -179,11 +160,8 @@ int opentcp(char *name)
f_flags=0;
if (tcp_mode == TCPMODE_ITN)
tel_enter_binary(3);
Syslog('+', "Established %s/TCP connection with %s, port %d",
(tcp_mode == TCPMODE_ITN) ? "ITN":(tcp_mode == TCPMODE_IFC) ? "IFC":(tcp_mode == TCPMODE_IBN) ? "IBN":"Unknown",
(tcp_mode == TCPMODE_IFC) ? "IFC":(tcp_mode == TCPMODE_IBN) ? "IBN":"Unknown",
inet_ntoa(server.sin_addr), (int)ntohs(server.sin_port));
c_start = time(NULL);
carrier = TRUE;
@@ -201,9 +179,6 @@ void closetcp(void)
if (!tcp_is_open)
return;
if (tcp_mode == TCPMODE_ITN)
tel_leave_binary(3);
shutdown(fd, 2);
Syslog('d', "SIGHUP => SIG_IGN");
signal(SIGHUP, SIG_IGN);
@@ -239,72 +214,3 @@ void closetcp(void)
}
void tel_enter_binary(int rw)
{
Syslog('d', "Telnet enter binary %d", rw);
if (rw & 1)
send_do(TELOPT_BINARY);
if (rw & 2)
send_will(TELOPT_BINARY);
send_dont(TELOPT_ECHO);
send_do(TELOPT_SGA);
send_dont(TELOPT_RCTE);
send_dont(TELOPT_TTYPE);
send_wont(TELOPT_ECHO);
send_will(TELOPT_SGA);
send_wont(TELOPT_RCTE);
send_wont(TELOPT_TTYPE);
}
void tel_leave_binary(int rw)
{
Syslog('d', "Telnet leave binary %d", rw);
if (rw & 1)
send_dont(TELOPT_BINARY);
if (rw & 2)
send_wont(TELOPT_BINARY);
}
/*
* These routines are in charge of sending option negotiations
* to the other side.
* The basic idea is that we send the negotiation if either side
* is in disagreement as to what the current state should be.
*/
void send_do(register int c)
{
NET2ADD(IAC, DO);
NETADD(c);
}
void send_dont(register int c)
{
NET2ADD(IAC, DONT);
NETADD(c);
}
void send_will(register int c)
{
NET2ADD(IAC, WILL);
NETADD(c);
}
void send_wont(register int c)
{
NET2ADD(IAC, WONT);
NETADD(c);
}

View File

@@ -1,81 +1,10 @@
/* $Id$ */
#ifndef _OPENTCP_H
#define _OPENTCP_H
int opentcp(char *);
void closetcp(void);
#define PUTCHAR(x) tty_putc(x)
#define ClearArray(x) memset((char *)x, 0, sizeof x)
#define NETADD(c) { PUTCHAR(c); }
#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); }
#define MY_STATE_WILL 0x01
#define MY_WANT_STATE_WILL 0x02
#define MY_STATE_DO 0x04
#define MY_WANT_STATE_DO 0x08
#define my_state_is_do(opt) (telnet_options[opt]&MY_STATE_DO)
#define my_state_is_will(opt) (telnet_options[opt]&MY_STATE_WILL)
#define my_want_state_is_do(opt) (telnet_options[opt]&MY_WANT_STATE_DO)
#define my_want_state_is_will(opt) (telnet_options[opt]&MY_WANT_STATE_WILL)
#define my_state_is_dont(opt) (!my_state_is_do(opt))
#define my_state_is_wont(opt) (!my_state_is_will(opt))
#define my_want_state_is_dont(opt) (!my_want_state_is_do(opt))
#define my_want_state_is_wont(opt) (!my_want_state_is_will(opt))
#define set_my_want_state_do(opt) {telnet_options[opt] |= MY_WANT_STATE_DO;}
#define set_my_want_state_will(opt) {telnet_options[opt] |= MY_WANT_STATE_WILL;}
#define set_my_want_state_dont(opt) {telnet_options[opt] &= ~MY_WANT_STATE_DO;}
#define set_my_want_state_wont(opt) {telnet_options[opt] &= ~MY_WANT_STATE_WILL;}
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
#define DO 253 /* please, you use option */
#define WONT 252 /* I won't use option */
#define WILL 251 /* I will use option */
/* telnet options */
#define TELOPT_BINARY 0 /* 8-bit data path */
#define TELOPT_ECHO 1 /* echo */
#define TELOPT_RCP 2 /* prepare to reconnect */
#define TELOPT_SGA 3 /* suppress go ahead */
#define TELOPT_NAMS 4 /* approximate message size */
#define TELOPT_STATUS 5 /* give status */
#define TELOPT_TM 6 /* timing mark */
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
#define TELOPT_NAOL 8 /* negotiate about output line width */
#define TELOPT_NAOP 9 /* negotiate about output page size */
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
#define TELOPT_XASCII 17 /* extended ascic character set */
#define TELOPT_LOGOUT 18 /* force logout */
#define TELOPT_BM 19 /* byte macro */
#define TELOPT_DET 20 /* data entry terminal */
#define TELOPT_SUPDUP 21 /* supdup protocol */
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
#define TELOPT_SNDLOC 23 /* send location */
#define TELOPT_TTYPE 24 /* terminal type */
#define TELOPT_EOR 25 /* end or record */
#define TELOPT_TUID 26 /* TACACS user identification */
#define TELOPT_OUTMRK 27 /* output marking */
#define TELOPT_TTYLOC 28 /* terminal location number */
#define TELOPT_3270REGIME 29 /* 3270 regime */
#define TELOPT_X3PAD 30 /* X.3 PAD */
#define TELOPT_NAWS 31 /* window size */
#define TELOPT_TSPEED 32 /* terminal speed */
#define TELOPT_LFLOW 33 /* remote flow control */
#define TELOPT_LINEMODE 34 /* Linemode option */
#define TELOPT_XDISPLOC 35 /* X Display Location */
#define TELOPT_ENVIRON 36 /* Environment variables */
#define TELOPT_AUTHENTICATION 37/* Authenticate */
#define TELOPT_ENCRYPT 38 /* Encryption option */
#define TELOPT_EXOPL 255 /* extended-options-list */
#endif

View File

@@ -96,9 +96,6 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
if (tcp_mode == TCPMODE_IBN) {
Syslog('+', "Incoming IBN/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
IsDoing("Incoming IBN/TCP");
} else if (tcp_mode == TCPMODE_ITN) {
Syslog('+', "Incoming ITN/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
IsDoing("Incoming ITN/TCP");
} else if (tcp_mode == TCPMODE_IFC) {
Syslog('+', "Incoming IFC/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
IsDoing("Incoming IFC/TCP");
@@ -435,18 +432,6 @@ SM_STATE(sendintro)
if ((localoptions & NOEMSI) == 0) {
PUTSTR((char *)"**EMSI_REQA77E\r\021");
}
// PUTSTR((char *)"\r\rAddress: ");
// PUTSTR(aka2str(CFG.aka[0]));
// PUTSTR((char *)" using mbcico ");
// PUTSTR((char *)VERSION);
// switch (tcp_mode) {
// case TCPMODE_IFC: PUTSTR((char *)"; IFC");
// break;
// case TCPMODE_ITN: PUTSTR((char *)"; ITN");
// break;
// case TCPMODE_IBN: PUTSTR((char *)"; IBN");
// break;
// }
PUTCHAR('\r');
if (STATUS) {
SM_ERROR;

View File

@@ -5,7 +5,6 @@
#define TCPMODE_NONE 0
#define TCPMODE_IFC 1 /* ifcico native EMSI on raw TCP */
#define TCPMODE_ITN 2 /* EMSI encapsulation through telnet */
#define TCPMODE_IBN 3 /* Binkp protocol */
#define SESSION_UNKNOWN 0

View File

@@ -87,78 +87,6 @@
#define TSYNC 0xae
#define YOOHOO 0xf1
/* ### Modifned by T.Tanaka on 4 Dec 1995 */
#define ClearArray(x) memset((char *)x, 0, sizeof x)
#define NETADD(c) { PUTCHAR(c); }
#define NET2ADD(c1,c2) { NETADD(c1); NETADD(c2); }
#define MY_STATE_WILL 0x01
#define MY_WANT_STATE_WILL 0x02
#define MY_STATE_DO 0x04
#define MY_WANT_STATE_DO 0x08
#define my_state_is_do(opt) (telnet_options[opt]&MY_STATE_DO)
#define my_state_is_will(opt) (telnet_options[opt]&MY_STATE_WILL)
#define my_want_state_is_do(opt) (telnet_options[opt]&MY_WANT_STATE_DO)
#define my_want_state_is_will(opt) (telnet_options[opt]&MY_WANT_STATE_WILL)
#define my_state_is_dont(opt) (!my_state_is_do(opt))
#define my_state_is_wont(opt) (!my_state_is_will(opt))
#define my_want_state_is_dont(opt) (!my_want_state_is_do(opt))
#define my_want_state_is_wont(opt) (!my_want_state_is_will(opt))
#define set_my_want_state_do(opt) {telnet_options[opt] |= MY_WANT_STATE_DO;}
#define set_my_want_state_will(opt) {telnet_options[opt] |= MY_WANT_STATE_WILL;}
#define set_my_want_state_dont(opt) {telnet_options[opt] &= ~MY_WANT_STATE_DO;}
#define set_my_want_state_wont(opt) {telnet_options[opt] &= ~MY_WANT_STATE_WILL;}
#define IAC 255 /* interpret as command: */
#define DONT 254 /* you are not to use option */
#define DO 253 /* please, you use option */
#define WONT 252 /* I won't use option */
#define WILL 251 /* I will use option */
/* telnet options */
#define TELOPT_BINARY 0 /* 8-bit data path */
#define TELOPT_ECHO 1 /* echo */
#define TELOPT_RCP 2 /* prepare to reconnect */
#define TELOPT_SGA 3 /* suppress go ahead */
#define TELOPT_NAMS 4 /* approximate message size */
#define TELOPT_STATUS 5 /* give status */
#define TELOPT_TM 6 /* timing mark */
#define TELOPT_RCTE 7 /* remote controlled transmission and echo */
#define TELOPT_NAOL 8 /* negotiate about output line width */
#define TELOPT_NAOP 9 /* negotiate about output page size */
#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */
#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */
#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */
#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */
#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */
#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */
#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */
#define TELOPT_XASCII 17 /* extended ascic character set */
#define TELOPT_LOGOUT 18 /* force logout */
#define TELOPT_BM 19 /* byte macro */
#define TELOPT_DET 20 /* data entry terminal */
#define TELOPT_SUPDUP 21 /* supdup protocol */
#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */
#define TELOPT_SNDLOC 23 /* send location */
#define TELOPT_TTYPE 24 /* terminal type */
#define TELOPT_EOR 25 /* end or record */
#define TELOPT_TUID 26 /* TACACS user identification */
#define TELOPT_OUTMRK 27 /* output marking */
#define TELOPT_TTYLOC 28 /* terminal location number */
#define TELOPT_3270REGIME 29 /* 3270 regime */
#define TELOPT_X3PAD 30 /* X.3 PAD */
#define TELOPT_NAWS 31 /* window size */
#define TELOPT_TSPEED 32 /* terminal speed */
#define TELOPT_LFLOW 33 /* remote flow control */
#define TELOPT_LINEMODE 34 /* Linemode option */
#define TELOPT_XDISPLOC 35 /* X Display Location */
#define TELOPT_ENVIRON 36 /* Environment variables */
#define TELOPT_AUTHENTICATION 37/* Authenticate */
#define TELOPT_ENCRYPT 38 /* Encryption option */
#define TELOPT_EXOPL 255 /* extended-options-list */
/* ### */
extern int tty_status;
extern int tty_resettimer(int tno);