C
C ------   Cut here - KDBUG.COM
C
C
C KDBUG.COM - DEBUG COMMON BLOCK
C
      OPTION       1+
      INTEGER      DBGSTAT         !debug statistics displayed
      INTEGER      DBGPACK         !dump transmissions
      INTEGER      DBGON           !general debug flag
      PARAMETER (DBGON =1, DBGSTAT=2, DBGPACK=3)
C
      LOGICAL      DEBUG(3)        !debug flags
      INTEGER      DBGFD           !debug file code
      CHARACTER*16 DBGFILE         !name of debug file
C
      COMMON /DEBUG/ DEBUG, DBGFD, DBGFILE
      OPTION       1-
C ------   End of insert
C
C ------   Cut here - KFILE.COM
C
C
C KFILE.COM - File i/o common block definitions
C
      OPTION 1+
      INTEGER      MAXFILE         !maximum number of files
      INTEGER      MAXCH           !maximum number of characters/buf
      PARAMETER (MAXFILE=8, MAXCH=768)
      INTEGER      EOF             !eof flag
      INTEGER      ERROR           !error flag
      PARAMETER (EOF=-1, ERROR=-2)
      INTEGER      CLOSED          !closed file
      INTEGER      RD              !read only file
      INTEGER      WR              !write only file
      PARAMETER (CLOSED=0, RD=1, WR=2)
      INTEGER      TAB             !tab character
      INTEGER      LF              !lf character
      INTEGER      CR              !cr character
      INTEGER      NEL             !new line
      INTEGER      BLANK           !blank character
      PARAMETER (TAB=9, LF=10, CR=13, NEL=O'205', BLANK=32)
      INTEGER      NOIO            !none started, none completed
      INTEGER      IOSTART         !io started
      INTEGER      IOCOMP          !io complete
       PARAMETER (NOIO = 0, IOSTART=2, IOCOMP = 3)
C
      CHARACTER*16 FNAME(MAXFILE)  !file names
      INTEGER      FMODE(MAXFILE)  !current mode
      INTEGER*1    FCHBUF(MAXCH, MAXFILE)  !character buffer
      INTEGER      FCHPTR(MAXFILE) !buffer pointer
      INTEGER      FCHCNT(MAXFILE) !count of characters in buffer
      LOGICAL      FEOF(MAXFILE)   !eof encountered
      LOGICAL      CTDEV(MAXFILE)  !device
      INTEGER      FREQ(MAXFILE)   !i/o request size
      INTEGER      IOPEND(MAXFILE) !i/o pending
      INTEGER      FBLK(4, MAXFILE) !dio parameter blocks
      LOGICAL      NOWAIT(MAXFILE) !do no wait io
      LOGICAL      BINARY(MAXFILE) !binary mode or ascii mode
      INTEGER      FTIMOUT(MAXFILE)!time for timeout
C
      COMMON /FILECOM/ FNAME, FMODE, FCHPTR, FEOF, CTDEV,
     $                 FCHCNT,            FCHBUF,
     $                 FREQ, IOPEND, FBLK, NOWAIT, BINARY,
     $                 FTIMOUT
      OPTION 1-
C ------   End of insert
C
C ------   Cut here - KMSG.COM
C
C
C KMSG.COM - KERMIT MESSAGE COMMON
C
      OPTION 1+
      INTEGER      PROMPT(21)
      INTEGER      LNAME           !length of name
      INTEGER      NAME(41)        !name of current kermit
      CHARACTER*72 VERSION         !current version
C
      COMMON /MSGCOM/ PROMPT, LNAME, NAME, VERSION
      OPTION 1-
C ------   End of insert
C
C ------   Cut here - KPACK.COM
C
C
C KPACK.COM  - KERMIT PACKET DESCRIPTION COMMON BLOCK
C
      OPTION       1+
