home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / asm / tbsource / logger / lv1.05.s < prev    next >
Encoding:
Text File  |  1993-12-21  |  25.4 KB  |  1,458 lines

  1. *************************************************
  2. *                        *
  3. *         (C)opyright 1992        *
  4. *                        *
  5. *        by  Tomi Blinnikka        *
  6. *                        *
  7. *    Don´t try to understand the code    *
  8. *                        *
  9. * Version 0.01    ??/??/1992            *
  10. *     -0.99ö                    *
  11. *                        *
  12. * BUGS:                        *
  13. *                        *
  14. * Version 1.00    01/08/1992            *
  15. *                        *
  16. * BUGS:    Logging problems, grr...        *
  17. *                        *
  18. * Version 1.01    08/08/1992            *
  19. *                        *
  20. * BUGS:                        *
  21. *                        *
  22. * Version 1.02    09/08/1992            *
  23. *                        *
  24. * Added speeds.                    *
  25. *                        *
  26. * Version 1.03    14/08/1992            *
  27. *                        *
  28. * Added log!                    *
  29. *                        *
  30. * BUGS:    Didn't give correct device in arguments    *
  31. *                        *
  32. * Version 1.04    15/08/1992            *
  33. *                        *
  34. * Version 1.05    22/08/1992            *
  35. *                        *
  36. * Changed log to be opened/closed before/after    *
  37. * writes.                    *
  38. *                        *
  39. *************************************************
  40.  
  41.     INCLUDE    "JMPLibs.i"
  42.     INCLUDE    "exec/types.i"
  43.     INCLUDE    "exec/nodes.i"
  44.     INCLUDE    "exec/lists.i"
  45.     INCLUDE    "exec/ports.i"
  46.     INCLUDE    "exec/memory.i"
  47.     INCLUDE    "exec/devices.i"
  48.     INCLUDE    "exec/io.i"
  49.     INCLUDE    "exec/tasks.i"
  50.     INCLUDE    "libraries/dosextens.i"
  51.     INCLUDE    "libraries/dos.i"
  52.     INCLUDE    "devices/serial.i"
  53.     INCLUDE    "dos/dostags.i"
  54.     INCLUDE    "dos/datetime.i"
  55.  
  56.     INCLUDE    "XREF:2.0.xref"
  57.     INCLUDE    "XREF:exec.xref"
  58.     INCLUDE    "XREF:dos.xref"
  59.  
  60.     XREF    _LVOCurrentTime
  61.     XREF    _LVOSystemTagList
  62.  
  63. TRUE:        EQU    1
  64.  
  65.         section    Logger,CODE
  66.  
  67.         push    d2-d7/a2-a6
  68.         push    d0/a0
  69.  
  70.         sub.l    a1,a1            ;Find our task
  71.         lib    Exec,FindTask
  72.         move.l    d0,OurTask
  73.  
  74.         openlib    Dos,NoDos        ;Keep at beginning
  75.  
  76. CLIStart:    lib    Dos,Output
  77.         move.l    d0,_stdout
  78.  
  79.         openlib    Utility,NoUtility
  80.  
  81.         pull    d0/a0
  82.         clr.b    -1(a0,d0.l)
  83.         cmp.b    #'?',(a0)
  84.         beq    Usage
  85.         cmp.w    #'-?',(a0)
  86.         beq    Usage
  87.         cmp.w    #'-h',(a0)
  88.         beq    Usage
  89.         cmp.b    #'h',(a0)
  90.         beq    Usage
  91.         cmp.w    #'-1',(a0)
  92.         bne    CLIStart1
  93.         move.w    #1,LogLevel
  94.         add.l    #3,a0
  95. CLIStart1:    cmp.w    #'-2',(a0)
  96.         bne    CLIStart2
  97.         move.w    #2,LogLevel
  98.         add.l    #3,a0
  99. CLIStart2:    cmp.w    #'-3',(a0)
  100.         bne    CLIStart3
  101.         move.w    #3,LogLevel
  102.         add.l    #3,a0
  103. CLIStart3:    cmp.w    #'-d',(a0)
  104.         bne    CLIStart9
  105.         move.w    #1,Dumb
  106.         add.l    #3,a0
  107. CLIStart9:    cmp.w    #'-s',(a0)
  108.         bne    CLIStart10
  109.         add.l    #2,a0
  110.         bsr    ConvASCII
  111.         tst.l    d0
  112.         beq    CLIStart2
  113.         move.l    d0,Speed
  114.  
  115. CLIStart10:    cmp.b    #' ',(a0)
  116.         bne    CLIStart11
  117.         add.l    #1,a0
  118.         bra    CLIStart10
  119. CLIStart11:
  120.  
  121. Cont0.2:    bsr    ConvASCII
  122.         tst.l    d0
  123.         beq    Cont1
  124.         move.l    d0,SerUnit
  125. Cont1:        cmp.b    #' ',(a0)
  126.         bne    Cont1.1
  127.         add.l    #1,a0
  128. Cont1.1:    tst.b    (a0)
  129.         beq    Cont1.2
  130.         move.l    a0,SerName
  131. Cont1.2:
  132.  
  133. MainStart:    openlib    Intuition,NoInt
  134.  
  135.  
  136. ;Create read reply port for serial.device (or modem0.device etc.)
  137.  
  138.         lib    Exec,CreateMsgPort
  139.         move.l    d0,SRRPort
  140.         beq    NoMsgPort
  141.  
  142. ;Create read IOReq for serial.device (or for other device, but size is EXTSER)
  143.  
  144.         move.l    #IOEXTSER_SIZE,d0
  145.         move.l    SRRPort,a0
  146.         lib    Exec,CreateIORequest
  147.         move.l    d0,IORRequest
  148.         beq    NoIOReq
  149.  
  150. ;Create write reply port for serial.device (or modem0.device etc.)
  151.  
  152.         lib    Exec,CreateMsgPort
  153.         move.l    d0,SWRPort
  154.         beq    NoMsgPort
  155.  
  156. ;Create write IOReq for serial.device (or for other device, but size is EXTSER)
  157.  
  158.         move.l    #IOEXTSER_SIZE,d0
  159.         move.l    SWRPort,a0
  160.         lib    Exec,CreateIORequest
  161.         move.l    d0,IOWRequest
  162.         beq    NoIOReq
  163.  
  164. ;open serial.device
  165.  
  166.         move.l    SerName,a0
  167.         move.l    SerUnit,d0
  168.         move.l    IORRequest,a1
  169.         move.l    Speed,IO_BAUD(a1)
  170.         move.b    #SERF_SHARED,IO_SERFLAGS(a1)
  171.         clr.l    d1                ;no flags
  172.         lib    Exec,OpenDevice
  173.         tst.l    d0
  174.         bne    NoSerial
  175.         move.w    #$1,SerOpen        ;just to tell if open
  176.  
  177. ;Copy info from one req to the other
  178.  
  179.         move.l    IORRequest,a0
  180.         move.l    IOWRequest,a1
  181.         move.l    IO_DEVICE(a0),IO_DEVICE(a1)
  182.         move.l    IO_UNIT(a0),IO_UNIT(a1)
  183.         add.l    #48,a0            ;get start of ioser
  184.         add.l    #48,a1
  185.         move.l    #34,d0
  186.         lib    Exec,CopyMem
  187.  
  188. ;set preferences with IOWReq
  189.  
  190.         tst.l    Speed
  191.         beq    SkipSpeed
  192.         move.l    IOWRequest,a1
  193.         clr.l    IO_LENGTH(a1)
  194.         clr.l    IO_DATA(a1)
  195.         move.w    #SDCMD_SETPARAMS,IO_COMMAND(a1)
  196.         move.l    Speed,IO_BAUD(a1)
  197.         lib    Exec,DoIO
  198.         tst.l    d0
  199.         bne    NoSetSer
  200. SkipSpeed:
  201.  
  202. ;
  203. ;Main loop here
  204. ;
  205. ;1.  Reset modem
  206. ;2.  Setup read
  207. ;3.  Wait for RING (*)
  208. ;4.  Answer with ATA (*)
  209. ;5.  Wait for CONNECT (*)
  210. ;6.  Delay of 1 SEC
  211. ;7.  Display Getty-Header
  212. ;8.  Ask login
  213. ;9.  Ask for password
  214. ;10. Test password with login
  215. ;11. Loop if incorrect or null
  216. ;12. Execute Login-Start of $username
  217.  
  218. ;(*) only if -d(umb) option is not set
  219.  
  220.         bsr    Reader
  221.  
  222. StartLoop:    clr.l    d1
  223.         bset.l    #SIGBREAKB_CTRL_C,d1    ;check for CTRL_C
  224.         lib    Dos,CheckSignal
  225.         btst.l    #SIGBREAKB_CTRL_C,d0
  226.         bne    ShutDown
  227.  
  228.         tst.w    Dumb
  229.         bne    StartLoop1
  230.         bsr    Reset
  231.  
  232. StartLoop1:    tst.w    Dumb
  233.         bne    Logging
  234.  
  235. StartLoop2:    clr.w    BufCount
  236.         bsr    WaitForRing
  237.         tst.l    d0
  238.         beq    ShutDown
  239.  
  240.         bsr    Answer
  241.         clr.w    BufCount
  242.         bsr    WaitForConnect
  243.         tst.l    d0
  244.         beq    ShutDown
  245.         cmp.l    #1111111,d0
  246.         beq    StartLoop2
  247.  
  248.         clr.l    d0
  249.         bsr    WaitUntilLF    ;clears connect speed + CR
  250.         clr.l    d0
  251.         bsr    WaitUntilLF    ;should clear LF
  252.  
  253. ;Login part starts here
  254.  
  255. Logging:    lea.l    LoginSeconds,a0
  256.         lea.l    MicrosTemp,a1
  257.         lib    Intuition,CurrentTime
  258.  
  259.         clr.w    LogFailCount
  260.         tst.w    Dumb
  261.         bne    Logging0.11111
  262.         bsr    Delay11SECS
  263.  
  264. Logging0.11111:    bsr    Welcome
  265. Logging1:    bsr    AskLogin
  266.         tst.l    d0
  267.         beq    ShutDown
  268.         tst.b    Buffer3
  269.         beq    Logging1
  270.         bsr    AskPassword
  271.         tst.l    d0
  272.         beq    ShutDown
  273.  
  274.         lea.l    PassWdFileN,a0
  275.         move.l    a0,d1
  276.         move.l    #MODE_OLDFILE,d2
  277.         lib    Dos,Open
  278.         move.l    d0,PassWdFile
  279.         bne    Logging1.1
  280.  
  281.         lea.l    PassWdFileN,a3
  282.         bsr    FileError1
  283.         bra    Logging2.9
  284.  
  285. Logging1.1:    bsr    ReadUser
  286.         tst.l    d0
  287.         bne    Logging2.9
  288.         lea.l    TempBuf1,a0
  289.         lea.l    UserName,a1
  290.         bsr    CmpStrings
  291.         tst.l    d0
  292.         beq    Logging1.1
  293.  
  294. Logging2:    lea.l    PassWord,a0
  295.         lea.l    Buffer4,a1
  296.         bsr    Decrypt
  297.         lea.l    Buffer4,a0
  298.         lea.l    Buffer3,a1
  299.         bsr    CmpStrings
  300.         tst.l    d0
  301.         bne    LoggedOn
  302. Logging2.9:    add.w    #1,LogFailCount
  303.         bsr    IncorrectLogin
  304.         cmp.w    #5,LogFailCount
  305.         beq    LoginFailure
  306.         bra    Logging1
  307.  
  308. LoggedOn:    move.l    PassWdFile,d1
  309.         beq    LoggedOn1
  310.         lib    Dos,Close
  311.         clr.l    PassWdFile
  312.  
  313. LoggedOn1:    lea.l    LoginSeconds,a0
  314.         lea.l    MicrosTemp,a1
  315.         lib    Intuition,CurrentTime
  316.  
  317.         lea.l    CRLFText1,a0
  318.         bsr    GetLength
  319.         bsr    Writer
  320.  
  321. ;Do log stuff
  322.  
  323.         cmp.w    #2,LogLevel
  324.         beq    LoggedOn2
  325.         cmp.w    #3,LogLevel
  326.         bne    LoggedOn3
  327. LoggedOn2:    lea.l    CorrectText1,a0
  328.         bsr    GetLength
  329.         bsr    Writer2
  330.         lea.l    TempBuf1,a0
  331.         bsr    GetLength
  332.         bsr    Writer2
  333.         lea.l    LogFailIncText1,a0
  334.         bsr    GetLength
  335.         bsr    Writer2
  336.         bsr    PutDate
  337.         lea.l    CRLFText1,a0
  338.         bsr    GetLength
  339.         bsr    Writer2
  340.  
  341. LoggedOn3:    bsr    OpenNIL
  342.         tst.l    NILFile
  343.         beq    ShutDown
  344.  
  345.         bsr    ClearSer
  346.  
  347.         bsr    MakeCmdString
  348.  
  349.         lea.l    CmdString1,a0
  350.         move.l    a0,d1
  351.         clr.l    d2
  352.         move.l    NILFile,d3
  353.         lib    Dos,Execute
  354.  
  355.         bsr    CloseNIL
  356.  
  357. LogOut:        lea.l    CRLFText1,a0
  358.         bsr    GetLength
  359.         bsr    Writer
  360.         bsr    OnTime
  361.  
  362.         tst.w    Dumb
  363.         bne    LogOut1
  364.         bsr    HangUp
  365. LogOut1:    cmp.w    #5,LogFailCount        ;don't wait for character
  366.         beq    LogOut2
  367.         bsr    CheckEvent
  368.         tst.l    d0
  369.         beq    ShutDown
  370.         bsr    Reader
  371. LogOut2:    bra    StartLoop
  372.  
  373. OnTime:        lea.l    LogoutSeconds,a0
  374.         lea.l    MicrosTemp,a1
  375.         lib    Intuition,CurrentTime
  376.  
  377.         move.l    LoginSeconds,d0
  378.         move.l    LogoutSeconds,d1
  379.         sub.l    d0,d1
  380.         divu.w    #60,d1            ;Minutes
  381.         clr.l    d0
  382.         move.w    d1,d0            ;test moving it straight to mins...
  383.         move.w    d0,OnTimeMins
  384.  
  385.         lea.l    fstrl,a0        ;HEX->ASCII
  386.         lea.l    OnTimeMins,a1        ;Number2Print
  387.         lea.l    PutChProc,a2
  388.         lea.l    OnTimeText2,a3        ;Destination
  389.         lib    Exec,RawDoFmt
  390.  
  391.         lea.l    OnTimeText1,a0
  392.         bsr    GetLength
  393.         bsr    Writer
  394.  
  395.         cmp.w    #2,LogLevel
  396.         beq    OnTime2
  397.         cmp.w    #3,LogLevel
  398.         bne    OnTime3
  399. OnTime2:    lea.l    LogOutText1,a0
  400.         bsr    GetLength
  401.         bsr    Writer2
  402.         bsr    PutDate
  403.         lea.l    CRLFText2,a0
  404.         bsr    GetLength
  405.         bsr    Writer2
  406.         lea.l    OnTimeText1,a0
  407.         bsr    GetLength
  408.         bsr    Writer2
  409.  
  410. OnTime3:    lea.l    ConnectionText1,a0
  411.         bsr    GetLength
  412.         bsr    Writer
  413.         rts
  414.  
  415. ;Waits for RING
  416. ;
  417. ;INPUT
  418. ;
  419. ;OUTPUT
  420. ;
  421. ;D0 = -1 if OK
  422. ;D0 =  0 if Break
  423. ;
  424. ;ACTION
  425. ;
  426. ;1. Wait for input, serial or CTRL_C
  427. ;2. If CTRL_C then break
  428. ;3. If serial test for ring
  429. ;4. If D0 = -1 then RING -> OUT
  430. ;5. If not then loop
  431.  
  432. WaitForRing:    bsr    CheckEvent
  433.         tst.l    d0
  434.         beq    WaitForRing_OUT
  435.  
  436.         bsr    TestRing
  437.         tst.l    d0
  438.         beq    WaitForRing        ;No RING so get more chars
  439. WaitForRing_OUT: rts
  440.  
  441. TestRing:    tst.w    BufCount
  442.         bne    TestRing2
  443.         cmp.b    #'R',Buffer1
  444.         bne    TestRing4
  445. TestRing2:    lea.l    Buffer2,a0
  446.         add.w    BufCount,a0
  447.         move.b    Buffer1,(a0)
  448.         add.w    #1,BufCount
  449.         cmp.w    #4,BufCount
  450.         bne    TestRing4
  451.         clr.w    BufCount
  452.         cmp.l    #'RING',Buffer2
  453.         bne    TestRing4
  454. TestRing3:    bsr    ClearSer
  455.         bsr    Reader
  456.         move.l    #-1,d0            ;indicate ring
  457.         rts
  458. TestRing4:    bsr    ClearSer        ;Abort possible prev. read
  459.         bsr    Reader            ;Set up new read
  460.         clr.l    d0
  461.         rts
  462.  
  463. ;Waits for CONNECT
  464. ;
  465. ;INPUT
  466. ;
  467. ;OUTPUT
  468. ;
  469. ;D0 = -1 if OK
  470. ;D0 =  0 if Break
  471. ;
  472. ;ACTION
  473. ;
  474. ;1. Wait for input, serial or CTRL_C
  475. ;2. If CTRL_C then break
  476. ;3. If serial test for connect
  477. ;4. If D0 = -1 then CONNECT -> OUT
  478. ;5. If not then loop
  479.  
  480. WaitForConnect:    bsr    CheckEvent
  481.         tst.l    d0
  482.         beq    WaitForConnect_OUT
  483.  
  484.         bsr    TestConnect
  485.         tst.l    d0
  486.         beq    WaitForConnect        ;No CONNECT so get more chars
  487. WaitForConnect_OUT: rts
  488.  
  489. TestConnect:    tst.w    BufCount
  490.         bne    TestConnect2
  491.         cmp.b    #'C',Buffer1
  492.         bne    TestConnect4
  493. TestConnect2:    lea.l    Buffer2,a0
  494.         add.w    BufCount,a0
  495.         move.b    Buffer1,(a0)
  496.         add.w    #1,BufCount
  497.         cmp.w    #7,BufCount
  498.         bne    TestConnect4
  499.         clr.w    BufCount
  500.         cmp.l    #'CONN',Buffer2
  501.         bne    TestConnect5
  502.         cmp.w    #'EC',Buffer2+4
  503.         bne    TestConnect5
  504.         cmp.b    #'T',Buffer2+6
  505.         bne    TestConnect5
  506. TestConnect3:    bsr    ClearSer
  507.         bsr    Reader
  508.         move.l    #-1,d0            ;indicate CONNECT
  509.         rts
  510. TestConnect4:    bsr    ClearSer        ;Abort possible prev. read
  511.         bsr    Reader            ;Set up new read
  512.         clr.l    d0
  513.         rts
  514. TestConnect5:    bsr    ClearSer        ;Abort possible prev. read
  515.         bsr    Reader            ;Set up new read
  516.         move.l    #1111111,d0
  517.         rts
  518.  
  519. Reset:        lea.l    ResetString,a0
  520.         bsr    GetLength
  521.         bsr    Writer
  522.         rts
  523.  
  524. Answer:        lea.l    AnswerString,a0
  525.         bsr    GetLength
  526.         bsr    Writer
  527.         rts
  528.  
  529. Welcome:    lea.l    WelcomeFileN,a0
  530.         move.l    a0,d1
  531.         move.l    #MODE_OLDFILE,d2
  532.         lib    Dos,Open
  533.         move.l    d0,WelcomeFile
  534.         beq    Welcome_ERR1
  535.  
  536.         move.l    d0,d1
  537.         bsr    GetFileLength
  538.         tst.l    d0
  539.         beq    Welcome2
  540.  
  541.         move.l    d0,WelcomeLength
  542.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1    ;Type of memory wanted
  543.         lib    Exec,AllocMem
  544.         move.l    d0,WelcomeMem
  545.         beq    Welcome_ERR2
  546.  
  547.         move.l    WelcomeFile,d1
  548.         move.l    WelcomeMem,d2
  549.         move.l    WelcomeLength,d3
  550.         lib    Dos,Read
  551.         cmp.l    WelcomeLength,d0
  552.         bne    Welcome_ERR3
  553.  
  554.         clr.l    d4
  555.         move.l    WelcomeMem,a3
  556. Welcome1:    move.l    a3,a0
  557.         bsr    GetLLength
  558.         add.l    d0,d4
  559.         add.l    d0,a3
  560.         sub.l    #1,d0
  561.         bsr    Writer
  562.         lea.l    CRLFText1,a0
  563.         bsr    GetLength
  564.         bsr    Writer
  565.  
  566.         cmp.l    WelcomeLength,d4
  567.         bcs    Welcome1
  568.  
  569. Welcome2:    move.l    WelcomeFile,d1
  570.         lib    Dos,Close
  571.         clr.l    WelcomeFile
  572.  
  573.         tst.l    WelcomeMem
  574.         beq    Welcome_OUT
  575.         move.l    WelcomeMem,a1
  576.         move.l    WelcomeLength,d0
  577.         lib    Exec,FreeMem
  578.         clr.l    WelcomeMem
  579.         clr.l    WelcomeLength
  580.  
  581. Welcome_OUT:    rts
  582.  
  583. Welcome_ERR1:    lea.l    WelcomeFileN,a3
  584.         bsr    FileError1
  585.         bra    Welcome_OUT
  586.  
  587. Welcome_ERR2:    bsr    WarnLowMem
  588.         bra    Welcome2
  589.  
  590. Welcome_ERR3:    lea.l    WelcomeFileN,a3
  591.         bsr    FileError2
  592.         bra    Welcome_OUT
  593.  
  594. AskLogin:    lea.l    LoginText1,a0
  595.         bsr    GetLength
  596.         bsr    Writer
  597.  
  598.         clr.w    BufCount
  599.         move.l    #1,d0
  600.         bsr    WaitUntilLF
  601.         tst.l    d0
  602.         beq    AskLogin_OUT
  603.  
  604.         lea.l    Buffer3,a0
  605.         lea.l    TempBuf1,a1
  606.         move.l    #32,d0
  607.         lib    Exec,CopyMem
  608.         move.l    #-1,d0
  609.         rts
  610. AskLogin_OUT:    clr.l    d0
  611.         rts
  612.  
  613. AskPassword:    lea.l    PasswordText1,a0
  614.         bsr    GetLength
  615.         bsr    Writer
  616.         clr.w    BufCount
  617.         clr.l    d0
  618.         bsr    WaitUntilLF
  619.         rts
  620.  
  621. IncorrectLogin:    lea.l    IncorrectText1,a0
  622.         bsr    GetLength
  623.         bsr    Writer
  624.         cmp.w    #1,LogLevel
  625.         beq    IncorrectLogin1
  626.         cmp.w    #3,LogLevel
  627.         bne    IncorrectLogin_OUT
  628. IncorrectLogin1: lea.l    IncorrectText2,a0
  629.         bsr    GetLength
  630.         bsr    Writer2
  631.         lea.l    TempBuf1,a0
  632.         bsr    GetLength
  633.         bsr    Writer2
  634.         lea.l    LogFailIncText2,a0
  635.         bsr    GetLength
  636.         bsr    Writer2
  637.         lea.l    Buffer3,a0
  638.         bsr    GetLength
  639.         bsr    Writer2
  640.         lea.l    LogFailIncText1,a0
  641.         bsr    GetLength
  642.         bsr    Writer2
  643.         bsr    PutDate
  644.         lea.l    CRLFText1,a0
  645.         bsr    GetLength
  646.         bsr    Writer2
  647.  
  648. IncorrectLogin_OUT: rts
  649.  
  650. LoginFailure:    lea.l    LogFailureText1,a0
  651.         bsr    GetLength
  652.         bsr    Writer
  653.         cmp.w    #1,LogLevel
  654.         beq    LoginFailure1
  655.         cmp.w    #3,LogLevel
  656.         bne    LoginFailure_OUT
  657. LoginFailure1:    lea.l    LogFailureText2,a0
  658.         bsr    GetLength
  659.         bsr    Writer2
  660.         lea.l    CRLFText1,a0
  661.         bsr    GetLength
  662.         bsr    Writer2
  663. LoginFailure_OUT: bra    LogOut
  664.  
  665. Echo:        lea.l    Buffer1,a0
  666.         move.l    #1,d0
  667.         bsr    Writer
  668.         rts
  669.  
  670. HangUp:        bsr    Delay3SECS
  671.         lea.l    HangUpString1,a0
  672.         bsr    GetLength
  673.         bsr    Writer
  674.         bsr    Delay3SECS
  675.         lea.l    HangUpString2,a0
  676.         bsr    GetLength
  677.         bsr    Writer
  678.         bsr    Delay1SEC
  679.         rts
  680.  
  681. Delay1SEC:    move.l    #51,d1
  682.         lib    Dos,Delay
  683.         rts
  684. Delay3SECS:    move.l    #3*51,d1
  685.         lib    Dos,Delay
  686.         rts
  687. Delay11SECS:    move.l    #11*51,d1
  688.         lib    Dos,Delay
  689.         rts
  690.  
  691. Break:        lea.l    BreakText1,a0
  692.         bsr    Printer
  693.         clr.l    d0
  694.         rts
  695.  
  696. OpenNIL:    lea.l    NILName,a0
  697.         move.l    a0,d1
  698.         move.l    #MODE_NEWFILE,d2
  699.         lib    Dos,Open
  700.         move.l    d0,NILFile
  701.         rts
  702.  
  703. CloseNIL:    move.l    NILFile,d1
  704.         beq    CloseNIL1
  705.         lib    Dos,Close
  706.         clr.l    NILFile
  707. CloseNIL1:    rts
  708.  
  709. MakeCmdString:    lea.l    fstrl2,a0        ;HEX->ASCII
  710.         lea.l    ASCIIUnit1,a1        ;Number2Print
  711.         lea.l    PutChProc,a2
  712.         lea.l    ASCIIUnit2,a3        ;Destination
  713.         lib    Exec,RawDoFmt
  714.  
  715.         lea.l    CmdString1,a0
  716.         lea.l    UserCommand,a4
  717.         move.l    a4,a5
  718.         add.l    #32,a5
  719.         bsr    MCS1
  720.  
  721.         move.b    #' ',(a0)+
  722.  
  723.         lea.l    UserName,a4
  724.         move.l    a4,a5
  725.         add.l    #10,a5
  726.         bsr    MCS1
  727.  
  728.         move.b    #' ',(a0)+
  729.         move.b    #'"',(a0)+
  730.  
  731.         lea.l    RealName,a4
  732.         move.l    a4,a5
  733.         add.l    #64,a5
  734.         bsr    MCS1
  735.  
  736.         move.b    #'"',(a0)+
  737.         move.b    #' ',(a0)+
  738.         move.b    #'"',(a0)+
  739.  
  740.         lea.l    UserHome,a4
  741.         move.l    a4,a5
  742.         add.l    #64,a5
  743.         bsr    MCS1
  744.  
  745.         move.b    #'"',(a0)+
  746.         move.b    #' ',(a0)+
  747.         move.b    #'"',(a0)+
  748.  
  749.         lea.l    Office,a4
  750.         move.l    a4,a5
  751.         add.l    #64,a5
  752.         bsr    MCS1
  753.  
  754.         move.b    #'"',(a0)+
  755.         move.b    #' ',(a0)+
  756.  
  757.         move.l    SerName,a4
  758.         move.l    a4,a5
  759.         add.l    #20,a5
  760.         bsr    MCS1
  761.  
  762.         move.b    #' ',(a0)+
  763.  
  764.         move.b    ASCIIUnit2,(a0)+
  765.         clr.b    (a0)+
  766.  
  767. ;        lea.l    CmdString1,a0        ;DEBUG
  768. ;        bsr    Printer            ;DEBUG
  769.  
  770.         rts
  771.  
  772. MCS1:        move.b    (a4)+,(a0)+
  773.         tst.b    (a4)
  774.         beq    MCS2
  775.         cmp.l    a4,a5
  776.         bne    MCS1
  777. MCS2:        rts
  778.  
  779. WarnLowMem:    lea.l    LowMemText1,a0
  780.         bsr    GetLength
  781.         bsr    Writer
  782.         rts
  783.  
  784. ;Outputs error message
  785. ;
  786. ;Inputs a3 = Filename
  787.  
  788. FileError1:    lea.l    FileErrorText1,a0
  789.         bsr    GetLength
  790.         bsr    Writer
  791.         move.l    a3,a0
  792.         bsr    GetLength
  793.         bsr    Writer
  794.         lea.l    CRLFText1,a0
  795.         bsr    GetLength
  796.         bsr    Writer
  797.         lea.l    FileErrorText1,a0
  798.         bsr    GetLength
  799.         bsr    Writer2            ;log them
  800.         move.l    a3,a0
  801.         bsr    GetLength
  802.         bsr    Writer2
  803.         lea.l    CRLFText1,a0
  804.         bsr    GetLength
  805.         bsr    Writer2
  806.         rts
  807.  
  808. FileError2:    lea.l    FileErrorText2,a0
  809.         bsr    GetLength
  810.         bsr    Writer
  811.         move.l    a3,a0
  812.         bsr    GetLength
  813.         bsr    Writer
  814.         lea.l    CRLFText1,a0
  815.         bsr    GetLength
  816.         bsr    Writer
  817.         lea.l    FileErrorText2,a0
  818.         bsr    GetLength
  819.         bsr    Writer2
  820.         move.l    a3,a0
  821.         bsr    GetLength
  822.         bsr    Writer2
  823.         lea.l    CRLFText1,a0
  824.         bsr    GetLength
  825.         bsr    Writer2
  826.         rts
  827.  
  828. ;Outputs error message
  829. ;
  830. ;Inputs a3 = Filename
  831.  
  832. FileError3:    lea.l    FileErrorText1,a0
  833.         bra    Printer
  834.         move.l    a3,a0
  835.         bsr    Printer
  836.         lea.l    CRLFText1,a0
  837.         bsr    Printer
  838.         rts
  839.  
  840. ClearSer:    clr.w    Requested
  841.         move.l    IORRequest,a1
  842.         lib    Exec,CheckIO
  843.         tst.l    d0
  844.         beq    ClearSer1
  845.         move.l    IORRequest,a1
  846.         lib    Exec,WaitIO
  847.         rts
  848. ClearSer1:    move.l    IORRequest,a1
  849.         ABORTIO
  850.         move.l    IORRequest,a1
  851.         lib    Exec,WaitIO
  852.         rts
  853.  
  854. Reader:        move.w    #1,Requested
  855.         move.l    IORRequest,a1
  856.         move.w    #CMD_READ,IO_COMMAND(a1)
  857.         move.l    #1,IO_LENGTH(a1)
  858.         lea.l    Buffer1,a0
  859.         move.l    a0,IO_DATA(a1)
  860.         lib    Exec,SendIO
  861.         rts
  862.  
  863. ;Writes string to serial port
  864. ;
  865. ;D0 = Length
  866. ;A0 = String
  867.  
  868. Writer:        move.l    IOWRequest,a1
  869.         move.w    #CMD_WRITE,IO_COMMAND(a1)
  870.         move.l    d0,IO_LENGTH(a1)
  871.         move.l    a0,IO_DATA(a1)
  872.         lib    Exec,DoIO        ;May freeze, too bad
  873.         rts
  874.  
  875. ;Tries to write string to logfile
  876. ;
  877. ;D0 = Length
  878. ;A0 = String
  879.  
  880. Writer2:    push    a0/d0
  881.         bsr    OpenLog
  882.         tst.l    d0
  883.         beq    Writer2_OUT
  884.         pull    a0/d0
  885.         move.l    LogFile,d1
  886.         beq    Writer2_OUT
  887.         move.l    a0,d2
  888.         move.l    d0,d3
  889.         lib    Dos,Write
  890.         bsr    CloseLog
  891. Writer2_OUT:    rts
  892.  
  893. ;Try to open logfile
  894.  
  895. OpenLog:    lea.l    LogFileN,a0
  896.         move.l    a0,d1
  897.         move.l    #MODE_READWRITE,d2
  898.         lib    Dos,Open
  899.         move.l    d0,LogFile
  900.         bne    OpenLog1
  901.  
  902.         lea.l    LogFileN,a3
  903.         bsr    FileError3
  904.         bra    OpenLog2
  905.  
  906. OpenLog1:    bsr    SeekEnd
  907.         move.l    #-1,d0
  908.         rts
  909. OpenLog2:    clr.l    d0
  910.         rts
  911.  
  912. CloseLog:    move.l    LogFile,d1
  913.         beq    CloseLog1
  914.         lib    Dos,Close
  915.         clr.l    LogFile
  916. CloseLog1:    rts
  917.  
  918. PutDate:    lea.l    DateTime1,a0
  919.         move.l    a0,d1
  920.         lib    Dos,DateStamp
  921.         lea.l    DateTime1,a0
  922.         move.l    a0,d1
  923.         lib    Dos,DateToStr
  924.         tst.l    d0
  925.         beq    PutDate_OUT
  926.         lea.l    StrTime1,a0
  927.         bsr    GetLength
  928.         bsr    Writer2
  929.         lea.l    SpaceText1,a0
  930.         bsr    GetLength
  931.         bsr    Writer2
  932.         lea.l    StrDay1,a0
  933.         bsr    GetLength
  934.         bsr    Writer2
  935.         lea.l    SpaceText1,a0
  936.         bsr    GetLength
  937.         bsr    Writer2
  938.         lea.l    StrDate1,a0
  939.         bsr    GetLength
  940.         bsr    Writer2
  941. PutDate_OUT:    rts
  942.  
  943. PutChProc:    tst.b    d0
  944.         beq    PutChProc_OUT
  945.         move.b    d0,(a3)+
  946. PutChProc_OUT:    rts
  947.  
  948. ShutDown:    tst.w    SerOpen
  949.         beq    ShutDown9000
  950.         tst.w    Requested
  951.         beq    ShutDown9500
  952.         bsr    ClearSer
  953. ShutDown9500:    move.l    IORRequest,a1
  954.         lib    Exec,CloseDevice
  955.  
  956. ShutDown9000:    move.l    IORRequest,a0
  957.         lib    Exec,DeleteIORequest
  958.  
  959.         move.l    SRRPort,a0
  960.         lib    Exec,DeleteMsgPort
  961.  
  962.         move.l    IOWRequest,a0
  963.         lib    Exec,DeleteIORequest
  964.  
  965.         move.l    SWRPort,a0
  966.         lib    Exec,DeleteMsgPort
  967.  
  968. ShutDown5000:    move.l    WelcomeFile,d1
  969.         beq    ShutDown4500
  970.         lib    Dos,Close
  971. ShutDown4500:    move.l    PassWdFile,d1
  972.         beq    ShutDown4400
  973.         lib    Dos,Close
  974. ShutDown4400:    move.l    NILFile,d1
  975.         beq    ShutDown4300
  976.         lib    Dos,Close
  977. ShutDown4300:    move.l    LogFile,d1
  978.         beq    ShutDown4000
  979.         lib    Dos,Close
  980.  
  981. ShutDown4000:    tst.l    WelcomeMem
  982.         beq    ShutDown3000
  983.         move.l    WelcomeMem,a1
  984.         move.l    WelcomeLength,d0
  985.         lib    Exec,FreeMem
  986.  
  987. ShutDown3000:
  988. ShutDown1000:    closlib    Intuition
  989.         closlib    Utility
  990.         closlib    Dos
  991.         pull    d2-d7/a2-a6
  992.         clr.l    d0
  993.         rts
  994.  
  995. ;CheckEvent gets messages from serial.device and keyboard (CTRL_C)
  996. ;
  997. ;Inputs
  998. ;
  999. ;Result
  1000. ;
  1001. ;D0 = -1 if serial returned
  1002. ;D0 = 0  if CTRL_C given
  1003.  
  1004. CheckEvent:    clr.l    d0
  1005.         clr.l    d1
  1006.         move.l    SRRPort,a1        ;serial.device
  1007.         move.b    MP_SIGBIT(a1),d1
  1008.         bset.l    d1,d0
  1009.         bset.l    #SIGBREAKB_CTRL_C,d0    ;and CTRL_C
  1010.         lib    Exec,Wait
  1011.  
  1012.         cmp.l    #SIGBREAKF_CTRL_C,d0    ;If CTRL_C
  1013.         beq    Break            ;go break
  1014.  
  1015.         move.l    #-1,d0            ;Serial returned
  1016.         rts
  1017.  
  1018. ReadUser:    move.l    PassWdFile,d1
  1019.         lea.l    UserName,a0
  1020.         move.l    a0,d2
  1021.         move.l    #DataSize,d3
  1022.         lib    Dos,Read
  1023.         cmp.l    #DataSize,d0
  1024.         beq    ReadUser2
  1025.         lib    Dos,IoErr
  1026.         tst.l    d0
  1027.         beq    ReadUser1
  1028.         lea.l    PassWdFileN,a3
  1029.         bsr    FileError2
  1030. ReadUser1:    move.l    #-1,d0
  1031.         rts
  1032. ReadUser2:    clr.l    d0
  1033.         rts
  1034.  
  1035. ;Compares two strings.
  1036. ;
  1037. ;INPUT
  1038. ;
  1039. ;A0 String 1
  1040. ;A1 String 2
  1041. ;
  1042. ;OUTPUT
  1043. ;
  1044. ;D0 = 0 if not same
  1045. ;
  1046. ;BUGS
  1047. ;
  1048. ;If String 2 is longer but correct upto length of
  1049. ;String 1, routine will say String 1 = String 2
  1050. ;String 1 has to have NULL at end!
  1051. ;
  1052.  
  1053. CmpStrings:    tst.b    (a0)
  1054.         beq    CmpStrings2
  1055.         cmp.b    (a0)+,(a1)+
  1056.         beq    CmpStrings
  1057.         clr.l    d0
  1058.         rts
  1059. CmpStrings2:    move.l    #-1,d0
  1060.         rts
  1061.  
  1062. ;Decrypts passwords
  1063. ;
  1064. ;Input a0 = pointer to encrypted password
  1065. ;      a1 = pointer to buffer for decrypted password
  1066. ;
  1067.  
  1068. Decrypt:    clr.l    d1
  1069. Decrypt1:    move.l    (a0)+,d0
  1070.         swap.l    d0
  1071.         rol.l    #7,d0
  1072.         sub.l    #$DEADBEEF,d0
  1073.         ror.l    #2,d0
  1074.         move.l    d0,(a1)+
  1075.         add.l    #1,d1
  1076.         cmp.l    #3,d1
  1077.         bne    Decrypt1
  1078.         rts
  1079.  
  1080. ;Wait until LF, CR received or buffer full from serial. Buffer all
  1081. ;input with DEL removal
  1082. ;
  1083. ;INPUT
  1084. ;
  1085. ;D0 = 1 if echoing is desired
  1086. ;
  1087. ;OUTPUT
  1088. ;
  1089. ;Buffer 3 = Data received.
  1090.  
  1091. WaitUntilLF:    move.l    d0,d5
  1092.  
  1093. WaitUntilLF1:    bsr    CheckEvent
  1094.         tst.l    d0
  1095.         beq    WaitUntilLF_OUT
  1096.  
  1097.         bsr    BufferInput
  1098.         tst.l    d0
  1099.         beq    WaitUntilLF1        ;No LF so get more chars
  1100. WaitUntilLF_OUT: rts
  1101.  
  1102. BufferInput:    cmp.b    #8,Buffer1        ;Test for BS
  1103.         bne    BufferInput2
  1104.         bsr    DoBS
  1105.         bsr    ClearSer
  1106.         bsr    Reader
  1107.         clr.l    d0
  1108.         rts
  1109. BufferInput2:    lea.l    Buffer3,a2
  1110.         add.w    BufCount,a2
  1111.         move.b    Buffer1,(a2)
  1112.         tst.l    d5
  1113.         beq    BufferInput2.1
  1114.         bsr    Echo
  1115.  
  1116. BufferInput2.1:    add.w    #1,BufCount
  1117.         cmp.w    #32,BufCount        ;Test for full buffer
  1118.         beq    BufferInput3        ;Buffer is full
  1119.  
  1120.         cmp.b    #10,Buffer1
  1121.         beq    BufferInput3
  1122.         cmp.b    #13,Buffer1
  1123.         beq    BufferInput3
  1124.         bsr    ClearSer
  1125.         bsr    Reader
  1126.         clr.l    d0
  1127.         rts
  1128. BufferInput3:    lea.l    Buffer3,a2
  1129.         add.w    BufCount,a2
  1130.         clr.b    -1(a2)
  1131.         bsr    ClearSer
  1132.         bsr    Reader
  1133.         move.l    #-1,d0
  1134.         rts
  1135.  
  1136. DoBS:        tst.w    BufCount
  1137.         beq    DoBS_OUT
  1138.         tst.l    d5
  1139.         beq    DoBS1
  1140.         bsr    Echo
  1141.         lea.l    SpaceText1,a0
  1142.         bsr    GetLength
  1143.         bsr    Writer
  1144.         bsr    Echo
  1145. DoBS1:        sub.w    #1,BufCount
  1146. DoBS_OUT:    rts
  1147.  
  1148. ;Get length of text in given address
  1149. ;
  1150. ;Input a0 = Address of null terminated text string
  1151. ;
  1152. ;Result d0 = Length
  1153.  
  1154. GetLength:    push    a0
  1155.         clr.l    d0
  1156.         cmp.l    #$00,a0        ;fixes enforcer hit
  1157.         beq    GetLength_OUT
  1158. GetLength2:    add.l    #1,d0
  1159.         tst.b    (a0)+
  1160.         bne    GetLength2
  1161.         sub.l    #1,d0        ;don't include NULL
  1162. GetLength_OUT:    pull    a0
  1163.         rts
  1164.  
  1165. ;Get line length of text in given address, including LF
  1166. ;
  1167. ;Input a0 = Address of LF terminated text string
  1168. ;
  1169. ;Result d0 = Length
  1170.  
  1171. GetLLength:    push    a0
  1172.         clr.l    d0
  1173.         cmp.l    #$00,a0        ;fixes enforcer hit
  1174.         beq    GetLLength_OUT
  1175. GetLLength2:    add.l    #1,d0
  1176.         cmp.b    #10,(a0)+
  1177.         bne    GetLLength2
  1178. GetLLength_OUT:    pull    a0
  1179.         rts
  1180.  
  1181. ;Gets the length of the file given
  1182. ;
  1183. ;Input d1 = File
  1184. ;
  1185. ;Result d0 = Length of file in bytes
  1186. ;
  1187.  
  1188. GetFileLength:    push    d5-d6
  1189.         move.l    d1,d6
  1190.         move.l    #00,d2
  1191.         move.l    #01,d3
  1192.         lib    Dos,Seek
  1193.         move.l    d6,d1
  1194.         lib    Dos,Seek
  1195.  
  1196.         move.l    d0,d5
  1197.         move.l    d6,d1
  1198.         move.l    #0,d2
  1199.         move.l    #-1,d3
  1200.         lib    Dos,Seek
  1201.  
  1202.         move.l    d5,d0
  1203.         pull    d5-d6
  1204.         rts
  1205.  
  1206. ;Seeks to end of the file given
  1207. ;
  1208. ;Input d1 = File
  1209. ;
  1210. ;Result d0 = Length of file in bytes
  1211. ;
  1212.  
  1213. SeekEnd:    push    d2-d6
  1214.         move.l    d1,d6
  1215.         move.l    #00,d2
  1216.         move.l    #01,d3
  1217.         lib    Dos,Seek
  1218.         move.l    d6,d1
  1219.         lib    Dos,Seek
  1220.         pull    d2-d6
  1221.         rts
  1222.  
  1223. ConvASCII:    clr.l    d0
  1224.         clr.l    d1
  1225.         cmp.b    #' ',(a0)
  1226.         bne    ConvASCII2
  1227.         add.l    #1,a0
  1228. ConvASCII2:    move.b    (a0),d1
  1229.         cmp.b    #'0',d1
  1230.         bcs    ConvASCII_OUT
  1231.         cmp.b    #'9',d1
  1232.         bhi    ConvASCII_OUT
  1233.         sub.b    #'0',d1
  1234.         push    d1/a0
  1235. ;        mulu.w    #10,d0
  1236.         move.l    #10,d1
  1237.         lib    Utility,UMult32
  1238.         pull    d1/a0
  1239.         add.l    d1,d0
  1240.         add.l    #1,a0
  1241.         bra    ConvASCII2
  1242. ConvASCII_OUT:    rts
  1243.  
  1244. ;Error etc. messages
  1245.  
  1246. Usage:        lea.l    UsageText1,a0
  1247.         bsr    Printer
  1248.         bra    ShutDown
  1249.  
  1250. NoDos:        add.l    #8,sp
  1251.         pull    d2-d7/a2-a6
  1252.         move.l    #RETURN_FAIL,d0
  1253.         rts
  1254.  
  1255. NoUtility:    add.l    #8,sp
  1256.         lea.l    NoUtiText1,a0
  1257.         bsr    Printer
  1258.         bra    ShutDown
  1259.  
  1260. NoInt:        lea.l    NoIntText1,a0
  1261.         bsr    Printer
  1262.         bra    ShutDown
  1263.  
  1264. NoMsgPort:    lea.l    NoMsgPortText1,a0
  1265.         bsr    Printer
  1266.         bra    ShutDown
  1267.  
  1268. NoIOReq:    lea.l    NoIOReqText1,a0
  1269.         bsr    Printer
  1270.         bra    ShutDown
  1271.  
  1272. NoSerial:    lea.l    NoSerialText1,a0
  1273.         bsr    Printer
  1274.         move.l    SerName,a0
  1275.         bsr    Printer
  1276.         lea.l    NoSerialText2,a0
  1277.         bsr    Printer
  1278.         bra    ShutDown
  1279.  
  1280. NoSetSer:    lea.l    NoSetSerText1,a0
  1281.         bsr    Printer
  1282.         bra    ShutDown
  1283.  
  1284. Printer:    printa    a0,_stdout
  1285.         rts
  1286.  
  1287. ;Structures
  1288.  
  1289. ;lib stuff
  1290.  
  1291.         libnames
  1292.  
  1293. ;Task stuff
  1294.  
  1295. OurTask:    dc.l    0
  1296.  
  1297. ;Other stuff XIV
  1298.  
  1299. LoginSeconds:    dc.l    0
  1300. LogoutSeconds:    dc.l    0
  1301. OnTimeMins:    dc.l    0
  1302. MicrosTemp:    dc.l    0
  1303. BufCount:    dc.w    0
  1304. LogFailCount:    dc.w    0
  1305. Dumb:        dc.w    0
  1306. LogLevel:    dc.w    0    ;0=none, 1=failures, 2=logins, 3=both
  1307.  
  1308. ;Ports/reqs/etc.
  1309.  
  1310. SRRPort:    dc.l    0
  1311. IORRequest:    dc.l    0
  1312. SWRPort:    dc.l    0
  1313. IOWRequest:    dc.l    0
  1314.  
  1315. ;Files
  1316.  
  1317. WelcomeFile:    dc.l    0
  1318. WelcomeLength:    dc.l    0
  1319. PassWdFile:    dc.l    0
  1320. LogFile:    dc.l    0
  1321. _stdout:    dc.l    0
  1322. ;_stdin:    dc.l    0
  1323. NILFile:    dc.l    0
  1324.  
  1325. ;Memory allocations
  1326.  
  1327. WelcomeMem:    dc.l    0
  1328.  
  1329. ;Serial device stuff
  1330.  
  1331. SerName:    dc.l    SerName2        ;A pointer!
  1332. SerUnit:    dc.l    0
  1333. SerOpen:    dc.w    0
  1334. Requested:    dc.w    0
  1335. Speed:        dc.l    0
  1336.  
  1337. ;Strings, error
  1338.  
  1339. BreakText1:    dc.b    "***Break",10,0
  1340. NoIntText1:    dc.b    "ERROR: Couldn't open intuition.library!",13,10,0
  1341. NoUtiText1:    dc.b    "ERROR: Couldn't open utility.library!",13,10,0
  1342. NoMsgPortText1:    dc.b    "ERROR: Couldn't get message port!",10,0
  1343. NoIOReqText1:    dc.b    "ERROR: Couldn't get SerialIOReq!",13,10,0
  1344. NoSerialText1:    dc.b    "ERROR: Couldn't open ",0
  1345. SerName2:    dc.b    "serial.device",0
  1346. NoSerialText2:    dc.b    10,0
  1347. NoSetSerText1:    dc.b    "ERROR: Couldn't set parameters for device!",13,10,0
  1348. NILName:    dc.b    "NIL:",0
  1349.  
  1350. ;Strings, names
  1351.  
  1352. STVersion:    dc.b    "$VER: "
  1353. UsageText1:    dc.b    "Logger 1.05 (22.8.92) (C)opyright Tomi Blinnikka 1992",13,10,13,10
  1354. ;        dc.b    10,"           !!! BETA TESTER VERSION !!!",13,10,13,10,13,10
  1355.         dc.b    "USAGE: Logger [-d] [-1] [-2] [-3] [-s Number] [Unit] [Device]",13,10,13,10
  1356.         dc.b    "       Where: [-d] for dumb mode (no hayes commands sent)",13,10
  1357.         dc.b    "              [-s Number] speed to use",13,10
  1358.         dc.b    "              [-1] log login failures",13,10
  1359.         dc.b    "              [-2] log correct logins",13,10
  1360.         dc.b    "              [-3] log all logins",13,10
  1361.         dc.b    "              [Unit] is the unit number",13,10
  1362.         dc.b    "              [Device] is the device name",13,10,13,10
  1363.         dc.b    "       Default: [Device] is serial.device",13,10
  1364.         dc.b    "                [Unit] is 0",13,10,13,10
  1365.         dc.b    "This program is a Getty clone. See docs for more information.",13,10,0
  1366. SRRPortName:    dc.b    "Logger read port",0
  1367. SWRPortName:    dc.b    "Logger write port",0
  1368.  
  1369. ;Filenames etc.
  1370.  
  1371. WelcomeFileN:    dc.b    "GETTY:Getty-Header",0
  1372. PassWdFileN:    dc.b    "GETTY:PassWd.LOGGER",0
  1373. LogFileN:    dc.b    "GETTY:Logger.LOG",0
  1374. ExecuteText1:    dc.b    "C:Execute",0
  1375. ASCIIUnit1:    dc.w    0
  1376. ASCIIUnit2:    dc.l    0
  1377.  
  1378. ;Modem control strings
  1379.  
  1380. ResetString:    dc.b    "ATZ",13,10,0
  1381. AnswerString:    dc.b    "ATA",13,10,0
  1382. HangUpString1:    dc.b    "+++",0
  1383. HangUpString2:    dc.b    "ATH0",13,10,0
  1384.  
  1385. ;Texts to output
  1386.  
  1387. LoginText1:    dc.b    13,10,"login: ",0
  1388. PasswordText1:    dc.b    13,10,"Password: ",0
  1389. CorrectText1:    dc.b    "*   Login correct:  ",0
  1390. IncorrectText1:    dc.b    13,10,"Login incorrect",13,10,0
  1391. IncorrectText2:    dc.b    "**  Login incorrect: ",0
  1392. LogFailureText1: dc.b    "Login failure",13,10,0
  1393. LogFailureText2: dc.b    "*** Login failure",0
  1394. LogOutText1:    dc.b    "    Logged out: ",0
  1395. LogFailIncText1: dc.b    " - ",0
  1396. LogFailIncText2: dc.b    ", ",0
  1397. SpaceText1:    dc.b    " ",0
  1398. CRLFText1:    dc.b    13,10,0
  1399. CRLFText2:    dc.b    13,10,"    ",0
  1400. OnTimeText1:    dc.b    "Minutes used: "
  1401. OnTimeText2:    dc.b    "    0"
  1402. OnTimeText3:    dc.b    13,10,0
  1403. ConnectionText1: dc.b    13,10,"Connection closed.",13,10,0
  1404. fstrl:        dc.b    "%5.d",0
  1405. fstrl2:        dc.b    "%1.d",0
  1406.  
  1407. ;Error texts to output
  1408.  
  1409. LowMemText1:    dc.b    13,10,"WARNING: System is low on memory!",13,10,0
  1410. FileErrorText1:    dc.b    13,10,"ERROR: A file couldn't be opened! File: ",0
  1411. FileErrorText2:    dc.b    13,10,"ERROR: A read error occured! File: ",0
  1412.  
  1413.         ds.l    0
  1414.  
  1415. ;Buffers
  1416. ;
  1417. ;Buffers 1 - 2 used by WaitForRing, WaitForConnect WaitUntilLF
  1418. ;Buffer 3 used by WaitUntilLF
  1419.  
  1420. Buffer1:    dcb.b    2,0
  1421. Buffer2:    dcb.b    16,0
  1422. Buffer3:    dcb.b    34,0
  1423. Buffer4:    dcb.b    12,0
  1424.  
  1425. TempBuf1:    dcb.b    34,0
  1426.  
  1427. CmdString1:    dcb.b    200,0
  1428.  
  1429. DATA_START:
  1430. UserName:    dc.b    "root"
  1431.         dcb.b    12-4,0                ;username
  1432. PassWord:    dcb.b    12,0                ;passwd (default is 'root')
  1433. RealName:    dc.b    "System Administraitor"        ;note the 'i' :)
  1434.         dcb.b    64-21,0                ;realname of user
  1435. UserHome:    dc.b    "USERS:root"
  1436.         dcb.b    64-10,0                ;user home directory
  1437. Office:        dc.b    "Admin"
  1438.         dcb.b    64-5,0                ;Office for finger etc.
  1439. UserCommand:    dc.b    "C:Execute Rem:Login-Start"    ;command to start
  1440.         dcb.b    64-25,0
  1441. DATA_END:    dc.l    0,0
  1442.  
  1443. DataSize:    EQU    (DATA_END-DATA_START)
  1444.  
  1445. DateTime1:    dcb.b    12,0        ;DateStamp
  1446.         dc.b    FORMAT_DOS    ;dat_Format
  1447.         dc.b    0        ;dat_Flags
  1448.         dc.l    StrDay1        ;dat_StrDay
  1449.         dc.l    StrDate1    ;dat_StrDate
  1450.         dc.l    StrTime1    ;dat_StrTime
  1451.  
  1452. StrDay1:    dcb.b    LEN_DATSTRING,0
  1453. StrDate1:    dcb.b    LEN_DATSTRING,0
  1454. StrTime1:    dcb.b    LEN_DATSTRING,0
  1455.  
  1456.         end
  1457.  
  1458.