home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / TELECOM / UUCPbb_2_1_src.lzh / UUCPBB21 / uucico.h < prev    next >
Text File  |  1994-09-26  |  6KB  |  155 lines

  1. /*  uucico.h  --header file for the uucico program.
  2.     Copyright (C) 1990, 1993  Rick Adams and Bob Billson
  3.  
  4.     This file is part of the OS-9 UUCP package, UUCPbb.
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 2 of the License, or
  9.     (at your option) any later version.
  10.  
  11.     This program is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with this program; if not, write to the Free Software
  18.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.     The author of UUCPbb, Bob Billson, can be contacted at:
  21.     bob@kc2wz.bubble.org  or  uunet!kc2wz!bob  or  by snail mail:
  22.     21 Bates Way, Westfield, NJ 07090
  23. */
  24.  
  25. #include <setjmp.h>
  26. #include <signal.h>
  27. #ifndef _OSK
  28. #include <utime.h>
  29. #endif
  30. #include <time.h>
  31.  
  32.  /***************************************************************
  33.   ***************************************************************
  34.   *******  WARNING: Gremlin Zone!!                         ******
  35.   *******           Do not mess with anything below here.  ******
  36.   ***************************************************************
  37.   ***************************************************************/
  38.  
  39. /* packet codes */
  40. #define CLOSE      0x08      /* close channel */
  41. #define RJ         0x10      /* reject */
  42. #define RR         0x20      /* receiver ready */
  43. #define SRJ        0x18      /* packet number to retransmit */
  44. #define INITA      0x38      /* initialization A */
  45. #define INITB      0x30      /* initialization B */
  46. #define INITC      0x28      /* initialization C */
  47. #define LDATA      0x80      /* long data */
  48. #define SDATA      0xC0      /* short data */
  49.  
  50. /* packet size codes */
  51. #define K32        1
  52. #define K64        2
  53. #define K128       3
  54. #define K256       4
  55. #define K512       5
  56. #define K1024      6
  57. #define K2048      7
  58. #define K4096      8
  59. #define KCONTROL   9
  60.  
  61. /* Max packet size for receiving */
  62. #define PACKET_SIZE   K64
  63.  
  64. /* Max packet size for sending and receiving */
  65. #define MAX_SEND_PACKET 128
  66.  
  67. #define MAGIC     0xAAAA
  68. #define DLE_TRIES  1         /* attempts getpacket() will try to get DLE */
  69.  
  70. /* uucico roles */
  71. #define MASTER   1
  72. #define SLAVE    0
  73.  
  74. /* Main switch states */
  75. #define INITIAL      0
  76. #define OPENPORT     1
  77. #define MAKECALL     2
  78. #define MOPEN        3
  79. #define SOPEN        4
  80. #define MS_SNDRCV    5
  81. #define _END         6
  82. #define CHATERROR    7
  83. #define PORTBUSY     8
  84. #define NOCARRIER   12
  85. #define NODIALTONE  13
  86. #define BUSY        14
  87. #define NOANSWER    15
  88. #define LOGERR      16
  89. #define MSGTIME      5         /* seconds to wait for a message */
  90. #define PKTTIME      5         /* seconds to wait for a packet */
  91.  
  92. /* g protocol packet definition */
  93. struct pk
  94.         {    char DLE,       /* DLE character */
  95.                   K,         /* packet size code */
  96.                   C0,        /* checksum (lo) */
  97.                   C1,        /* checksum (hi) */
  98.                   C,         /* control packet code */
  99.                   X,         /* XOR of K, C0, C1 and C */
  100.                              /* data buffer */
  101.                   data[MAX_SEND_PACKET+1];
  102.         };
  103.  
  104. extern QQ int rec_segment;
  105. extern QQ int rec_window;
  106. extern QQ flag dropDTR;
  107. extern char *nodename, fname[], temp[];
  108.  
  109. EXTERN QQ flag logopen;                         /* log file open flag */
  110. EXTERN QQ flag role;                            /* default role is master */
  111. EXTERN QQ flag ramdisk;                         /* don't use RAM disk yet */
  112. EXTERN QQ flag quiet;                           /* print to stdout --BGP  */
  113. EXTERN QQ flag logflag;                         /* write /DD/LOG/uulog --TK */
  114. EXTERN QQ flag normal_end, uuxflag;
  115. EXTERN QQ flag endflag, offhook;
  116. EXTERN QQ int winsiz;                           /* window size */
  117. EXTERN QQ int segsiz;                           /* packet size */
  118. EXTERN QQ int port;                             /* path for device we use */
  119. EXTERN QQ int debuglvl;
  120. EXTERN QQ char protocol;                        /* name of protocol we use */
  121. EXTERN QQ char rseq, sseq, swin;                /* used in gproto.c */
  122. EXTERN QQ FILE *log;
  123.  
  124. /* globals added/changed --REB */
  125. EXTERN char phone[25],                          /* remote's number */
  126.             baud[7],                            /* computer to modem speed */
  127.             device[5],                          /* device name of port */
  128.             sysname[9],                         /* remote's name */
  129.             sender[15],                         /* who is doing the sending */
  130.             modemreset[20],                     /* modem reset string */
  131.             dialscript[128],                   /* script for dialing remote */
  132.             chatscript[128];              /* script for logging into remote */
  133.  
  134. #ifndef _OSK
  135. EXTERN long start_time, endtime, call_length;
  136. #else
  137. EXTERN time_t start_time, endtime, call_length;
  138. #endif
  139.  
  140. /* global environment variable for low level errors --REB */
  141. EXTERN jmp_buf env;
  142.  
  143. /* g protocol packet buffers used by gproto.c and filexfer.c */
  144. EXTERN struct pk inpacket, outpacket[8];
  145.  
  146. #ifdef MAIN
  147. char *ssiz[] = {"K0","K32","K64","K128","K256","K512","K1024",
  148.                 "K2048","K4096",""};
  149. #else
  150. extern char *ssiz[];
  151. #endif
  152.  
  153. /* function declarations */
  154. void openlog(), closelog();
  155.