C
C     DO NOT ALLOCATE ANY STORAGE BETWEEN PACKSIZ AND SNDSYNC!
C
C
C layout in init packet  (my parameters)
C
      INTEGER      PACKSIZ
      INTEGER      TIMEOUT
      INTEGER      NPAD
      INTEGER      PADCH
      INTEGER      EOLCH
      INTEGER      QUOTECH
      INTEGER      QUOTE8
      INTEGER      CHKTYP
      INTEGER      RPREFIX
      INTEGER      RESERVE(2)      !extra capabilities
      INTEGER      SYNC            !not part of init  (end of string)
C
C layout in init packet (other kermits)
C
      INTEGER      SPKSIZ
      INTEGER      STIMOUT
      INTEGER      SPAD
      INTEGER      SPADCH
      INTEGER      SPEOL
      INTEGER      SPQUOTE
      INTEGER      S8QUOTE
      INTEGER      SCHKTYP
      INTEGER      SREPEAT
      INTEGER      UNUSED(2)
      INTEGER      SNDSYNC         !not part of init (end of string)
      COMMON /PACKCOM/ PACKSIZ, TIMEOUT, NPAD, PADCH, EOLCH, QUOTECH,
     +                QUOTE8, CHKTYP, RPREFIX, RESERVE, SYNC,
     +                SPKSIZ, STIMOUT, SPAD, SPADCH, SPEOL, SPQUOTE,
     +                S8QUOTE, SCHKTYP, SREPEAT, UNUSED, SNDSYNC
      OPTION       1-
C ------   End of insert
C
C ------   Cut here - KPROT.COM
C
C
C KPROT.COM - KERMIT PROTOCOL COMMON BLOCK
C
      OPTION 1+
      INTEGER      PACKET(MAXPACK) !send packet
      INTEGER      RECPACK(MAXPACK) !receive packet
      INTEGER      FILESTR(MAXPACK) !file name packet
      INTEGER      PSIZE           !packet size
      INTEGER      PACKNUM         !current packet sequence number
      INTEGER      NUMTRY          !retry count
      INTEGER      MAXRTRY         !maximum number of retry for fail
      INTEGER      MAXRINI         !retry initialization
      INTEGER      STATE           !current state
      INTEGER      IFD             !input device
      INTEGER      OFD             !output device
      INTEGER      FFD             !current file device
      INTEGER      DELAYFP         !delay before attempt initialization
      INTEGER      SAVEDPX         !save the current duplex to restore
      CHARACTER*6  COMPORT         !communications port name 
      LOGICAL      ECHO            !echo the port in connect mode
      INTEGER      ESCCHR          !character to escape connect mode
      INTEGER      LFD             !sesson log file fd
      CHARACTER*16 LOGFILE         !sesson log file name
      LOGICAL      LOG             !log this sesson
      INTEGER      INPUTFD         !input coming from this fd
      INTEGER      INSTKFD(MAXINSTK) !input stack
      INTEGER      INSTACK         !stack pointer
C
C     STORAGE FOR STATISTICS
C
CLT 2.4 EXPANEDED NUMBER OF ABORTS POSSIBLE TO 20
      LOGICAL      ABORTYP(20)     !types of aborts
      INTEGER      STARTIM         !start time of transmit in sec.
      INTEGER      ENDTIM          !ending time of last trans. in sec.
      INTEGER      SCHCNT          !send character count
      INTEGER      RCHCNT          !receive character count
      INTEGER      SCHOVRH         !send character overhead count
      INTEGER      RCHOVRH         !receive char overhead count
      INTEGER      TOTSDRC         !total send or receive
      INTEGER      TOTRTRY         !total retries
C
      COMMON /PROTO/ PACKET, RECPACK,FILESTR,
     +   PSIZE, PACKNUM, NUMTRY, MAXRTRY, MAXRINI, STATE, IFD, OFD, FFD,
     +   DELAYFP, SAVEDPX, COMPORT,
     +   ABORTYP, STARTIM, ENDTIM, SCHCNT, RCHCNT, SCHOVRH, RCHOVRH,
     $   ECHO, LOG, LOGFILE, LFD, ESCCHR, INPUTFD,
     $   INSTACK, INSTKFD,
     $   TOTSDRC, TOTRTRY
      OPTION 1-
