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

1.1       root        1: /* fidodefs.h */
                      2: 
                      3: /* FidoNet constants, macros, and structure definitions */
                      4: 
1.1.1.2 ! root        5: /* $Id: fidodefs.h,v 1.11 2011/09/01 02:37:12 rswindell Exp $ */
1.1       root        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:  *                                                                                                                                                     *
1.1.1.2 ! root       11:  * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html         *
1.1       root       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                                */
1.1.1.2 ! root       80:     int16_t orignode,                          /* Origination Node of Packet                   */
1.1       root       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:           orignet,                                     /* Origination Net of Packet                    */
                     91:           destnet;                                     /* Destination Net of Packet                    */
                     92:     uchar prodcode,                                    /* Product Code (00h is Fido)                   */
                     93:           sernum,                                      /* Binary Serial Number or NULL                 */
                     94:           password[FIDO_PASS_LEN];     /* Session Password or NULL                             */
1.1.1.2 ! root       95:     int16_t origzone,                          /* Origination Zone of Packet or NULL   */
1.1       root       96:           destzone;                                    /* Destination Zone of Packet or NULL   */
                     97:        union {                                                 
                     98:                char padding[20];                       /* Fill Characters (Type 2.0)                   */
                     99:                struct {                                        /* OR Type 2+ Packet Header Info                */
1.1.1.2 ! root      100:                        int16_t auxnet,                 /* Orig Net if Origin is a Point                */
1.1       root      101:                                  cwcopy;                       /* Must be Equal to cword                               */
                    102:                        uchar prodcode,                 /* Product Code                                                 */
                    103:                                  revision;             /* Revision                                                             */
1.1.1.2 ! root      104:                        int16_t cword,                  /* Compatibility Word                                   */
1.1       root      105:                                  origzone,             /* Zone of Packet Sender or NULL                */
                    106:                                  destzone,             /* Zone of Packet Receiver or NULL              */
                    107:                                  origpoint,            /* Origination Point of Packet                  */
                    108:                                  destpoint;            /* Destination Point of Packet                  */
                    109:                        char empty[4];                  
                    110:                } two_plus;                                     
                    111:                struct {                                        /* OR Type 2.2 Packet Header Info               */
                    112:                        char origdomn[8];               /* Origination Domain                                   */
                    113:                        char destdomn[8];               /* Destination Domain                                   */
                    114:                        char empty[4];                  /* Product Specific Data                                */
                    115:                } two_two;
                    116:        } fill;
                    117: 
                    118: } fpkthdr_t;
                    119: 
                    120: #define FIDO_PACKET_HDR_LEN                    58
                    121: #define FIDO_PACKET_TERMINATOR         0x0000  /* 16-bits */
                    122: 
                    123: typedef struct _PACK {                         /* FidoNet Packed Message Header                */
1.1.1.2 ! root      124:        int16_t type;                                   /* Message type: 2                                              */
        !           125:        int16_t orignode;
        !           126:        int16_t destnode;
        !           127:        int16_t orignet;
        !           128:        int16_t destnet;
        !           129:        int16_t attr;
        !           130:        int16_t cost;
1.1       root      131:        char    time[FIDO_TIME_LEN];    /* Time in goof-ball ASCII format               */
                    132: } fpkdmsg_t;
                    133: 
                    134: #define FIDO_PACKED_MSG_HDR_LEN                34              /* Fixed header fields only */
                    135: #define FIDO_PACKED_MSG_TERMINATOR     '\0'    /* 8-bits */
                    136: 
                    137: typedef struct _PACK {                         /* FidoNet Stored Message Header *.msg  */
                    138:        char    from[FIDO_NAME_LEN],    /* From user                                                    */
                    139:                        to[FIDO_NAME_LEN],              /* To user                                                              */
                    140:                        subj[FIDO_SUBJ_LEN],    /* Message title                                                */
                    141:                        time[FIDO_TIME_LEN];    /* Time in goof-ball ASCII format               */
1.1.1.2 ! root      142:        int16_t read,                                   /* Times read                                                   */
1.1       root      143:                        destnode,                               /* Destination node                                             */
                    144:                        orignode,                               /* Origin node                                                  */
                    145:                        cost,                                   /* Cost in pennies                                              */
                    146:                        orignet,                                /* Origin net                                                   */
                    147:                        destnet,                                /* Destination net                                              */
                    148:                        destzone,                               /* Destination zone                                             */
                    149:                        origzone,                               /* Origin zone                                                  */
                    150:                        destpoint,                              /* Destination point                                    */
                    151:                        origpoint,                              /* Origin point                                                 */
                    152:                        re,                                     /* Message number regarding                             */
                    153:                        attr,                                   /* Attributes - see FIDO_*                              */
                    154:                        next;                                   /* Next message number in stream                */
                    155: } fmsghdr_t;
                    156: 
                    157: #define FIDO_STORED_MSG_HDR_LEN                190
                    158: #define FIDO_STORED_MSG_TERMINATOR     '\0'    /* 8-bits */
                    159: 
                    160: #if defined(PRAGMA_PACK)
                    161: #pragma pack(pop)              /* original packing */
                    162: #endif
                    163: 
                    164: #endif /* Don't add anything after this line */
                    165: 

unix.superglobalmegacorp.com

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