diff --git a/ChangeLog b/ChangeLog index 99a2aa11..cad628e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,10 +3,24 @@ $Id$ v0.37.00 26-Dec-2002. + general: + A new developer joined the team, David Gonzalez. + + libs: + The nodelist lookup functions are now in a separate library. + This will give us easy implemtation of new nodelist formats + and flags. + Introduced a new file, ~/etc/nodelist.conf, this file will + be used for nodelist lookup behaviour. + mbcico: With binkp and EMSI sessions double received remote aka's are filtered. + examples: + Prepared for more example translations. + + v0.36.00 26-Dec-2002 - stable release diff --git a/lib/Makefile b/lib/Makefile index 76e754a1..8614d318 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -8,16 +8,19 @@ CLCOMM_SRCS = clcomm.c client.c crc.c semafore.c signame.c CLCOMM_OBJS = clcomm.o client.o crc.o semafore.o signame.o CLCOMM_HDRS = clcomm.h COMMON_SRCS = attach.c charconv_utf.c falists.c hdr.c parsedate.c rfcmsg.c unpacker.c \ - batchrd.c charset.c ftn.c nodelist.c pktname.c mangle.c sectest.c \ + batchrd.c charset.c ftn.c pktname.c mangle.c sectest.c \ charconv.c dostran.c ftnmsg.c mbfile.c nodelock.c rawio.c strcasestr.c \ charconv_hz.c execute.c expipe.c getheader.c mime.c noderecord.c rfcaddr.c strutil.c \ charconv_jp.c faddr.c gmtoffset.c packet.c rfcdate.c term.c COMMON_OBJS = ftscprod.o attach.o charconv_utf.o falists.o hdr.o parsedate.o rfcmsg.o unpacker.o \ - batchrd.o charset.o ftn.o nodelist.o pktname.o mangle.o sectest.o \ + batchrd.o charset.o ftn.o pktname.o mangle.o sectest.o \ charconv.o dostran.o ftnmsg.o mbfile.o nodelock.o rawio.o strcasestr.o \ charconv_hz.o execute.o expipe.o getheader.o mime.o noderecord.o rfcaddr.o strutil.o \ charconv_jp.o faddr.o gmtoffset.o packet.o rfcdate.o term.o COMMON_HDRS = common.h +NODELIST_SRCS = nodelist.c +NODELIST_OBJS = nodelist.o +NODELIST_HDRS = nodelist.h DBASE_SRCS = dbcfg.c dbdupe.c dbftn.c dbmsgs.c dbnode.c dbtic.c dbuser.c DBASE_OBJS = dbcfg.o dbdupe.o dbftn.o dbmsgs.o dbnode.o dbtic.o dbuser.o DBASE_HDRS = dbcfg.h dbdupe.h dbftn.h dbmsgs.h dbnode.h dbtic.h dbuser.h @@ -35,14 +38,15 @@ MEMWATCH_OBJS = memwatch.o MEMWATCH_HDRS = memwatch.h OTHER_HDRS = ansi.h bluewave.h libs.h mbse.h records.h structs.h users.h mberrors.h SRCS = ${CLCOMM_SRCS} ${COMMON_SRCS} ${DBASE_SRCS} ${MSGBASE_SRCS} ${MBINET_SRCS} \ - ${DIESEL_SRCS} ${MEMWATCH_SRCS} + ${DIESEL_SRCS} ${MEMWATCH_SRCS} ${NODELIST_SRCS} OBJS = ${CLCOMM_OBJS} ${COMMON_OBJS} ${DBASE_OBJS} ${MSGBASE_OBJS} ${MBINET_OBJS} \ - ${DIESEL_OBJS} ${MEMWATCH_OBJS} + ${DIESEL_OBJS} ${MEMWATCH_OBJS} ${NODELIST_OBJS} HDRS = ${CLCOMM_HDRS} ${COMMON_HDRS} ${DBASE_HDRS} ${MSGBASE_HDRS} ${MBINET_HDRS} \ - ${DIESEL_HDRS} ${MEMWATCH_HDRS} ${OTHER_HDRS} + ${DIESEL_HDRS} ${MEMWATCH_HDRS} ${NODELIST_HDRS} ${OTHER_HDRS} OTHER = Makefile README ftscprod.006 mkprod.awk FAQ README.memwatch USING test.c \ memwatch.c.org README.diesel README.macro Diesel.doc nodelist.conf -TARGET = libclcomm.a libcommon.a libdbase.a libmsgbase.a libmbinet.a libdiesel.a libmemwatch.a +TARGET = libclcomm.a libcommon.a libdbase.a libmsgbase.a libmbinet.a libdiesel.a \ + libmemwatch.a libnodelist.a ############################################################################# @@ -82,6 +86,10 @@ libmemwatch.a: ${MEMWATCH_OBJS} ar r $@ $? ${RANLIB} $@ +libnodelist.a: ${NODELIST_OBJS} + ar r $@ $? + ${RANLIB} $@ + install: all ${INSTALL} -c -o ${OWNER} -g ${GROUP} -m 0444 nodelist.conf ${ETCDIR} @@ -131,7 +139,6 @@ unpacker.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h c batchrd.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h charset.o: ../config.h libs.h memwatch.h structs.h common.h clcomm.h ftn.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h dbftn.h common.h -nodelist.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h pktname.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h mangle.o: ../config.h libs.h memwatch.h structs.h clcomm.h common.h sectest.o: ../config.h libs.h structs.h common.h clcomm.h @@ -172,5 +179,6 @@ smtp.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h mbine diesel.o: ../config.h libs.h memwatch.h diesel.h mbdiesel.o: ../config.h libs.h memwatch.h structs.h users.h records.h common.h clcomm.h diesel.h memwatch.o: ../config.h libs.h memwatch.h +nodelist.o: ../config.h libs.h memwatch.h structs.h users.h records.h clcomm.h common.h nodelist.h ftscprod.o: ../config.h libs.h memwatch.h structs.h common.h # End of generated dependencies diff --git a/lib/common.h b/lib/common.h index 81e459dc..05e5edef 100644 --- a/lib/common.h +++ b/lib/common.h @@ -48,89 +48,6 @@ -/* - * Analogue Modem flag values, order is important, first the - * compresion capabilities, then the linespeeds. This is late - * tested by portsel to find the fastest common connection - * speed for a given line if you have multiple dialout modems. - */ -#define NL_MNP 0x00000001L -#define NL_V42 0x00000002L -#define NL_V42B 0x00000004L -#define NL_V22 0x00000008L -#define NL_V29 0x00000010L -#define NL_V32 0x00000020L -#define NL_H96 0x00000040L -#define NL_HST 0x00000080L -#define NL_MAX 0x00000100L -#define NL_PEP 0x00000200L -#define NL_CSP 0x00000400L -#define NL_V32B 0x00000800L -#define NL_H14 0x00001000L -#define NL_V32T 0x00002000L -#define NL_H16 0x00004000L -#define NL_ZYX 0x00008000L -#define NL_Z19 0x00010000L -#define NL_VFC 0x00020000L -#define NL_V34 0x00040000L -#define NL_X2C 0x00080000L -#define NL_X2S 0x00100000L -#define NL_V90C 0x00200000L -#define NL_V90S 0x00400000L - - - -/* - * ISDN Flags - */ -#define ND_V110L 0x00000001L -#define ND_V110H 0x00000002L -#define ND_V120L 0x00000004L -#define ND_V120H 0x00000008L -#define ND_X75 0x00000010L - - - -/* - * TCP/IP flags - */ -#define IP_IBN 0x00000001L -#define IP_IFC 0x00000002L -#define IP_ITN 0x00000004L -#define IP_IVM 0x00000008L -#define IP_IP 0x00000010L -#define IP_IFT 0x00000020L - - - -/* - * Online special flags - */ -#define OL_CM 0x00000001L -#define OL_MO 0x00000002L -#define OL_LO 0x00000004L -#define OL_MN 0x00000008L - - - -/* - * Request flags - */ -#define RQ_RQMODE 0x0000000fL -#define RQ_RQ_BR 0x00000001L -#define RQ_RQ_BU 0x00000002L -#define RQ_RQ_WR 0x00000004L -#define RQ_RQ_WU 0x00000008L -#define RQ_XA (RQ_RQ_BR | RQ_RQ_BU | RQ_RQ_WR | RQ_RQ_WU) -#define RQ_XB (RQ_RQ_BR | RQ_RQ_BU | RQ_RQ_WR ) -#define RQ_XC (RQ_RQ_BR | RQ_RQ_WR | RQ_RQ_WU) -#define RQ_XP (RQ_RQ_BR | RQ_RQ_BU ) -#define RQ_XR (RQ_RQ_BR | RQ_RQ_WR ) -#define RQ_XW ( RQ_RQ_WR ) -#define RQ_XX ( RQ_RQ_WR | RQ_RQ_WU) - - - /* * Returned function keys */ @@ -271,91 +188,6 @@ extern struct _ftscprod { -/* - * Nodelist entry - */ -typedef struct _node { - faddr addr; /* Node address */ - unsigned short upnet; /* Uplink netnumber */ - unsigned short upnode; /* Uplink nodenumber */ - unsigned short region; /* Region belongin to */ - unsigned char type; - unsigned char pflag; - char *name; /* System name */ - char *location; /* System location */ - char *sysop; /* Sysop name */ - char *phone; /* Phone number */ - unsigned speed; /* Baudrate */ - unsigned long mflags; /* Modem flags */ - unsigned long dflags; /* ISDN flags */ - unsigned long iflags; /* TCP-IP flags */ - unsigned long oflags; /* Online flags */ - unsigned long xflags; /* Request flags */ - char *uflags[MAXUFLAGS]; /* User flags */ - int t1; /* T flag, first char */ - int t2; /* T flag, second char */ -} node; - - - -extern struct _fkey { - char *key; - unsigned long flag; -} fkey[]; - - - -extern struct _dkey { - char *key; - unsigned long flag; -} dkey[]; - - - -extern struct _ikey { - char *key; - unsigned long flag; -} ikey[]; - - - -extern struct _okey { - char *key; - unsigned long flag; -} okey[]; - - - -extern struct _xkey { - char *key; - unsigned long flag; -} xkey[]; - - - -extern struct _nodelist { - char *domain; - FILE *fp; -} *nodevector; - - - -struct _ixentry { - unsigned short zone; - unsigned short net; - unsigned short node; - unsigned short point; -}; - - - -extern struct _pkey { - char *key; - unsigned char type; - unsigned char pflag; -} pkey[]; - - extern char SigName[32][16]; @@ -463,19 +295,6 @@ int mkdirs(char *name, mode_t); int diskfree(int); -/* - * From nodelist.c - */ -int initnl(void); -node *getnlent(faddr *); -void olflags(unsigned long); -void rqflags(unsigned long); -void moflags(unsigned long); -void diflags(unsigned long); -void ipflags(unsigned long); - - - /* * From nodelock.c */ diff --git a/lib/nodelist.c b/lib/nodelist.c index 592f0720..9a02834d 100644 --- a/lib/nodelist.c +++ b/lib/nodelist.c @@ -36,6 +36,7 @@ #include "records.h" #include "clcomm.h" #include "common.h" +#include "nodelist.h" #define NULLDOMAIN "nulldomain" diff --git a/mbtask/nodelist.h b/lib/nodelist.h similarity index 92% rename from mbtask/nodelist.h rename to lib/nodelist.h index 41147677..2b247455 100644 --- a/mbtask/nodelist.h +++ b/lib/nodelist.h @@ -3,11 +3,14 @@ #ifndef _NODELIST_H #define _NODELIST_H +#include "../config.h" + #define MAXNAME 35 #define MAXUFLAGS 16 + /* * Analogue Modem flag values, order is important, first the * compresion capabilities, then the linespeeds. This is late @@ -112,8 +115,8 @@ typedef struct _node { unsigned long oflags; /* Online flags */ unsigned long xflags; /* Request flags */ char *uflags[MAXUFLAGS]; /* User flags */ - int t1; /* First Txx flag */ - int t2; /* Second Txx flag */ + int t1; /* T flag, first char */ + int t2; /* T flag, second char */ } node; @@ -176,8 +179,17 @@ extern struct _pkey { } pkey[]; + +/* + * From nodelist.c + */ int initnl(void); node *getnlent(faddr *); +void olflags(unsigned long); +void rqflags(unsigned long); +void moflags(unsigned long); +void diflags(unsigned long); +void ipflags(unsigned long); #endif diff --git a/mbcico/Makefile b/mbcico/Makefile index 3f2683a8..0f151d5d 100644 --- a/mbcico/Makefile +++ b/mbcico/Makefile @@ -31,7 +31,8 @@ MBCICO_OBJS = zmmisc.o zmrle.o zmrecv.o zmsend.o binkp.o \ ttyio.o lutil.o scanout.o emsi.o ulock.o \ callstat.o session.o call.o mbcico.o MBOUT_OBJS = outstat.o nlinfo.o mbout.o scanout.o callstat.o -LIBS += ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a +LIBS += ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a \ + ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libnodelist.a OTHER = Makefile README TARGET = mbcico mbout @@ -86,47 +87,47 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend -zmmisc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h zmodem.h -zmrle.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ttyio.h session.h zmodem.h -zmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h filelist.h openport.h -zmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h zmodem.h lutil.h emsi.h filelist.h -binkp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h openfile.h respfreq.h filelist.h opentcp.h rdoptions.h lutil.h binkp.h config.h -xmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h filelist.h filetime.h -xmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filelist.h filetime.h +zmmisc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h zmodem.h +zmrle.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ttyio.h session.h zmodem.h +zmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h lutil.h ttyio.h session.h zmodem.h config.h emsi.h openfile.h filelist.h openport.h +zmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ttyio.h session.h zmodem.h lutil.h emsi.h filelist.h +binkp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h openfile.h respfreq.h filelist.h opentcp.h rdoptions.h lutil.h binkp.h config.h +xmsend.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h filelist.h filetime.h +xmrecv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h openfile.h m7recv.h xmrecv.h filelist.h filetime.h m7recv.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7recv.h m7send.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h statetbl.h ttyio.h m7send.h -hydra.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h session.h filelist.h filetime.h ttyio.h statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h mbcico.h hydra.h -answer.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h lutil.h session.h config.h answer.h openport.h portsel.h dial.h rdoptions.h mbcico.h +hydra.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h filelist.h filetime.h ttyio.h statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h mbcico.h hydra.h +answer.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h lutil.h session.h config.h answer.h openport.h portsel.h dial.h rdoptions.h mbcico.h chat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h config.h chat.h ttyio.h -dial.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h config.h chat.h ttyio.h session.h dial.h -dietifna.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h emsi.h dietifna.h respfreq.h filelist.h xmrecv.h xmsend.h -emsidat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h emsi.h session.h lutil.h config.h emsidat.h filetime.h -filelist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h config.h session.h filelist.h +dial.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h config.h chat.h ttyio.h session.h dial.h +dietifna.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h emsi.h dietifna.h respfreq.h filelist.h xmrecv.h xmsend.h +emsidat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h emsi.h session.h lutil.h config.h emsidat.h filetime.h +filelist.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h config.h session.h filelist.h openfile.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h ../lib/common.h config.h lutil.h openfile.h openport.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ulock.h ttyio.h openport.h -opentcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h session.h ttyio.h openport.h opentcp.h -rdoptions.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h session.h config.h -yoohoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/mberrors.h statetbl.h ttyio.h session.h config.h emsi.h hydra.h rdoptions.h wazoo.h dietifna.h yoohoo.h -recvbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h statetbl.h recvbark.h respfreq.h filelist.h -respfreq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h session.h lutil.h config.h atoul.h respfreq.h filelist.h -sendbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h statetbl.h sendbark.h xmrecv.h -tcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h tcpproto.h tcp.h -tcpproto.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h config.h emsi.h lutil.h openfile.h filelist.h tcpproto.h -wazoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h wazoo.h zmodem.h +opentcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h ttyio.h openport.h opentcp.h +rdoptions.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/dbnode.h session.h config.h +yoohoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/mberrors.h statetbl.h ttyio.h session.h config.h emsi.h hydra.h rdoptions.h wazoo.h dietifna.h yoohoo.h +recvbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h recvbark.h respfreq.h filelist.h +respfreq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h session.h lutil.h config.h atoul.h respfreq.h filelist.h +sendbark.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h sendbark.h xmrecv.h +tcp.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h tcpproto.h tcp.h +tcpproto.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h config.h emsi.h lutil.h openfile.h filelist.h tcpproto.h +wazoo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h respfreq.h filelist.h wazoo.h zmodem.h filetime.o: ../config.h ../lib/libs.h ../lib/memwatch.h filetime.h -ftsc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h session.h ttyio.h statetbl.h config.h ftsc.h rdoptions.h recvbark.h filelist.h sendbark.h respfreq.h xmrecv.h xmsend.h +ftsc.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/mberrors.h session.h ttyio.h statetbl.h config.h ftsc.h rdoptions.h recvbark.h filelist.h sendbark.h respfreq.h xmrecv.h xmsend.h atoul.o: ../config.h ../lib/libs.h ../lib/memwatch.h atoul.h portsel.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h portsel.h ttyio.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ttyio.h lutil.h lutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h lutil.h scanout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbftn.h config.h scanout.h lutil.h -emsi.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h emsidat.h hydra.h rdoptions.h tcp.h wazoo.h +emsi.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/dbnode.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h session.h statetbl.h config.h emsi.h emsidat.h hydra.h rdoptions.h tcp.h wazoo.h ulock.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h callstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h callstat.h -session.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mberrors.h ttyio.h statetbl.h emsi.h ftsc.h session.h yoohoo.h mbcico.h binkp.h callstat.h -call.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h session.h callstat.h call.h config.h dial.h lutil.h portsel.h openport.h opentcp.h rdoptions.h -mbcico.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h config.h answer.h call.h lutil.h mbcico.h session.h -outstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h scanout.h callstat.h outstat.h -nlinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/clcomm.h nlinfo.h -mbout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h outstat.h nlinfo.h +session.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/nodelist.h ../lib/mberrors.h ttyio.h statetbl.h emsi.h ftsc.h session.h yoohoo.h mbcico.h binkp.h callstat.h +call.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/mberrors.h session.h callstat.h call.h config.h dial.h lutil.h portsel.h openport.h opentcp.h rdoptions.h +mbcico.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h config.h answer.h call.h lutil.h mbcico.h session.h +outstat.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h scanout.h callstat.h outstat.h +nlinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h nlinfo.h +mbout.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbftn.h ../lib/mberrors.h outstat.h nlinfo.h # End of generated dependencies diff --git a/mbcico/answer.c b/mbcico/answer.c index 21043181..49cbfe86 100644 --- a/mbcico/answer.c +++ b/mbcico/answer.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbnode.h" #include "../lib/mberrors.h" diff --git a/mbcico/binkp.c b/mbcico/binkp.c index 9ef70787..d9889753 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -36,6 +36,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "../lib/clcomm.h" #include "../lib/mberrors.h" diff --git a/mbcico/call.c b/mbcico/call.c index ad177153..dfb848d3 100644 --- a/mbcico/call.c +++ b/mbcico/call.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbnode.h" #include "../lib/mberrors.h" diff --git a/mbcico/dial.c b/mbcico/dial.c index 694b4320..e256712e 100644 --- a/mbcico/dial.c +++ b/mbcico/dial.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbnode.h" #include "../lib/mberrors.h" diff --git a/mbcico/dietifna.c b/mbcico/dietifna.c index b0cfa43d..e8eae029 100644 --- a/mbcico/dietifna.c +++ b/mbcico/dietifna.c @@ -33,6 +33,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/emsi.c b/mbcico/emsi.c index 28bc11c9..004b2fd2 100644 --- a/mbcico/emsi.c +++ b/mbcico/emsi.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "../lib/clcomm.h" #include "../lib/mberrors.h" diff --git a/mbcico/emsidat.c b/mbcico/emsidat.c index cecdd3fc..caa27fdd 100644 --- a/mbcico/emsidat.c +++ b/mbcico/emsidat.c @@ -36,6 +36,7 @@ #include "../lib/records.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "emsi.h" #include "session.h" diff --git a/mbcico/filelist.c b/mbcico/filelist.c index 0665cee4..db9071a4 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -36,6 +36,7 @@ #include "../lib/records.h" #include "../lib/clcomm.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "config.h" #include "session.h" #include "filelist.h" diff --git a/mbcico/ftsc.c b/mbcico/ftsc.c index c71f3b23..4bd369a2 100644 --- a/mbcico/ftsc.c +++ b/mbcico/ftsc.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/mberrors.h" #include "session.h" diff --git a/mbcico/hydra.c b/mbcico/hydra.c index 4c89a975..09a4c7e5 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -46,6 +46,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/mberrors.h" #include "session.h" diff --git a/mbcico/mbcico.c b/mbcico/mbcico.c index b782d871..4313c4f5 100644 --- a/mbcico/mbcico.c +++ b/mbcico/mbcico.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbcfg.h" #include "../lib/dbnode.h" diff --git a/mbcico/mbout.c b/mbcico/mbout.c index 32e0fc6b..30bbc44d 100644 --- a/mbcico/mbout.c +++ b/mbcico/mbout.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbcfg.h" #include "../lib/dbnode.h" diff --git a/mbcico/nlinfo.c b/mbcico/nlinfo.c index 069bca99..68c17071 100644 --- a/mbcico/nlinfo.c +++ b/mbcico/nlinfo.c @@ -33,6 +33,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "nlinfo.h" diff --git a/mbcico/opentcp.c b/mbcico/opentcp.c index 0a7d9dbc..b266c51a 100644 --- a/mbcico/opentcp.c +++ b/mbcico/opentcp.c @@ -36,6 +36,7 @@ #include "../lib/records.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "session.h" #include "ttyio.h" diff --git a/mbcico/outstat.c b/mbcico/outstat.c index 901ec22c..ef61dca8 100644 --- a/mbcico/outstat.c +++ b/mbcico/outstat.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbcfg.h" #include "../lib/dbnode.h" diff --git a/mbcico/rdoptions.c b/mbcico/rdoptions.c index 01cce57c..76ba8c06 100644 --- a/mbcico/rdoptions.c +++ b/mbcico/rdoptions.c @@ -36,6 +36,7 @@ #include "../lib/records.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "session.h" #include "config.h" diff --git a/mbcico/recvbark.c b/mbcico/recvbark.c index 11fa2e10..892a8c10 100644 --- a/mbcico/recvbark.c +++ b/mbcico/recvbark.c @@ -34,6 +34,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index 6bd356ab..ba7fa341 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "session.h" #include "lutil.h" diff --git a/mbcico/sendbark.c b/mbcico/sendbark.c index 124966bc..8f9ff38a 100644 --- a/mbcico/sendbark.c +++ b/mbcico/sendbark.c @@ -34,6 +34,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/session.c b/mbcico/session.c index 32488918..41cd29c5 100644 --- a/mbcico/session.c +++ b/mbcico/session.c @@ -36,6 +36,7 @@ #include "../lib/records.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/mberrors.h" #include "ttyio.h" #include "statetbl.h" diff --git a/mbcico/tcp.c b/mbcico/tcp.c index 4a439ed0..9e29aa2f 100644 --- a/mbcico/tcp.c +++ b/mbcico/tcp.c @@ -37,6 +37,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/tcpproto.c b/mbcico/tcpproto.c index 6f7e5ce5..79b9b059 100644 --- a/mbcico/tcpproto.c +++ b/mbcico/tcpproto.c @@ -38,6 +38,7 @@ #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/mberrors.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/wazoo.c b/mbcico/wazoo.c index cf2b7c18..3184c2f0 100644 --- a/mbcico/wazoo.c +++ b/mbcico/wazoo.c @@ -34,6 +34,7 @@ #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "../lib/mberrors.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/xmrecv.c b/mbcico/xmrecv.c index d891c43d..e20145dd 100644 --- a/mbcico/xmrecv.c +++ b/mbcico/xmrecv.c @@ -33,6 +33,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "session.h" #include "ttyio.h" diff --git a/mbcico/xmsend.c b/mbcico/xmsend.c index 8378fa5e..6978ffd7 100644 --- a/mbcico/xmsend.c +++ b/mbcico/xmsend.c @@ -33,6 +33,7 @@ #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "session.h" #include "ttyio.h" diff --git a/mbcico/yoohoo.c b/mbcico/yoohoo.c index ad758b88..3ccca298 100644 --- a/mbcico/yoohoo.c +++ b/mbcico/yoohoo.c @@ -44,6 +44,7 @@ #include "../lib/records.h" #include "../lib/clcomm.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/dbnode.h" #include "../lib/mberrors.h" #include "statetbl.h" diff --git a/mbcico/zmmisc.c b/mbcico/zmmisc.c index 45e26fa7..e03f2f2f 100644 --- a/mbcico/zmmisc.c +++ b/mbcico/zmmisc.c @@ -65,6 +65,7 @@ static void garbitch(void); #include "../lib/memwatch.h" #include "../lib/structs.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/zmrecv.c b/mbcico/zmrecv.c index 92524ee9..cd6b7475 100644 --- a/mbcico/zmrecv.c +++ b/mbcico/zmrecv.c @@ -34,6 +34,7 @@ #include "../lib/structs.h" #include "../lib/clcomm.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "lutil.h" #include "ttyio.h" #include "session.h" diff --git a/mbcico/zmrle.c b/mbcico/zmrle.c index d8684e50..6f573d70 100644 --- a/mbcico/zmrle.c +++ b/mbcico/zmrle.c @@ -43,6 +43,7 @@ #include "../lib/structs.h" #include "../lib/clcomm.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "ttyio.h" #include "session.h" #include "zmodem.h" diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 6c2776b9..e40a9793 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -34,6 +34,7 @@ #include "../lib/structs.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/nodelist.h" #include "ttyio.h" #include "session.h" #include "zmodem.h" diff --git a/mbfido/Makefile b/mbfido/Makefile index 4f71a992..0376882e 100644 --- a/mbfido/Makefile +++ b/mbfido/Makefile @@ -42,7 +42,7 @@ MBFILE_OBJS = mbfile.o mbfkill.o mbfutil.o mbfindex.o mbfcheck.o mbfpack.o mbfli mbfimport.o virscan.o mbftoberep.o mbfmove.o mbfdel.o MBMSG_OBJS = post.o mbmsg.o MBFIDO_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ - ../lib/libdbase.a ../lib/libdiesel.a ../lib/libmbinet.a + ../lib/libdbase.a ../lib/libdiesel.a ../lib/libmbinet.a ../lib/libnodelist.a MBSEQ_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBAFF_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ ../lib/libdbase.a ../lib/libdiesel.a @@ -144,12 +144,12 @@ mgrutil.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/u qualify.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h qualify.h ptic.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbtic.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbdupe.h unpack.h mover.h toberep.h tic.h utic.h addbbs.h magic.h forward.h rollover.h ptic.h magic.h createf.h virscan.h qualify.h sendmail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/dbmsgs.h addpkt.h rollover.h sendmail.h -tracker.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h tracker.h +tracker.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h tracker.h addpkt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h bwrite.o: ../config.h ../lib/libs.h ../lib/memwatch.h bwrite.h forward.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbtic.h ../lib/diesel.h tic.h sendmail.h rollover.h mgrutil.h forward.h lhash.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/clcomm.h lhash.h -mbfido.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h ../lib/mberrors.h flock.h tosspkt.h unpack.h tic.h fsort.h scan.h mbfido.h tracker.h notify.h rollover.h hatch.h scannews.h maketags.h makestat.h newspost.h rnews.h mgrutil.h backalias.h rfc2ftn.h dirsession.h dirlock.h queue.h +mbfido.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/clcomm.h ../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h ../lib/mberrors.h flock.h tosspkt.h unpack.h tic.h fsort.h scan.h mbfido.h tracker.h notify.h rollover.h hatch.h scannews.h maketags.h makestat.h newspost.h rnews.h mgrutil.h backalias.h rfc2ftn.h dirsession.h dirlock.h queue.h mkftnhdr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h atoul.h hash.h msgflags.h aliasdb.h mkftnhdr.h ping.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h sendmail.h postnetmail.h ping.h rfc2ftn.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h postnetmail.h postecho.h msgflags.h rfc2ftn.h diff --git a/mbfido/mbfido.c b/mbfido/mbfido.c index 72b2347d..92998e73 100644 --- a/mbfido/mbfido.c +++ b/mbfido/mbfido.c @@ -36,6 +36,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbdupe.h" #include "../lib/dbcfg.h" diff --git a/mbfido/tracker.c b/mbfido/tracker.c index a48eaf3f..ad5d0ed8 100644 --- a/mbfido/tracker.c +++ b/mbfido/tracker.c @@ -35,6 +35,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/clcomm.h" #include "../lib/dbnode.h" #include "../lib/dbftn.h" diff --git a/mbsebbs/Makefile b/mbsebbs/Makefile index f37f5e57..afa9a316 100644 --- a/mbsebbs/Makefile +++ b/mbsebbs/Makefile @@ -28,12 +28,12 @@ MBSEBBS_OBJS = bank.o bbslist.o chat.o file.o funcs.o mail.o menu.o \ pop3.o email.o input.o whoson.o door.o dispfile.o userlist.o timestats.o \ logentry.o morefile.o lastcallers.o MBSEBBS_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ - ../lib/libdbase.a ../lib/libmbinet.a + ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a MBNEWUSR_OBJS = mbnewusr.o newuser.o language.o timeout.o dispfile.o oneline.o \ timecheck.o input.o exitinfo.o funcs.o misc.o change.o door.o \ filesub.o mail.o email.o msgutil.o pop3.o lineedit.o fsedit.o whoson.o MBNEWUSR_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a \ - ../lib/libdbase.a ../lib/libmbinet.a + ../lib/libdbase.a ../lib/libmbinet.a ../lib/libnodelist.a MBALL_OBJS = mball.o MBALL_LIBS = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a MBLANG_OBJS = mblang.o @@ -150,7 +150,7 @@ mbuser.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/us page.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h dispfile.h input.h chat.h page.h timeout.h mail.h language.h bye.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h dispfile.h misc.h language.h bye.h funcs.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h ../lib/clcomm.h ../lib/mberrors.h funcs.h -mail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h +mail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/nodelist.h ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h input.h language.h misc.h timeout.h oneline.h exitinfo.h lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h door.h whoson.h newuser.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h funcs.h input.h newuser.h language.h timeout.h change.h dispfile.h pinfo.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h pinfo.h input.h timecheck.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/mbse.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/mberrors.h timecheck.h funcs.h bye.h exitinfo.h language.h input.h diff --git a/mbsebbs/mail.c b/mbsebbs/mail.c index 6b423a6b..68d1e498 100644 --- a/mbsebbs/mail.c +++ b/mbsebbs/mail.c @@ -43,6 +43,7 @@ #include "../lib/users.h" #include "../lib/records.h" #include "../lib/common.h" +#include "../lib/nodelist.h" #include "../lib/msgtext.h" #include "../lib/clcomm.h" #include "../lib/msg.h" diff --git a/mbtask/Makefile b/mbtask/Makefile index 3c143b6a..4d4e163e 100644 --- a/mbtask/Makefile +++ b/mbtask/Makefile @@ -4,15 +4,16 @@ include ../Makefile.global -SRCS = callstat.c nodelist.c scanout.c taskcomm.c taskinfo.c taskstat.c \ +SRCS = callstat.c scanout.c taskcomm.c taskinfo.c taskstat.c \ mbtask.c outstat.c signame.c taskdisk.c taskregs.c taskutil.c \ ports.c calllist.c ping.c crc.c HDRS = callstat.h mbtask.h outstat.h signame.h taskdisk.h taskregs.h taskutil.h \ - libs.h nodelist.h scanout.h taskcomm.h taskinfo.h taskstat.h \ + libs.h scanout.h taskcomm.h taskinfo.h taskstat.h \ ports.h calllist.h ping.h crc.h -OBJS = callstat.o nodelist.o scanout.o taskcomm.o taskinfo.o taskstat.o \ +OBJS = callstat.o scanout.o taskcomm.o taskinfo.o taskstat.o \ mbtask.o outstat.o signame.o taskdisk.o taskregs.o taskutil.o \ ports.o calllist.o ping.o crc.o +LIBS += ../lib/libnodelist.a OTHER = Makefile issue issue.netbsd ############################################################################# @@ -78,18 +79,17 @@ depend: # DO NOT DELETE THIS LINE - MAKE DEPEND RELIES ON IT # Dependencies generated by make depend callstat.o: ../config.h libs.h ../lib/structs.h taskutil.h callstat.h -nodelist.o: ../config.h libs.h ../lib/structs.h taskutil.h nodelist.h scanout.o: ../config.h libs.h ../lib/structs.h taskutil.h scanout.h taskcomm.o: ../config.h libs.h ../lib/structs.h taskstat.h taskregs.h taskdisk.h taskinfo.h taskutil.h taskcomm.h taskinfo.o: ../config.h libs.h ../lib/structs.h taskinfo.h taskstat.o: ../config.h libs.h ../lib/structs.h ../lib/mberrors.h taskstat.h callstat.h outstat.h taskutil.h -mbtask.o: ../config.h libs.h ../lib/structs.h ../paths.h ../lib/mberrors.h signame.h taskstat.h taskutil.h taskregs.h taskcomm.h callstat.h outstat.h nodelist.h ports.h calllist.h ping.h mbtask.h -outstat.o: ../config.h libs.h ../lib/structs.h ../lib/mberrors.h taskutil.h taskstat.h scanout.h nodelist.h callstat.h ports.h outstat.h +mbtask.o: ../config.h libs.h ../lib/structs.h ../paths.h ../lib/mberrors.h signame.h taskstat.h taskutil.h taskregs.h taskcomm.h callstat.h outstat.h ../lib/nodelist.h ports.h calllist.h ping.h mbtask.h +outstat.o: ../config.h libs.h ../lib/structs.h ../lib/mberrors.h taskutil.h taskstat.h scanout.h ../lib/nodelist.h callstat.h ports.h outstat.h signame.o: ../config.h signame.h taskdisk.o: ../config.h libs.h ../lib/structs.h taskdisk.h taskutil.h taskregs.o: ../config.h libs.h ../lib/structs.h taskstat.h taskregs.h taskutil.h taskutil.o: ../config.h libs.h ../lib/structs.h signame.h scanout.h crc.h taskutil.h -ports.o: ../config.h libs.h ../lib/structs.h taskutil.h nodelist.h ports.h +ports.o: ../config.h libs.h ../lib/structs.h taskutil.h ../lib/nodelist.h ports.h calllist.o: ../config.h libs.h ../lib/structs.h taskstat.h taskutil.h callstat.h outstat.h mbtask.h calllist.h ping.o: ../config.h libs.h ../lib/structs.h ../lib/mberrors.h taskstat.h taskutil.h ping.h crc.o: ../config.h libs.h crc.h diff --git a/mbtask/calllist.c b/mbtask/calllist.c index eda39edf..d569cef1 100644 --- a/mbtask/calllist.c +++ b/mbtask/calllist.c @@ -78,7 +78,7 @@ int check_calllist(void) } } if (!found) { - tasklog('c', "Removing slot %d node %s from calllist", i, ascfnode(calllist[i].addr, 0x0f)); + Syslog('c', "Removing slot %d node %s from calllist", i, ascfnode(calllist[i].addr, 0x0f)); memset(&calllist[i], 0, sizeof(tocall)); } } @@ -113,7 +113,7 @@ int check_calllist(void) if (!found) { for (i = 0; i < MAXTASKS; i++) { if (!calllist[i].addr.zone) { - tasklog('c', "Adding %s to calllist slot %d", ascfnode(tmp->addr, 0x1f), i); + Syslog('c', "Adding %s to calllist slot %d", ascfnode(tmp->addr, 0x1f), i); calllist[i].addr = tmp->addr; calllist[i].cst = tmp->cst; calllist[i].callmode = tmp->callmode; @@ -126,7 +126,7 @@ int check_calllist(void) } } } - tasklog('o', "%d system%s to call", call_work, (call_work == 1)?"":"s"); + Syslog('o', "%d system%s to call", call_work, (call_work == 1)?"":"s"); } else { if (s_scanout) sem_set((char *)"scanout", FALSE); @@ -136,11 +136,11 @@ int check_calllist(void) for (i = 0; i < MAXTASKS; i++) { if (calllist[i].addr.zone) { if (!call_work) { - tasklog('c', "Slot Call Pid Try Status Mode Modem ISDN TCP/IP Address"); - tasklog('c', "---- ----- ----- --- ------- ------- -------- -------- -------- ----------------"); + Syslog('c', "Slot Call Pid Try Status Mode Modem ISDN TCP/IP Address"); + Syslog('c', "---- ----- ----- --- ------- ------- -------- -------- -------- ----------------"); } call_work++; - tasklog('c', "%4d %s %5d %3d %s %s %08x %08x %08x %s", i, calllist[i].calling?"true ":"false", calllist[i].taskpid, + Syslog('c', "%4d %s %5d %3d %s %s %08x %08x %08x %s", i, calllist[i].calling?"true ":"false", calllist[i].taskpid, calllist[i].cst.tryno, callstatus(calllist[i].cst.trystat), callmode(calllist[i].callmode), calllist[i].moflags, calllist[i].diflags, calllist[i].ipflags, ascfnode(calllist[i].addr, 0x1f)); } diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c index 67aa1011..d3a31cec 100644 --- a/mbtask/mbtask.c +++ b/mbtask/mbtask.c @@ -40,7 +40,7 @@ #include "taskcomm.h" #include "callstat.h" #include "outstat.h" -#include "nodelist.h" +#include "../lib/nodelist.h" #include "ports.h" #include "calllist.h" #include "ping.h" @@ -437,13 +437,13 @@ void load_taskcfg(void) sprintf(TCFG.isp_ping1, "192.168.1.1"); sprintf(TCFG.isp_ping2, "192.168.1.1"); if ((fp = fopen(tcfgfn, "a+")) == NULL) { - tasklog('?', "$Can't create %s", tcfgfn); + Syslog('?', "$Can't create %s", tcfgfn); die(MBERR_INIT_ERROR); } fwrite(&TCFG, sizeof(TCFG), 1, fp); fclose(fp); chmod(tcfgfn, 0640); - tasklog('+', "Created new %s", tcfgfn); + Syslog('+', "Created new %s", tcfgfn); } else { fread(&TCFG, sizeof(TCFG), 1, fp); fclose(fp); @@ -467,7 +467,7 @@ pid_t launch(char *cmd, char *opts, char *name, int tasktype) pid_t pid = 0; if (checktasks(0) >= MAXTASKS) { - tasklog('?', "Launch: can't execute %s, maximum tasks reached", cmd); + Syslog('?', "Launch: can't execute %s, maximum tasks reached", cmd); return 0; } @@ -482,36 +482,36 @@ pid_t launch(char *cmd, char *opts, char *name, int tasktype) vector[15] = NULL; if (file_exist(vector[0], X_OK)) { - tasklog('?', "Launch: can't execute %s, command not found", vector[0]); + Syslog('?', "Launch: can't execute %s, command not found", vector[0]); return 0; } pid = fork(); switch (pid) { case -1: - tasklog('?', "$Launch: error, can't fork grandchild"); + Syslog('?', "$Launch: error, can't fork grandchild"); return 0; case 0: /* From Paul Vixies cron: */ (void)setsid(); /* It doesn't seem to help */ close(0); if (open("/dev/null", O_RDONLY) != 0) { - tasklog('?', "$Launch: \"%s\": reopen of stdin to /dev/null failed", buf); + Syslog('?', "$Launch: \"%s\": reopen of stdin to /dev/null failed", buf); _exit(MBERR_EXEC_FAILED); } close(1); if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 1) { - tasklog('?', "$Launch: \"%s\": reopen of stdout to /dev/null failed", buf); + Syslog('?', "$Launch: \"%s\": reopen of stdout to /dev/null failed", buf); _exit(MBERR_EXEC_FAILED); } close(2); if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 2) { - tasklog('?', "$Launch: \"%s\": reopen of stderr to /dev/null failed", buf); + Syslog('?', "$Launch: \"%s\": reopen of stderr to /dev/null failed", buf); _exit(MBERR_EXEC_FAILED); } errno = 0; rc = execv(vector[0],vector); - tasklog('?', "$Launch: execv \"%s\" failed, returned %d", cmd, rc); + Syslog('?', "$Launch: execv \"%s\" failed, returned %d", cmd, rc); _exit(MBERR_EXEC_FAILED); default: /* grandchild's daddy's process */ @@ -539,9 +539,9 @@ pid_t launch(char *cmd, char *opts, char *name, int tasktype) ptimer = PAUSETIME; if (opts) - tasklog('+', "Launch: task %d \"%s %s\" success, pid=%d", i, cmd, opts, pid); + Syslog('+', "Launch: task %d \"%s %s\" success, pid=%d", i, cmd, opts, pid); else - tasklog('+', "Launch: task %d \"%s\" success, pid=%d", i, cmd, pid); + Syslog('+', "Launch: task %d \"%s\" success, pid=%d", i, cmd, pid); return pid; } @@ -577,9 +577,9 @@ int checktasks(int onsig) if (onsig) { if (kill(task[i].pid, onsig) == 0) - tasklog('+', "%s to %s (pid %d) succeeded", SigName[onsig], task[i].name, task[i].pid); + Syslog('+', "%s to %s (pid %d) succeeded", SigName[onsig], task[i].name, task[i].pid); else - tasklog('+', "%s to %s (pid %d) failed", SigName[onsig], task[i].name, task[i].pid); + Syslog('+', "%s to %s (pid %d) failed", SigName[onsig], task[i].name, task[i].pid); } task[i].rc = wait4(task[i].pid, &status, WNOHANG | WUNTRACED, NULL); @@ -595,20 +595,20 @@ int checktasks(int onsig) if (first && task[i].rc) { first = FALSE; - tasklog('t', "Task Type pid stat rc"); - tasklog('t', "---------------- ------- ----- ---- -----"); + Syslog('t', "Task Type pid stat rc"); + Syslog('t', "---------------- ------- ----- ---- -----"); for (j = 0; j < MAXTASKS; j++) if (strlen(task[j].name)) - tasklog('t', "%-16s %s %5d %s %5d", task[j].name, callmode(task[j].tasktype), + Syslog('t', "%-16s %s %5d %s %5d", task[j].name, callmode(task[j].tasktype), task[j].pid, task[j].running?"runs":"stop", task[j].rc); } switch (task[i].rc) { case -1: if (errno == ECHILD) - tasklog('+', "Task %d \"%s\" is ready", i, task[i].name); + Syslog('+', "Task %d \"%s\" is ready", i, task[i].name); else - tasklog('+', "Task %d \"%s\" is ready, error: %s", i, task[i].name, strerror(errno)); + Syslog('+', "Task %d \"%s\" is ready, error: %s", i, task[i].name, strerror(errno)); break; case 0: /* @@ -621,20 +621,20 @@ int checktasks(int onsig) if (WIFEXITED(task[i].status)) { rc = WEXITSTATUS(task[i].status); if (rc) - tasklog('+', "Task %s is ready, error=%d", task[i].name, rc); + Syslog('+', "Task %s is ready, error=%d", task[i].name, rc); else - tasklog('+', "Task %s is ready", task[i].name); + Syslog('+', "Task %s is ready", task[i].name); } else if (WIFSIGNALED(task[i].status)) { rc = WTERMSIG(task[i].status); if (rc <= 31) - tasklog('+', "Task %s terminated on signal %s (%d)", task[i].name, SigName[rc], rc); + Syslog('+', "Task %s terminated on signal %s (%d)", task[i].name, SigName[rc], rc); else - tasklog('+', "Task %s terminated with error nr %d", task[i].name, rc); + Syslog('+', "Task %s terminated with error nr %d", task[i].name, rc); } else if (WIFSTOPPED(task[i].status)) { rc = WSTOPSIG(task[i].status); - tasklog('+', "Task %s stopped on signal %s (%d)", task[i].name, SigName[rc], rc); + Syslog('+', "Task %s stopped on signal %s (%d)", task[i].name, SigName[rc], rc); } else { - tasklog('+', "FIXME: 1"); + Syslog('+', "FIXME: 1"); } break; } @@ -663,15 +663,15 @@ void die(int onsig) signal(onsig, SIG_IGN); if (onsig == SIGTERM) - tasklog('+', "Starting normal shutdown"); + Syslog('+', "Starting normal shutdown"); else - tasklog('+', "Abnormal shutdown on signal %s", SigName[onsig]); + Syslog('+', "Abnormal shutdown on signal %s", SigName[onsig]); /* * First check if there are tasks running, if so try to stop them */ if ((count = checktasks(0))) { - tasklog('+', "There are %d tasks running, sending SIGTERM", count); + Syslog('+', "There are %d tasks running, sending SIGTERM", count); checktasks(SIGTERM); for (i = 0; i < 15; i++) { sleep(1); @@ -683,21 +683,21 @@ void die(int onsig) /* * There are some diehards running... */ - tasklog('+', "There are %d tasks running, sending SIGKILL", count); + Syslog('+', "There are %d tasks running, sending SIGKILL", count); count = checktasks(SIGKILL); } if (count) { sleep(1); count = checktasks(0); if (count) - tasklog('?', "Still %d tasks running, giving up", count); + Syslog('?', "Still %d tasks running, giving up", count); } } if ((count = checktasks(0))) - tasklog('?', "Shutdown with %d tasks still running", count); + Syslog('?', "Shutdown with %d tasks still running", count); else - tasklog('+', "Good, no more tasks running"); + Syslog('+', "Good, no more tasks running"); ulocktask(); if (sock != -1) @@ -707,7 +707,7 @@ void die(int onsig) if (!file_exist(spath, R_OK)) { unlink(spath); } - tasklog(' ', "MBTASK finished"); + Syslog(' ', "MBTASK finished"); exit(onsig); } @@ -791,7 +791,7 @@ void test_sema(char *sema) { if (IsSema(sema)) { RemoveSema(sema); - tasklog('s', "Semafore %s detected", sema); + Syslog('s', "Semafore %s detected", sema); sem_set(sema, TRUE); } } @@ -810,15 +810,15 @@ void check_sema(void) */ if (IsSema((char *)"upsalarm")) { if (!UPSalarm) - tasklog('!', "UPS: power failure"); + Syslog('!', "UPS: power failure"); UPSalarm = TRUE; } else { if (UPSalarm) - tasklog('!', "UPS: the power is back"); + Syslog('!', "UPS: the power is back"); UPSalarm = FALSE; } if (IsSema((char *)"upsdown")) { - tasklog('!', "UPS: power failure, starting shutdown"); + Syslog('!', "UPS: power failure, starting shutdown"); /* * Since the upsdown semafore is permanent, the system WILL go down * there is no point for this program to stay. Signal all tasks and stop. @@ -882,7 +882,7 @@ void scheduler(void) * Setup UNIX Datagram socket */ if ((sock = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) { - tasklog('?', "$Can't create socket"); + Syslog('?', "$Can't create socket"); die(MBERR_INIT_ERROR); } @@ -893,7 +893,7 @@ void scheduler(void) if (bind(sock, &servaddr, sizeof(servaddr)) < 0) { close(sock); sock = -1; - tasklog('?', "$Can't bind socket %s", spath); + Syslog('?', "$Can't bind socket %s", spath); die(MBERR_INIT_ERROR); } @@ -914,7 +914,7 @@ void scheduler(void) initnl(); sem_set((char *)"scanout", TRUE); if (!TCFG.max_tcp && !pots_lines && !isdn_lines) { - tasklog('?', "ERROR: this system cannot connect to other systems, check setup"); + Syslog('?', "ERROR: this system cannot connect to other systems, check setup"); } /* @@ -935,7 +935,7 @@ void scheduler(void) * Poll can be interrupted by a finished child so that's not a real error. */ if (errno != EINTR) { - tasklog('?', "$poll() rc=%d sock=%d, events=%04x", rc, sock, pfd.revents); + Syslog('?', "$poll() rc=%d sock=%d, events=%04x", rc, sock, pfd.revents); } } else if (rc) { if (pfd.revents & POLLIN) { @@ -947,7 +947,7 @@ void scheduler(void) rlen = recvfrom(sock, buf, sizeof(buf) -1, 0, &from, &fromlen); do_cmd(buf); } else { - tasklog('-', "Return poll rc=%d, events=%04x", rc, pfd.revents); + Syslog('-', "Return poll rc=%d, events=%04x", rc, pfd.revents); } } @@ -971,19 +971,19 @@ void scheduler(void) if (fscanf(fp, "%lf %lf %lf", &loadavg[0], &loadavg[1], &loadavg[2]) == 3) { Load = loadavg[0]; } else { - tasklog('-', "error"); + Syslog('-', "error"); } fclose(fp); } #endif if (Load >= TCFG.maxload) { if (!LOADhi) { - tasklog('!', "System load too high: %2.2f (%2.2f)", Load, TCFG.maxload); + Syslog('!', "System load too high: %2.2f (%2.2f)", Load, TCFG.maxload); LOADhi = TRUE; } } else { if (LOADhi) { - tasklog('!', "System load normal: %2.2f (%2.2f)", Load, TCFG.maxload); + Syslog('!', "System load normal: %2.2f (%2.2f)", Load, TCFG.maxload); LOADhi = FALSE; } } @@ -1021,17 +1021,17 @@ void scheduler(void) olddo = tm->tm_min; TouchSema((char *)"mbtask.last"); if (file_time(tcfgfn) != tcfg_time) { - tasklog('+', "Task configuration changed, reloading"); + Syslog('+', "Task configuration changed, reloading"); load_taskcfg(); sem_set((char *)"scanout", TRUE); } if (file_time(cfgfn) != cfg_time) { - tasklog('+', "Main configuration changed, reloading"); + Syslog('+', "Main configuration changed, reloading"); load_maincfg(); sem_set((char *)"scanout", TRUE); } if (file_time(ttyfn) != tty_time) { - tasklog('+', "Ports configuration changed, reloading"); + Syslog('+', "Ports configuration changed, reloading"); load_ports(); check_ports(); sem_set((char *)"scanout", TRUE); @@ -1041,7 +1041,7 @@ void scheduler(void) * If the next event time is reached, rescan the outbound */ if ((utm->tm_hour == nxt_hour) && (utm->tm_min == nxt_min)) { - tasklog('+', "It is now %02d:%02d UTC, starting new event", utm->tm_hour, utm->tm_min); + Syslog('+', "It is now %02d:%02d UTC, starting new event", utm->tm_hour, utm->tm_min); sem_set((char *)"scanout", TRUE); } } @@ -1051,12 +1051,12 @@ void scheduler(void) */ if (s_bbsopen && !UPSalarm && !LOADhi) { if (!Processing) { - tasklog('+', "Resuming normal operations"); + Syslog('+', "Resuming normal operations"); Processing = TRUE; } } else { if (Processing) { - tasklog('+', "Suspending operations"); + Syslog('+', "Suspending operations"); Processing = FALSE; } } @@ -1295,8 +1295,8 @@ int main(int argc, char **argv) sprintf(cfgfn, "%s/etc/config.data", getenv("MBSE_ROOT")); load_maincfg(); - tasklog(' ', " "); - tasklog(' ', "MBTASK v%s", VERSION); + Syslog(' ', " "); + Syslog(' ', "MBTASK v%s", VERSION); sprintf(tcfgfn, "%s/etc/task.data", getenv("MBSE_ROOT")); load_taskcfg(); status_init(); @@ -1327,14 +1327,14 @@ int main(int argc, char **argv) * associated with that terminal as its control terminal. */ if ((pgrp = setpgid(0, 0)) == -1) { - tasklog('?', "$setpgid failed"); + Syslog('?', "$setpgid failed"); die(MBERR_INIT_ERROR); } frk = fork(); switch (frk) { case -1: - tasklog('?', "$Unable to fork daemon"); + Syslog('?', "$Unable to fork daemon"); die(MBERR_INIT_ERROR); case 0: /* @@ -1355,7 +1355,7 @@ int main(int argc, char **argv) fprintf(fp, "%10u\n", frk); fclose(fp); } - tasklog('+', "Starting daemon with pid %d", frk); + Syslog('+', "Starting daemon with pid %d", frk); exit(MBERR_OK); } diff --git a/mbtask/nodelist.c b/mbtask/nodelist.c deleted file mode 100644 index f5019d10..00000000 --- a/mbtask/nodelist.c +++ /dev/null @@ -1,496 +0,0 @@ -/***************************************************************************** - * - * $Id$ - * Purpose ...............: Read nodelists information - * - ***************************************************************************** - * Copyright (C) 1997-2001 - * - * Michiel Broek FIDO: 2:280/2802 - * Beekmansbos 10 - * 1971 BV IJmuiden - * the Netherlands - * - * This file is part of MBSE BBS. - * - * This BBS is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2, or (at your option) any - * later version. - * - * MBSE BBS is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with MBSE BBS; see the file COPYING. If not, write to the Free - * Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - *****************************************************************************/ - -#include "../config.h" -#include "libs.h" -#include "../lib/structs.h" -#include "taskutil.h" -#include "nodelist.h" - - -#define NULLDOMAIN "nulldomain" - - -struct _pkey pkey[] = { - {(char *)"Down", NL_NODE, NL_DOWN}, - {(char *)"Hold", NL_NODE, NL_HOLD}, - {(char *)"Region", NL_REGION, NL_REGION}, - {(char *)"Host", NL_HOST, NL_HOST}, - {(char *)"Hub", NL_HUB, NL_HUB}, - {(char *)"Point", NL_POINT, NL_POINT}, - {(char *)"Pvt", NL_NODE, NL_NODE}, - {NULL, 0, 0} -}; - - - -struct _okey okey[] = { - {(char *)"CM", OL_CM}, - {(char *)"MO", OL_MO}, - {(char *)"LO", OL_LO}, - {(char *)"MN", OL_MN}, - {NULL, 0} -}; - -struct _fkey fkey[] = { - {(char *)"V22", NL_V22}, - {(char *)"V29", NL_V29}, - {(char *)"V32", NL_V32}, - {(char *)"V32B",NL_V32B | NL_V32}, - {(char *)"V34", NL_V34}, - {(char *)"V42", NL_V42 | NL_MNP}, - {(char *)"V42B",NL_V42B | NL_V42 | NL_MNP}, - {(char *)"MNP", NL_MNP}, - {(char *)"H96", NL_H96}, - {(char *)"HST", NL_HST | NL_MNP}, - {(char *)"H14", NL_H14 | NL_HST | NL_MNP}, - {(char *)"H16", NL_H16 | NL_H14 | NL_HST | NL_MNP | NL_V42 | NL_V42B}, - {(char *)"MAX", NL_MAX}, - {(char *)"PEP", NL_PEP}, - {(char *)"CSP", NL_CSP}, - {(char *)"V32T",NL_V32T | NL_V32B | NL_V32}, - {(char *)"VFC", NL_VFC}, - {(char *)"ZYX", NL_ZYX | NL_V32B | NL_V32 | NL_V42B | NL_V42 | NL_MNP}, - {(char *)"X2C", NL_X2C | NL_X2S | NL_V34}, - {(char *)"X2S", NL_X2S | NL_V34}, - {(char *)"V90C",NL_V90C | NL_V90S | NL_V34}, - {(char *)"V90S",NL_V90S | NL_V34}, - {(char *)"Z19", NL_Z19 | NL_V32B | NL_V32 | NL_V42B | NL_V42 | NL_MNP | NL_ZYX}, - {NULL, 0} -}; - -struct _xkey xkey [] = { - {(char *)"XA", RQ_XA}, - {(char *)"XB", RQ_XB}, - {(char *)"XC", RQ_XC}, - {(char *)"XP", RQ_XP}, - {(char *)"XR", RQ_XR}, - {(char *)"XW", RQ_XW}, - {(char *)"XX", RQ_XX}, - {NULL, 0} -}; - -struct _dkey dkey [] = { - {(char *)"V110L", ND_V110L}, - {(char *)"V110H", ND_V110H}, - {(char *)"V120L", ND_V120L}, - {(char *)"V120H", ND_V120H}, - {(char *)"X75", ND_X75}, - {NULL, 0} -}; - -struct _ikey ikey [] = { - {(char *)"IBN", IP_IBN}, - {(char *)"IFC", IP_IFC}, - {(char *)"ITN", IP_ITN}, - {(char *)"IVM", IP_IVM}, - {(char *)"IP", IP_IP}, - {(char *)"IFT", IP_IFT}, - {NULL, 0} -}; - -extern struct sysconfig CFG; - - -int initnl(void) -{ - int rc = 0; - FILE *dbf, *fp; - char *filexnm, *path; - struct _nlfil fdx; - - filexnm = xstrcpy(CFG.nodelists); - filexnm = xstrcat(filexnm,(char *)"/node.files"); - - if ((dbf = fopen(filexnm, "r")) == NULL) { - tasklog('?', "$Can't open %s", filexnm); - rc = 101; - } else { - path = calloc(PATH_MAX, sizeof(char)); - - while (fread(&fdx, sizeof(fdx), 1, dbf) == 1) { - sprintf(path, "%s/%s", CFG.nodelists, fdx.filename); - if ((fp = fopen(path, "r")) == NULL) { - tasklog('?', "$Can't open %s", path); - rc = 101; - } else { - fclose(fp); - } - } - - fclose(dbf); - free(path); - } - - free(filexnm); - return rc; -} - - - -int comp_node(struct _nlidx, struct _ixentry); -int comp_node(struct _nlidx fap1, struct _ixentry fap2) -{ - if (fap1.zone != fap2.zone) - return (fap1.zone - fap2.zone); - else if (fap1.net != fap2.net) - return (fap1.net - fap2.net); - else if (fap1.node != fap2.node) - return (fap1.node - fap2.node); - else - return (fap1.point - fap2.point); -} - - - -node *getnlent(faddr *addr) -{ - FILE *fp; - static node nodebuf; - static char buf[256], *p, *q; - struct _ixentry xaddr; - int i, j, Found = FALSE, ixflag, stdflag, ndrecord = FALSE; - char *mydomain, *path; - struct _nlfil fdx; - struct _nlidx ndx; - long lowest, highest, current; - struct _nodeshdr ndhdr; - static struct _nodes nd; - - mydomain = xstrcpy(CFG.aka[0].domain); - if (mydomain == NULL) - mydomain = (char *)NULLDOMAIN; - - nodebuf.addr.domain = NULL; - nodebuf.addr.zone = 0; - nodebuf.addr.net = 0; - nodebuf.addr.node = 0; - nodebuf.addr.point = 0; - nodebuf.addr.name = NULL; - nodebuf.upnet = 0; - nodebuf.upnode = 0; - nodebuf.region = 0; - nodebuf.type = 0; - nodebuf.pflag = 0; - nodebuf.name = NULL; - nodebuf.location = NULL; - nodebuf.sysop = NULL; - nodebuf.phone = NULL; - nodebuf.speed = 0; - nodebuf.mflags = 0L; - nodebuf.oflags = 0L; - nodebuf.xflags = 0L; - nodebuf.iflags = 0L; - nodebuf.dflags = 0L; - nodebuf.uflags[0] = NULL; - nodebuf.t1 = '\0'; - nodebuf.t2 = '\0'; - - if (addr == NULL) - goto retdummy; - - if (addr->zone == 0) - addr->zone = CFG.aka[0].zone; - xaddr.zone = addr->zone; - nodebuf.addr.zone = addr->zone; - xaddr.net = addr->net; - nodebuf.addr.net = addr->net; - xaddr.node = addr->node; - nodebuf.addr.node = addr->node; - xaddr.point = addr->point; - nodebuf.addr.point = addr->point; - - if (initnl()) - goto retdummy; - - /* - * First, lookup node in index. NOTE -- NOT 5D YET - */ - path = calloc(128, sizeof(char)); - sprintf(path, "%s/%s", CFG.nodelists, "node.index"); - if ((fp = fopen(path, "r")) == NULL) { - tasklog('?', "$Can't open %s", path); - free(path); - goto retdummy; - } - - fseek(fp, 0, SEEK_END); - highest = ftell(fp) / sizeof(ndx); - lowest = 0; - - while (TRUE) { - current = ((highest - lowest) / 2) + lowest; - fseek(fp, current * sizeof(ndx), SEEK_SET); - if (fread(&ndx, sizeof(ndx), 1, fp) != 1) - break; - - if (comp_node(ndx, xaddr) == 0) { - Found = TRUE; - break; - } - if (comp_node(ndx, xaddr) < 0) - lowest = current; - else - highest = current; - if ((highest - lowest) <= 1) - break; - } - - fclose(fp); - - if (!Found) { - free(path); - goto retdummy; - } - - sprintf(path, "%s/%s", CFG.nodelists, "node.files"); - if ((fp = fopen(path, "r")) == NULL) { - tasklog('?', "$Can't open %s", path); - free(path); - goto retdummy; - } - - /* - * Get filename from node.files - */ - for (i = 0; i < (ndx.fileno +1); i++) - fread(&fdx, sizeof(fdx), 1, fp); - fclose(fp); - - /* CHECK DOMAIN HERE */ - - /* - * Open and read in real nodelist - */ - sprintf(path, "%s/%s", CFG.nodelists, fdx.filename); - if ((fp = fopen(path, "r")) == NULL) { - tasklog('?', "$Can't open %s", path); - free(path); - goto retdummy; - } - - if (fseek(fp, ndx.offset, SEEK_SET) != 0) { - tasklog('?', "$Seek failed for nodelist entry"); - fclose(fp); - goto retdummy; - } - - if (fgets(buf, sizeof(buf)-1, fp) == NULL) { - tasklog('?', "$fgets failed for nodelist entry"); - fclose(fp); - goto retdummy; - } - fclose(fp); - - /* - * Load noderecord if this node has one, if there is one then - * nodelist overrides in this record will be used instead of - * the nodelist entries. - */ - sprintf(path, "%s/etc/nodes.data", getenv("MBSE_ROOT")); - if ((fp = fopen(path, "r")) != NULL) { - fread(&ndhdr, sizeof(ndhdr), 1, fp); - - while (fread(&nd, ndhdr.recsize, 1, fp) == 1) { - fseek(fp, ndhdr.filegrp + ndhdr.mailgrp, SEEK_CUR); - for (i = 0; i < 20; i++) { - if ((addr->zone == nd.Aka[i].zone) && (addr->net == nd.Aka[i].net) && - (addr->node == nd.Aka[i].node) && (addr->point == nd.Aka[i].point)) { - ndrecord = TRUE; - break; - } - } - if (ndrecord) - break; - } - - fclose(fp); - } - free(path); - - nodebuf.type = ndx.type; - nodebuf.pflag = ndx.pflag; - - if (*(p = buf + strlen(buf) -1) == '\n') - *p = '\0'; - if (*(p = buf + strlen(buf) -1) == '\r') - *p = '\0'; - for (p = buf; *p; p++) - if (*p == '_') - *p = ' '; - - p = buf; - - if ((q = strchr(p,','))) - *q++ = '\0'; - - p = q; - if (p == NULL) - goto badsyntax; - - if ((q=strchr(p,','))) - *q++ = '\0'; - p = q; - if (p == NULL) - goto badsyntax; - - /* - * Get system name - */ - if ((q=strchr(p,','))) - *q++ = '\0'; - if (ndrecord && strlen(nd.Nl_hostname)) - nodebuf.name = nd.Nl_hostname; - else - nodebuf.name = p; - p = q; - if (p == NULL) - goto badsyntax; - - /* - * Get location - */ - if ((q=strchr(p,','))) - *q++ = '\0'; - nodebuf.location = p; - p = q; - if (p == NULL) - goto badsyntax; - - /* - * Get sysop name - */ - if ((q=strchr(p,','))) - *q++ = '\0'; - nodebuf.sysop = p; - p = q; - if (p == NULL) - goto badsyntax; - - /* - * Get phone number - */ - if ((q=strchr(p,','))) - *q++ = '\0'; - if (strcasecmp(p, "-Unpublished-") == 0) - nodebuf.phone = NULL; - else - nodebuf.phone = p; - p = q; - if (p == NULL) - goto badsyntax; - - /* - * Get modem speed - */ - if ((q=strchr(p,','))) - *q++ = '\0'; - nodebuf.speed = atoi(p); - - /* - * Process the nodelist flags, get them from the node override - * field if this is present, else use the nodelist. - */ - if (ndrecord && strlen(nd.Nl_flags)) - q = nd.Nl_flags; - ixflag = 0; - stdflag = TRUE; - for (p = q; p; p = q) { - if ((q = strchr(p, ','))) - *q++ = '\0'; - if ((strncasecmp(p, "U", 1) == 0) && (strlen(p) == 1)) { - stdflag = FALSE; - } else { - /* - * Experimental: process authorized flags and - * User flags both as authorized. - */ - for (j = 0; fkey[j].key; j++) - if (strcasecmp(p, fkey[j].key) == 0) - nodebuf.mflags |= fkey[j].flag; - for (j = 0; okey[j].key; j++) - if (strcasecmp(p, okey[j].key) == 0) - nodebuf.oflags |= okey[j].flag; - for (j = 0; dkey[j].key; j++) - if (strcasecmp(p, dkey[j].key) == 0) - nodebuf.dflags |= dkey[j].flag; - for (j = 0; ikey[j].key; j++) - if (strncasecmp(p, ikey[j].key, strlen(ikey[j].key)) == 0) - nodebuf.iflags |= ikey[j].flag; - for (j = 0; xkey[j].key; j++) - if (strcasecmp(p, xkey[j].key) == 0) - nodebuf.xflags |= xkey[j].flag; - if ((p[0] == 'T') && (strlen(p) == 3)) { - /* - * System open hours flag - */ - nodebuf.t1 = p[1]; - nodebuf.t2 = p[2]; - } - if (!stdflag) { - if (ixflag < MAXUFLAGS) { - nodebuf.uflags[ixflag++] = p; - if (ixflag < MAXUFLAGS) - nodebuf.uflags[ixflag] = NULL; - } - } - } - } - - nodebuf.addr.name = nodebuf.sysop; - nodebuf.addr.domain = xstrcpy(fdx.domain); - nodebuf.upnet = ndx.upnet; - nodebuf.upnode = ndx.upnode; - nodebuf.region = ndx.region; - if (addr->domain == NULL) - addr->domain = xstrcpy(nodebuf.addr.domain); - - free(mydomain); - return &nodebuf; - -badsyntax: - tasklog('?', "nodelist %d offset +%lu: bad syntax in line \"%s\"", ndx.fileno, (unsigned long)ndx.offset, buf); - /* fallthrough */ - -retdummy: - memset(&nodebuf, 0, sizeof(nodebuf)); - nodebuf.pflag = NL_DUMMY; - nodebuf.name = (char *)"Unknown"; - nodebuf.location = (char *)"Nowhere"; - nodebuf.sysop = (char *)"Sysop"; - nodebuf.phone = NULL; - nodebuf.speed = 2400; - free(mydomain); - - return &nodebuf; -} - - - diff --git a/mbtask/outstat.c b/mbtask/outstat.c index 769b837d..bfa7ded0 100644 --- a/mbtask/outstat.c +++ b/mbtask/outstat.c @@ -35,7 +35,7 @@ #include "taskutil.h" #include "taskstat.h" #include "scanout.h" -#include "nodelist.h" +#include "../lib/nodelist.h" #include "callstat.h" #include "ports.h" #include "outstat.h" @@ -153,7 +153,7 @@ char *callstatus(int status) case MBERR_NOT_ZMH: return (char *)"No ZMH "; case MBERR_SESSION_ERROR: return (char *)"Badsess"; case MBERR_NO_IP_ADDRESS: return (char *)"No IP "; - default: tasklog('-', "callstatus(%d), unknown", status); + default: Syslog('-', "callstatus(%d), unknown", status); return (char *)"ERROR "; } } @@ -208,7 +208,7 @@ int outstat() uhour = tm->tm_hour; umin = tm->tm_min; sprintf(utc, "%02d:%02d", uhour, umin); - tasklog('+', "Scanning outbound at %s UTC.", utc); + Syslog('+', "Scanning outbound at %s UTC.", utc); nxt_hour = 24; nxt_min = 0; inet_calls = isdn_calls = pots_calls = 0; @@ -223,7 +223,7 @@ int outstat() alist = NULL; if ((rc = scanout(each))) { - tasklog('?', "Error scanning outbound, aborting"); + Syslog('?', "Error scanning outbound, aborting"); return rc; } @@ -233,7 +233,7 @@ int outstat() temp = calloc(PATH_MAX, sizeof(char)); sprintf(temp, "%s/etc/nodes.data", getenv("MBSE_ROOT")); if ((fp = fopen(temp, "r")) == NULL) { - tasklog('?', "Error open %s, aborting", temp); + Syslog('?', "Error open %s, aborting", temp); free(temp); return 1; } @@ -272,7 +272,7 @@ int outstat() if ((sb.st_mode & S_IRUSR) && (sb.st_mode & S_IWUSR)) { each(fa, flavor, OUT_FIL, temp); } else { - tasklog('+', "No R/W permission on %s", temp); + Syslog('+', "No R/W permission on %s", temp); } } else if (pw->pw_gid == sb.st_gid) { /* @@ -281,7 +281,7 @@ int outstat() if ((sb.st_mode & S_IRGRP) && (sb.st_mode & S_IWGRP)) { each(fa, flavor, OUT_FIL, temp); } else { - tasklog('+', "No R/W permission on %s", temp); + Syslog('+', "No R/W permission on %s", temp); } } else { /* @@ -290,14 +290,14 @@ int outstat() if ((sb.st_mode & S_IROTH) && (sb.st_mode & S_IWOTH)) { each(fa, flavor, OUT_FIL, temp); } else { - tasklog('+', "No R/W permission on %s", temp); + Syslog('+', "No R/W permission on %s", temp); } } } else { - tasklog('+', "Not a regular file: %s", temp); + Syslog('+', "Not a regular file: %s", temp); } } else { - tasklog('?', "Can't stat %s", temp); + Syslog('?', "Can't stat %s", temp); } } } @@ -318,12 +318,12 @@ int outstat() */ for (tmp = alist; tmp; tmp = tmp->next) { if (first) { - tasklog('+', "Flavor Out Size Online Modem ISDN TCP/IP Calls Status Mode Address"); + Syslog('+', "Flavor Out Size Online Modem ISDN TCP/IP Calls Status Mode Address"); first = FALSE; } rc = load_node(tmp->addr); -// tasklog('o', "Load node %s rc=%s, NoCall=%s, NoTCP=%s", ascfnode(tmp->addr, 0x0f), rc?"true":"false", +// Syslog('o', "Load node %s rc=%s, NoCall=%s, NoTCP=%s", ascfnode(tmp->addr, 0x0f), rc?"true":"false", // nodes.NoCall?"True":"False", nodes.NoTCP?"True":"False"); /* @@ -399,7 +399,7 @@ int outstat() T_window = TRUE; } } -// tasklog('o', "T_window=%s, iszmh=%s", T_window?"true":"false", iszmh?"true":"false"); +// Syslog('o', "T_window=%s, iszmh=%s", T_window?"true":"false", iszmh?"true":"false"); strcpy(flstr,"...... .... .."); /* @@ -516,7 +516,7 @@ int outstat() * Here we are out of options, clear callflag. */ if (tmp->callmode == CM_NONE) { - tasklog('!', "No method to call %s available", ascfnode(tmp->addr, 0x0f)); + Syslog('!', "No method to call %s available", ascfnode(tmp->addr, 0x0f)); tmp->flavors &= ~F_CALL; } } @@ -536,7 +536,7 @@ int outstat() (unsigned int)tmp->olflags, (unsigned int)tmp->moflags, (unsigned int)tmp->diflags, (unsigned int)tmp->ipflags, tmp->cst.tryno, callstatus(tmp->cst.trystat), callmode(tmp->callmode), ascfnode(tmp->addr, 0x0f)); - tasklog('+', "%s", temp); + Syslog('+', "%s", temp); } /* All nodes scanned. */ @@ -554,17 +554,17 @@ int outstat() if (!IsSema((char *)"do_inet") && inet_calls) { CreateSema((char *)"do_inet"); s_do_inet = TRUE; - tasklog('c', "Created semafore do_inet"); + Syslog('c', "Created semafore do_inet"); } else if (IsSema((char *)"do_inet") && !inet_calls) { RemoveSema((char *)"do_inet"); s_do_inet = FALSE; - tasklog('c', "Removed semafore do_inet"); + Syslog('c', "Removed semafore do_inet"); } /* * Log results */ - tasklog('+', "Systems to call: Inet=%d, ISDN=%d, POTS=%d, Next event at %02d:%02d UTC", + Syslog('+', "Systems to call: Inet=%d, ISDN=%d, POTS=%d, Next event at %02d:%02d UTC", inet_calls, isdn_calls, pots_calls, nxt_hour, nxt_min); free(temp); return 0; @@ -633,11 +633,11 @@ int each(faddr *addr, char flavor, int isflo, char *fname) case 'o': (*tmp)->flavors |= F_NORMAL; break; case 'c': (*tmp)->flavors |= F_CRASH; break; case 'h': (*tmp)->flavors |= F_HOLD; break; - default: tasklog('?', "Unknown flavor: '%c'\n",flavor); break; + default: Syslog('?', "Unknown flavor: '%c'\n",flavor); break; } if (stat(fname,&st) != 0) { - tasklog('?', "$Can't stat %s", fname); + Syslog('?', "$Can't stat %s", fname); st.st_size = 0L; st.st_mtime = time(NULL); } @@ -694,7 +694,7 @@ int each(faddr *addr, char flavor, int isflo, char *fname) } fclose(fp); } else - tasklog('?', "Can't open %s", fname); + Syslog('?', "Can't open %s", fname); } else if (isflo == OUT_PKT) { (*tmp)->size += st.st_size; diff --git a/mbtask/ping.c b/mbtask/ping.c index dd3cd587..d95f87a4 100644 --- a/mbtask/ping.c +++ b/mbtask/ping.c @@ -170,7 +170,7 @@ int ping_send(struct in_addr addr) #ifndef __linux__ if (!(pe = getprotobyname("ip"))) { - tasklog('?', "icmp ping: getprotobyname() failed: %s", strerror(errno)); + Syslog('?', "icmp ping: getprotobyname() failed: %s", strerror(errno)); return -1; } SOL_IP = pe->p_proto; @@ -191,7 +191,7 @@ int ping_send(struct in_addr addr) f.data=0xfffff7f6; if (setsockopt(ping_isocket, SOL_RAW, ICMP_FILTER, &f, sizeof(f)) == -1) { if (icmp_errs < ICMP_MAX_ERRS) - tasklog('?', "$icmp ping: setsockopt() failed %d", ping_isocket); + Syslog('?', "$icmp ping: setsockopt() failed %d", ping_isocket); return -1; } #endif @@ -224,9 +224,9 @@ int ping_send(struct in_addr addr) if (sentlen != ICMP4_ECHO_LEN) { if (icmp_errs < ICMP_MAX_ERRS) { if (sentlen == -1) - tasklog('+', "ping: sent error: %s", strerror(errno)); + Syslog('+', "ping: sent error: %s", strerror(errno)); else - tasklog('+', "ping: sent %d octets, ret %d", ICMP4_ECHO_LEN, sentlen); + Syslog('+', "ping: sent %d octets, ret %d", ICMP4_ECHO_LEN, sentlen); } return -2; } @@ -263,7 +263,7 @@ int ping_receive(struct in_addr addr) */ if (poll(&pfd, 1, 10) < 0) { if (icmp_errs < ICMP_MAX_ERRS) - tasklog('?', "$poll/select failed"); + Syslog('?', "$poll/select failed"); return -3; } @@ -317,16 +317,16 @@ void check_ping(void) pingresult[1] = pingresult[2] = internet = FALSE; break; - case P_PAUSE: // tasklog('p', "PAUSE:"); + case P_PAUSE: // Syslog('p', "PAUSE:"); if (time(NULL) >= pingtime) pingstate = P_SENT; break; - case P_WAIT: // tasklog('p', "WAIT:"); + case P_WAIT: // Syslog('p', "WAIT:"); if (time(NULL) >= pingtime) { pingstate = P_ERROR; if (icmp_errs < ICMP_MAX_ERRS) - tasklog('?', "ping: to %s timeout", pingaddress); + Syslog('?', "ping: to %s timeout", pingaddress); } else { /* * Quickly eat all packets not for us, we only want our @@ -339,11 +339,11 @@ void check_ping(void) */ rc = time(NULL) - (pingtime - 20); if (rc > 2) - tasklog('p', "ping: reply after %d seconds", rc); + Syslog('p', "ping: reply after %d seconds", rc); pingresult[pingnr] = TRUE; if (pingresult[1] || pingresult[2]) { if (!internet) { - tasklog('!', "Internet connection is up"); + Syslog('!', "Internet connection is up"); internet = TRUE; sem_set((char *)"scanout", TRUE); CreateSema((char *)"is_inet"); @@ -355,14 +355,14 @@ void check_ping(void) pingstate = P_PAUSE; } else { if (rc != -6) { - tasklog('p', "ping: recv %s id=%d rc=%d", pingaddress, id, rc); + Syslog('p', "ping: recv %s id=%d rc=%d", pingaddress, id, rc); pingstate = P_ERROR; } } } break; - case P_SENT: // tasklog('p', "SENT:"); + case P_SENT: // Syslog('p', "SENT:"); pingtime = time(NULL) + 10; // 10 secs timeout for pause. if (pingnr == 1) { pingnr = 2; @@ -384,12 +384,12 @@ void check_ping(void) } } pingtime = time(NULL) + 20; // 20 secs timeout for a real ping - // tasklog('p', "nr %d address %s", pingnr, pingaddress); + // Syslog('p', "nr %d address %s", pingnr, pingaddress); if (inet_aton(pingaddress, &paddr)) { rc = ping_send(paddr); if (rc) { if (icmp_errs++ < ICMP_MAX_ERRS) - tasklog('?', "ping: to %s rc=%d", pingaddress, rc); + Syslog('?', "ping: to %s rc=%d", pingaddress, rc); pingstate = P_ERROR; pingresult[pingnr] = FALSE; } else { @@ -397,17 +397,17 @@ void check_ping(void) } } else { if (icmp_errs++ < ICMP_MAX_ERRS) - tasklog('?', "Ping address %d is invalid \"%s\"", pingnr, pingaddress); + Syslog('?', "Ping address %d is invalid \"%s\"", pingnr, pingaddress); pingstate = P_PAUSE; } break; - case P_ERROR: // tasklog('p', "ERROR:"); + case P_ERROR: // Syslog('p', "ERROR:"); pingresult[pingnr] = FALSE; if (pingresult[1] == FALSE && pingresult[2] == FALSE) { icmp_errs++; if (internet) { - tasklog('!', "Internet connection is down"); + Syslog('!', "Internet connection is down"); internet = FALSE; sem_set((char *)"scanout", TRUE); RemoveSema((char *)"is_inet"); diff --git a/mbtask/ports.c b/mbtask/ports.c index 6e6aa5a5..b3f03ae4 100644 --- a/mbtask/ports.c +++ b/mbtask/ports.c @@ -32,7 +32,7 @@ #include "libs.h" #include "../lib/structs.h" #include "taskutil.h" -#include "nodelist.h" +#include "../lib/nodelist.h" #include "ports.h" @@ -116,7 +116,7 @@ void load_ports() tidy_portlist(&pl); if ((fp = fopen(ttyfn, "r")) == NULL) { - tasklog('?', "$Can't open %s", ttyfn); + Syslog('?', "$Can't open %s", ttyfn); return; } fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, fp); @@ -151,14 +151,14 @@ void load_ports() } } - tasklog('p', "port %s modem %08lx ISDN %08lx", new.tty, new.mflags, new.dflags); + Syslog('p', "port %s modem %08lx ISDN %08lx", new.tty, new.mflags, new.dflags); fill_portlist(&pl, &new); } } fclose(fp); tty_time = file_time(ttyfn); - tasklog('+', "Detected %d modem port%s and %d ISDN port%s", + Syslog('+', "Detected %d modem port%s and %d ISDN port%s", pots_lines, (pots_lines == 1)?"":"s", isdn_lines, (isdn_lines == 1)?"":"s"); } @@ -183,7 +183,7 @@ void check_ports(void) if ((lf = fopen(lckname, "r")) == NULL) { if (tpl->locked) { tpl->locked = 0; - tasklog('+', "Port %s is now free after %d seconds", tpl->tty, tpl->locktime); + Syslog('+', "Port %s is now free after %d seconds", tpl->tty, tpl->locktime); if (tpl->locktime > 4) /* * Good, set master rescan flag if longer then 4 seconds locked. @@ -195,14 +195,14 @@ void check_ports(void) rempid = tmppid; fclose(lf); if (kill(rempid, 0) && (errno == ESRCH)) { - tasklog('+', "Stale lockfile for %s, unlink", tpl->tty); + Syslog('+', "Stale lockfile for %s, unlink", tpl->tty); unlink(lckname); changed = TRUE; } else { if (!tpl->locked) { tpl->locked = rempid; tpl->locktime = 0; - tasklog('+', "Port %s locked, pid %d", tpl->tty, rempid); + Syslog('+', "Port %s locked, pid %d", tpl->tty, rempid); } else { /* * Count locktime @@ -210,7 +210,7 @@ void check_ports(void) tpl->locktime++; if (tpl->locktime == 5) { changed = TRUE; - tasklog('+', "Port %s locked for 5 seconds, forcing scan", tpl->tty); + Syslog('+', "Port %s locked for 5 seconds, forcing scan", tpl->tty); } } } @@ -226,7 +226,7 @@ void check_ports(void) if (changed) { rescan = TRUE; - tasklog('p', "Free ports: pots=%d isdn=%d", pots_free, isdn_free); + Syslog('p', "Free ports: pots=%d isdn=%d", pots_free, isdn_free); } } } diff --git a/mbtask/scanout.c b/mbtask/scanout.c index 103e8698..6ffb7367 100644 --- a/mbtask/scanout.c +++ b/mbtask/scanout.c @@ -63,17 +63,17 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo time_t t_start; t_start = time(NULL); -// tasklog('o' ,"scan_dir \"%s\" (%s)",MBSE_SS(dname),ispoint?"point":"node"); +// Syslog('o' ,"scan_dir \"%s\" (%s)",MBSE_SS(dname),ispoint?"point":"node"); if ((dp = opendir(dname)) == NULL) { - tasklog('-', "Creating directory %s", dname); + Syslog('-', "Creating directory %s", dname); /* * Create a fake filename, mkdirs() likes that. */ sprintf(fname, "%s/foo", dname); (void)mkdirs(fname, 0770); if ((dp = opendir(dname)) == NULL) { - tasklog('o' ,"\"%s\" cannot be opened, proceed",MBSE_SS(dname)); + Syslog('o' ,"\"%s\" cannot be opened, proceed",MBSE_SS(dname)); return 0; } } @@ -81,7 +81,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo while ((de=readdir(dp))) if ((strlen(de->d_name) == 12) && (de->d_name[8] == '.') && (strspn(de->d_name,"0123456789abcdefABCDEF") == 8)) { -// tasklog('o' ,"checking: \"%s\"",de->d_name); +// Syslog('o' ,"checking: \"%s\"",de->d_name); addr.point= 0; strncpy(fname,dname,PATH_MAX-2); strcat(fname,"/"); @@ -124,7 +124,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo isflo=OUT_POL; else isflo=-1; -// tasklog('o' ,"%s \"%s\"", (isflo == OUT_FLO) ? "flo file" : "packet", de->d_name); +// Syslog('o' ,"%s \"%s\"", (isflo == OUT_FLO) ? "flo file" : "packet", de->d_name); if ((rc=fn(&addr,flavor,isflo,fname))) goto exout; } else if ((strncasecmp(de->d_name+9,"su",2) == 0) || @@ -138,12 +138,12 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo if ((rc = fn(&addr, flavor, isflo, fname))) goto exout; -// tasklog('o' ,"arcmail file \"%s\"",de->d_name); +// Syslog('o' ,"arcmail file \"%s\"",de->d_name); sprintf(fname, "%s/%s", dname, de->d_name); fage = (int)((t_start - file_time(fname)) / 86400); if (file_size(fname) == 0) { -// tasklog('o', "Age %d days", fage); +// Syslog('o', "Age %d days", fage); /* * Remove truncated ARCmail that has a day extension * other then the current day or if the file is older @@ -151,7 +151,7 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo */ if ((strncasecmp(de->d_name+9, dayname(), 2)) || (fage > 6)) { if (unlink(fname) == 0) - tasklog('-', "Removed truncated ARCmail file %s", fname); + Syslog('-', "Removed truncated ARCmail file %s", fname); } } @@ -160,10 +160,10 @@ static int scan_dir(int (*fn)(faddr *, char, int, char *), char *dname, int ispo * Remove ARCmail that is on hold too long. */ if (unlink(fname) == 0) - tasklog('+', "Removed ARCmail %s, %d days", fname, fage); + Syslog('+', "Removed ARCmail %s, %d days", fname, fage); } } else { -// tasklog('o' ,"skipping \"%s\"",de->d_name); +// Syslog('o' ,"skipping \"%s\"",de->d_name); } } @@ -183,7 +183,7 @@ int scanout(int (*fn)(faddr *, char, int, char *)) DIR *dp; if ((dp = opendir(CFG.outbound)) == NULL) { - tasklog('?', "$Can't open outbound directory \"%s\" for reading", MBSE_SS(CFG.outbound)); + Syslog('?', "$Can't open outbound directory \"%s\" for reading", MBSE_SS(CFG.outbound)); return 1; } closedir(dp); @@ -217,7 +217,7 @@ int scanout(int (*fn)(faddr *, char, int, char *)) sprintf(fext, ".%03x", fidonet.zone[j]); p = xstrcat(p, fext); } -// tasklog('o', "Zone %d Dir %s", fidonet.zone[j], p); +// Syslog('o', "Zone %d Dir %s", fidonet.zone[j], p); addr.zone = fidonet.zone[j]; addr.domain = fidonet.domain; diff --git a/mbtask/taskcomm.c b/mbtask/taskcomm.c index 3d4cdaeb..b9b28f72 100644 --- a/mbtask/taskcomm.c +++ b/mbtask/taskcomm.c @@ -450,17 +450,17 @@ void do_cmd(char *cmd) int slen, tries = 0; if (logtrans) - tasklog('-', "< %s", cmd); + Syslog('-', "< %s", cmd); sprintf(buf, "%s", exe_cmd(cmd)); if (logtrans) - tasklog('-', "> %s", buf); + Syslog('-', "> %s", buf); for (;;) { slen = sendto(sock, buf, strlen(buf), 0, &from, fromlen); if (slen == -1) - tasklog('?', "$do_cmd(): sendto error %d %s", tries, from.sun_path); + Syslog('?', "$do_cmd(): sendto error %d %s", tries, from.sun_path); else if (slen != strlen(buf)) - tasklog('?', "do_cmd(): send %d of %d bytes, try=%d", slen, strlen(buf), tries); + Syslog('?', "do_cmd(): send %d of %d bytes, try=%d", slen, strlen(buf), tries); else return; tries++; diff --git a/mbtask/taskregs.c b/mbtask/taskregs.c index 338685b7..e13317fe 100644 --- a/mbtask/taskregs.c +++ b/mbtask/taskregs.c @@ -55,7 +55,7 @@ int reg_find(char *pids) return i; } - tasklog('?', "Panic, pid %s not found", pids); + Syslog('?', "Panic, pid %s not found", pids); return -1; } @@ -82,7 +82,7 @@ int reg_newcon(char *data) * Abort if no empty record is found */ if ((retval = reg_find((char *)"0")) == -1) { - tasklog('?', "Maximum clients (%d) reached", MAXCLIENT); + Syslog('?', "Maximum clients (%d) reached", MAXCLIENT); return -1; } @@ -106,7 +106,7 @@ int reg_newcon(char *data) stat_inc_clients(); if (strcmp(prg, (char *)"mbcico") == 0) mailers++; - tasklog('-', "Registered client pgm \"%s\", pid %s, slot %d, mailers %d, TCP/IP %d", + Syslog('-', "Registered client pgm \"%s\", pid %s, slot %d, mailers %d, TCP/IP %d", prg, pid, retval, mailers, ipmailers); return retval; } @@ -127,7 +127,7 @@ int reg_closecon(char *data) mailers--; if (reginfo[rec].istcp) ipmailers--; - tasklog('-', "Unregistered client pgm \"%s\", pid %s, slot %d, mailers %d, TCP/IP %d", + Syslog('-', "Unregistered client pgm \"%s\", pid %s, slot %d, mailers %d, TCP/IP %d", reginfo[rec].prg, pid, rec, mailers, ipmailers); memset(®info[rec], 0, sizeof(reg_info)); stat_dec_clients(); @@ -153,7 +153,7 @@ void reg_check(void) mailers--; if (reginfo[i].istcp) ipmailers--; - tasklog('?', "Stale registration found for pid %d (%s), mailers now %d, TCP/IP now %d", + Syslog('?', "Stale registration found for pid %d (%s), mailers now %d, TCP/IP now %d", reginfo[i].pid, reginfo[i].prg, mailers, ipmailers); memset(®info[i], 0, sizeof(reg_info)); stat_dec_clients(); @@ -165,10 +165,10 @@ void reg_check(void) if ((Now - reginfo[i].lastcon) >= reginfo[i].altime) { if (reginfo[i].altime < 600) { kill(reginfo[i].pid, SIGKILL); - tasklog('+', "Send SIGKILL to pid %d", reginfo[i].pid); + Syslog('+', "Send SIGKILL to pid %d", reginfo[i].pid); } else { kill(reginfo[i].pid, SIGTERM); - tasklog('+', "Send SIGTERM to pid %d", reginfo[i].pid); + Syslog('+', "Send SIGTERM to pid %d", reginfo[i].pid); } /* * 10 seconds to the next kill @@ -222,7 +222,7 @@ int reg_ip(char *data) reginfo[rec].istcp = TRUE; reginfo[rec].lastcon = time(NULL); ipmailers++; - tasklog('?', "TCP/IP session registered (%s), now %d sessions", pid, ipmailers); + Syslog('?', "TCP/IP session registered (%s), now %d sessions", pid, ipmailers); return 0; } @@ -275,7 +275,7 @@ int reg_timer(int Set, char *data) reginfo[rec].altime = val; reginfo[rec].lastcon = time(NULL); - tasklog('r', "Set timeout value for %d to %d", reginfo[rec].pid, val); + Syslog('r', "Set timeout value for %d to %d", reginfo[rec].pid, val); return 0; } @@ -379,7 +379,7 @@ char *reg_ipm(char *data) reginfo[rec].ptr_out = 0; if (reginfo[rec].ptr_out == reginfo[rec].ptr_in) reginfo[rec].ismsg = FALSE; - tasklog('+', "reg_ipm: in=%d out=%d ismsg=%d", reginfo[rec].ptr_in, reginfo[rec].ptr_out, reginfo[rec].ismsg); + Syslog('+', "reg_ipm: in=%d out=%d ismsg=%d", reginfo[rec].ptr_in, reginfo[rec].ptr_out, reginfo[rec].ismsg); return buf; } @@ -427,7 +427,7 @@ int reg_spm(char *data) else reginfo[i].ptr_in = 0; reginfo[i].ismsg = TRUE; - tasklog('+', "reg_spm: in=%d out=%d ismsg=%d", reginfo[i].ptr_in, reginfo[i].ptr_out, reginfo[i].ismsg); + Syslog('+', "reg_spm: in=%d out=%d ismsg=%d", reginfo[i].ptr_in, reginfo[i].ptr_out, reginfo[i].ismsg); return 0; } } diff --git a/mbtask/taskstat.c b/mbtask/taskstat.c index 05b82c73..82116d49 100644 --- a/mbtask/taskstat.c +++ b/mbtask/taskstat.c @@ -113,7 +113,7 @@ void status_init() status.sequence = (unsigned long)time(NULL); stat_fd = open(stat_fn, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); cnt = write(stat_fd, &status, sizeof(status_r)); - tasklog('+', "New statusfile created"); + Syslog('+', "New statusfile created"); lseek(stat_fd, 0, SEEK_SET); } @@ -129,7 +129,7 @@ void status_init() lseek(stat_fd, 0, SEEK_SET); cnt = write(stat_fd, &status, sizeof(status_r)); if (cnt != sizeof(status_r)) { - tasklog('?', "$Error rewrite status file\n"); + Syslog('?', "$Error rewrite status file\n"); exit(MBERR_INIT_ERROR); } close(stat_fd); @@ -156,36 +156,36 @@ void status_write(void) * If we passed to the next day, zero the today counters */ if (ttm->tm_yday != ytm->tm_yday) { - tasklog('+', "Last days statistics:"); - tasklog('+', "Total clients : %lu", status.today.tot_clt); - tasklog('+', "Peak clients : %lu", status.today.peak_clt); - tasklog('+', "Syntax errors : %lu", status.today.s_error); - tasklog('+', "Comms errors : %lu", status.today.c_error); + Syslog('+', "Last days statistics:"); + Syslog('+', "Total clients : %lu", status.today.tot_clt); + Syslog('+', "Peak clients : %lu", status.today.peak_clt); + Syslog('+', "Syntax errors : %lu", status.today.s_error); + Syslog('+', "Comms errors : %lu", status.today.c_error); memset((char *)&status.today, 0, sizeof(cl_stat)); status.daily = time(NULL); - tasklog('+', "Zeroed todays status counters"); + Syslog('+', "Zeroed todays status counters"); } if ((stat_fd = open(stat_fn, O_RDWR)) == -1) { - tasklog('?', "$Error open statusfile %s", stat_fn); + Syslog('?', "$Error open statusfile %s", stat_fn); return; } if ((d = lseek(stat_fd, 0, SEEK_SET)) != 0) { - tasklog('?', "$Error seeking in statusfile"); + Syslog('?', "$Error seeking in statusfile"); return; } d = write(stat_fd, &status, sizeof(status_r)); if (d != sizeof(status_r)) - tasklog('?', "$Error writing statusfile, only %d bytes", d); + Syslog('?', "$Error writing statusfile, only %d bytes", d); /* * CLose the statusfile */ if (close(stat_fd) != 0) - tasklog('?', "$Error closing statusfile"); + Syslog('?', "$Error closing statusfile"); } @@ -212,13 +212,13 @@ int get_zmh() if ((strncmp(sstime, TCFG.zmh_start, 5) >= 0) && (strncmp(sstime, TCFG.zmh_end, 5) < 0)) { if (!ZMH) { CreateSema((char *)"zmh"); - tasklog('!', "Start of Zone Mail Hour"); + Syslog('!', "Start of Zone Mail Hour"); ZMH = TRUE; } } else { if (ZMH) { RemoveSema((char *)"zmh"); - tasklog('!', "End of Zone Mail Hour"); + Syslog('!', "End of Zone Mail Hour"); ZMH = FALSE; } } @@ -254,12 +254,12 @@ void stat_set_open(int op) { if (op) { if (!s_bbsopen) { - tasklog('!', "The bbs is open"); + Syslog('!', "The bbs is open"); sem_set((char *)"scanout", TRUE); } } else { if (s_bbsopen) { - tasklog('!', "The bbs is closed"); + Syslog('!', "The bbs is closed"); } } s_bbsopen = status.open = op; @@ -339,7 +339,7 @@ char *getseq(void) int sem_set(char *sem, int value) { - tasklog('s', "%s semafore \"%s\"", value?"Set":"Clear", sem); + Syslog('s', "%s semafore \"%s\"", value?"Set":"Clear", sem); if (!strcmp(sem, "scanout")) { s_scanout = value; @@ -398,12 +398,12 @@ char *sem_status(char *data) } else if (!strcmp(sem, "do_inet")) { value = s_do_inet; } else { - tasklog('s', "sem_status(%s) buf=%s", sem, buf); + Syslog('s', "sem_status(%s) buf=%s", sem, buf); return buf; } sprintf(buf, "100:1,%s;", value ? "1":"0"); - tasklog('s', "Check semafore \"%s\": %s present", sem, value?"is":"not"); + Syslog('s', "Check semafore \"%s\": %s present", sem, value?"is":"not"); return buf; } diff --git a/mbtask/taskutil.c b/mbtask/taskutil.c index b464ae88..82a73f07 100644 --- a/mbtask/taskutil.c +++ b/mbtask/taskutil.c @@ -46,6 +46,7 @@ extern struct _fidonet fidonet; extern struct taskrec TCFG; unsigned long lcrc = 0, tcrc = 1; int lcnt = 0, lchr; +static char *pbuff = NULL; static char *mon[] = { @@ -79,10 +80,25 @@ char *date(void) +void WriteError(const char *format, ...) +{ + char *outputstr; + va_list va_ptr; + + outputstr = calloc(10240, sizeof(char)); + va_start(va_ptr, format); + vsprintf(outputstr, format, va_ptr); + va_end(va_ptr); + Syslog('?', outputstr); + free(outputstr); +} + + + /* * general log for this server */ -void tasklog(int grade, const char *format, ...) +void Syslog(int grade, const char *format, ...) { va_list va_ptr; char outstr[1024]; @@ -151,7 +167,7 @@ int ulog(char *fn, char *grade, char *prname, char *prpid, char *format) umask(oldmask); if (log == NULL) { oserr = errno; - tasklog('!', "$Cannot open user logfile %s", fn); + Syslog('!', "$Cannot open user logfile %s", fn); return -1; } @@ -162,7 +178,7 @@ int ulog(char *fn, char *grade, char *prname, char *prpid, char *format) fflush(log); if (fclose(log) != 0) { oserr = errno; - tasklog('!', "$Cannot close user logfile %s", fn); + Syslog('!', "$Cannot close user logfile %s", fn); return -1; } return 0; @@ -216,7 +232,7 @@ void CreateSema(char *sem) if ((fd = open(temp, O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) >= 0) close(fd); else - tasklog('?', "Can't create semafore %s", temp); + Syslog('?', "Can't create semafore %s", temp); } @@ -230,7 +246,7 @@ void TouchSema(char *sem) if ((fd = open(temp, O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) >= 0) { close(fd); } else - tasklog('?', "Can't touch semafore %s", temp); + Syslog('?', "Can't touch semafore %s", temp); } @@ -243,7 +259,7 @@ void RemoveSema(char *sem) if (access(temp, F_OK)) return; if (unlink(temp) == -1) - tasklog('?', "Can't remove semafore %s", temp); + Syslog('?', "Can't remove semafore %s", temp); } @@ -302,7 +318,7 @@ int mkdirs(char *name, mode_t mode) if ((last == 0) || (last == EEXIST)) { return TRUE; } else { - tasklog('?', "$mkdirs(%s)", name); + Syslog('?', "$mkdirs(%s)", name); return FALSE; } } @@ -446,3 +462,58 @@ int SearchFidonet(unsigned short zone) } + +char *xmalloc(size_t); +char *xmalloc(size_t size) +{ + char *tmp; + + tmp = malloc(size); + if (!tmp) + abort(); + + return tmp; +} + + + +char *printable(char *s, int l) +{ + int len; + char *p; + + if (pbuff) + free(pbuff); + pbuff=NULL; + + if (s == NULL) + return (char *)"(null)"; + + if (l > 0) + len=l; + else if (l == 0) + len=strlen(s); + else { + len=strlen(s); + if (len > -l) + len=-l; + } + pbuff=(char*)xmalloc(len*4+1); + p=pbuff; + while (len--) { + if (*(unsigned char*)s >= ' ') + *p++=*s; + else switch (*s) { + case '\\': *p++='\\'; *p++='\\'; break; + case '\r': *p++='\\'; *p++='r'; break; + case '\n': *p++='\\'; *p++='n'; break; + case '\t': *p++='\\'; *p++='t'; break; + case '\b': *p++='\\'; *p++='b'; break; + default: sprintf(p,"\\%03o",*s); p+=4; break; + } + s++; + } + *p='\0'; + return pbuff; +} + diff --git a/mbtask/taskutil.h b/mbtask/taskutil.h index 443c3f61..5dc008ae 100644 --- a/mbtask/taskutil.h +++ b/mbtask/taskutil.h @@ -21,7 +21,8 @@ typedef struct _srv_auth { /* * Function prototypes */ -void tasklog(int, const char *, ...); +void WriteError(const char *, ...); +void Syslog(int, const char *, ...); int ulog(char *, char *, char *, char *, char*); char *xstrcpy(char *); char *xstrcat(char *, char *); @@ -38,6 +39,7 @@ char *Dos2Unix(char *); char *dayname(void); void InitFidonet(void); int SearchFidonet(unsigned short); +char *printable(char *, int); #endif