C ------   End of insert
C
C ------   Cut here - KTIME.COM
C
C
C KTIME.COM - Timing of kermit
C
      INTEGER      PUTIME         !time for putc
      INTEGER      GETIME         !time for getc
      INTEGER      PUTCOUNT        !count put
      INTEGER      GETCOUNT        !count get
      INTEGER      WAITIME         !wait time
      INTEGER      WAITCNT         !count of waits
      INTEGER      TOTIME          !total time connect
C
      COMMON /TIMECOM/ PUTIME, GETIME, PUTCOUNT, GETCOUNT,
     $                 WAITIME, WAITCNT, TOTIME
C ------   End of insert
C
C ------   Cut here - KDEF.INS
C
C
C KDEF.INS - KERMIT SYMBOL DEFINITIONS
C
C L.TATE 5/8/86 SAI - ADDED ITYP PACKET FOR SERVER INIT
C
      OPTION 1+
C
C     FILE I/O DEFINITIONS
C
      INTEGER      STDIN,STDOUT
      PARAMETER (STDIN=1, STDOUT=2)
C
C     INPUT STACK SIZE
C
      INTEGER      MAXINSTK
      PARAMETER (MAXINSTK = 3)
C
C     CHARACTER DEFINITIONS
C
      INTEGER      SOH,TAB,LF,CR,BLANK,MINUS
      INTEGER      QMARK,DEL,NEL,NULL,EOF
      PARAMETER (SOH=1, TAB=9, LF=10, CR=13, BLANK=32, MINUS=45)
      PARAMETER (QMARK=63, DEL=127, NEL=O'205', NULL=O'4000', EOF=-1)
C
C     MISCELLANEOUS
C
      INTEGER      OK,ERROR,ON,OFF
      PARAMETER (OK=1, ERROR=-2, ON=1, OFF=0)
C
C     PROTOCOL DEFINITIONS
C
      INTEGER      UNKNOWN,FULL,HALF
      INTEGER      NONE,EVEN,ODD,MARK,SPACE
      INTEGER      MAXINIT,MAXTRY
      INTEGER      MAXPACK,MYTIME,MYPAD,MYPADCH
      INTEGER      MYEOL,MYQUOTE,QUOT8CH,MYCKTYP
      INTEGER      PREFXCH
      PARAMETER (UNKNOWN=0, FULL=1, HALF=2)
      PARAMETER (NONE=0, EVEN=1, ODD=2, MARK=3, SPACE=4)
      PARAMETER (MAXINIT=20, MAXTRY=5)
      PARAMETER (MAXPACK=94, MYTIME=10, MYPAD=0, MYPADCH=0)
      PARAMETER (MYEOL=13, MYQUOTE=35, QUOT8CH=78, MYCKTYP=49)
      PARAMETER (PREFXCH=126)
C
C     PACKET TYPES
C
      INTEGER      A,B,C,D,E,F,G,L,N,R,S,Y,Z,ITYP
      PARAMETER (A=65, B=66, C=67, D=68, E=69, F=70, G=71, L=76, N=78)
      PARAMETER (R=82, S=83, Y=89, Z=90, ITYP=73)
C
C     PACKET ERROR DEFINITIONS
C
      INTEGER      TOOMANY,INVALID,SEQERR
      INTEGER      LCLFILE
      INTEGER      SENDING,READING
      INTEGER      INITERR,FILERR,DATAERR,EOFERR
      INTEGER      BRKERR
CLT 2.4 CHANGED LCLFILE ERROR CODE TO 11 (FROM 3)
      PARAMETER (TOOMANY = 1, INVALID=2, SEQERR=3,LCLFILE=11)
      PARAMETER (SENDING=4, READING=5, INITERR=6, FILERR=7)
      PARAMETER (DATAERR=8, EOFERR=9, BRKERR=10)
C
      OPTION 1-
C ------   End of insert
C
C ------   Cut here - KVER.INS
C
C
C KVER.INS  - KERMIT CAPABILITIES
C
      LOGICAL      LOCALON         !enables connect mode
        PARAMETER (LOCALON = .TRUE.)
C ------   End of insert
C
C ------   End of GM2KERM.INS insert file
