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

  1. #define INCL_SUB
  2. #define INCL_BASE
  3. #define INCL_DOS
  4. #include <os2.h>
  5. #include <stdio.h>
  6. #include <stdarg.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <ctype.h>
  10. #include "ndis.h"
  11. #include "ioctl.h"
  12. #include "ibmtool.h"
  13. #include "intrface.h"
  14.  
  15. extern int  CurrMenuOpt;
  16.  
  17. extern char far *VendorDesc;
  18.  
  19. extern COMMONCHAR  MACMCC;
  20. extern SERVICESTAT MACMSS;
  21. extern SERVICECHAR MACMSC;
  22. extern UPPERDISP   MACMUD;
  23. extern PROTLWRDISP PROTLD;
  24. extern MCASTBUF    MACMCBuff;
  25.  
  26. BOOLEAN Test     = FALSE;
  27.  
  28. void SetTestMACTables ()
  29. {
  30.   MACMCC.CcSize = sizeof (MACMCC);   // WORD   Table size
  31.   MACMCC.CcNDISMjrVer = 2;           // BYTE   Major NDIS Version
  32.   MACMCC.CcNDISMnrVer = 0;           // BYTE   Minor NDIS Version
  33.   MACMCC.CcSpLvl = 1;                // WORD   Level of spec tables
  34.   MACMCC.CcMjrVer = 1;               // BYTE   Module Major version number
  35.   MACMCC.CcMnrVer = 0;               // BYTE   Module Minor version number
  36.   MACMCC.CcBindFnc = 3;              // DWORD  "Hints" on binding support
  37.   strcpy (MACMCC.CcName, "TESTMAC"); // BYTE   Module name
  38.   MACMCC.CcUPLevel = 1;              // BYTE   Upper protocol level
  39.   MACMCC.CcUIType = 1;               // BYTE   Upper interface type
  40.   MACMCC.CcLPLevel = 0;              // BYTE   Lower protocol level
  41.   MACMCC.CcLIType = 0;               // BYTE   Lower interface type
  42.   MACMCC.CcModuleID = 5;             // WORD   Module ID (supplied by PM)
  43.   MACMCC.CcDataSeg = 0x1234;         // WORD   Module Data Segment
  44.   MACMCC.CcSysReq = NULL;            // far *
  45.   MACMCC.CcSCp = NULL;               // far *  specific characteristics
  46.   MACMCC.CcSSp = NULL;               // far *  specific status
  47.   MACMCC.CcUDp = NULL;               // far *  upper dispatch table
  48.   MACMCC.CcLDp = NULL;               // far *  lower dispatch table
  49.  
  50.   MACMSC.MscSize = sizeof (MACMSC);  // WORD   Table size
  51.   strcpy (MACMSC.MscType, "802.5");  // BYTE   MAC type name
  52.   WedgeCommon->StnAdrSz =
  53.   MACMSC.MscStnAdrSz = 6;            // WORD   Station address length
  54.   MACMSC.MscPermStnAdr[0] = 0x01;    // BYTE   Permanent station address
  55.   MACMSC.MscPermStnAdr[1] = 0x02;    // BYTE   Permanent station address
  56.   MACMSC.MscPermStnAdr[2] = 0x03;    // BYTE   Permanent station address
  57.   MACMSC.MscPermStnAdr[3] = 0x04;    // BYTE   Permanent station address
  58.   MACMSC.MscPermStnAdr[4] = 0x05;    // BYTE   Permanent station address
  59.   MACMSC.MscPermStnAdr[5] = 0x06;    // BYTE   Permanent station address
  60.   MACMSC.MscCurrStnAdr[0] = 0x01;    // BYTE   Current station address
  61.   MACMSC.MscCurrStnAdr[1] = 0x02;    // BYTE   Current station address
  62.   MACMSC.MscCurrStnAdr[2] = 0x03;    // BYTE   Current station address
  63.   MACMSC.MscCurrStnAdr[3] = 0x04;    // BYTE   Current station address
  64.   MACMSC.MscCurrStnAdr[4] = 0x05;    // BYTE   Current station address
  65.   MACMSC.MscCurrStnAdr[5] = 0x06;    // BYTE   Current station address
  66.   MACMSC.MscCurrFncAdr = 0x11223344;
  67.                                      // DWORD  Current functional address
  68.   MACMSC.MscMCp = NULL;              // struct MCastBuf far * multicast buffer
  69.   MACMSC.MscLinkSpd = 4000000;       // DWORD  Link speed (bits/sec)
  70.   MACMSC.MscService = 0;             // DWORD  Services supported flags
  71.   MACMSC.MscMaxFrame = 2000;         // WORD   Maximum frame size
  72.   MACMSC.MscTBufCap = 1024;          // DWORD  Transmit buffer capacity
  73.   MACMSC.MscTBlkSz = 256;            // WORD   Transmit buf alloc block size
  74.   MACMSC.MscRBufCap = 1024;          // DWORD  Receive buffer capacity
  75.   MACMSC.MscRBlkSz = 256;            // WORD   Receive buf alloc block size
  76.   MACMSC.MscVenCode[0] = 0x01;       // BYTE   Vendor code
  77.   MACMSC.MscVenCode[1] = 0x02;       // BYTE   Vendor code
  78.   MACMSC.MscVenCode[2] = 0x03;       // BYTE   Vendor code
  79.   MACMSC.MscVenAdapter = 0x0F;       // BYTE   Vendor adapter code
  80.   MACMSC.MscVenAdaptDesc = VendorDesc;
  81.                                      // BYTE far * vendor adapter desc
  82.   MACMSC.MscInterrupt = 3;           // WORD   Interrupt level used
  83.   MACMSC.MscTxQDepth = 16;           // WORD   Transmit Queue Depth
  84.   MACMSC.MscMaxDataBlocks = 8;       // WORD   Max buff descriptor data blocks
  85.  
  86.   MACMSS.MssSize = sizeof (MACMSS);  // WORD   Table size
  87.   MACMSS.MssDiagDT = 123456L;        // DWORD  Last diagnostic Date/Time
  88.   MACMSS.MssStatus = MS_BOUND | MS_OPEN;
  89.                                      // DWORD  MAC status - bit mask
  90.   MACMSS.MssFilter = 3;              // WORD   Current packet filter
  91.   MACMSS.MssM8Sp = NULL;             // void far * to Media specific status
  92.   MACMSS.MssClearDT = 123456L;       // DWORD  Last clear stats Date/Time
  93.   MACMSS.MssFR = 123456L;            // DWORD  Frames received: total
  94.   MACMSS.MssRFCRC = 123456L;         // DWORD  Receive fail: CRC error
  95.   MACMSS.MssFRByt = 123456L;         // DWORD  Frames received: total bytes
  96.   MACMSS.MssRFLack = 123456L;        // DWORD  Receive fail: lack of buffers
  97.   MACMSS.MssFRMC = 123456L;          // DWORD  Frames received: multicast
  98.   MACMSS.MssFRBC = 123456L;          // DWORD  Frames received: broadcast
  99.   MACMSS.MssRFErr = 123456L;         // DWORD  rcv fail: errors in general
  100.   MACMSS.MssRFMax = 123456L;         // DWORD  rcv fail: exceeds max size
  101.   MACMSS.MssRFMin = 123456L;         // DWORD  rcv fail: less than min size
  102.   MACMSS.MssFRMCByt = 123456L;       // DWORD  Frames rcvd: multicast bytes
  103.   MACMSS.MssFRBCByt = 123456L;       // DWORD  Frames rcvd: broadcast bytes
  104.   MACMSS.MssRFHW = 123456L;          // DWORD  rcv fail: hardware error
  105.   MACMSS.MssFS = 123456L;            // DWORD  Frames sent: total
  106.   MACMSS.MssFSByt = 123456L;         // DWORD  Frames sent: total bytes
  107.   MACMSS.MssFSMC = 123456L;          // DWORD  Frames sent: multicast
  108.   MACMSS.MssFSBC = 123456L;          // DWORD  Frames sent: broadcast
  109.   MACMSS.MssFSBCByt = 123456L;       // DWORD  Frames sent: broadcast bytes
  110.   MACMSS.MssFSMCByt = 123456L;       // DWORD  Frames sent: multicast bytes
  111.   MACMSS.MssSFTime = 123456L;        // DWORD  Send fail: time-out
  112.   MACMSS.MssSFHW = 123456L;          // DWORD  Send fail: hardware error
  113.  
  114.   MACMCBuff.McbMax = 10;
  115.   MACMCBuff.McbCnt = 0;
  116. }
  117.  
  118.