From 16b185f277816e790c6f2e39461f92d157a18aae Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 11 Jan 2004 16:51:00 +0000 Subject: [PATCH] Added some stuff for T-Mail fileboxes --- mbcico/binkpnew.c | 7 +++---- mbcico/outstat.c | 30 ++++++++++++++++++++++++++++++ mbtask/outstat.c | 32 +++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 5 deletions(-) diff --git a/mbcico/binkpnew.c b/mbcico/binkpnew.c index c52660ac..df816b79 100644 --- a/mbcico/binkpnew.c +++ b/mbcico/binkpnew.c @@ -972,7 +972,7 @@ TrType binkp_receiver(void) } else if (bcmd == MM_EOB) { Syslog('+', "Binkp: rcvd M_EOB"); if ((bp.Major == 1) && (bp.Minor != 0)) { - Syslog('b', "Binkp: 1.1 check local_EOB=%s remote_EOB=%s messages=%d", + Syslog('B', "Binkp: 1.1 check local_EOB=%s remote_EOB=%s messages=%d", bp.local_EOB?"True":"False", bp.remote_EOB?"True":"False", bp.messages); if (bp.local_EOB && bp.remote_EOB) { Syslog('b', "Binkp: receiver detects both sides in EOB state"); @@ -1250,7 +1250,7 @@ TrType binkp_transmitter(void) if ((respond = respond_wazoo()) != NULL) { for (tsl = tosend; tsl->next; tsl = tsl ->next); tsl->next = respond; - Syslog('+', "Binkp: added requested files"); + Syslog('b', "Binkp: added requested files"); } /* @@ -1415,7 +1415,7 @@ TrType binkp_transmitter(void) } if ((bp.Major == 1) && (bp.Minor != 0)) { - Syslog('b', "Binkp: 1.1 check local_EOB=%s remote_EOB=%s messages=%d", + Syslog('B', "Binkp: 1.1 check local_EOB=%s remote_EOB=%s messages=%d", bp.local_EOB?"True":"False", bp.remote_EOB?"True":"False", bp.messages); if (bp.local_EOB && bp.remote_EOB) { @@ -1797,7 +1797,6 @@ int binkp_process_messages(void) long lsize, loffs; Syslog('b', "Binkp: Process The Messages Queue Start"); - debug_binkp_list(&bll); lname = calloc(512, sizeof(char)); diff --git a/mbcico/outstat.c b/mbcico/outstat.c index 2e1012df..f1fb55ca 100644 --- a/mbcico/outstat.c +++ b/mbcico/outstat.c @@ -67,6 +67,36 @@ static struct _alist +/* + * Returns name of T-Mail filebox in Dos format (8+3). + * I know, this code looks ungly, but it works. - MiCHA :-) + */ +const char* shortboxname(const faddr *fa) { + static char dirname[12]; + unsigned z=fa->zone, n=fa->net, f=fa->node, p=fa->point; + unsigned u,v; + + u=z%32; z/=32; if (z>=32) return NULL; + dirname[0]=z<10?z+'0':z-10+'a'; + dirname[1]=u<10?u+'0':u-10+'a'; + u=n%32; n/=32; v=n%32; n/=32; if (n>=32) return NULL; + dirname[2]=n<10?n+'0':n-10+'a'; + dirname[3]=v<10?v+'0':v-10+'a'; + dirname[4]=u<10?u+'0':u-10+'a'; + u=f%32; f/=32; v=f%32; f/=32; if (f>=32) return NULL; + dirname[5]=f<10?f+'0':f-10+'a'; + dirname[6]=v<10?v+'0':v-10+'a'; + dirname[7]=u<10?u+'0':u-10+'a'; + dirname[8]='.'; + u=p%32; p/=32; if (p>=32) return NULL; + dirname[9]=p<10?p+'0':p-10+'a'; + dirname[10]=u<10?u+'0':u-10+'a'; + dirname[11]=0; + return dirname; +} + + + int outstat() { int rc; diff --git a/mbtask/outstat.c b/mbtask/outstat.c index 4bea01e0..1b7f1d6f 100644 --- a/mbtask/outstat.c +++ b/mbtask/outstat.c @@ -4,7 +4,7 @@ * Purpose ...............: mbtask - Scan mail outbound status * ***************************************************************************** - * Copyright (C) 1997-2003 + * Copyright (C) 1997-2004 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -178,6 +178,36 @@ char *callmode(int mode) +/* + * Returns name of T-Mail filebox in Dos format (8+3). + * I know, this code looks ungly, but it works. - MiCHA :-) + */ +const char* shortboxname(const faddr *fa) { + static char dirname[12]; + unsigned z=fa->zone, n=fa->net, f=fa->node, p=fa->point; + unsigned u,v; + + u=z%32; z/=32; if (z>=32) return NULL; + dirname[0]=z<10?z+'0':z-10+'a'; + dirname[1]=u<10?u+'0':u-10+'a'; + u=n%32; n/=32; v=n%32; n/=32; if (n>=32) return NULL; + dirname[2]=n<10?n+'0':n-10+'a'; + dirname[3]=v<10?v+'0':v-10+'a'; + dirname[4]=u<10?u+'0':u-10+'a'; + u=f%32; f/=32; v=f%32; f/=32; if (f>=32) return NULL; + dirname[5]=f<10?f+'0':f-10+'a'; + dirname[6]=v<10?v+'0':v-10+'a'; + dirname[7]=u<10?u+'0':u-10+'a'; + dirname[8]='.'; + u=p%32; p/=32; if (p>=32) return NULL; + dirname[9]=p<10?p+'0':p-10+'a'; + dirname[10]=u<10?u+'0':u-10+'a'; + dirname[11]=0; + return dirname; +} + + + /* * Scan outbound, the call status is set in three counters: internet, * ISDN and POTS (analogue modems).