Logfile fixes for mbcico

This commit is contained in:
Michiel Broek 2002-04-20 20:23:22 +00:00
parent cefd9187b5
commit 61788737a5
6 changed files with 9 additions and 37 deletions

View File

@ -310,18 +310,15 @@ SM_EDECL
databuf = xstrcpy(intro); databuf = xstrcpy(intro);
SM_START(checkpkt) SM_START(checkpkt)
Syslog('I', "rxemsi START");
Syslog('i', "RXEMSI: start"); Syslog('i', "RXEMSI: start");
SM_STATE(waitpkt) SM_STATE(waitpkt)
Syslog('I', "rxemsi WAITPKT");
standby = 0; standby = 0;
SM_PROCEED(waitchar); SM_PROCEED(waitchar);
SM_STATE(waitchar) SM_STATE(waitchar)
Syslog('I', "rxemsi WAITCHAR");
c = GETCHAR(5); c = GETCHAR(5);
if (c == TIMEOUT) { if (c == TIMEOUT) {
if (++tries > 9) { if (++tries > 9) {
@ -359,7 +356,6 @@ SM_STATE(waitchar)
SM_STATE(checkemsi) SM_STATE(checkemsi)
Syslog('I', "rxemsi CHECKEMSI");
Syslog('i', "RXEMSI: rcvd %s", printable(buf, 0)); Syslog('i', "RXEMSI: rcvd %s", printable(buf, 0));
if (strncasecmp(buf, "EMSI_DAT",8) == 0) { if (strncasecmp(buf, "EMSI_DAT",8) == 0) {
@ -375,8 +371,6 @@ SM_STATE(checkemsi)
SM_STATE(getdat) SM_STATE(getdat)
Syslog('I', "rxemsi GETDAT");
if (sscanf(buf+8,"%04x",&len) != 1) { if (sscanf(buf+8,"%04x",&len) != 1) {
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
} }
@ -406,7 +400,6 @@ SM_STATE(getdat)
SM_STATE(checkpkt) SM_STATE(checkpkt)
Syslog('I', "rxemsi CHECKPKT");
if (strncasecmp(databuf,"EMSI_DAT",8) == 0) { if (strncasecmp(databuf,"EMSI_DAT",8) == 0) {
SM_PROCEED(checkdat); SM_PROCEED(checkdat);
} }
@ -422,13 +415,11 @@ SM_STATE(checkpkt)
} else if (strncasecmp(databuf, "EMSI_INQ", 8) == 0) { } else if (strncasecmp(databuf, "EMSI_INQ", 8) == 0) {
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
} else { } else {
Syslog('I', "RXEMSI: ignore packet \"%s\"",databuf);
SM_PROCEED(waitpkt); SM_PROCEED(waitpkt);
} }
SM_STATE(checkdat) SM_STATE(checkdat)
Syslog('I', "rxemsi CHECKDAT");
sscanf(databuf + 8, "%04x", &len); sscanf(databuf + 8, "%04x", &len);
if (len != (strlen(databuf) - 16)) { if (len != (strlen(databuf) - 16)) {
Syslog('+', "Bad EMSI_DAT length: %d/%d", len, strlen(databuf)); Syslog('+', "Bad EMSI_DAT length: %d/%d", len, strlen(databuf));
@ -453,7 +444,6 @@ SM_STATE(checkdat)
SM_STATE(sendnak) SM_STATE(sendnak)
Syslog('I', "rxemsi SENDNAK");
if (++tries > 9) { if (++tries > 9) {
Syslog('+', "Too many tries getting EMSI_DAT"); Syslog('+', "Too many tries getting EMSI_DAT");
SM_ERROR; SM_ERROR;
@ -472,14 +462,12 @@ SM_STATE(sendnak)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('I', "rxemsi SENDACK");
Syslog('i', "RXEMSI: send **EMSI_ACKA490 (2 times)"); Syslog('i', "RXEMSI: send **EMSI_ACKA490 (2 times)");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
SM_SUCCESS; SM_SUCCESS;
SM_END SM_END
Syslog('I', "rxemsi END");
Syslog('i', "RXEMSI: end"); Syslog('i', "RXEMSI: end");
free(databuf); free(databuf);
@ -518,7 +506,6 @@ SM_START(senddata)
SM_STATE(senddata) SM_STATE(senddata)
Syslog('I', "txemsi SENDDATA");
p = mkemsidat(caller); p = mkemsidat(caller);
PUTCHAR('*'); PUTCHAR('*');
PUTCHAR('*'); PUTCHAR('*');
@ -531,13 +518,11 @@ SM_STATE(senddata)
SM_STATE(waitpkt) SM_STATE(waitpkt)
Syslog('I', "txemsi WAITPKT");
standby = 0; standby = 0;
SM_PROCEED(waitchar); SM_PROCEED(waitchar);
SM_STATE(waitchar) SM_STATE(waitchar)
Syslog('I', "txemsi WAITCHAR");
c = GETCHAR(8); c = GETCHAR(8);
if (c == TIMEOUT) { if (c == TIMEOUT) {
if (++tries > 9) { if (++tries > 9) {
@ -575,7 +560,6 @@ SM_STATE(waitchar)
SM_STATE(checkpkt) SM_STATE(checkpkt)
Syslog('I', "txemsi CHECKPKT");
Syslog('i', "TXEMSI: rcvd %s", buf); Syslog('i', "TXEMSI: rcvd %s", buf);
if (strncasecmp(buf, "EMSI_DAT", 8) == 0) { if (strncasecmp(buf, "EMSI_DAT", 8) == 0) {
SM_PROCEED(sendack); SM_PROCEED(sendack);
@ -598,7 +582,6 @@ SM_STATE(checkpkt)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('I', "txemsi SENDACK");
Syslog('i', "TXEMSI: send **EMSI_ACKA490 (2 times)"); Syslog('i', "TXEMSI: send **EMSI_ACKA490 (2 times)");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");
PUTSTR((char *)"**EMSI_ACKA490\r\021"); PUTSTR((char *)"**EMSI_ACKA490\r\021");

View File

@ -86,7 +86,6 @@ SM_START(waitchar)
SM_STATE(sendnak) SM_STATE(sendnak)
Syslog('X', "m7recv SENDNAK count=%d", count);
if (count++ > 20) { if (count++ > 20) {
Syslog('+', "Too many tries getting modem7 name"); Syslog('+', "Too many tries getting modem7 name");
SM_ERROR; SM_ERROR;
@ -103,37 +102,33 @@ SM_STATE(sendnak)
SM_STATE(waitack) SM_STATE(waitack)
Syslog('X', "m7recv WAITACK");
c = GETCHAR(5); c = GETCHAR(5);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('X', "m7 got timeout waiting for ACK"); Syslog('x', "m7 got timeout waiting for ACK");
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
} else if (c < 0) { } else if (c < 0) {
SM_ERROR; SM_ERROR;
} else { } else {
Syslog('X', "Got 0x%02x %s", c, printablec(c));
switch (c) { switch (c) {
case ACK: SM_PROCEED(waitchar); case ACK: SM_PROCEED(waitchar);
break; break;
case EOT: last=1; case EOT: last=1;
SM_SUCCESS; SM_SUCCESS;
break; break;
default: Syslog('X', "m7 got '%s' waiting for ACK", printablec(c)); default: Syslog('x', "m7 got '%s' waiting for ACK", printablec(c));
break; break;
} }
} }
SM_STATE(waitchar) SM_STATE(waitchar)
Syslog('X', "m7recv WAITCHAR");
c = GETCHAR(1); c = GETCHAR(1);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('X', "m7 got timeout waiting for char",c); Syslog('x', "m7 got timeout waiting for char",c);
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
} else if (c < 0) { } else if (c < 0) {
SM_ERROR; SM_ERROR;
} else { } else {
Syslog('X', "Got 0x%02x %s", c, printablec(c));
switch (c) { switch (c) {
case EOT: last=1; case EOT: last=1;
SM_SUCCESS; SM_SUCCESS;
@ -159,22 +154,19 @@ SM_STATE(waitchar)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('X', "m7recv SENDACK");
PUTCHAR(ACK); PUTCHAR(ACK);
SM_PROCEED(waitchar); SM_PROCEED(waitchar);
SM_STATE(sendcheck) SM_STATE(sendcheck)
Syslog('X', "m7recv SENDCHECK cs=%d", cs);
PUTCHAR(cs); PUTCHAR(cs);
SM_PROCEED(waitckok); SM_PROCEED(waitckok);
SM_STATE(waitckok) SM_STATE(waitckok)
Syslog('X', "m7recv WAITCKOK");
c = GETCHAR(1); c = GETCHAR(1);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('X', "m7 got timeout waiting for ack ACK"); Syslog('x', "m7 got timeout waiting for ack ACK");
SM_PROCEED(sendnak); SM_PROCEED(sendnak);
} else if (c < 0) { } else if (c < 0) {
SM_ERROR; SM_ERROR;

View File

@ -88,7 +88,6 @@ SM_START(sendack)
SM_STATE(waitnak) SM_STATE(waitnak)
Syslog('x', "m7send WAITNAK");
if (count++ > 20) { if (count++ > 20) {
Syslog('+', "too many tries sending modem7 name"); Syslog('+', "too many tries sending modem7 name");
SM_ERROR; SM_ERROR;
@ -110,7 +109,6 @@ SM_STATE(waitnak)
SM_STATE(sendack) SM_STATE(sendack)
Syslog('x', "m7send SENDACK");
i = 0; i = 0;
PUTCHAR(ACK); PUTCHAR(ACK);
if (STATUS) { if (STATUS) {
@ -121,7 +119,6 @@ SM_STATE(sendack)
SM_STATE(sendchar) SM_STATE(sendchar)
Syslog('x', "m7send SENDCHAR");
if (i > 11) { if (i > 11) {
SM_PROCEED(sendsub); SM_PROCEED(sendsub);
} }
@ -135,7 +132,6 @@ SM_STATE(sendchar)
SM_STATE(waitack) SM_STATE(waitack)
Syslog('x', "m7send WAITACK");
c = GETCHAR(1); c = GETCHAR(1);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('x', "m7 got timeout waiting ACK for char %d",i); Syslog('x', "m7 got timeout waiting ACK for char %d",i);
@ -153,13 +149,11 @@ SM_STATE(waitack)
SM_STATE(sendsub) SM_STATE(sendsub)
Syslog('x', "m7send SENDSUB");
PUTCHAR(SUB); PUTCHAR(SUB);
SM_PROCEED(waitcheck); SM_PROCEED(waitcheck);
SM_STATE(waitcheck) SM_STATE(waitcheck)
Syslog('x', "m7send WAITCHECK");
c = GETCHAR(1); c = GETCHAR(1);
if (c == TIMEOUT) { if (c == TIMEOUT) {
Syslog('x', "m7 got timeout waiting check"); Syslog('x', "m7 got timeout waiting check");
@ -177,7 +171,6 @@ SM_STATE(waitcheck)
SM_STATE(ackcheck) SM_STATE(ackcheck)
Syslog('x', "m7send ACKCHECK");
PUTCHAR(ACK); PUTCHAR(ACK);
if (STATUS) { if (STATUS) {
SM_ERROR; SM_ERROR;

View File

@ -45,7 +45,8 @@
#include "callstat.h" #include "callstat.h"
extern int tcp_mode; extern int tcp_mode;
node *nlent; node *nlent;
fa_list *remote=NULL; fa_list *remote=NULL;

View File

@ -592,3 +592,4 @@ int tty_putget(char **obuf, int *osize, char **ibuf, int *isize)
return ((*isize == 0) | ((*osize == 0) << 1)); return ((*isize == 0) | ((*osize == 0) << 1));
} }

View File

@ -1,3 +1,5 @@
/* $Id$ */
#ifndef TTYIO_H #ifndef TTYIO_H
#define TTYIO_H #define TTYIO_H