Annotation of sbbs/src/sbbs3/fidodefs.h, revision 1.1.1.1

1.1       root        1: /* fidodefs.h */
                      2: 
                      3: /* FidoNet constants, macros, and structure definitions */
                      4: 
                      5: /* $Id: fidodefs.h,v 1.8 2005/11/17 01:53:04 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: #ifndef _FIDODEFS_H_
                     39: #define _FIDODEFS_H_
                     40: 
                     41: #include "gen_defs.h"  /* uchar */
                     42: 
                     43: #define FIDO_NAME_LEN  36                      /* Includes '\0' terminator                             */
                     44: #define FIDO_SUBJ_LEN  72                      /* Includes '\0' terminator                             */
                     45: #define FIDO_TIME_LEN  20                      /* Includes '\0' terminator                             */
                     46: #define FIDO_PASS_LEN  8                       /* Does NOT include '\0' terminator             */
                     47: 
                     48:                                                                        /* Attribute bits for fmsghdr_t.attr    */
                     49: #define FIDO_PRIVATE   (1<<0)          /* Private message                                              */
                     50: #define FIDO_CRASH             (1<<1)          /* Crash-mail (send immediately)                */
                     51: #define FIDO_RECV              (1<<2)          /* Received successfully                                */
                     52: #define FIDO_SENT              (1<<3)          /* Sent successfully                                    */
                     53: #define FIDO_FILE              (1<<4)          /* File attached                                                */
                     54: #define FIDO_INTRANS   (1<<5)          /* In transit                                                   */
                     55: #define FIDO_ORPHAN    (1<<6)          /* Orphan                                                               */
                     56: #define FIDO_KILLSENT  (1<<7)          /* Kill it after sending it                             */
                     57: #define FIDO_LOCAL             (1<<8)          /* Created locally - on this system             */
                     58: #define FIDO_HOLD              (1<<9)          /* Hold - don't send it yet                             */
                     59: #define FIDO_FREQ              (1<<11)         /* File request                                                 */
                     60: #define FIDO_RRREQ             (1<<12)         /* Return receipt request                               */
                     61: #define FIDO_RR                (1<<13)         /* This is a return receipt                             */
                     62: #define FIDO_AUDIT             (1<<14)         /* Audit request                                                */
                     63: #define FIDO_FUPREQ    (1<<15)         /* File update request                                  */
                     64: 
                     65: #if defined(_WIN32) || defined(__BORLANDC__)
                     66:        #define PRAGMA_PACK
                     67: #endif
                     68: 
                     69: #if defined(PRAGMA_PACK) || defined(__WATCOMC__)
                     70:        #define _PACK
                     71: #else
                     72:        #define _PACK __attribute__ ((packed))
                     73: #endif
                     74: 
                     75: #if defined(PRAGMA_PACK)
                     76:        #pragma pack(push,1)                    /* Disk image structures must be packed */
                     77: #endif
                     78: 
                     79: typedef struct _PACK {                         /* Fidonet Packet Header                                */
                     80:     short orignode,                                    /* Origination Node of Packet                   */
                     81:           destnode,                                    /* Destination Node of Packet                   */
                     82:           year,                                                /* Year of Packet Creation e.g. 1995    */
                     83:           month,                                       /* Month of Packet Creation 0-11                */
                     84:           day,                                         /* Day of Packet Creation 1-31                  */
                     85:           hour,                                                /* Hour of Packet Creation 0-23                 */
                     86:           min,                                         /* Minute of Packet Creation 0-59               */
                     87:           sec,                                         /* Second of Packet Creation 0-59               */
                     88:           baud,                                                /* Max Baud Rate of Orig & Dest                 */
                     89:           pkttype,                                     /* Packet Type (-1 is obsolete)                 */
                     90: #define PKT_TWO_PLUS   0                       /* Type 2+ Packet Header                                */
                     91: #define PKT_TWO_TWO    1                       /* Type 2.2 Packet Header                               */
                     92: #define PKT_TWO                2                       /* Old Type Packet Header                               */
                     93:           orignet,                                     /* Origination Net of Packet                    */
                     94:           destnet;                                     /* Destination Net of Packet                    */
                     95:     uchar prodcode,                                    /* Product Code (00h is Fido)                   */
                     96:           sernum,                                      /* Binary Serial Number or NULL                 */
                     97:           password[FIDO_PASS_LEN];     /* Session Password or NULL                             */
                     98:     short origzone,                                    /* Origination Zone of Packet or NULL   */
                     99:           destzone;                                    /* Destination Zone of Packet or NULL   */
                    100:        union {                                                 
                    101:                char padding[20];                       /* Fill Characters (Type 2.0)                   */
                    102:                struct {                                        /* OR Type 2+ Packet Header Info                */
                    103:                        short auxnet,                   /* Orig Net if Origin is a Point                */
                    104:                                  cwcopy;                       /* Must be Equal to cword                               */
                    105:                        uchar prodcode,                 /* Product Code                                                 */
                    106:                                  revision;             /* Revision                                                             */
                    107:                        short cword,                    /* Compatibility Word                                   */
                    108:                                  origzone,             /* Zone of Packet Sender or NULL                */
                    109:                                  destzone,             /* Zone of Packet Receiver or NULL              */
                    110:                                  origpoint,            /* Origination Point of Packet                  */
                    111:                                  destpoint;            /* Destination Point of Packet                  */
                    112:                        char empty[4];                  
                    113:                } two_plus;                                     
                    114:                struct {                                        /* OR Type 2.2 Packet Header Info               */
                    115:                        char origdomn[8];               /* Origination Domain                                   */
                    116:                        char destdomn[8];               /* Destination Domain                                   */
                    117:                        char empty[4];                  /* Product Specific Data                                */
                    118:                } two_two;
                    119:        } fill;
                    120: 
                    121: } fpkthdr_t;
                    122: 
                    123: #define FIDO_PACKET_HDR_LEN                    58
                    124: #define FIDO_PACKET_TERMINATOR         0x0000  /* 16-bits */
                    125: 
                    126: typedef struct _PACK {                         /* FidoNet Packed Message Header                */
                    127:        short   type;                                   /* Message type: 2                                              */
                    128:        short   orignode;
                    129:        short   destnode;
                    130:        short   orignet;
                    131:        short   destnet;
                    132:        short   attr;
                    133:        short   cost;
                    134:        char    time[FIDO_TIME_LEN];    /* Time in goof-ball ASCII format               */
                    135: } fpkdmsg_t;
                    136: 
                    137: #define FIDO_PACKED_MSG_HDR_LEN                34              /* Fixed header fields only */
                    138: #define FIDO_PACKED_MSG_TERMINATOR     '\0'    /* 8-bits */
                    139: 
                    140: typedef struct _PACK {                         /* FidoNet Stored Message Header *.msg  */
                    141:        char    from[FIDO_NAME_LEN],    /* From user                                                    */
                    142:                        to[FIDO_NAME_LEN],              /* To user                                                              */
                    143:                        subj[FIDO_SUBJ_LEN],    /* Message title                                                */
                    144:                        time[FIDO_TIME_LEN];    /* Time in goof-ball ASCII format               */
                    145:        short   read,                                   /* Times read                                                   */
                    146:                        destnode,                               /* Destination node                                             */
                    147:                        orignode,                               /* Origin node                                                  */
                    148:                        cost,                                   /* Cost in pennies                                              */
                    149:                        orignet,                                /* Origin net                                                   */
                    150:                        destnet,                                /* Destination net                                              */
                    151:                        destzone,                               /* Destination zone                                             */
                    152:                        origzone,                               /* Origin zone                                                  */
                    153:                        destpoint,                              /* Destination point                                    */
                    154:                        origpoint,                              /* Origin point                                                 */
                    155:                        re,                                     /* Message number regarding                             */
                    156:                        attr,                                   /* Attributes - see FIDO_*                              */
                    157:                        next;                                   /* Next message number in stream                */
                    158: } fmsghdr_t;
                    159: 
                    160: #define FIDO_STORED_MSG_HDR_LEN                190
                    161: #define FIDO_STORED_MSG_TERMINATOR     '\0'    /* 8-bits */
                    162: 
                    163: #if defined(PRAGMA_PACK)
                    164: #pragma pack(pop)              /* original packing */
                    165: #endif
                    166: 
                    167: #endif /* Don't add anything after this line */
                    168: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.