Updates for telnet protocol calls
This commit is contained in:
@@ -176,11 +176,9 @@ int call(faddr *addr)
|
||||
tcp_mode = TCPMODE_IBN;
|
||||
} else if (strcmp(protocol, "fido") == 0) {
|
||||
tcp_mode = TCPMODE_IFC;
|
||||
#ifdef USE_TELNET
|
||||
} else if (strcmp(protocol, "telnet") == 0) {
|
||||
tcp_mode = TCPMODE_ITN;
|
||||
telnet = TRUE;
|
||||
#endif
|
||||
} else {
|
||||
Syslog('+', "No common TCP/IP protocols for node %s", nlent->name);
|
||||
free(inetaddr);
|
||||
|
@@ -83,19 +83,12 @@ void usage(void)
|
||||
{
|
||||
fprintf(stderr,"ifcico; (c) Eugene G. Crosser, 1993-1997\n");
|
||||
fprintf(stderr,"mbcico ver. %s; (c) %s\n\n", VERSION, SHORTRIGHT);
|
||||
fprintf(stderr,"-a<inetaddr> <node>\n");
|
||||
fprintf(stderr,"-n<phone> forced phone number\n");
|
||||
fprintf(stderr,"-l<ttydevice> forced tty device\n");
|
||||
#ifdef USE_TELNET
|
||||
fprintf(stderr,"-t<tcpmode> must be one of ifc|itn|ibn, forces TCP/IP\n");
|
||||
#else
|
||||
fprintf(stderr,"-t<tcpmode> must be one of ifc|ibn, forces TCP/IP\n");
|
||||
#endif
|
||||
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\n",myname);
|
||||
fprintf(stderr," (this implies slave mode)\n");
|
||||
fprintf(stderr,"mbcico [-a inetaddr[:port]] [-n phone] [-l tty] [-t ibn|-t ifc|-t itn] node\n");
|
||||
fprintf(stderr,"node should be in domain form, e.g. f11.n22.z3\n");
|
||||
fprintf(stderr," (this implies master mode)\n");
|
||||
fprintf(stderr," or:\n");
|
||||
fprintf(stderr,"mbcico tsync|yoohoo|**EMSI_INQC816|-t ibn|-t ifc|-t itn\n");
|
||||
fprintf(stderr," (this implies slave mode)\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +246,7 @@ int main(int argc, char *argv[])
|
||||
protocol = xstrcpy((char *)"binkp");
|
||||
} else if (strncmp(p, "itn", 3) == 0) {
|
||||
tcp_mode = TCPMODE_ITN;
|
||||
protocol = xstrcpy((char *)"tfido");
|
||||
protocol = xstrcpy((char *)"telnet");
|
||||
telnet = TRUE;
|
||||
} else {
|
||||
usage();
|
||||
|
@@ -103,13 +103,11 @@ int opentcp(char *name)
|
||||
else
|
||||
server.sin_port = htons(FIDOPORT);
|
||||
break;
|
||||
#ifdef USE_TELNET
|
||||
case TCPMODE_ITN: if ((se = getservbyname("tfido", "tcp")))
|
||||
case TCPMODE_ITN: if ((se = getservbyname("telnet", "tcp")))
|
||||
server.sin_port = se->s_port;
|
||||
else
|
||||
server.sin_port = htons(TELNPORT);
|
||||
break;
|
||||
#endif
|
||||
case TCPMODE_IBN: if ((se = getservbyname("binkd", "tcp")))
|
||||
server.sin_port = se->s_port;
|
||||
else
|
||||
|
@@ -52,9 +52,7 @@
|
||||
|
||||
|
||||
extern int tcp_mode;
|
||||
#ifdef USE_TELNET
|
||||
extern int telnet;
|
||||
#endif
|
||||
|
||||
|
||||
node *nlent;
|
||||
@@ -104,11 +102,9 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
|
||||
} else if (tcp_mode == TCPMODE_IFC) {
|
||||
Syslog('+', "Incoming IFC/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
|
||||
IsDoing("Incoming IFC/TCP");
|
||||
#ifdef USE_TELNET
|
||||
} else if (tcp_mode == TCPMODE_ITN) {
|
||||
Syslog('+', "Incoming ITN/TCP connection from %s", inet_ntoa(peeraddr.sin_addr));
|
||||
IsDoing("Incoming ITN/TCP");
|
||||
#endif
|
||||
} else if (tcp_mode == TCPMODE_NONE) {
|
||||
WriteError("Unknown TCP connection, parameter missing");
|
||||
die(MBERR_COMMANDLINE);
|
||||
@@ -116,10 +112,8 @@ int session(faddr *a, node *nl, int role, int tp, char *dt)
|
||||
}
|
||||
session_flags |= SESSION_TCP;
|
||||
}
|
||||
#ifdef USE_TELNET
|
||||
if (telnet && (session_flags & SESSION_TCP))
|
||||
telnet_init();
|
||||
#endif
|
||||
|
||||
if (data)
|
||||
free(data);
|
||||
|
Reference in New Issue
Block a user