int timeout = 60; /* default timeout for logins and things */
int paclen = DEFPACLEN; /* default buffer size for outgoing packets */
int tabsize = 8; /* default tabsize for text messages */
+char *connsort = "local"; /* the connection variety */
+
myregex_t iscallreg[] = { /* regexes to determine whether this is a reasonable callsign */
{
unsigned char c;
/* input modes */
- if (in) {
+ if (ending == 0 && in) {
char *p, buf[MAXBUFL];
int r;
*/
void setmode(char *m)
{
- char *connsort = strlower(m);
- if (eq(connsort, "telnet") || eq(connsort, "local") || eq(connsort, "nlonly") {
+ connsort = strlower(m);
+ if (eq(connsort, "telnet") || eq(connsort, "local") || eq(connsort, "nlonly")) {
nl = '\n';
echo = 1;
- mode = eq(connsort, "nlonly") 2 : 1;
+ mode = eq(connsort, "nlonly") ? 2 : 1;
} else if (eq(connsort, "ax25")) {
nl = '\r';
echo = 0;
}
/* this is kludgy, but hey so is the rest of this! */
- if (!eq(connsort, "ax25") && paclen == DEFPACLEN) {
+ if (mode != 0 && paclen == DEFPACLEN) {
paclen = MAXPACLEN;
}
}
void terminate(int i)
{
+#if 0
if (node && send_Z && call) {
send_msg(node, 'Z', "bye", 3);
}
+#endif
signal(SIGALRM, term_timeout);
alarm(10);
/* is this a login? */
if (eq(call, "LOGIN") || eq(call, "login")) {
- chgstate(LOGIN);
- } else if (eq(
char buf[MAXPACLEN+1];
char callsign[MAXCALLSIGN+1];
} else {
struct termios t = in->t;
t.c_lflag &= ~(ECHO|ECHONL|ICANON);
+ t.c_oflag = 0;
if (tcsetattr(0, TCSANOW, &t) < 0)
die("tcsetattr (%d)", errno);
in->echo = echo;
send_msg(node, 'A', connsort, strlen(connsort));
/* main processing loop */
- while (!ending) {
+ while (ending == 0) {
sel_run();
- if (!ending) {
+ if (ending == 0) {
process_stdin();
process_node();
}