home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ibmtool.zip / support.c < prev    next >
Text File  |  1997-11-07  |  19KB  |  719 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*      FILE: SUPPORT.C                                                       */
  4. /*                                                                            */
  5. /*   PURPOSE: This file contains the support functions for IBMTOOL.           */
  6. /*                                                                            */
  7. /* FUNCTIONS: GetNumericParm                                                  */
  8. /*            TTEcho                                                          */
  9. /*            TTDispRcvBufs                                                   */
  10. /*            TTReadMAC                                                       */
  11. /*            TTLog                                                           */
  12. /*            TTDebug                                                         */
  13. /*            TTCheckData                                                     */
  14. /*            TTJump                                                          */
  15. /*            TTClearIndications                                              */
  16. /*            TTCheckIndications                                              */
  17. /*            TTClearMAC                                                      */
  18. /*            TTServerXmit                                                    */
  19. /*            TTSleep                                                         */
  20. /*            TTCheckLookahead                                                */
  21. /*            TTSetStatus                                                     */
  22. /*            TTCheckStatus                                                   */
  23. /*            TTRun                                                           */
  24. /*            TTCheckTokenRing                                                */
  25. /*                                                                            */
  26. /* GLOBAL DATA ACCESSED                                                       */
  27. /*      char        *RetStr[]                                                 */
  28. /*      BYTE    far *TMRcvBuff                                                */
  29. /*      BOOLEAN      Debug                                                    */
  30. /*      BOOLEAN      SLog                                                     */
  31. /*      BOOLEAN      ScriptMode                                               */
  32. /*      BOOLEAN      TokenRing                                                */
  33. /*      ULONG        hTestMAC                                                 */
  34. /*      FILE        *ScriptFile                                               */
  35. /*      FILE        *LogFile                                                  */
  36. /*      SERVICECHAR  MACMSC                                                   */
  37. /*      MCASTBUF     MACMCBuff                                                */
  38. /*      INDICCNT     IndicCnt                                                 */
  39. /*                                                                            */
  40. /******************************************************************************/
  41.  
  42. #define INCL_SUB
  43. #define INCL_BASE
  44. #define INCL_DOS
  45. #include <os2.h>
  46. #include <stdio.h>
  47. #include <stdarg.h>
  48. #include <malloc.h>
  49. #include <stdlib.h>
  50. #include <string.h>
  51. #include <ctype.h>
  52. #include "ndis.h"
  53. #include "ibmtool.h"
  54. #include "ioctl.h"
  55. #include "intrface.h"
  56.  
  57. extern  BYTE far *TMRcvBuff;
  58.  
  59. USHORT  LastStatus;
  60. WORD    IndicationCount = 0;
  61. WORD    LastFrameSize = 0;
  62. WORD    LastLookahead = 0;
  63. WORD    ScriptStatus = 0;
  64.  
  65. ULONG GetNumericParm (char *token)
  66. {
  67.   ULONG tlong;
  68.  
  69.   if (!strncmp (token, "0X", 2))
  70.     {
  71.      // convert hex input
  72.      if (strlen (token + 2) == 2)
  73.         if (sscanf (token + 2, "%02X", &tlong) != 1)
  74.            return -1L;
  75.         else
  76.            return tlong;
  77.      else if (strlen (token + 2) == 4)
  78.         if (sscanf (token + 2, "%04X", &tlong) != 1)
  79.            return -1L;
  80.         else
  81.            return tlong;
  82.      else
  83.         if (sscanf (token + 2, "%08lX", &tlong) != 1)
  84.            return -1L;
  85.         else
  86.            return tlong;
  87.     }
  88.   else
  89.     {
  90.      // convert decimal input
  91.      if (sscanf (token, "%ld", &tlong) != 1)
  92.         return -1L;
  93.      else
  94.         return tlong;
  95.     } /* endif */
  96.  
  97. }
  98.  
  99. int TTEcho ()
  100. {
  101.   // ECHO
  102.  
  103.   Echo = (Echo) ? FALSE : TRUE;
  104.  
  105.   if (Echo)
  106.      aprintf (0, 75, 0x74, "E");
  107.   else
  108.      aprintf (0, 75, 0x70, " ");
  109.  
  110.   return SUCCESS;
  111. }
  112.  
  113. int TTDispRcvBufs ()
  114. {
  115.   char *token;
  116.  
  117.   PrintMsg (0, "Receive Buffer");
  118.  
  119.   if ((token = strtok (NULL, "\n\t ")))
  120.     {
  121.      if (*token == 'P')
  122.      hexprint (WedgeCommon->RcvData, LastFrameSize, TRUE);
  123.     }
  124.   else
  125.      hexprint (WedgeCommon->RcvData, LastFrameSize, FALSE);
  126.  
  127.   return SUCCESS;
  128. }
  129.  
  130. int TTReadMAC ()
  131. {
  132.   // READMAC {"MCC" | "MSC" | "MSS" | "MMC"} <offset> [{"=" | "&"} <xx>*]
  133.  
  134.   BYTE *TablePtr, *p;
  135.   char *token;
  136.   char *tablename[] = { "MCC", "MSC", "MSS", "MMC", "" };
  137.   char *longtablename[] = { "Common Characteristics Table",
  138.                             "Sevice-Specific Characteristics Table",
  139.                             "Sevice-Specific Status Table",
  140.                             "Multicast Address List" };
  141.   BYTE  tablevalue, value[256];
  142.   int   i, table, offset, valuecnt = 0, temp;
  143.  
  144.   // get the table
  145.   if (!(token = strtok (NULL, "\n\t ")))
  146.      return TT_INVALID_PARAMETER;
  147.  
  148.   for (table=0; *tablename[table]; ++table)
  149.      if (!stricmp (token, tablename[table]))
  150.         break;
  151.   if (table > MMC) return TT_INVALID_PARAMETER;
  152.   TablePtr = GetTable (table);
  153.  
  154.   // get the offset
  155.   if (!(token = strtok (NULL, "\n\t ")))
  156.      return TT_INVALID_PARAMETER;
  157.   if ((offset = (int) GetNumericParm (token)) < 0)
  158.      return TT_INVALID_PARAMETER;
  159.  
  160.   // get the value
  161.   TablePtr += offset;
  162.   tablevalue = *TablePtr;
  163.  
  164.   // get the operator
  165.   if ((token = strtok (NULL, "\n\t ")))
  166.     {
  167.      switch (*token)
  168.        {
  169.         case '=':
  170.           // get the test value(s)
  171.           while ((token = strtok (NULL, "\n\t ")))
  172.             {
  173.              sscanf (token, "%02X", &temp);
  174.              value[valuecnt] = (BYTE) temp;
  175.              ++valuecnt;
  176.             }
  177.           if (!valuecnt)
  178.              return TT_INVALID_PARAMETER;
  179.           LastStatus = GENERAL_FAILURE;
  180.           i = 0;
  181.           if ((valuecnt == 1) && (tablevalue == value[0]))
  182.              LastStatus = SUCCESS;
  183.           else
  184.             {
  185.              for (i=0; i<valuecnt; ++i)
  186.                 if (*(TablePtr + i) != value[i]) break;
  187.              if (i == valuecnt)
  188.                 LastStatus = SUCCESS;
  189.             }
  190.           PrintMsg (0, "%s", RetStr[LastStatus]);
  191.           break;
  192.         case '&':
  193.           // get the test value(s)
  194.           while ((token = strtok (NULL, "\n\t ")))
  195.             {
  196.              sscanf (token, "%02X", &temp);
  197.              value[valuecnt] = (BYTE) temp;
  198.              ++valuecnt;
  199.             }
  200.           if (!valuecnt)
  201.              return TT_INVALID_PARAMETER;
  202.           LastStatus = GENERAL_FAILURE;
  203.           if ((valuecnt == 1) && (tablevalue & value[0]))
  204.              LastStatus = SUCCESS;
  205.           else
  206.             {
  207.              for (i=0; i<valuecnt; ++i)
  208.                 if (!(tablevalue & value[i])) break;
  209.              if (i == valuecnt)
  210.                 LastStatus = SUCCESS;
  211.             }
  212.           PrintMsg (0, "%s", RetStr[LastStatus]);
  213.           break;
  214.         default:
  215.           return TT_INVALID_PARAMETER;
  216.           break;
  217.        } /* endswitch */
  218.     }
  219.   else
  220.      PrintMsg (0, "%s byte %d = 0x%02X", longtablename[table], offset, tablevalue);
  221.  
  222.   return SUCCESS;
  223. }
  224.  
  225. int TTLog ()
  226. {
  227.   // LOG filename
  228.  
  229.   char *filename;
  230.  
  231.   filename = strtok (NULL, "\n\t ");
  232.   if (filename)
  233.     {
  234.      LogFile = fopen (filename, "wt");
  235.      SLog = TRUE;
  236.     }
  237.   else if (!SLog)
  238.      return TT_INVALID_PARAMETER;
  239.   else
  240.      SLog = FALSE;
  241.  
  242.   if (SLog)
  243.      aprintf (0, 78, 0x74, "L");
  244.   else
  245.      aprintf (0, 78, 0x70, " ");
  246.  
  247.   return SUCCESS;
  248. }
  249.  
  250. int TTDebug ()
  251. {
  252.   // DEBUG <"ON" | "OFF">
  253.  
  254.   char *State;
  255.  
  256.   State = strtok (NULL, "\n\t ");
  257.   if (!stricmp (State, "ON"))
  258.     {
  259.      // Open TESTMAC
  260.      if (!OpenTestMAC ()) Debug = TRUE;
  261.     }
  262.   else if (!stricmp (State, "OFF"))
  263.     {
  264.      Debug = FALSE;
  265.      DosClose ((USHORT) hTestMAC);
  266.      _ffree (TMRcvBuff);
  267.     }
  268.   else
  269.      return TT_INVALID_PARAMETER;
  270.  
  271.   if (Debug)
  272.      aprintf (0, 79, 0x74, "D");
  273.   else
  274.      aprintf (0, 79, 0x70, " ");
  275.  
  276.   return SUCCESS;
  277. }
  278.  
  279. int TTCheckData ()
  280. {
  281.   // CHKDATA { "ON" | "OFF" } ["STOP" | "NOSTOP"]
  282.  
  283.   char *token;
  284.  
  285.   if (!(token = strtok (NULL, "\n\t ")))
  286.      return TT_INVALID_PARAMETER;
  287.   if (stricmp (token, "ON") && stricmp (token, "OFF"))
  288.      return TT_INVALID_PARAMETER;
  289.  
  290.   // Set data verification checking in WEDGE
  291.   WedgeCommon->CheckData = (stricmp (token, "ON")) ? FALSE : TRUE;
  292.  
  293.   if ((token = strtok (NULL, "\n\t ")))
  294.     {
  295.      if (stricmp (token, "STOP") && stricmp (token, "NOSTOP"))
  296.         return TT_INVALID_PARAMETER;
  297.      // Set StopOnErr in WEDGE
  298.      WedgeCommon->StopOnErr = (stricmp (token, "NOSTOP")) ? FALSE : TRUE;
  299.     }
  300.  
  301.   // display the data check flag
  302.   if (WedgeCommon->CheckData)
  303.      aprintf (0, 75, 0x74, "C");
  304.   else
  305.      aprintf (0, 75, 0x70, " ");
  306.  
  307.   return SUCCESS;
  308. }
  309.  
  310. int TTJump ()
  311. {
  312.   // JUMP [[!] <Status>] [Label]
  313.   //    Status = any NDIS defined return code
  314.   //    Label  = where to jump to, if not present skip one instruction
  315.  
  316.   char     str[80], searchstr[80];
  317.   char    *token, *label;
  318.   int      status;
  319.   BOOLEAN  found = FALSE, not = FALSE, statuscheck = FALSE;
  320.  
  321.   if (!ScriptMode) return SUCCESS;
  322.  
  323.   if (!(token = strtok (NULL, "\n\t ")))
  324.     {
  325.      // no parameters - skip the next instruction
  326.      while (!(token = strtok (fgets (str, 80, ScriptFile), "\n\t ")));
  327.      return SUCCESS;
  328.     }
  329.   else if (*token == '!')
  330.     {
  331.      not = TRUE;
  332.      // get conditional status
  333.      if ((status = GetRCInt (token+1)) < 0)
  334.         return TT_INVALID_PARAMETER;
  335.      statuscheck = TRUE;
  336.      // see if there's a label
  337.      if (!(token = strtok (NULL, "\n\t ")))
  338.        {
  339.         // no label - skip the next instruction
  340.         while (!(token = strtok (fgets (str, 80, ScriptFile), "\n\t ")));
  341.         return SUCCESS;
  342.        }
  343.      else
  344.         label = token;
  345.     }
  346.   else if ((status = GetRCInt (token)) < 0)
  347.     {
  348.      // not a valid return code - assume it's a label
  349.      label = token;
  350.     }
  351.   else
  352.     {
  353.      // see if there's a label
  354.      statuscheck = TRUE;
  355.      if (!(token = strtok (NULL, "\n\t ")))
  356.        {
  357.         // no label - skip the next instruction
  358.         while (!(token = strtok (fgets (str, 80, ScriptFile), "\n\t ")));
  359.         return SUCCESS;
  360.        }
  361.      else
  362.        {
  363.         label = token;
  364.        }
  365.     }
  366.  
  367.   // here's the check for the jump - returning SUCCESS means we won't jump
  368.   if (statuscheck)
  369.     {
  370.      if (not)
  371.        {
  372.         if (LastStatus == status) return SUCCESS;
  373.        }
  374.      else if (LastStatus != status) return SUCCESS;
  375.     }
  376.  
  377.   // otherwise, jump
  378.   rewind (ScriptFile);
  379.   while (fgets (searchstr, 80, ScriptFile))
  380.      if (*searchstr == ':')
  381.        {
  382.         strcpy (str, searchstr);
  383.         token = strtok (searchstr + 1, "\n\t ");
  384.         if (!stricmp (searchstr + 1, label))
  385.           {
  386.            fprintf (LogFile, "\n%s", str);
  387.            return SUCCESS;
  388.           }
  389.        }
  390.  
  391.   return TT_INVALID_PARAMETER;
  392.  
  393. }
  394.  
  395. int TTClearIndications ()
  396. {
  397.   // CLRIND
  398.  
  399.   IndicationCount = 0;
  400.   IndicCnt.Rx = 0;
  401.   IndicCnt.Tx = 0;
  402.   IndicCnt.Stat = 0;
  403.   IndicCnt.Comp = 0;
  404.   IndicCnt.GenReq = 0;
  405.   IndicCnt.RingStatus = 0;
  406.   IndicCnt.AdapterCheck = 0;
  407.   IndicCnt.StartReset = 0;
  408.   IndicCnt.EndReset = 0;
  409.   IndicCnt.Interrupt = 0;
  410.   IndicCnt.Total = 0;
  411.   return SUCCESS;
  412. }
  413.  
  414. int TTCheckIndications ()
  415. {
  416.   // CHKIND [<Count> <Type>]
  417.   //    Type     = { "RX" | "TX" | "ICOMP" | "GENREQ" | "STAT" [<StatType>] }
  418.   //    StatType = { "RING" | "ADAPTER" | "START" | "END" | "INT" }
  419.  
  420.   char *token;
  421.   WORD  IndCnt;
  422.   WORD  Type = 0;
  423.   WORD  StatType = 0;
  424.  
  425.   LastStatus = GENERAL_FAILURE;
  426.  
  427.   // get Count to check for
  428.   if ((token = strtok (NULL, "\n\t ")))
  429.     {
  430.      if ((IndCnt = (WORD) GetNumericParm (token)) < 0)
  431.         return TT_INVALID_PARAMETER;
  432.     }
  433.  
  434.   // get Type
  435.   if ((token = strtok (NULL, "\n\t ")))
  436.     {
  437.      if (!stricmp (token, "RX"))
  438.         Type = 1;
  439.      else if (!stricmp (token, "TX"))
  440.         Type = 2;
  441.      else if (!stricmp (token, "STAT"))
  442.        {
  443.         Type = 3;
  444.         if ((token = strtok (NULL, "\n\t ")))
  445.           {
  446.            if (!stricmp (token, "RING"))
  447.               StatType = 1;
  448.            else if (!stricmp (token, "ADAPTER"))
  449.               StatType = 2;
  450.            else if (!stricmp (token, "START"))
  451.               StatType = 3;
  452.            else if (!stricmp (token, "END"))
  453.               StatType = 4;
  454.            else if (!stricmp (token, "INT"))
  455.               StatType = 5;
  456.            else
  457.               return TT_INVALID_PARAMETER;
  458.           }
  459.        }
  460.      else if (!stricmp (token, "ICOMP"))
  461.         Type = 4;
  462.      else if (!stricmp (token, "GENREQ"))
  463.         Type = 5;
  464.      else
  465.         return TT_INVALID_PARAMETER;
  466.     }
  467.  
  468.   CheckIndications ();
  469.  
  470.   switch (Type)
  471.     {
  472.      case 0:
  473.        if (IndicationCount == IndCnt) LastStatus = SUCCESS;
  474.        break;
  475.      case 1:
  476.        if (IndicCnt.Rx == IndCnt) LastStatus = SUCCESS;
  477.        break;
  478.      case 2:
  479.        if (IndicCnt.Tx == IndCnt) LastStatus = SUCCESS;
  480.        break;
  481.      case 3:
  482.        switch (StatType)
  483.          {
  484.           case 0:
  485.             if (IndicCnt.Stat == IndCnt) LastStatus = SUCCESS;
  486.             break;
  487.           case 1:
  488.             if (IndicCnt.RingStatus == IndCnt) LastStatus = SUCCESS;
  489.             break;
  490.           case 2:
  491.             if (IndicCnt.AdapterCheck == IndCnt) LastStatus = SUCCESS;
  492.             break;
  493.           case 3:
  494.             if (IndicCnt.StartReset == IndCnt) LastStatus = SUCCESS;
  495.             break;
  496.           case 4:
  497.             if (IndicCnt.EndReset == IndCnt) LastStatus = SUCCESS;
  498.             break;
  499.           case 5:
  500.             if (IndicCnt.Interrupt == IndCnt) LastStatus = SUCCESS;
  501.             break;
  502.          } /* endswitch */
  503.        break;
  504.      case 4:
  505.        if (IndicCnt.Comp == IndCnt) LastStatus = SUCCESS;
  506.        break;
  507.      case 5:
  508.        if (IndicCnt.GenReq == IndCnt) LastStatus = SUCCESS;
  509.        break;
  510.     } /* endswitch */
  511.  
  512.   if (!token)
  513.     {
  514.      PrintMsg (0, "Indications:");
  515.      PrintMsg (0, "   Receive                 = %d", IndicCnt.Rx);
  516.      PrintMsg (0, "   TransmitConfirm         = %d", IndicCnt.Tx);
  517.      PrintMsg (0, "   Status                  = %d", IndicCnt.Stat);
  518.      PrintMsg (0, "   IndicationComplete      = %d", IndicCnt.Comp);
  519.      PrintMsg (0, "   General Request Confirm = %d", IndicCnt.GenReq);
  520.     } /* endif */
  521.   else
  522.      PrintMsg (0, "CheckIndications: %s", RetStr[LastStatus]);
  523.  
  524.   return SUCCESS;
  525. }
  526.  
  527. int TTClearMAC ()
  528. {
  529.   // CLRMAC
  530.  
  531.   char  cmd[80];
  532.   int   i, j;
  533.  
  534.   // set Filter = 0
  535.   ParseCommand ("FILTER 0");
  536.  
  537.   // clear the Multicast Address List
  538.   GetTable (MMC);
  539.   for (i=0; i<MACMCBuff.McbCnt; ++i)
  540.     {
  541.      strcpy (cmd, "DELMC ");
  542.      for (j=0; j<MACMSC.MscStnAdrSz; ++j)
  543.         sprintf (cmd + 6 + 3 * j, "%02X ", MACMCBuff.McbAddrs[i].mAddr[j]);
  544.      ParseCommand (cmd);
  545.     }
  546.  
  547.   // Close the MAC
  548.   ParseCommand ("CLOSE");
  549.  
  550.   // set Current Station Address = Permanent Station Address
  551.   strcpy (cmd, "SETSTN ");
  552.   GetTable (MSC);
  553.   for (i=0; i<WedgeCommon->StnAdrSz; ++i)
  554.      sprintf (cmd + 7 + 3 * i, "%02X ", (BYTE) MACMSC.MscPermStnAdr[i]);
  555.   ParseCommand (cmd);
  556.  
  557.   LastStatus = SUCCESS;
  558.  
  559.   ScriptStatus = 0;
  560.  
  561.   return SUCCESS;
  562. }
  563.  
  564. int TTServerXmit ()
  565. {
  566.   // SRVTX <Cnt> <Min> <Max> [<Type> [<NetAddr>]]
  567.   //    Tells the current server to transmit (MULTRAN)
  568.   //    Type: 0 = BROADCAST (default)
  569.   //          1 = DIRECTED - <NetAddr> required
  570.   //          2 = DIRECTED TO WHOEVER SENT THE CONTROL FRAME
  571.   //          3 = DIRECTED TO SERVER
  572.  
  573.   USHORT rc;
  574.  
  575.   if ((rc = SendControlFrame (CCXMIT)))
  576.     {
  577. //     LastStatus = GENERAL_FAILURE;
  578.      return rc;
  579.     }
  580.  
  581. //  LastStatus = SUCCESS;
  582.   return SUCCESS;
  583. }
  584.  
  585. int TTSleep ()
  586. {
  587.   // SLEEP <Seconds>
  588.  
  589.   char *token;
  590.   WORD  Seconds;
  591.  
  592.   if (!ScriptMode) return SUCCESS;
  593.  
  594.   if (!(token = strtok (NULL, "\n\t ")))
  595.      return TT_INVALID_PARAMETER;
  596.  
  597.   if ((Seconds = (WORD) GetNumericParm (token)) < 0)
  598.      return TT_INVALID_PARAMETER;
  599.  
  600.   DosSleep (Seconds * 1000);
  601.  
  602.   return SUCCESS;
  603. }
  604.  
  605. int TTCheckLookahead ()
  606. {
  607.   char *token;
  608.   WORD  Lookahead;
  609.  
  610.   if (!(token = strtok (NULL, "\n\t ")))
  611.      return TT_INVALID_PARAMETER;
  612.  
  613.   if ((Lookahead = (WORD) GetNumericParm (token)) < 0)
  614.      return TT_INVALID_PARAMETER;
  615.  
  616.   LastStatus = (LastLookahead == Lookahead) ? SUCCESS : GENERAL_FAILURE;
  617.  
  618.   return SUCCESS;
  619. }
  620.  
  621. int TTSetStatus ()
  622. {
  623.   // SETSTAT <Status>
  624.  
  625.   char *token;
  626.  
  627.   if (!(token = strtok (NULL, "\n\t ")))
  628.      return TT_INVALID_PARAMETER;
  629.  
  630.   if ((ScriptStatus = (WORD) GetNumericParm (token)) < 0)
  631.      return TT_INVALID_PARAMETER;
  632.  
  633.   return SUCCESS;
  634. }
  635.  
  636. int TTCheckStatus ()
  637. {
  638.   // CHKSTAT <Status>
  639.  
  640.   char *token;
  641.   WORD  status;
  642.  
  643.   if (!(token = strtok (NULL, "\n\t ")))
  644.      return TT_INVALID_PARAMETER;
  645.  
  646.   if ((status = (WORD) GetNumericParm (token)) < 0)
  647.      return TT_INVALID_PARAMETER;
  648.  
  649.   LastStatus = (status == ScriptStatus) ? SUCCESS : GENERAL_FAILURE;
  650.  
  651.   return SUCCESS;
  652. }
  653.  
  654. int TTRun ()
  655. {
  656.   // RUN <ScriptFile> [<LogFile>]
  657.  
  658.   char *token;
  659.   char  cmd[MAXSTRING];
  660.  
  661.   // get ScriptFile
  662.   if (!(token = strtok (NULL, "\n\t ")))
  663.      return TT_INVALID_PARAMETER;
  664.  
  665.   ScriptFile = fopen (token, "rt");
  666.  
  667.   // get LogFile (optional)
  668.   if ((token = strtok (NULL, "\n\t ")))
  669.     {
  670.      SLog = TRUE;
  671.      LogFile = fopen (token, "wt");
  672.     }
  673.  
  674.   memset (cmd, '\0', MAXSTRING);
  675.  
  676.   while (fgets (cmd, MAXSTRING, ScriptFile))
  677.     {
  678.      CheckIndications ();
  679.  
  680.      if (*cmd != ':' && SLog)
  681.        {
  682.         if (strstr (cmd, "\n"))
  683.            fprintf (LogFile, "%s", cmd);
  684.         else
  685.            fprintf (LogFile, "%s\n", cmd);
  686.        }
  687.  
  688.      if (*cmd != '#' && *cmd != ':')
  689.         ParseCommand (cmd);
  690.  
  691.     } /* endwhile */
  692.  
  693.   fclose (ScriptFile);
  694.   if (SLog) fclose (LogFile);
  695.  
  696.   return SUCCESS;
  697. }
  698.  
  699. int TTCheckTokenRing ()
  700. {
  701.   LastStatus = (TokenRing) ? SUCCESS : GENERAL_FAILURE;
  702.   return SUCCESS;
  703. }
  704.  
  705. int TTInt3 ()
  706. {
  707.   _asm int 3
  708.   return SUCCESS;
  709. }
  710.  
  711. int TTVersion ()
  712. {
  713.   char *Version = "IBM NDIS TEST TOOL Version 1.10";
  714.  
  715.   PrintMsg (YELLOW, "%s", Version);
  716.   return SUCCESS;
  717. }
  718.  
  719.