home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES2.ZIP / UUCICO / dcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-12  |  7.2 KB  |  146 lines

  1. #ifndef DCP_H
  2. #define DCP_H
  3.  
  4. /*--------------------------------------------------------------------*/
  5. /*    d c p . h                                                       */
  6. /*                                                                    */
  7. /*    UUCICO main program definitions                                 */
  8. /*--------------------------------------------------------------------*/
  9.  
  10. /*--------------------------------------------------------------------*/
  11. /*    Copyright (C) Richard H. Lamb 1985, 1986, 1987                  */
  12. /*--------------------------------------------------------------------*/
  13.  
  14. /*--------------------------------------------------------------------*/
  15. /*    Changes Copyright (c) 1990-1993 by Kendra Electronic            */
  16. /*    Wonderworks.                                                    */
  17. /*                                                                    */
  18. /*    All rights reserved except those explicitly granted by the      */
  19. /*    UUPC/extended license agreement.                                */
  20. /*--------------------------------------------------------------------*/
  21.  
  22. /*--------------------------------------------------------------------*/
  23. /*                          RCS Information                           */
  24. /*--------------------------------------------------------------------*/
  25.  
  26. /*
  27.  *    $Id: dcp.h 1.10 1993/10/12 01:35:12 ahd Exp $
  28.  *
  29.  *    $Log: dcp.h $
  30.  * Revision 1.10  1993/10/12  01:35:12  ahd
  31.  * Normalize comments to PL/I style
  32.  *
  33.  * Revision 1.9  1993/09/29  04:56:11  ahd
  34.  * Suspend port by port name, not modem file name
  35.  *
  36.  * Revision 1.8  1993/09/27  00:50:57  ahd
  37.  * Control of serial port in passive mode by K. Rommel
  38.  *
  39.  * Revision 1.7  1993/09/21  01:43:46  ahd
  40.  * Move MAXPACK to commlib.h to allow use as standard comm buffer size
  41.  *
  42.  *      Mon May 15 19:54:43 1989 change portactive to port_active
  43.  *      Mon May 15 19:51:13 1989 Add portactive flag
  44.  *      19 Mar 1990  Add hostable.h header                           ahd
  45.  *
  46.  */
  47.  
  48. #define SMALL_PACKET 64       /* Max packet size most UUCP's can
  49.                                  handle                              */
  50. #ifndef RECV_BUF
  51. #define RECV_BUF (MAXPACK*8)  /* 512 * 8 = 4096 = COMMFIFO buffer size  */
  52.                               /* for DOS                              */
  53. #endif
  54.  
  55. #define DCP_ERROR   10
  56. #define DCP_EMPTY   11
  57.  
  58. /*--------------------------------------------------------------------*/
  59. /*    Define high level state machine levels.  These levels define    */
  60. /*    processing during initialization, connection and                */
  61. /*    termination, but not during actual file transfers               */
  62. /*--------------------------------------------------------------------*/
  63.  
  64. typedef enum {
  65.       CONN_INITSTAT   = 'A',  /* Load host status file               */
  66.       CONN_INITIALIZE,        /* Select system to call, if any       */
  67.       CONN_CHECKTIME,         /* Check time to dial another          */
  68.       CONN_MODEM,             /* Load modem to process a system      */
  69.       CONN_DIALOUT,           /* Actually dial modem to system       */
  70.       CONN_HOTMODEM,          /* Initialize for a modem already
  71.                                  off-hook                            */
  72.       CONN_ANSWER,            /* Wait for phone to ring and user to
  73.                                  login                               */
  74.       CONN_LOGIN,             /* Modem is connected, do a login      */
  75.       CONN_HOTLOGIN,          /* Modem is connected, initialize user
  76.                                  from command line w/o login         */
  77.       CONN_PROTOCOL,          /* Exchange protocol information       */
  78.       CONN_SERVER,            /* Process files after dialing out     */
  79.       CONN_CLIENT,            /* Process files after being called    */
  80.       CONN_TERMINATE,         /* Terminate procotol                  */
  81.       CONN_DROPLINE,          /* Hangup the telephone                */
  82.       CONN_WAIT,              /* Wait until told to continue         */
  83.       CONN_EXIT }             /* Exit state machine loop             */
  84.       CONN_STATE ;
  85.  
  86. /*--------------------------------------------------------------------*/
  87. /*                        File transfer states                        */
  88. /*--------------------------------------------------------------------*/
  89.  
  90. typedef enum {
  91.       XFER_SENDINIT = 'a',    /* Initialize outgoing protocol        */
  92.       XFER_MASTER,            /* Begin master mode                   */
  93.       XFER_FILEDONE,          /* Receive or transmit is complete     */
  94.       XFER_NEXTJOB,           /* Look for work in local queue        */
  95.       XFER_REQUEST,           /* Process work in local queue         */
  96.       XFER_PUTFILE,           /* Send a file to remote host at our
  97.                                  request                             */
  98.       XFER_GETFILE,           /* Retrieve a file from a remote host
  99.                                  at our request                      */
  100.       XFER_SENDDATA,          /* Remote accepted our work, send data */
  101.       XFER_SENDEOF,           /* File xfer complete, send EOF        */
  102.       XFER_NOLOCAL,           /* No local work, remote have any?     */
  103.       XFER_SLAVE,             /* Begin slave mode                    */
  104.       XFER_RECVINIT,          /* Initialize Receive protocol         */
  105.       XFER_RECVHDR,           /* Receive header from other host      */
  106.       XFER_GIVEFILE,          /* Send a file to remote host at their
  107.                                  request                             */
  108.       XFER_TAKEFILE,          /* Retrieve a file from a remote host
  109.                                  at their request                    */
  110.       XFER_RECVDATA,          /* Receive file data from other host   */
  111.       XFER_RECVEOF,           /* Close file received from other host */
  112.       XFER_NOREMOTE,          /* No remote work, local have any?     */
  113.       XFER_LOST,              /* Lost the other host, flame out      */
  114.       XFER_ABORT,             /* Internal error, flame out           */
  115.       XFER_ENDP,              /* End the protocol                    */
  116.       XFER_EXIT               /* Return to caller                    */
  117.       } XFER_STATE ;
  118.  
  119. #define DCP_RETRY   (-2)
  120. #define DCP_FAILED  (-1)
  121. #define DCP_OK      0
  122.  
  123. typedef short   (*procref)();
  124.  
  125. extern size_t s_pktsize;        /* send packet size for this protocol  */
  126. extern size_t r_pktsize;        /* receive packet size for this protocol*/
  127. extern FILE *syslog;            /* syslog file pointer                 */
  128. extern char workfile[FILENAME_MAX];
  129.                                 /* name of current workfile            */
  130. extern FILE *fwork;             /* current work file pointer    */
  131. extern FILE *xfer_stream;       /* current disk file stream for file
  132.                                    being transfered                    */
  133. extern FILE *fsys;
  134.  
  135. extern char *Rmtname;           /* system we WANT to talk to    */
  136.  
  137. extern char rmtname[20];        /* system we end up talking to  */
  138.  
  139. extern struct HostTable *hostp;
  140. extern struct HostStats remote_stats;
  141.                                 /* host status, as defined by hostatus */
  142.  
  143. int    dcpmain(int  argc,char  * *argv);
  144.  
  145. #endif /* __DCP */
  146.