|
|
1.1 ! root 1: /* sbbsecho.h */ ! 2: ! 3: /* Synchronet FidoNet Echomail tosser/scanner/areafix program */ ! 4: ! 5: /* $Id: sbbsecho.h,v 1.11 2005/09/01 18:32:06 rswindell Exp $ */ ! 6: ! 7: /**************************************************************************** ! 8: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 9: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 10: * * ! 11: * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html * ! 12: * * ! 13: * This program is free software; you can redistribute it and/or * ! 14: * modify it under the terms of the GNU General Public License * ! 15: * as published by the Free Software Foundation; either version 2 * ! 16: * of the License, or (at your option) any later version. * ! 17: * See the GNU General Public License for more details: gpl.txt or * ! 18: * http://www.fsf.org/copyleft/gpl.html * ! 19: * * ! 20: * Anonymous FTP access to the most recent released source is available at * ! 21: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 22: * * ! 23: * Anonymous CVS access to the development source and modification history * ! 24: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 26: * (just hit return, no password is necessary) * ! 27: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 28: * * ! 29: * For Synchronet coding style and modification guidelines, see * ! 30: * http://www.synchro.net/source.html * ! 31: * * ! 32: * You are encouraged to submit any modifications (preferably in Unix diff * ! 33: * format) via e-mail to [email protected] * ! 34: * * ! 35: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 36: ****************************************************************************/ ! 37: ! 38: /* Portions written by Allen Christiansen 1994-1996 */ ! 39: ! 40: #define SBBSECHO_VER "2.11" ! 41: ! 42: #define IMPORT_NETMAIL (1L<<0) ! 43: #define IMPORT_PACKETS (1L<<1) ! 44: #define IMPORT_ECHOMAIL (1L<<2) ! 45: #define EXPORT_ECHOMAIL (1L<<3) ! 46: #define DELETE_NETMAIL (1L<<4) ! 47: #define DELETE_PACKETS (1L<<5) ! 48: #define STORE_SEENBY (1L<<6) /* Store SEEN-BYs in SMB */ ! 49: #define STORE_PATH (1L<<7) /* Store PATHs in SMB */ ! 50: #define STORE_KLUDGE (1L<<8) /* Store unknown kludges in SMB */ ! 51: #define IGNORE_MSGPTRS (1L<<9) ! 52: #define UPDATE_MSGPTRS (1L<<10) ! 53: #define LEAVE_MSGPTRS (1L<<11) ! 54: #define STRIP_LF (1L<<12) /* Stripl line-feeds from outgoing messages */ ! 55: #define ASCII_ONLY (1L<<13) ! 56: #define LOGFILE (1L<<14) ! 57: #define REPORT (1L<<15) ! 58: #define EXPORT_ALL (1L<<16) ! 59: #define UNKNOWN_NETMAIL (1L<<17) ! 60: #define IGNORE_ADDRESS (1L<<18) ! 61: #define IGNORE_RECV (1L<<19) ! 62: #define CONVERT_TEAR (1L<<20) ! 63: #define IMPORT_PRIVATE (1L<<21) ! 64: #define LOCAL_NETMAIL (1L<<22) ! 65: #define NOTIFY_RECEIPT (1L<<23) ! 66: #define FLO_MAILER (1L<<24) /* Binkley .FLO style mailer */ ! 67: #define PACK_NETMAIL (1L<<25) /* Pack *.MSG NetMail into packets */ ! 68: #define FUZZY_ZONE (1L<<26) ! 69: #define TRUNC_BUNDLES (1L<<27) /* Truncate bundles after sent (set TFS flag) */ ! 70: #define SECURE (1L<<28) /* Secure operation */ ! 71: #define ELIST_ONLY (1L<<29) /* Allow adding from AREAS.BBS */ ! 72: #define GEN_NOTIFY_LIST (1L<<30) /* Generate Notify Lists */ ! 73: #define KILL_EMPTY_MAIL (1L<<31) /* Kill empty netmail messages */ ! 74: ! 75: #define ATTR_HOLD (1<<0) /* Hold */ ! 76: #define ATTR_CRASH (1<<1) /* Crash */ ! 77: #define ATTR_DIRECT (1<<2) /* Direct */ ! 78: #define ATTR_PASSIVE (1<<3) /* Used to temp disconnect */ ! 79: #define SEND_NOTIFY (1<<4) /* Send Notify Lists */ ! 80: ! 81: ! 82: #define LOG_AREAFIX (1L<<0) /* Log areafix messages */ ! 83: #define LOG_IMPORTED (1L<<1) /* Log imported netmail messages */ ! 84: #define LOG_PACKETS (1L<<2) /* Log imported packet names/types */ ! 85: #define LOG_SECURE (1L<<3) /* Log security violations */ ! 86: #define LOG_GRUNGED (1L<<4) /* Log grunged messages */ ! 87: #define LOG_PRIVATE (1L<<5) /* Log disallowed private msgs */ ! 88: #define LOG_AREA_TOTALS (1L<<6) /* Log totals for each area */ ! 89: #define LOG_TOTALS (1L<<7) /* Log over-all totals */ ! 90: #define LOG_PACKING (1L<<8) /* Log packing of out-bound netmail */ ! 91: #define LOG_ROUTING (1L<<9) /* Log routing of out-bound netmail */ ! 92: ! 93: #define LOG_DUPES (1L<<24) /* Log individual dupe messages */ ! 94: #define LOG_CIRCULAR (1L<<25) /* Log individual circ paths */ ! 95: #define LOG_IGNORED (1L<<26) /* Log ignored netmail */ ! 96: #define LOG_UNKNOWN (1L<<27) /* Log netmail for unknown users */ ! 97: ! 98: #define LOG_DEFAULTS 0xffffffL /* Low 24 bits default to ON */ ! 99: ! 100: #define MAX_OPEN_SMBS 2 ! 101: #define DFLT_OPEN_PKTS 4 ! 102: #define MAX_TOTAL_PKTS 100 ! 103: #define DFLT_PKT_SIZE 250*1024L ! 104: #define DFLT_BDL_SIZE 250*1024L ! 105: ! 106: #define NOFWD (1<<0) /* Do not forward requests */ ! 107: ! 108: typedef struct { /* Fidonet Packet Header */ ! 109: short orignode, /* Origination Node of Packet */ ! 110: destnode, /* Destination Node of Packet */ ! 111: year, /* Year of Packet Creation e.g. 1995 */ ! 112: month, /* Month of Packet Creation 0-11 */ ! 113: day, /* Day of Packet Creation 1-31 */ ! 114: hour, /* Hour of Packet Creation 0-23 */ ! 115: min, /* Minute of Packet Creation 0-59 */ ! 116: sec, /* Second of Packet Creation 0-59 */ ! 117: baud, /* Max Baud Rate of Orig & Dest */ ! 118: pkttype, /* Packet Type (-1 is obsolete) */ ! 119: orignet, /* Origination Net of Packet */ ! 120: destnet; /* Destination Net of Packet */ ! 121: uchar prodcode, /* Product Code (00h is Fido) */ ! 122: sernum, /* Binary Serial Number or NULL */ ! 123: password[8]; /* Session Password or NULL */ ! 124: short origzone, /* Origination Zone of Packet or NULL */ ! 125: destzone; /* Destination Zone of Packet or NULL */ ! 126: uchar empty[20]; /* Fill Characters */ ! 127: } pkthdr_t; ! 128: ! 129: typedef struct { /* Type 2+ Packet Header Info */ ! 130: short auxnet, /* Orig Net if Origin is a Point */ ! 131: cwcopy; /* Must be Equal to cword */ ! 132: uchar prodcode, /* Product Code */ ! 133: revision; /* Revision */ ! 134: short cword, /* Compatibility Word */ ! 135: origzone, /* Zone of Packet Sender or NULL */ ! 136: destzone, /* Zone of Packet Receiver or NULL */ ! 137: origpoint, /* Origination Point of Packet */ ! 138: destpoint; /* Destination Point of Packet */ ! 139: uchar empty[4]; ! 140: } two_plus_t; ! 141: ! 142: typedef struct { /* Type 2.2 Packet Header Info */ ! 143: uchar origdomn[8], /* Origination Domain */ ! 144: destdomn[8], /* Destination Domain */ ! 145: empty[4]; /* Product Specific Data */ ! 146: } two_two_t; ! 147: ! 148: typedef struct { ! 149: uint sub; /* Set to INVALID_SUB if pass-thru */ ! 150: ulong tag; /* CRC-32 of tag name */ ! 151: char *name; /* Area tag name */ ! 152: uint uplinks; /* Total number of uplinks for this echo */ ! 153: uint imported; /* Total messages imported this run */ ! 154: uint exported; /* Total messages exported this run */ ! 155: uint circular; /* Total circular paths detected */ ! 156: uint dupes; /* Total duplicate messages detected */ ! 157: faddr_t *uplink; /* Each uplink */ ! 158: } areasbbs_t; ! 159: ! 160: typedef struct { ! 161: char flag[5]; ! 162: } flag_t; ! 163: ! 164: typedef struct { ! 165: uint tags; /* Number of area tags */ ! 166: char **tag; /* Name of each area tag */ ! 167: } area_t; ! 168: ! 169: typedef struct { ! 170: FILE *stream; /* The stream associated with this packet */ ! 171: faddr_t uplink; /* The current uplink for this packet */ ! 172: uchar filename[128],curopen;/* Name of the file and if it's open or not */ ! 173: } outpkt_t; ! 174: ! 175: typedef struct { ! 176: uint addrs; /* Total number of uplinks */ ! 177: faddr_t *addr; /* Each uplink */ ! 178: } addrlist_t; ! 179: ! 180: typedef struct { ! 181: char name[26] /* Short name of archive type */ ! 182: ,hexid[26] /* Hexadecimal ID to search for */ ! 183: ,pack[81] /* Pack command line */ ! 184: ,unpack[81]; /* Unpack command line */ ! 185: uint byteloc; /* Offset to Hex ID */ ! 186: } arcdef_t; ! 187: ! 188: typedef struct { ! 189: faddr_t faddr /* Fido address of this node */ ! 190: ,route; /* Address to route FLO stuff through */ ! 191: ushort arctype /* De/archiver to use for this node */ ! 192: ,numflags /* Number of flags defined for this node */ ! 193: ,pkt_type; /* Packet type to use for outgoing PKTs */ ! 194: ushort attr; /* Message bits to set for this node */ ! 195: char password[26]; /* Areafix password for this node */ ! 196: char pktpwd[9]; /* Packet password for this node */ ! 197: flag_t *flag; /* Areafix flags for this node */ ! 198: } nodecfg_t; ! 199: ! 200: typedef struct { ! 201: char listpath[129]; /* Path to this echolist */ ! 202: uint numflags,misc; /* Number of flags for this echolist */ ! 203: flag_t *flag; /* Flags to access this echolist */ ! 204: faddr_t forward; /* Where to forward requests */ ! 205: char password[72]; /* Password to use for forwarding req's */ ! 206: } echolist_t; ! 207: ! 208: typedef struct { ! 209: faddr_t dest; ! 210: char fname[13]; ! 211: } attach_t; ! 212: ! 213: typedef struct { ! 214: char inbound[82] /* Inbound directory */ ! 215: ,secure[82] /* Secure Inbound directory */ ! 216: ,outbound[82] /* Outbound directory */ ! 217: ,areafile[128] /* AREAS.BBS path/filename */ ! 218: ,logfile[128] /* LOG path/filename */ ! 219: ,cfgfile[128]; /* Configuration path/filename */ ! 220: ulong maxpktsize /* Maximum size for packets */ ! 221: ,maxbdlsize /* Maximum size for bundles */ ! 222: ,log; /* What do we log? */ ! 223: int badecho; /* Area to store bad echomail msgs */ ! 224: uint arcdefs /* Number of archive definitions */ ! 225: ,nodecfgs /* Number of nodes with configs */ ! 226: ,listcfgs /* Number of echolists defined */ ! 227: ,areas /* Number of areas defined */ ! 228: ,notify; /* User number (sysop) to notify */ ! 229: arcdef_t *arcdef; /* Each archive definition */ ! 230: nodecfg_t *nodecfg; /* Each node configuration */ ! 231: echolist_t *listcfg; /* Each echolist configuration */ ! 232: areasbbs_t *area; /* Each area configuration */ ! 233: BOOL check_path; /* Enable circular path detection */ ! 234: } config_t; ! 235: ! 236: #ifdef __WATCOMC__ ! 237: struct time { ! 238: unsigned char ti_min; /* Minutes */ ! 239: unsigned char ti_hour; /* Hours */ ! 240: unsigned char ti_hund; /* Hundredths of seconds */ ! 241: unsigned char ti_sec; /* Seconds */ ! 242: }; ! 243: ! 244: struct date { ! 245: int da_year; /* Year - 1980 */ ! 246: char da_day; /* Day of the month */ ! 247: char da_mon; /* Month (1 = Jan) */ ! 248: }; ! 249: #endif ! 250: ! 251: /***********************/ ! 252: /* Function prototypes */ ! 253: /***********************/ ! 254: void read_echo_cfg(void); ! 255: void bail(int code); ! 256: faddr_t atofaddr(char *str); ! 257: int matchnode(faddr_t addr, int exact); ! 258: void export_echomail(char *sub_code,faddr_t addr);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.