home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / c / bts314b4 / nodeproc.h < prev    next >
C/C++ Source or Header  |  1994-05-29  |  8KB  |  278 lines

  1. #ifndef H_NODEPROC
  2. #define H_NODEPROC
  3. /*
  4.  * nodeproc.h
  5.  *
  6.  * Definitions for using nodeproc.c
  7.  *
  8.  */
  9.  
  10. /*--------------------------------------------------------------------------*/
  11. /* NodeList.Sys                                                             */
  12. /*                                                                            */
  13. /*      NET > 0 and NODE > 0      Normal node                                    */
  14. /*                                                                            */
  15. /*      NET > 0 and NODE <= 0   Host node                                     */
  16. /*                                 Net host........node== 0                    */
  17. /*                                 Regional host...node==-1                    */
  18. /*                                 Country host....node==-2                    */
  19. /*                                                                            */
  20. /*      NET == -1      Nodelist.Sys revision                                    */
  21. /*                                                                            */
  22. /*      NET == -2      Nodelist statement                                     */
  23. /*                                                                            */
  24. /*--------------------------------------------------------------------------*/
  25.  
  26.  
  27. #if 0
  28. /*--------------------------------------------------------------------------*/
  29. /* NODE                                                                     */
  30. /* Please note the NewStyle structure (below).    Time is running out for the */
  31. /* existing `_node' structure!    Opus currently uses the old style node        */
  32. /* structure, but not for long.                                             */
  33. /*--------------------------------------------------------------------------*/
  34. struct _node
  35. {
  36.    WORD number;                                   /* node number                                   */
  37.    WORD net;                                      /* net number                                    */
  38.    WORD cost;                                      /* cost of a message to this
  39.                                                   * node                */
  40.    UWORD rate;                                      /* baud rate                                       */
  41.    char name[20];                                 /* node name                                      */
  42.    char phone[40];                                 /* phone number                                  */
  43.    char city[40];                                 /* city and state                                  */
  44. };
  45. #endif
  46.  
  47. /*--------------------------------------------------------------------------*/
  48. /* THE NEWSTYLE NODE LIST IS NOW BEING USED BY OPUS 1.10                    */
  49. /*--------------------------------------------------------------------------*/
  50. struct _newnode
  51. {
  52.    word NetNumber;
  53.    word NodeNumber;
  54.    word Cost;                                     /* cost to user for a
  55.                                                   * message */
  56.    byte SystemName[34];                          /* node name */
  57.    byte PhoneNumber[40];                         /* phone number */
  58.    byte MiscInfo[30];                             /* city and state */
  59.    byte Password[8];                             /* WARNING: not necessarily
  60.                                                   * null-terminated */
  61.    word RealCost;                                 /* phone company's charge */
  62.    word HubNode;                                 /* node # of this node's hub
  63.                                                   * or 0 if none */
  64.    UBYTE BaudRate;                                 /* baud rate divided by 300 */
  65.    byte ModemType;                                 /* RESERVED for modem type */
  66.    word NodeFlags;                                 /* set of flags (see below) */
  67.    word NodeFiller;
  68. };
  69.  
  70.  
  71. /*------------------------------------------------------------------------*/
  72. /* Values for the `NodeFlags' field                                       */
  73. /*------------------------------------------------------------------------*/
  74. #define B_hub       0x0001
  75. #define B_host       0x0002
  76. #define B_region   0x0004
  77. #define B_zone       0x0008
  78. #define B_CrashM   0x0010
  79. #define B_ores1    0x0020
  80. #define B_ores2    0x0040
  81. #define B_ores3    0x0080
  82. #define B_ores4    0x0100
  83. #define B_ores5    0x0200
  84. #define B_res1       0x0400
  85. #define B_res2       0x0800
  86. #define B_res3       0x1000
  87. #define B_res4       0x2000
  88. #define B_res5       0x4000
  89. #define B_res6       0x8000
  90.  
  91. /*------------------------------------------------------------------------*/
  92. /* Values for the `modem' field                                           */
  93. /*------------------------------------------------------------------------*/
  94. #define M_HST       0x01    /* node uses an HST                    0000 0001 */
  95. #define M_PEP       0x02    /* node uses a PEP modem             0000 0010 */
  96.  
  97.  
  98. /*--------------------------------------------------------------------------*/
  99. /* Nodelist.Idx                                                             */
  100. /* (File is terminated by EOF)                                                */
  101. /*--------------------------------------------------------------------------*/
  102.  
  103. struct _ndi
  104. {
  105.    WORD node;                                      /* node number  */
  106.    WORD net;                                      /* net number   */
  107. };
  108.  
  109.  
  110. #if 0
  111. /*--------------------------------------------------------------------------*/
  112. /* QuickBBS 2.00 QNL_IDX.BBS                                                */
  113. /* (File is terminated by EOF)                                                */
  114. /*--------------------------------------------------------------------------*/
  115.  
  116. struct QuickNodeIdxRecord
  117. {
  118.    WORD QI_Zone;
  119.    WORD QI_Net;
  120.    WORD QI_Node;
  121.    byte QI_NodeType;
  122. };
  123.  
  124.  
  125. /*--------------------------------------------------------------------------*/
  126. /* QuickBBS 2.00 QNL_DAT.BBS                                                */
  127. /* (File is terminated by EOF)                                                */
  128. /*--------------------------------------------------------------------------*/
  129.  
  130. struct QuickNodeListRecord
  131. {
  132.    byte QL_NodeType;
  133.    WORD QL_Zone;
  134.    WORD QL_Net;
  135.    WORD QL_Node;
  136.    byte QL_Name[21];                             /* Pascal! 1 byte count, up
  137.                                                   * to 20 chars */
  138.    byte QL_City[41];                             /* 1 + 40 */
  139.    byte QL_Phone[41];                             /* 1 + 40 */
  140.    byte QL_Password[9];                          /* 1 + 8 */
  141.    word QL_Flags;                                 /* Same as flags in new
  142.                                                   * nodelist structure */
  143.    UWORD QL_BaudRate;
  144.    WORD QL_Cost;
  145. };
  146.  
  147.  
  148. /* SEAdog NETLIST.DOG format */
  149. struct netls
  150. {
  151.    WORD netnum;
  152.    char netname[14];
  153.    char netcity[40];
  154.    WORD havehost;
  155.    WORD nethost;
  156.    WORD havegate;
  157.    WORD netgate;
  158.    long nodeptr;
  159.    WORD numnodes;
  160. };
  161.  
  162. /* SEAdog NODELIST.DOG format */
  163. struct nodels
  164. {
  165.    WORD nodenum;
  166.    char nodename[14];
  167.    char nodecity[40];
  168.    char nodephone[40];
  169.    WORD havehub;
  170.    WORD nodehub;
  171.    WORD nodecost;
  172.    UWORD nodebaud;
  173. };
  174.  
  175. /* Things most nodelists don't contain, but Binkley likes to have */
  176. struct extrastuff
  177. {
  178.    char password[8];
  179.    UWORD flags1;
  180.    byte modem;
  181.    char extra[5];                                 /* for future expansion */
  182. };
  183.  
  184. #endif
  185.  
  186. /*
  187.  * BTNC Nodelist structures
  188.  */
  189.  
  190. typedef struct {
  191.     UBYTE name[13];
  192.     UBYTE listfile[13];
  193.     UWORD zone;
  194.     ULONG startoffset;
  195.     ULONG length;
  196. } DOMAINS_BNL;
  197.  
  198. typedef struct {
  199.     UBYTE sysname[34];
  200.     UBYTE location[30];
  201.     UBYTE operator[30];
  202.     UBYTE phone[40];
  203.     UWORD hubnode;
  204.     BYTE maxbaud;
  205.     WORD modemtype;
  206.     UWORD flags;
  207. } NODEINFO_BNL;
  208.  
  209. typedef struct {
  210.     BYTE type;
  211.     UWORD value;
  212. } INDEX_BNL;
  213.  
  214. #define BNL_ZONECOORD 6
  215. #define BNL_REGCOORD  5
  216. #define BNL_NETCOORD  4
  217. #define BNL_HUB       3
  218. #define BNL_NODE      2
  219. #define BNL_POINT      1
  220.  
  221. #define BNL_HST    1
  222. #define BNL_PEP    2
  223. #define BNL_MNP    4
  224. #define BNL_V32    8
  225. #define BNL_V32B  16
  226. #define BNL_V42   32
  227. #define BNL_V42B  64
  228. #define BNL_MAX  128
  229.  
  230. #define MAILONLY              1U    /* no MailBox behind mailer */
  231. #define CONTINUOUSMAIL          2U    /* Crashmail capable */
  232. #define NOARCMAIL              4U    /* no arcmail supported */
  233. #define UNDIALABLE              8U    /* should be set by bink */
  234. #define BARK_REQUEST         16U
  235. #define BARK_UPDATEREQUEST     32U
  236. #define WAZOO_REQUEST         64U
  237. #define WAZOO_UPDATEREQUEST 128U
  238. #define PRIVATE             256U    /* redirect to hub/host */
  239. #define HOLD                512U
  240.  
  241. /*
  242.  * Enumerated type for nodelists
  243.  */
  244.  
  245. typedef enum {
  246.     VERSION6,
  247.     BTNC,
  248.     LASTNODELIST
  249. } NODELISTTYPE;
  250.  
  251. #define B_CM CONTINUOUSMAIL            /* Used by rest of program */
  252.  
  253. /*---------------------------------------------------------------------
  254.  * Variables
  255.  */
  256.  
  257. extern NODELISTTYPE nodeListType;                /* Type of nodelist */
  258. extern unsigned int cacheSize;                    /* Size of nodelist cache */
  259.  
  260. extern char *node_prefix;
  261. extern int autobaud;
  262. extern int found_zone;                             /* zone we found              */
  263. extern int found_net;                             /* zone we found              */
  264. extern struct _newnode newnodedes;                 /* structure in new list      */
  265. extern char far *node_index;
  266.  
  267. /*-----------------------------------------------------------------------
  268.  * Functions
  269.  */
  270.  
  271. void lock_nodelist(BOOLEAN flag);
  272. int nodefind (ADDR *, int);
  273. int checklist (void);
  274. int nodeproc (char *);
  275. long cost_of_call (long, long);
  276.  
  277. #endif
  278.