home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / COMET.ZIP / COMET13.INF (.txt) < prev    next >
OS/2 Help File  |  1991-07-25  |  370KB  |  18,351 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Disclosure ΓòÉΓòÉΓòÉ
  3.  
  4. COMET is the sole property of the IBM Corporation and is protected under U.S. 
  5. copyright laws.  IBM grants you the right to make unlimited copies of this 
  6. material and the right to distribute it freely, as long as you receive no 
  7. profit from said distribution.  These materials are provided as is, with no 
  8. warranties or guarantees expressed or implied. 
  9.  
  10.  
  11. ΓòÉΓòÉΓòÉ 2. OVERVIEW ΓòÉΓòÉΓòÉ
  12.  
  13. As OS/2 Extended Edition was being developed, there were programs written by 
  14. various groups to test specific programming interfaces. The Communication 
  15. Manager testers, for instance, wrote programs to test the APPC interface, and 
  16. the other communications API's. Similarly, the database group wrote programs to 
  17. test the database API's, but there was no program available that could exercise 
  18. all of the available API's.  For example, no program existed which could select 
  19. some data from a database and then send the data to another PC across an APPC 
  20. link.  COMET provides this missing function. 
  21.  
  22. The main purpose for the development of COMET is to create a single test tool 
  23. which is capable of exercising all of the various Application Programming 
  24. Interfaces (API's) provided by IBM's OS/2 Extended Edition.  To do so, a user 
  25. must first create an input file which specifies what commands are to be issued 
  26. to which API's. The user can specify commands to any API, in any order. COMET 
  27. reads the instructions from the file,  and issues the desired API function 
  28. calls in the order listed in the input file. 
  29.  
  30. COMET is a command interpreter which reads an instruction from a specified file 
  31. and processes that instruction by calling the required API with the desired 
  32. function before reading and processing the next instruction. 
  33.  
  34. COMET can be used to create and use databases with the Database Manager's API. 
  35. It can also be used to transfer data to other PC's or host systems using the 
  36. Communication Manager's different API's. 
  37.  
  38.  The following documentation shows a user how to use Comet, and also contains 
  39. sample code on how to program each of the API's used by Comet.  Each API 
  40. supported is accompanied by a description of how to use the API in Comet (what 
  41. parameters to use, etc ), as well as a Sample Code selection that illustrates 
  42. how to use that particular API in a C program. 
  43.  
  44. The API's supported by COMET are: 
  45.  
  46.  ACDI      Asynchronous Communication Device Interface 
  47.  APPC      Advanced Program to Program Communication 
  48.  SRPI      Server/Requestor Programming Interface 
  49.  DBM       Database Manager Utility functions 
  50.  SQL       Database Manager Structured Query Language functions 
  51.  OS/2      Selected OS/2 operating system function calls 
  52.  802.2     IEEE 802.2 Local Area Network interface 
  53.  NETBIOS   PC Network Netbios interface 
  54.  PM        Selected OS/2 Presentation Manager functions 
  55.  EHLLAPI   Emulator High Level Language Application Programming Interface 
  56.  
  57.  There are some internal COMET commands also available which provide some other 
  58.  useful functions.  The categories of COMET commands available are: 
  59.  
  60.  COMET     Some utility commands. 
  61.  IF        Conditional Jumps 
  62.  GOTO      Unconditional Jumps 
  63.  CALL      Subroutine calls 
  64.  RETURN    Return from subroutine calls 
  65.  BEGIN_LOOP Begin a timed or counted loop 
  66.  BREAK_TO  Break out of a loop to a label 
  67.  END_LOOP  End of a loop construct 
  68.  
  69.  For more information about using COMET, see the following sections: USING 
  70.  COMET and CREATING COMET INPUT FILES. 
  71.  
  72.  COMET is written using IBM's C/2 programming language and compiler. 
  73.  
  74.  Version Level Descriptions 
  75.  
  76.  Please refer to COMET Version Level Descriptions. for description of changes 
  77.  made to COMET and the corresponding version  levels. 
  78.  
  79.  
  80. ΓòÉΓòÉΓòÉ 3. USING COMET ΓòÉΓòÉΓòÉ
  81.  
  82.  Using COMET, Quick Description 
  83.  COMET Help Panel 
  84.  Using COMET, More Details 
  85.  COMET Ending Conditions 
  86.  
  87.  
  88. ΓòÉΓòÉΓòÉ 3.1. Using COMET, Quick Description ΓòÉΓòÉΓòÉ
  89.  
  90. This is a quick description of how to run COMET.  For more details, see Using 
  91. COMET, More Details. 
  92.  
  93. Before you can run a COMET test case, you must first create an input file for 
  94. COMET.  The input file should contain commands which tell COMET what functions 
  95. you wish to perform.  The input file can be created using an editor which 
  96. creates a simple ASCII file. See CREATING COMET INPUT FILES for details on 
  97. creating a COMET input file. 
  98.  
  99. To run a COMET test case, do the following: 
  100.  
  101.   1. IPL your PC with OS/2 Extended Edition Version 1.1 or later version. 
  102.  
  103.   2. Start an OS/2 Command Prompt (Protect mode session). 
  104.  
  105.   3. Include the directory which contains the COMET files in your PATH and 
  106.      DPATH statements. 
  107.  
  108.   4. Issue the COMET command in the following form: 
  109.  
  110.      COMET inputfilename [outputfilename] [/nl] [:start_label] 
  111.  
  112.      The outputfilename, start label, and /nl parameters are optional. Specify 
  113.      an outputfilename if don't wish to use the default log file name, which is 
  114.      COMETLOG.TXT. If you don't want a log file to be created, use the /nl 
  115.      (nolog) option.  If you want to begin processing the input file at some 
  116.      line other than the beginning of the file, type the label of the starting 
  117.      point. (Don't actually type the brackets around these items... they are 
  118.      used just to show that these parameters are optional.) 
  119.  
  120.  COMET will read the instructions from the input file, and perform the 
  121.  specified functions. 
  122.  
  123.  If you don't specify an output file name (and don't choose the nolog (/nl) 
  124.  option), COMET will create an output file with the default name COMETLOG.TXT 
  125.  in the current directory. 
  126.  
  127.  
  128. ΓòÉΓòÉΓòÉ 3.2. COMET Help Panel ΓòÉΓòÉΓòÉ
  129.  
  130.  The version number on the current version of COMET you are using can be 
  131. obtained by specifying a question mark ('?') in the place of the input file 
  132. name. Along with the version number, the distribution start date and the COMET 
  133. run syntax format will also be specified. 
  134.  
  135. For example, entering: 
  136.  
  137. COMET ? 
  138.  
  139. will return output similar to this: 
  140.  
  141.  COMET Version #  Date 
  142.  
  143.  Format:  COMET input_filename [output_filename] [/nl] [:start_label] 
  144.  
  145.  Where: 
  146.  
  147.     input_filename is the name of the COMET input file.  (Default extension is 
  148.               .CMT) 
  149.     output_filename is the name of the output file. (Default name is 
  150.               COMETLOG.TXT) 
  151.     /nl       is the nolog option, to keep an output file from being created. 
  152.     :start_label is a label within the input file where processing is to start. 
  153.  
  154.   When COMET ends, the error level of the process is returned to OS/2. The 
  155.  error level may be specified by the user (by issuing the COMET ERRORLEVEL 
  156.  command in the input file).  If no user error level is set, then COMET returns 
  157.  an error level of 0 for successful completion of a test case, or an error 
  158.  level of 1 for an unsuccessful completion. 
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 3.3. Using COMET, More Details ΓòÉΓòÉΓòÉ
  162.  
  163.   Hardware Requirements 
  164.   Software Requirements 
  165.   System Setup 
  166.   Syntax for Running COMET 
  167.  
  168.  
  169. ΓòÉΓòÉΓòÉ 3.3.1. Hardware Requirements ΓòÉΓòÉΓòÉ
  170.  
  171. Since COMET only runs in OS/2 protect mode, you must have a PC which can run 
  172. OS/2.  The useable PC's at this time are: 
  173.  
  174.  286 machine 
  175.  386 machine 
  176.  486 machine 
  177.  
  178.  You must have enough storage available on the PC to run OS/2. You should allow 
  179.  approximately 800K of storage for COMET if you are using all of its functions. 
  180.  You will need at least 6 Megabytes of memory in your PC if you wish to run 
  181.  OS/2 with both the Database and Communication Managers. 
  182.  
  183.  
  184. ΓòÉΓòÉΓòÉ 3.3.2. Software Requirements ΓòÉΓòÉΓòÉ
  185.  
  186. The following software is required to run COMET. 
  187.  
  188.   1. IBM OS/2 Extended Edition 
  189.  
  190.      For COMET Version 1.2x and 1.3x, OS/2 EE version 1.2 or later is required. 
  191.  
  192.      For COMET Version 1.1x, OS/2 EE versions 1.1, or 1.2 may be used. 
  193.  
  194.      For COMET Version 1.0x, OS/2 EE versions 1.0, 1.1, or 1.2 may be used. 
  195.  
  196.      OS/2 Extended Edition includes the OS/2 operating system, the 
  197.      Communication Manager, and the Database Manager. 
  198.  
  199.   2. The COMET program. 
  200.  
  201.      The following files are provided with COMET, and should all reside in the 
  202.      same directory: 
  203.  
  204.     COMET.EXE         The COMET executable program. 
  205.     CMTSQL.BND        A database bind file, used when processing a database 
  206.                       manager "Create Database" command. 
  207.  
  208.  
  209. ΓòÉΓòÉΓòÉ 3.3.3. System Setup ΓòÉΓòÉΓòÉ
  210.  
  211. When copying the COMET files to your hard disk, your PATH and DPATH statements 
  212. must include a path to the directory which contains these COMET files.  This 
  213. can be done in several different ways. In OS/2 Version 1.1+, the PATH and DPATH 
  214. for a new screen group can be specified in the config.sys file.  If you don't 
  215. wish to add the COMET directory to the generic PATH's found in the config.sys 
  216. file, an alternative is to run another command (batch) file to set up the 
  217. environment before running COMET 
  218.  
  219.  Assuming that the COMET files are in the C:\COMET directory, the PATH and 
  220.  DPATH statements might include the following paths: 
  221.  
  222.  PATH=C:\OS2;C:\MUGLIB;C:\SQLLIB;C:\CMLIB;C:\OS2\SYSTEM;. . . ;C:\;c:\comet; 
  223.  
  224.  DPATH=C:\OS2;C:\MUGLIB\DLL;C:\CMLIB;C:\IBMLAN\NETPROG;. . . ;C:\;c:\comet; 
  225.  
  226.  
  227. ΓòÉΓòÉΓòÉ 3.3.4. Syntax for Running COMET ΓòÉΓòÉΓòÉ
  228.  
  229. Once the system is set up, you are ready to run a COMET test case. 
  230.  
  231. To do so, you must first create an input file which contains COMET commands. 
  232. The input file may be created with a PC editor such as "E" which creates a 
  233. simple ASCII file. See CREATING COMET INPUT FILES for more details. 
  234.  
  235. To run COMET, type the following command at the OS/2 command prompt. 
  236.  
  237. COMET input_file [output_file] [/nl] [:start_label] [/start=line_number] 
  238.  
  239. The input file parameter must immediately follow the COMET command, but the 
  240. other parameters may be entered in any order. The parameters in brackets are 
  241. optional. (You should not type the brackets when entering the command.) 
  242.  
  243. The COMET parameters are as follows: 
  244.  
  245.  input_file    The name of the input file.  If no file extension is specified, 
  246.                a default of .CMT will be used. The file name may specify the 
  247.                drive and path pointing to the file, if desired.  If the 
  248.                specified file is in the current directory, or if it is in a 
  249.                directory pointed to by the current DPATH, then only the file 
  250.                name is required. To execute one or more input files 
  251.                sequentially, enter input file names in the order you want to 
  252.                execute them. Seperate the input file names by comma with no 
  253.                space between file names. COMET will concatenate all input files 
  254.                into a temperory input file BIG$CMT.CMT. 
  255.  
  256.  output_file   The name of the desired output log file.  If this parameter is 
  257.                not specified (and the /nl option is not used), then the default 
  258.                log file name, COMETLOG.TXT, is used.  If the drive and path are 
  259.                not specified, the log file will be stored in the current 
  260.                directory of the current drive. This is an optional parameter. 
  261.  
  262.  /nl           The "nolog" parameter.  If specified, no log file is created. 
  263.  
  264.  :start_label  The label indicating at which line to start processing the input 
  265.                file.  The label is a variable parameter, and must begin with a 
  266.                colon.  If the label does not exist in the specified input file, 
  267.                an error message will be displayed saying that the label was not 
  268.                found. 
  269.  
  270.  /start=line_number Start processing input file at the line specified by 
  271.                line_number. 
  272.  
  273.  Here is an example of how to run a COMET test case. Assume that the COMET 
  274.  program files are on the C drive in a directory called \COMET, and the current 
  275.  drive is the C drive. The input file you wish to run is called MYCOMET.IN, and 
  276.  is on a diskette in the A drive.  Also, you want the COMET log data file to be 
  277.  called MYCOMET.LOG, and stored in the C:\COMET\LOGFILES directory which 
  278.  already exists on the C drive. 
  279.  
  280.   Since the A drive is not in your DPATH in this example, you would issue the 
  281.  following instruction to run that test case: 
  282.  
  283.  COMET A:MYCOMET.IN \COMET\LOGFILES\MYCOMET.LOG 
  284.  
  285.   Had the A drive been included in your DPATH, and you wished to write the 
  286.  output file to the current directory, you would issue the following 
  287.  instruction to run that test case: 
  288.  
  289.  COMET MYCOMET.IN MYCOMET.LOG 
  290.  
  291.   If no output log file is desired, the following command might be issued: 
  292.  
  293.  COMET MYCOMET.IN /nl 
  294.  
  295.   For one or more input files, the following command execute MYCOMET1.IN and 
  296.  then MYCOMET2.IN sequentially. 
  297.  
  298.  COMET MYCOMET1.IN,MYCOMET2.IN MYCOMET.LOG 
  299.  
  300.  
  301. ΓòÉΓòÉΓòÉ 3.4. COMET Ending Conditions ΓòÉΓòÉΓòÉ
  302.  
  303. When COMET processes an input file, one of two final results will occur as a 
  304. result.  It will either end successfully (no errors) or unsuccessfully 
  305. (something unexpected occurred). 
  306.  
  307.  
  308. ΓòÉΓòÉΓòÉ 3.4.1. Successful Ending Conditions ΓòÉΓòÉΓòÉ
  309.  
  310. If no errors occurred during the processing of the input file, the test case is 
  311. considered to be successful by COMET, and COMET exits with an error level of 
  312. zero. (See Error Levels (COMET Return Codes).) The phrase "no errors occurred" 
  313. means that, for each statement executed in the input file, all parameters which 
  314. were returned from the API compared successfully with the expected values.  For 
  315. instance, when receiving data,  if the data specified by the expected data 
  316. parameter exactly matches the data which is actually received, that comparison 
  317. is successful. 
  318.  
  319. Return codes resulting from an API call can be somewhat confusing. COMET's 
  320. default is to expect a return code of zero for each API command, unless the 
  321. input file statement explicitly says to check for a non-zero return code.  Each 
  322. API command has a parameter of the form "RC=...", which tells COMET that a 
  323. non-zero return code is expected.  In this case, the specified non-zero return 
  324. code is the expected (thus, the "successful") condition, and a return code of 
  325. zero would be regarded as an error. 
  326.  
  327. Another way of dealing with return codes from the API calls is by using a 
  328. condition (IF) statement after an API instruction in the input file.  The IF 
  329. statement allows return code checking just as the "RC=..." parameter did. 
  330. Specifying the actual return code in the IF statement also results in a 
  331. "successful" condition for that API command.  See If. 
  332.  
  333.  
  334. ΓòÉΓòÉΓòÉ 3.4.2. Unsuccessful Ending Conditions ΓòÉΓòÉΓòÉ
  335.  
  336. If some type of error is detected, COMET will stop the processing of the input 
  337. file at that point, display an error message in a popup window and allow user 
  338. to select the following options from the action bar: 
  339.  
  340.   select EXIT to terminate COMET with an error level of 1. 
  341.  
  342.   select CONTINUE to resume COMET test case at the command line following the 
  343.    command line at which the error occurs. 
  344.  
  345.   select RETRY to re-execute the command line at which the error occurs. 
  346.  
  347.  The types of things which will result in COMET stopping a test case early are 
  348.  such things as an error found in the syntax of a command in the input file, or 
  349.  a returned parameter from an API call that does not compare successfully with 
  350.  the expected value. 
  351.  
  352.  COMET will terminate a test case with an error message in the following types 
  353.  of situation. 
  354.  
  355.   The input file could not be opened for some reason. 
  356.  
  357.   A syntax error was found in an input file command. 
  358.  
  359.   A non-zero return code occurred on an API command, with no "RC=.." parameter 
  360.    on the statement, and no IF statement following the API command in the input 
  361.    file. 
  362.  
  363.   A return code of zero was received when an "RC=..." parameter was used, 
  364.    specifying a non-zero return code was expected. 
  365.  
  366.   A non-zero return code occurred on an API command, with IF statement(s) 
  367.    following the command, but the IF statement does not select the actual 
  368.    return code received. 
  369.  
  370.  See If for more information about the IF statement. 
  371.  
  372.  
  373. ΓòÉΓòÉΓòÉ 3.4.3. Error Levels (COMET Return Codes) ΓòÉΓòÉΓòÉ
  374.  
  375. When COMET terminates, it passes an error level back to the operating system. 
  376. The error level is a type of return code which can be used in batch (command) 
  377. files to determine the results of running a program, and to decide what action 
  378. to take as a result. 
  379.  
  380. The error level set by COMET when it ends can be specified by the user from 
  381. within the input file.  See Exit for information about user specified exit 
  382. error levels. 
  383.  
  384. If the input file does not specify an exit error level by using the COMET EXIT 
  385. command, COMET will set the error level based on the results processing the 
  386. input file.  If no errors were detected when processing the input file, an 
  387. error level of zero is set. If an error did occur, the COMET sets an error 
  388. level of one. 
  389.  
  390.  
  391. ΓòÉΓòÉΓòÉ 4. CREATING COMET INPUT FILES ΓòÉΓòÉΓòÉ
  392.  
  393. When running a COMET test case, an input file must be specified. 
  394.  
  395. The input file provided by the user of COMET contains a script of instructions 
  396. which tells COMET what function calls to issue to which APIs.  A number of OS/2 
  397. commands, Database Manager commands, and Communication Manager Commands are 
  398. supported.  In addition, there are some general control and utility commands 
  399. which allow other functions to be accomplished. 
  400.  
  401.  
  402. ΓòÉΓòÉΓòÉ 4.1. General Instruction Syntax ΓòÉΓòÉΓòÉ
  403.  
  404. The basic format of a COMET instruction is as follows.  The first word (token) 
  405. of the instruction tells COMET which API the command is for.  The second word 
  406. (token) in the instruction tell what API function is desired.  Any other 
  407. parameters in the instruction are used to further define the instruction.  A 
  408. semicolon (;) signals the end of an instruction. For detailed input file 
  409. examples see Sample COMET Input Files. 
  410.  
  411. The following conventions are used in this document to describe the syntax of 
  412. specific COMET instructions. 
  413.  
  414.   1. Items written in CAPITAL letters are reserved COMET script words and are 
  415.      not required to be typed in capital letters. 
  416.  
  417.   2. Items shown in lower case letters represent parameters which are variable. 
  418.      For instance, "filename.ext" would represent any pc filename which the 
  419.      input file script writer might choose to type. 
  420.  
  421.   3. Parameters are separated by commas (,). 
  422.  
  423.   4. A semicolon (;) indicates the end of an instruction.  There should not be 
  424.      a comma between the last parameter and the semicolon which ends the 
  425.      instruction. 
  426.  
  427.   5. Items in square [ ] brackets are optional parameters. If these items are 
  428.      included in the instruction, the [ ] brackets should NOT be typed as part 
  429.      of the instruction. If an optional parameter is not specified, then the 
  430.      default value for that parameter is assumed. 
  431.  
  432.   6. If two or more items are separated by a vertical bar | character, and 
  433.      enclosed in <> brackets, then one, and only one, of the parameters may be 
  434.      selected. When entering the parameter, the <> brackets and the | character 
  435.      should not be typed. For example, if PARAMETER1 has two choices then it is 
  436.      shown here as PARAMETER1= <choice1|choice2>. If you selected choice1 then 
  437.      you would specify it as PARAMETER1= choice1. 
  438.  
  439.   7. If an item is shown enclosed in quotes, the quotation marks are required 
  440.      when you specify it in your input file. Character strings which may 
  441.      contain blanks will always be surrounded by quotes. If a string contains a 
  442.      quote, the nested quote must be preceded by a backslash. For example, a 
  443.      string containing only a quotation mark will be defined this way: "\"". 
  444.  
  445.   8. A character string can be continued on the next line of the input file.  A 
  446.      dash (-) as the last character on the line in a string definition (within 
  447.      quotes) signals that the next line is a continuation of the string.  The 
  448.      dash will be deleted from the data stream, and leading blanks on the next 
  449.      line will also be deleted.  The character string will continue with the 
  450.      first nonblank character on next line. For example, if PARAMETER2 is 
  451.      specified in your input file as:            PARAMETER2="This is - 
  452.      an example.", it would be equivalent to:            PARAMETER2="This is an 
  453.      example.", within COMET. 
  454.  
  455.   9. A character string can contain carriage return and line feed characters 
  456.      (CRLF) if desired.  If the last character on the line in a character 
  457.      string definition (within quotes) is a backslash (\), the backslash will 
  458.      be replaced by CRLF.  The leading blanks on the next line will be deleted. 
  459.      For example, if PARAMETER3 is specified in your input file as: 
  460.      PARAMETER3="This is /                  an example.", it would be 
  461.      equivalent to:            PARAMETER3="This is an example.", within COMET. 
  462.  
  463.  10. Hexadecimal data may be specified using the format x'hex_numbers', for 
  464.      example, x'000F' represents the number 15 in hex. 
  465.  
  466.  11. A pound sign symbol (#) indicates the start of a comment (unless it is 
  467.      within quotes used to define a string).  The comment begins at the pound 
  468.      sign and extends to the end of the line. 
  469.  
  470.  See the following sections for details on specific instructions, and Appendix 
  471.  A for input file examples. 
  472.  
  473.  
  474. ΓòÉΓòÉΓòÉ 4.2. COMET Control Commands ΓòÉΓòÉΓòÉ
  475.  
  476. This section describes COMET control commands. Looping and Conditional Jumps 
  477. are supported. There are also some commands (@define and @include) which allow 
  478. constants and imbedded input files to be used when writing an input file. 
  479.  
  480.  
  481. ΓòÉΓòÉΓòÉ 4.2.1. @Define ΓòÉΓòÉΓòÉ
  482.  
  483. Define a constant.  This allows commonly used values to be defined once in the 
  484. input file, and then be used any number of times.  See @DEFINE Examples to see 
  485. how constants can be used. 
  486.  
  487. SYNTAX 
  488.  
  489. @DEFINE constant_name  constant_value; 
  490.  
  491. Where: 
  492.  
  493.  constant_name is the name of the constant.  It can be composed of any 
  494.              combination of non-blank characters, and is limited to 50 
  495.              characters in length. Constant names are case-sensitive. For 
  496.              example, a lower-case version of an upper-case constant name will 
  497.              not be interpreted as the upper-case constant. 
  498.  
  499.  constant_value is the character string that is represented by the constant. 
  500.              Constant names will be interpreted literally by the following 
  501.              COMET interfaces : OS/2 Shell, Query Manager Callable Interface, 
  502.              SQL. 
  503.  
  504.   Sample Code 
  505.  
  506.  
  507. ΓòÉΓòÉΓòÉ 4.2.1.1. @DEFINE Examples ΓòÉΓòÉΓòÉ
  508.  
  509. In the following example,  an APPC send data command is being issued.  The data 
  510. being sent is specified in the first @define statement; the expected primary 
  511. return code is x'0003' (which means an allocation error occurred), and the 
  512. expected secondary return code is x'00000005' (which means the allocate can be 
  513. retried). 
  514.  
  515.  @define DATA1  "This is some sample data"; 
  516.  @define ALLOC_ERROR  x'0003'; 
  517.  @define RETRY     x'00000005'; 
  518.  appc send_data data=DATA1, prc=ALLOC_ERROR, src=RETRY; 
  519.  
  520.  The above example is equivalent to the following statement, using no @define 
  521.  statements: 
  522.  
  523.  appc send_data    data="This is some sample data", 
  524.  
  525.     prc=x'0003', 
  526.     src=x'00000005'; Note:  @Define statements need the trailing semicolon, and 
  527.     constant names will be interpreted literally if included as PART of a 
  528.     parameter value. 
  529.  
  530.  
  531. ΓòÉΓòÉΓòÉ 4.2.2. @Include ΓòÉΓòÉΓòÉ
  532.  
  533. Inserts another input file.  The specified file is processed just as if it's 
  534. statements were included in the original file. When the included input file has 
  535. been completely processed, COMET returns to the original file and continues 
  536. processing it at the line following the include statement. If a terminal error 
  537. occurs in the included file, the entire test case stops, just as if it had 
  538. happened in the original input file. 
  539.  
  540. SYNTAX 
  541.  
  542. @INCLUDE "file_name"; 
  543.  
  544. Where: 
  545.  
  546.  file_name   is the name of a file which contains COMET commands. This can be 
  547.              just the file name, or can include the entire drive and path 
  548.              specification.  If the drive and path are not specified, the 
  549.              current drive and subdirectory are assumed. If the file can not be 
  550.              found in the current directory, the directories listed in the 
  551.              DPATH will be searched for the file. 
  552.  
  553.  
  554. ΓòÉΓòÉΓòÉ 4.2.3. Begin_Loop ΓòÉΓòÉΓòÉ
  555.  
  556. This is a structured loop construct which allows you to execute a group of 
  557. statements in the COMET input file a number of times. You can executed the 
  558. statements within the loop a specified number of times or for a specified 
  559. period of time.  If both a time value and a loop count are specified, COMET 
  560. will exit the loop when both of the conditions are met (whichever happens 
  561. last). 
  562.  
  563. Infinite loops can be done by setting the time parameter equal to zero. 
  564.  
  565. See Labels used for Loops and Jumps. for additional information about loops and 
  566. loop names. 
  567.  
  568. SYNTAX 
  569.  
  570. BEGIN_LOOP loop_name <TIME=minutes,  || COUNT=loop_count>; 
  571.  
  572. Where: 
  573.  
  574.  loop_name   is the name of the loop.  There should be a corresponding END_LOOP 
  575.              statement in the input file with the same loop name. 
  576.  
  577.  TIME        is the minumum length of time (in minutes) that the loop should 
  578.              run.  If TIME is not specified, then the COUNT parameter must be 
  579.              specified.  Both TIME and COUNT may be specified.  If so, both 
  580.              conditions must be met in order to exit the loop, that is, COMET 
  581.              will exit the loop when this time has expired, unless the minimum 
  582.              COUNT has not yet been reached. Set TIME = 0 for an infinite loop. 
  583.  
  584.  COUNT       is the minimum number of times to go through the loop. COMET will 
  585.              exit the loop after it has completed this many times through the 
  586.              loop.  This is a decimal number. If COUNT is not specified, then 
  587.              the TIME parameter must be used. COUNT and TIME may both be 
  588.              specified. If the TIME parameter was also specified, and the 
  589.              mimimum time has not yet been reached, the loop will continue till 
  590.              the timer has expired even if it exceeds the loop count specified 
  591.              here. 
  592.  
  593.  
  594. ΓòÉΓòÉΓòÉ 4.2.3.1. Loop example ΓòÉΓòÉΓòÉ
  595.  
  596. The example in Figure "Example of a Loop" shows a timed loop.  The loop will 
  597. run for two minutes, beeping for 1 second at 15 second intervals.  If an error 
  598. occurs when issuing the DosBeep command (if a non-zero return code occurs), 
  599. then the test case will exit the loop using the Break_To command and display an 
  600. error message on the screen. If no errors occur, the test case will jump to the 
  601. end after the loop completes. 
  602.  
  603.   begin_loop  beeper  time=2;
  604.     os2_api dosbeep  440,1000;
  605.     if os2_rc <> x'0'  break_to  beep_error;
  606.     os2_api dossleep  seconds=15;
  607.   end_loop beeper;
  608.   goto end;
  609.  
  610.   :beep_error
  611.     comet msg msg="error occurred in DosBeep command";
  612.  
  613.   :end
  614.  
  615. Example of a Loop
  616.  
  617. This example shows the Begin_Loop, Break_To, and End_Loop
  618. commands.
  619.  
  620.  
  621. ΓòÉΓòÉΓòÉ 4.2.4. Break_to ΓòÉΓòÉΓòÉ
  622.  
  623. This allows you to break out of a loop before the loop ending conditions (time 
  624. or count) have been met.  See Begin_Loop for information about the time and 
  625. count parameters when starting a loop. 
  626.  
  627. When jumping out of a loop, you must use BREAK_TO rather than the GOTO 
  628. statement. Using the BREAK_TO statement tells COMET to remove the loop 
  629. information from the internal loop stack which would not be removed if a GOTO 
  630. was used. 
  631.  
  632. Break_to can be used as part of an IF statement to make a conditional break 
  633. from a loop, or it can be used alone to cause an unconditional break from a 
  634. loop.  See Figure "Example of a Loop" to see how a break_to command might be 
  635. coded in a loop.  The BREAK_TO command will only break from on level of 
  636. looping.  You will need more that one BREAK_TO command to break out of each 
  637. level of imbedded loops. 
  638.  
  639. SYNTAX 
  640.  
  641. BREAK_TO label; 
  642.  
  643. Where: 
  644.  
  645.  label       is the label for the statement in the input file which should be 
  646.              processed next. 
  647.  
  648.  
  649. ΓòÉΓòÉΓòÉ 4.2.5. Call ΓòÉΓòÉΓòÉ
  650.  
  651. The Call command allows subroutines to be coded in the input file.  The 
  652. beginning of the subroutine is at the specified call label, and it ends when a 
  653. Return command is reached. There can be a maximum of 10 nested calls.  (A 
  654. nested call is a call statement which is placed in a subroutine which is called 
  655. from elsewhere in the input file.) 
  656.  
  657. See Labels used for jumps. for more information about labels used at the 
  658. beginning of called routines in the COMET input file. 
  659.  
  660. SYNTAX 
  661.  
  662. CALL label; 
  663.  
  664. Where: 
  665.  
  666.  label       is the label of the line in the input file which should be 
  667.              executed next. 
  668.  
  669.  
  670. ΓòÉΓòÉΓòÉ 4.2.6. Clear ΓòÉΓòÉΓòÉ
  671.  
  672. The CLEAR command is used to clear an error condition for an API return code 
  673. variable.  It can be used alone, or in conjunction with the IF statement to 
  674. clear an error condition for a return code. 
  675.  
  676. When an API command is used in a COMET input file, the return code resulting 
  677. from the API call will be either zero or non-zero. If it is zero, then the 
  678. command was successfully completed, as defined by the API command 
  679. specification.  COMET treats any zero return codes as a successful completion, 
  680. and any non-zero return codes as an unsuccessful, or error completion.  The 
  681. default treatment of an error condition is for COMET to log an error message 
  682. and stop the execution of the test case input file. To clear an error condition 
  683. (a non-zero return code) and allow a test case to continue, any combination of 
  684. the following things can be done: 
  685.  
  686.  Use the "RC=" parameter when issuing the API command.  This requires the test 
  687.  case writer to know exactly what return code is expected. 
  688.  
  689.  Use an "IF" statement, or a series of "IF" statements to test the appropriate 
  690.  return code(s) after the API command is issued in the test case.  Using the 
  691.  "IF" statement will clear an error condition only if the actual error 
  692.  condition is specified in the "IF" test.  For a more complete description of 
  693.  the IF statement, see If. 
  694.  
  695.  Use the CLEAR command to clear an error condition for a specific return code 
  696.  variable.  The syntax of the clear command is defined later in this section. 
  697.  
  698.  The CLEAR command can be used as a shortcut to allow you to test only certain 
  699.  error conditions in a test case, without having to test all possibilities. 
  700.  The clear command can then be used to reset the error to allow COMET to 
  701.  continue processing the test case instead of terminating it.  More than one 
  702.  return code variable can be cleared with a single CLEAR statement. 
  703.  
  704.  SYNTAX 
  705.  
  706.  CLEAR  ret_code_variable [, ret_code_variable,...]; 
  707.  
  708.  Where: 
  709.  
  710.  ret_code_variable specifies the return code variable for which the error 
  711.              condition should be cleared.  It can be one of the following: 
  712.  
  713.     ACDI_RC     ACDI return code. 
  714.  
  715.     APPC_PRC    Advanced Program to Program Communication Primary return code. 
  716.                 See APPC (Advanced Program to Program Communications) commands 
  717.                 for details on the APPC interface. 
  718.  
  719.     APPC_SRC    Advanced Program to Program Communication Secondary return 
  720.                 code.  See APPC (Advanced Program to Program Communications) 
  721.                 commands for details on the APPC interface. 
  722.  
  723.     SRPI_RC     Server/Requestor Programming Interface return code. See SRPI 
  724.                 (Server/Requester Programming Interface) commands for details 
  725.                 on the SRPI interface. 
  726.  
  727.     SRVR_RC     Server return code (for SRPI API). See SRPI (Server/Requester 
  728.                 Programming Interface) commands for details on the SRPI 
  729.                 interface. 
  730.  
  731.     DBM_RC      Database Manager return code (for utility functions). See DBM 
  732.                 (Database Manager) commands for details on the Database Manager 
  733.                 utility functions interface. 
  734.  
  735.     SQL_RC      Structured Query Language return code. See SQL (Structured 
  736.                 Query Language) commands for details on the SQL interface. 
  737.  
  738.     OS2_RC      OS/2 API return code. See OS2_API commands for details on the 
  739.                 OS/2 interface. 
  740.  
  741.     8022_RC     802.2 interface return code. See IEEE 802.2 API for details on 
  742.                 the IEEE 802.2 LAN interface. 
  743.  
  744.     NETB_RC     Netbios return code. See NETBIOS API for details on the Netbios 
  745.                 interface. 
  746.  
  747.     EHLLAPI_RC  Emulator High Level Language API return code. See EHLLAPI API 
  748.                 for details on the EHLLAPI interface. 
  749.  
  750.  
  751. ΓòÉΓòÉΓòÉ 4.2.6.1. CLEAR command example: ΓòÉΓòÉΓòÉ
  752.  
  753. The example in Figure "Example using Clear command" shows how the CLEAR command 
  754. might be used.  An APPC Confirm command will be issued, and one of two return 
  755. conditions is expected:  either a good return code (Primary return code = 
  756. x'0000') or an Allocation Error condition (Primary return code = x'0003'). If 
  757. the return code is good, the test case will continue to Send_Data command.  If 
  758. the return code is an Allocation Error, the test case will pause for 2 seconds 
  759. and retry the Allocate.  Any other return code condition will cause COMET to 
  760. display an error message and exit the test with an ERRORLEVEL of 10. 
  761.  
  762.  
  763.     :allocate_label
  764.      appc mc_alloc  remote_lu="LU_1", mode="MODE_1",
  765.              tp="TP_1", sync=NONE;
  766.      if appc_prc = x'0000' goto send_data;
  767.      if appc_prc = x'0003' goto retry_alloc;
  768.      clear appc_prc, appc_src;
  769.      comet msg msg="ERROR on ALLOCATE";
  770.      comet exit errorlevel=10;
  771.  
  772.     :retry_alloc
  773.      os2_api dossleep seconds=2;
  774.      goto allocate_label;
  775.  
  776.     :send_data
  777.      appc mc_send_data data="Send this data to LU_1";
  778.  
  779. Example using Clear command
  780.  
  781. This example shows how the Clear command could be used
  782. to clear an error in an input file.  Clearing the error condition
  783. allows COMET to continue with the next instructions, in this case,
  784. displaying an error message and exiting with an error level of 10.
  785.  
  786.  
  787. ΓòÉΓòÉΓòÉ 4.2.7. End_Loop ΓòÉΓòÉΓòÉ
  788.  
  789. The End_Loop command signals the end of a loop construct in the input file. 
  790. There should be a corresponding Begin_Loop command earlier in the input file. 
  791. See Figure "Example of a Loop" to see how a loop might be coded in an input 
  792. file. 
  793.  
  794. SYNTAX 
  795.  
  796. END_LOOP loop_name; 
  797.  
  798. Where: 
  799.  
  800.  loop_name   is the name of the loop.  There should be a corresponding 
  801.              BEGIN_LOOP statement in the input file with the same loop name. 
  802.  
  803.  
  804. ΓòÉΓòÉΓòÉ 4.2.8. Goto ΓòÉΓòÉΓòÉ
  805.  
  806. The Goto command allows the branching within the input file. Both conditional 
  807. and unconditional GOTO's are allowed.  You should not use a GOTO statement to 
  808. branch from within a loop to a place outside of the loop.  In that case, the 
  809. BREAK_TO statement should be used. See If and Labels used for jumps. for 
  810. information on conditional goto's and how to label the lines to which you are 
  811. branching. 
  812.  
  813. SYNTAX 
  814.  
  815. GOTO  label; 
  816.  
  817. Where: 
  818.  
  819.  label       is the label of the line to which you want to jump. You do not 
  820.              type a colon at the beginning of the label here. 
  821.  
  822.  
  823. ΓòÉΓòÉΓòÉ 4.2.9. If ΓòÉΓòÉΓòÉ
  824.  
  825. The IF command allows conditional execution of other COMET commands, based on 
  826. the value of a return code resulting from a previous API call. 
  827.  
  828. The IF statement can be considered to be an extension of the preceding 
  829. statement, in that it is used to check the return code of that statement.  It 
  830. can be used in conjunction with, or instead of, the "RC=..." parameter which 
  831. can be used on each API command supported by COMET.  For further discussion of 
  832. this, see the note which follows the IF syntax description. 
  833.  
  834. The IF command can be used only to test the results of API calls. The results 
  835. of COMET control and utility commands can not currently be tested with the IF 
  836. statement.  See the syntax (below) for the valid API return codes which can be 
  837. tested. 
  838.  
  839. SYNTAX 
  840.  
  841. IF  ret_code_variable  condition  value  COMET_instruction; 
  842.  
  843. Where: 
  844.  
  845.  ret_code_variable must be one of the following, indicating which return code 
  846.              is to be tested: 
  847.  
  848.     ACDI_RC     ACDI return code. 
  849.     APPC_PRC    APPC primary return code. (Note If) 
  850.     APPC_SRC    APPC secondary return code. (Note If) 
  851.     SRPI_RC     SRPI return code. (Note If) 
  852.     SRVR_RC     SRPI server return code. (Note If) 
  853.     DBM_RC      Database Manager return code. 
  854.     SQL_RC      Structured Query Language return code. 
  855.     OS2_RC      OS/2 API command return code. 
  856.     8022_RC     802.2 return code. 
  857.     NETB_RC      Netbios return code. 
  858.     EHLLAPI_RC  Emulator High Level Language API return code. 
  859.  
  860.  condition   must be one of the following, indicating how the return code 
  861.              should be compared with the following value. 
  862.  
  863.     =         return code equals value 
  864.     <         return code is less than value 
  865.     >         return code is greater than value 
  866.     <=        return code is less than or equal to value 
  867.     >=        return code is greater than or equal to value 
  868.     <>        return code is not equal to value 
  869.  
  870.  value       is a 1 to 8 digit hex_number.  Since most return codes are either 
  871.              2 or 4 bytes long, the value should normally be specified in one 
  872.              of the following forms:  x'nnnn' or x'nnnnnnnn' where 'n' 
  873.              represents any valid hex digit. 
  874.  
  875.  COMET_instruction is any input file instruction supported by COMET except the 
  876.              following: 
  877.  
  878.      Begin_Loop 
  879.      End_Loop 
  880.      If 
  881.  
  882.   1. Normally, if a non-zero return code occurs on an API command issued by 
  883.      COMET, an error will be logged and COMET will end the test case.  This can 
  884.      be prevented in one of two ways:  use the "RC=..." parameter on the API 
  885.      command, if the non-zero return code is expected, or use an IF statement 
  886.      (or a series of IF statements) after the API command to test for the 
  887.      possible return codes. 
  888.  
  889.   2. When using IF statements to check the return codes, COMET will continue to 
  890.      the next non-IF statement following the API command ONLY if a true 
  891.      condition is chosen in the IF statements.  If the failing condition is not 
  892.      found, then COMET will end the test case. 
  893.  
  894.   3. If the primary APPC return code (APPC_PRC) is correctly identified by an 
  895.      IF statement, any errors in the secondary return code will be cleared, and 
  896.      COMET will continue to the next statement which follows the APPC command. 
  897.      (See note If.) 
  898.  
  899.   4. A bad comparison on an APPC Secondary return code (APPC_SRC) will not 
  900.      necessarily cause COMET to terminate the test case.  If the APPC Primary 
  901.      return code is correctly identified using an IF statement after an APPC 
  902.      function, the error in the secondary return code will be cleared, allowing 
  903.      the test case to continue. Correctly identifying the secondary return code 
  904.      will not clear an error in the primary return code, though. 
  905.  
  906.   5. If the actual srpi return code (SRPI_RC) is correctly identified, any 
  907.      comparison error condition for the server return code (SRVR_RC) will be 
  908.      ignored. 
  909.  
  910.  
  911. ΓòÉΓòÉΓòÉ 4.2.10. Return ΓòÉΓòÉΓòÉ
  912.  
  913. The return command tells COMET to return to the instruction following the last 
  914. CALL command which was processed. A subroutine begins with a label (see Labels 
  915. used for jumps.) and ends with a Return command.  There may be more than one 
  916. return statement in a subroutine.  The subroutine will end at the first return 
  917. statement encountered while processing the subroutine. A CALL command is used 
  918. to call the subroutine. 
  919.  
  920. SYNTAX 
  921.  
  922. RETURN; 
  923.  
  924. There are no parameters for this instruction. 
  925.  
  926.  
  927. ΓòÉΓòÉΓòÉ 4.2.11. Labels used for Loops and Jumps. ΓòÉΓòÉΓòÉ
  928.  
  929. The method of labeling lines in the input file is different for loops and 
  930. jumps. 
  931.  
  932.  
  933. ΓòÉΓòÉΓòÉ 4.2.11.1. Labels used for loops. ΓòÉΓòÉΓòÉ
  934.  
  935. For loops, the label is part of the Begin_Loop and End_Loop statements, where 
  936. the first parameter on the input line after the Begin_Loop and End_Loop key 
  937. words is the loop name (or label). In the following example (Figure "Example 
  938. showing labels for loops"), two loops are used, called "loop1" and "loop2." 
  939. Since loop2 is nested within loop1, it will loop 5 times for every time loop 1 
  940. executes. 
  941.  
  942.  
  943.   Begin_Loop loop1 count=10;
  944.  
  945.         COMET instruction A;
  946.  
  947.         Begin_Loop loop2 count=5;
  948.  
  949.               COMET instruction B;
  950.  
  951.         End_Loop loop2;
  952.  
  953.         COMET instruction C;
  954.  
  955.   End_Loop loop1;
  956.  
  957.  
  958.   Example showing labels for loops
  959.  
  960.   This example shows how loop labels are used.
  961.  
  962.  
  963. ΓòÉΓòÉΓòÉ 4.2.11.2. Labels used for jumps. ΓòÉΓòÉΓòÉ
  964.  
  965. For jumps (conditional and unconditional goto's) and subroutine calls, the line 
  966. to which the test case is jumping must be labeled. A label is created, just as 
  967. in a DOS batch file or OS/2 command file, by typing a colon (:) as the first 
  968. non-blank character on a line of the input file, and immediately following it 
  969. with the desired label.  There may be no spaces in the label, and there may not 
  970. be a space between the starting colon and the label. 
  971.  
  972. This same type of label (starting with a colon) is used if the start_label 
  973. option is used on the command line when starting COMET.  See Syntax for Running 
  974. COMET for more details. In the following example (Figure "Example showing 
  975. labels for goto's"), "label1" is the label identifying the line at which 
  976. processing should continue should the IF condition be true, and "end_testcase" 
  977. is a label used at the end of the input file. Note that when calling the label, 
  978. the colon is not used. 
  979.  
  980.  
  981.      APPC MC_CONFIRM;
  982.      If appc_prc = x'3' goto label1;
  983.      COMET instruction A;
  984.      goto end_testcase;
  985.  
  986.      :label1
  987.       COMET instruction B;
  988.  
  989.      :end_testcase
  990.  
  991. Example showing labels for goto's
  992.  
  993. This example shows how labels are used for conditional
  994. and unconditional goto's.
  995.  
  996. In the above example, the following thing might happen: 
  997.  
  998.   If the actual primary return code from the Confirm is 3, then the next 
  999.    instruction processed after the IF will be COMET instruction B, which 
  1000.    follows "label1" in the example. 
  1001.  
  1002.   If the actual primary return code is zero, then COMET will continue the test 
  1003.    case with COMET instruction A, which follows immediately after the IF 
  1004.    statement. Assuming the result of instruction A is good, COMET will then 
  1005.    jump to "end_testcase" as a result of the unconditional GOTO following 
  1006.    instruction A. 
  1007.  
  1008.   If the actual primary return code from the Confirm is something other than 0 
  1009.    or 3, then COMET will log an error and terminate the test case. 
  1010.  
  1011.  
  1012. ΓòÉΓòÉΓòÉ 4.3. COMET Utility Commands ΓòÉΓòÉΓòÉ
  1013.  
  1014. This section describes COMET utility commands. 
  1015.  
  1016.  
  1017. ΓòÉΓòÉΓòÉ 4.3.1. Compare_Files ΓòÉΓòÉΓòÉ
  1018.  
  1019. Compares two files to see if they are the same.  The two files are not compared 
  1020. byte for byte, but a checksum (CRC) is computed for each file, and the two 
  1021. checksums are compared.  If the checksums are equal, the files are assumed to 
  1022. be the same and the test case continues to the next instruction in the input 
  1023. file. If the checksums do not match, the files are assumed to be different. If 
  1024. the files are not the same, an error message is stored in the status log, and 
  1025. the test case is stopped. 
  1026.  
  1027. SYNTAX 
  1028.  
  1029. COMET COMPARE_FILES FILE1=file_specification, 
  1030. FILE2=file_specification; 
  1031.  
  1032. Where: 
  1033.  
  1034.  FILE1       is the name of the first file to be compared. 
  1035.  
  1036.  FILE2       is the name of the second file to be compared. 
  1037.  
  1038.  Sample Code 
  1039.  
  1040.  
  1041. ΓòÉΓòÉΓòÉ 4.3.2. Display_On ΓòÉΓòÉΓòÉ
  1042.  
  1043. Turn on the display message facility.  Informational messages describing what 
  1044. is currently happening in the test case will be displayed to the screen.  The 
  1045. informational messages are the same as those stored into the log file created 
  1046. by COMET. 
  1047.  
  1048. SYNTAX 
  1049.  
  1050. COMET DISPLAY_ON; 
  1051.  
  1052.  
  1053. ΓòÉΓòÉΓòÉ 4.3.3. Display_Off ΓòÉΓòÉΓòÉ
  1054.  
  1055. Turn off the display message facility.  This is the default condition; the 
  1056. display_off command is not necessary unless the DISPLAY_ON instruction was 
  1057. previously used.  This does not affect the test case start and end messages.  A 
  1058. message indicating the test case has started and ended will be displayed even 
  1059. if the DISPLAY_OFF option is used. 
  1060.  
  1061. SYNTAX 
  1062.  
  1063. COMET DISPLAY_OFF; 
  1064.  
  1065.  
  1066. ΓòÉΓòÉΓòÉ 4.3.4. Debug_On ΓòÉΓòÉΓòÉ
  1067.  
  1068. Set debug mode for specific API's.  Debug mode can be set for the ACDI, APPC, 
  1069. SRPI, DBM, or SQL interfaces.  If debug mode is set, the control blocks (data 
  1070. structures) passed to the specified API and returned from the API will be 
  1071. displayed on the screen.  The hex and ascii representations of the control 
  1072. blocks will be displayed. There is no decoding of specific fields within a 
  1073. control block. 
  1074.  
  1075. SYNTAX 
  1076.  
  1077. COMET DEBUG_ON  [COMET] [,ACDI] [,APPC]         [,SRPI] [,DBM] [,SQL] 
  1078. [,802.2] [,NETB] [ALL]; 
  1079.  
  1080. Where: 
  1081.  
  1082.  COMET       will turn on the COMET debug facility. 
  1083.  
  1084.  ACDI        will turn on the ACDI debug facility. 
  1085.  
  1086.  APPC        will turn on the APPC debug facility. 
  1087.  
  1088.  SRPI        will turn on the SRPI debug facility. 
  1089.  
  1090.  DBM         will turn on the DBM debug facility. 
  1091.  
  1092.  SQL         will turn on the SQL debug facility. 
  1093.  
  1094.  802.2       will turn on the 802.2 debug facility. 
  1095.  
  1096.  NETB        will turn on the NETBIOS debug facility. 
  1097.  
  1098.  ALL         will turn on all of the above debug facilities. None of the other 
  1099.              options should be selected if ALL is used. 
  1100.  
  1101.  
  1102. ΓòÉΓòÉΓòÉ 4.3.5. Debug_Off ΓòÉΓòÉΓòÉ
  1103.  
  1104. Turn off debug mode for specific API's.  If debug mode is not set for the 
  1105. specified API, this command has no effect. 
  1106.  
  1107. SYNTAX 
  1108.  
  1109. COMET DEBUG_OFF  [COMET] [,ACDI] [,APPC]          [,SRPI] [,DBM] [,SQL] 
  1110. [,802.2] [,NETB] [ALL]; 
  1111.  
  1112. Where: 
  1113.  
  1114.  COMET       will turn on the COMET debug facility. 
  1115.  
  1116.  ACDI        will turn off the ACDI debug facility. 
  1117.  
  1118.  APPC        will turn off the APPC debug facility. 
  1119.  
  1120.  SRPI        will turn off the SRPI debug facility. 
  1121.  
  1122.  DBM         will turn off the DBM debug facility. 
  1123.  
  1124.  SQL         will turn off the SQL debug facility. 
  1125.  
  1126.  802.2       will turn off the 802.2 debug facility. 
  1127.  
  1128.  NETB        will turn off the NETBIOS debug facility. 
  1129.  
  1130.  ALL         will turn off all of the above debug facilities. None of the other 
  1131.              options should be selected if ALL is used. 
  1132.  
  1133.  
  1134. ΓòÉΓòÉΓòÉ 4.3.6. Entry_Points ΓòÉΓòÉΓòÉ
  1135.  
  1136. Used to specify a file which will contain the addresses of key COMET procedures 
  1137. loaded into main memory. If the file specified exists, it will be written over. 
  1138. If the file specified does not already exist, it will be created. 
  1139.  
  1140. SYNTAX 
  1141.  
  1142. COMET ENTRY_POINTS FILE=file_specification; 
  1143.  
  1144. Where: 
  1145.  
  1146.  FILE        is the name of the output file. 
  1147.  
  1148.  
  1149. ΓòÉΓòÉΓòÉ 4.3.7. Exit ΓòÉΓòÉΓòÉ
  1150.  
  1151. Used to end a test case and exit COMET  The input file can specify an error 
  1152. level to be returned to the operating system when ending COMET 
  1153.  
  1154. SYNTAX 
  1155.  
  1156. COMET EXIT  ERRORLEVEL=number; 
  1157.  
  1158. Where: 
  1159.  
  1160.  ERRORLEVEL  is the return code (error level) to be returned to the operating 
  1161.              system.  The number specified should be a decimal number. 
  1162.  
  1163.  
  1164. ΓòÉΓòÉΓòÉ 4.3.8. Log ΓòÉΓòÉΓòÉ
  1165.  
  1166. Used to control the logging of status information when an input file is being 
  1167. processed.  This command can be used to turn logging on and off, or to change 
  1168. the name of the output log file. 
  1169.  
  1170. SYNTAX 
  1171.  
  1172. COMET LOG   [FILE=file_name]        [,ACTION=<PAUSE|RESUME|RESET>]; 
  1173.  
  1174. Where: 
  1175.  
  1176.  FILE        is the new name to be used for the output log file.  The previous 
  1177.              log file is closed if PAUSE or RESET are specified. NOTE:  Using 
  1178.              this parameter without any ACTION will cause the specified file to 
  1179.              be cleared of data and replaced by a log file. RESET is the 
  1180.              default value for ACTION. At least one parameter must be 
  1181.              specified. 
  1182.  
  1183.  ACTION      is used to control logging. PAUSE will cause COMET to  stop 
  1184.              logging status to the output log file. RESUME will cause logging 
  1185.              to resume in append mode. RESET will clear any current log file 
  1186.              and will start a fresh log in the specified file or the current 
  1187.              log file. PAUSE, RESUME, and RESET all need a current log file or 
  1188.              a new log file name specified. For example, if COMET was started 
  1189.              with the /nl (no log) option and RESET was specified without a 
  1190.              file name, COMET will end with an error. On the other hand, if 
  1191.              COMET was started without specifying a log file or /nl, RESET 
  1192.              specified without a file parameter would cause a new log to be 
  1193.              made in cometlog.txt. 
  1194.  
  1195.  
  1196. ΓòÉΓòÉΓòÉ 4.3.9. MSG ΓòÉΓòÉΓòÉ
  1197.  
  1198. Used to display a message to the screen or store it into a file. 
  1199.  
  1200. SYNTAX 
  1201.  
  1202. COMET MSG   MSG="user message string"        [,FILE=file_name] 
  1203. [,DISPLAY]; 
  1204.  
  1205. Where: 
  1206.  
  1207.  MSG         is the message which is to be displayed or logged. 
  1208.  
  1209.  FILE        is the name of the file into which the message should be stored. 
  1210.              The file will be opened in append mode, and the message added to 
  1211.              the end of the file.  If FILE is specified, the message will not 
  1212.              be displayed to the screen unless the DISPLAY option is also used. 
  1213.  
  1214.  DISPLAY     tells COMET to display the message on the screen in addition to 
  1215.              storing it into a file.  If the FILE parameter is not used, it is 
  1216.              not necessary to specify DISPLAY, since it will be displayed on 
  1217.              the screen by default. 
  1218.  
  1219.  
  1220. ΓòÉΓòÉΓòÉ 4.3.10. WAIT ΓòÉΓòÉΓòÉ
  1221.  
  1222. Used to tell COMET to wait for an operator to press the ENTER key on the 
  1223. keyboard before continuing.  A message can optionally be displayed on the 
  1224. screen. 
  1225.  
  1226. SYNTAX 
  1227.  
  1228. COMET WAIT  [MSG="user message string"]; 
  1229.  
  1230. Where: 
  1231.  
  1232.  MSG         is the message which is to be displayed. 
  1233.  
  1234.  
  1235. ΓòÉΓòÉΓòÉ 4.4. OS/2 Shell commands ΓòÉΓòÉΓòÉ
  1236.  
  1237. COMET supports two types of OS/2 commands.  The first type, described here, are 
  1238. OS/2 shell commands.  See OS2_API commands for a description of OS/2 API 
  1239. commands. 
  1240.  
  1241. OS/2 shell commands cause COMET to issue OS/2 commands which would normally be 
  1242. issued at the OS/2 command line prompt.  The string specified in the OS2_SHELL 
  1243. instruction is passed directly to the OS/2 prompt and executed in an OS/2 
  1244. shell.  OS/2 shell instructions begin with the keyword: OS2_SHELL 
  1245.  
  1246. SYNTAX 
  1247.  
  1248. OS2_SHELL "os2 command string"; 
  1249.  
  1250. For example, the following instruction would cause COMET to issue an OS/2 copy 
  1251. command. 
  1252.  
  1253. OS2_SHELL "COPY file1.ext file2.ext"; 
  1254.  
  1255. The following utility command would cause a file called file1.ext to be erased. 
  1256.  
  1257. OS2_SHELL "ERASE file1.ext"; 
  1258.  
  1259. The following utility command would cause a directory list to be displayed on 
  1260. the screen. 
  1261.  
  1262. OS2_SHELL "dir"; 
  1263.  
  1264. Sample Code 
  1265.  
  1266.  
  1267. ΓòÉΓòÉΓòÉ 4.5. OS2_API commands ΓòÉΓòÉΓòÉ
  1268.  
  1269. The second type of OS/2 command supported by COMET is OS2 API. See OS/2 Shell 
  1270. commands for a description of OS/2 SHELL commands. 
  1271.  
  1272. OS/2 API commands cause COMET to issue the specified OS/2 API function calls to 
  1273. the OS/2 callable interface.  They begin with the keyword: OS2_API 
  1274.  
  1275. New OS/2 commands will be added to COMET as the need arises.  Since normal 
  1276. COMET processing already causes various OS/2 commands to be issued, the need 
  1277. for adding more OS/2 function calls to the COMET input file command language is 
  1278. small. 
  1279.  
  1280.  
  1281. ΓòÉΓòÉΓòÉ 4.5.1. DosBeep ΓòÉΓòÉΓòÉ
  1282.  
  1283. Generate sound from the PC speaker. 
  1284.  
  1285. SYNTAX 
  1286.  
  1287. OS2_API DOSBEEP frequency,duration        [,RC=expected_return_code]; 
  1288.  
  1289. Where: 
  1290.  
  1291.  frequency   is the frequency in hertz (cycles per second) of the tone to be 
  1292.              generated, in range of 37 to 32767. 
  1293.  
  1294.  duration    is the length of the sound in milliseconds. 
  1295.  
  1296.  RC          is the expected return code. If this parameter is not specified, 
  1297.              an error will be flagged if the return code is not okay. 
  1298.  
  1299.    Sample Code 
  1300.  
  1301.  
  1302. ΓòÉΓòÉΓòÉ 4.5.2. DosGetDateTime ΓòÉΓòÉΓòÉ
  1303.  
  1304. This command will be supported in a future version of COMET. 
  1305.  
  1306. Get the current time and date from the operating system.  The result can be 
  1307. displayed to the screen or stored in a file. 
  1308.  
  1309. SYNTAX 
  1310.  
  1311. OS2_API TIMEDATE [FILE=file_specification]          [,RC=expected_return_code]; 
  1312.  
  1313. Where: 
  1314.  
  1315.  FILE        is a file specification, which may include the drive and path. If 
  1316.              the file already exists, the time and date will be appended to the 
  1317.              end.  Otherwise, the file will be created. 
  1318.  
  1319.              If the FILE parameter is not specified, the time and date will be 
  1320.              displayed to the screen. 
  1321.  
  1322.  RC          is the expected return code. If this parameter is not specified, 
  1323.              an error will be flagged if the return code is not okay. 
  1324.  
  1325.  Sample Code 
  1326.  
  1327.  
  1328. ΓòÉΓòÉΓòÉ 4.5.3. DosSetDateTime ΓòÉΓòÉΓòÉ
  1329.  
  1330. This command will be supported in a future version of COMET. 
  1331.  
  1332. Set the current system time and date. 
  1333.  
  1334. SYNTAX 
  1335.  
  1336. OS2_API SETTIMEDATE [TIME=time_specification] 
  1337. [,DATE=date_specification]           [,RC=expected_return_code]; 
  1338.  
  1339. Where: 
  1340.  
  1341.  TIME        is a time specification in the format: HH:MM[:SS]. HH is the 
  1342.              hours, MM is the minutes, and SS is the seconds.  The Seconds are 
  1343.              optional. 
  1344.  
  1345.  DATE        is a date specification in the format: MM/DD/YYYY. MM is the month 
  1346.              (01-12), DD is the day (01-31), and YYYY is the year (0000-9999). 
  1347.  
  1348.  RC          is the expected return code. If this parameter is not specified, 
  1349.              an error will be flagged if the return code is not okay. 
  1350.  
  1351.  Sample Code 
  1352.  
  1353.  
  1354. ΓòÉΓòÉΓòÉ 4.5.4. DosSleep ΓòÉΓòÉΓòÉ
  1355.  
  1356. Wait for a specified length of time before continuing to the next step of the 
  1357. test case. 
  1358.  
  1359. SYNTAX 
  1360.  
  1361. OS2_API DOSSLEEP SECONDS = number_of_seconds        [,MINUTES = 
  1362. number_of_minutes]; 
  1363.  
  1364. Where: 
  1365.  
  1366.  SECONDS     is the number of seconds to wait before continuing. 
  1367.  
  1368.  MINUTES     is the number of minutes to wait before continuing. 
  1369.  
  1370.  Sample Code 
  1371.  
  1372.  
  1373. ΓòÉΓòÉΓòÉ 4.6. DBM (Database Manager) commands ΓòÉΓòÉΓòÉ
  1374.  
  1375. COMET divides the available database manager calls into two groups. The first 
  1376. group, DBM (database manager) calls, is described in this section.  The other 
  1377. group (SQL, or structured query language) calls is described in SQL (Structured 
  1378. Query Language) commands.  The DBM calls include Database Environment (DBE) 
  1379. commands and Database Utility (DBU) commands, as described in the Database 
  1380. Manager documentation. The SQL calls include Data Definition Language (DDL) 
  1381. commands, Data Manipulation Language (DML) commands, and Dynamic SQL Language 
  1382. (DSL) commands.  Only a subset of these commands will be supported by COMET. 
  1383.  
  1384. The following sections list the supported commands and describe the syntax to 
  1385. be used when including these commands in a COMET test case input file. 
  1386.  
  1387. For a more complete description of the Database commands, see the OS/2 Database 
  1388. Manager Programming Guide or or other Database Manager Documentation. 
  1389.  
  1390. Refer to General Instruction Syntax for general information about the command 
  1391. syntax for COMET instructions. 
  1392.  
  1393.  
  1394. ΓòÉΓòÉΓòÉ 4.6.1. Alter_DB ΓòÉΓòÉΓòÉ
  1395.  
  1396. Change the password for a database, or add or delete database security. 
  1397.  
  1398. SYNTAX 
  1399.  
  1400. DBM ALTER_DB  DB=database_name,        OLDPW=old_password, 
  1401. NEWPW=new_password        [,RC=expected_return_code]; 
  1402.  
  1403. Where: 
  1404.  
  1405.  DB          is the database name. 
  1406.  
  1407.  OLDPW       is the old password.  To add database security (if there was no 
  1408.              old password specified), set OLDPW=NONE. 
  1409.  
  1410.  NEWPW       is the new password.  To remove database security (to eliminate 
  1411.              the password), set NEWPW=NONE. 
  1412.  
  1413.  RC          is the expected return code.  COMET will compare the actual return 
  1414.              code with this value.  If they are not the same, an error will be 
  1415.              flagged.  If this parameter is not specified, an error will be 
  1416.              flagged if the return code is not good. 
  1417.  
  1418.  Sample Code 
  1419.  
  1420.  
  1421. ΓòÉΓòÉΓòÉ 4.6.2. Catalog_DB ΓòÉΓòÉΓòÉ
  1422.  
  1423. (Remote Database Services command) Catalogs a remote database. 
  1424.  
  1425. SYNTAX 
  1426.  
  1427. DBM CATALOG_DB DB=database_name        [,ALIAS=alias_database_name] 
  1428. [,NODENAME=node name alias]        [,TYPE=0|1]        [,DRIVE=drive lam alias] 
  1429. [,COMMENT=comment string]        [,CODEPAGE=comment_code_page] 
  1430. [,RC=expected_return_code]; 
  1431.  
  1432. Where: 
  1433.  
  1434.  DB          is the remote database name. 
  1435.  
  1436.  ALIAS       is the alias name the remote database will be known as locally. 
  1437.  
  1438.  NODENAME    is the name of the node to be used. Note: the node was defined 
  1439.              using CATALOG_NODE or Query Manager. 
  1440.  
  1441.  TYPE        is the type to be associated with the database. Type 0 speficies 
  1442.              this will be an local indirectly cataloged db. Type 1, which is 
  1443.              the default, specifies that this will be a remotely access 
  1444.              database. 
  1445.  
  1446.  DRIVE       used when TYPE=0, this will specifiy the drive the local 
  1447.              indirectly cataloged database resides on. 
  1448.  
  1449.  COMMENT     is a comment string. 
  1450.  
  1451.  CODEPAGE    is the desired code page number (used with national language 
  1452.              support applications). 
  1453.  
  1454.  RC          is the expected return code.  COMET will compare the actual return 
  1455.              code with this value.  If they are not the same, an error will be 
  1456.              flagged.  If this parameter is not specified, an error will be 
  1457.              flagged if the return code is not good. 
  1458.  
  1459.  Sample Code 
  1460.  
  1461.  
  1462. ΓòÉΓòÉΓòÉ 4.6.3. Catalog_Node ΓòÉΓòÉΓòÉ
  1463.  
  1464. (Remote Database Services command) Catalogs a node for RDS communications. 
  1465.  
  1466. SYNTAX 
  1467.  
  1468. DBM CATALOG_NODE NODENAME=node_name        ,LOCAL_LU=local_lu_name 
  1469. ,PARTNER_LU=partner_lu_name        ,MODE=mode_name        [,COMMENT=descriptive 
  1470. comment ]        [,CODEPAGE=comment_codepage_number] 
  1471. [,RC=expected_return_code]; 
  1472.  
  1473. Where: 
  1474.  
  1475.  NODENAME    is the name to be used when referring this node. 
  1476.  
  1477.  LOCAL_LU    is the defined local lu name for the SNA conversation session. 
  1478.  
  1479.  PARTNER_LU  is the defined partner lu alias name for this SNA conversation 
  1480.              session. 
  1481.  
  1482.  MODE        is the conversation mode for this conversation session. 
  1483.  
  1484.  COMMENT     is a comment string for this node. 
  1485.  
  1486.  CODEPAGE    is the desired code page number (used with national language 
  1487.              support applications). 
  1488.  
  1489.  RC          is the expected return code.  COMET will compare the actual return 
  1490.              code with this value.  If they are not the same, an error will be 
  1491.              flagged.  If this parameter is not specified, an error will be 
  1492.              flagged if the return code is not good. 
  1493.  
  1494.  Sample Code 
  1495.  
  1496.  
  1497. ΓòÉΓòÉΓòÉ 4.6.4. Create_DB ΓòÉΓòÉΓòÉ
  1498.  
  1499. Initialize a new database. A bind to a database is automatically done by COMET 
  1500. immediately after the Create Database command is issued. 
  1501.  
  1502. SYNTAX 
  1503.  
  1504. DBM CREATE_DB DB=database_name        [,PW=password]        [,COMMENT="comment 
  1505. string"]        [,CODEPAGE=codepage_number]        [,RC=expected_return_code]; 
  1506.  
  1507. Where: 
  1508.  
  1509.  DB          is the database name. 
  1510.  
  1511.  PW          is the password, if required. 
  1512.  
  1513.  COMMENT     is a comment string. 
  1514.  
  1515.  CODEPAGE    is the desired code page number (used with national language 
  1516.              support applications). 
  1517.  
  1518.  RC          is the expected return code.  COMET will compare the actual return 
  1519.              code with this value.  If they are not the same, an error will be 
  1520.              flagged.  If this parameter is not specified, an error will be 
  1521.              flagged if the return code is not good. 
  1522.  
  1523.  Sample Code 
  1524.  
  1525.  
  1526. ΓòÉΓòÉΓòÉ 4.6.5. Drop_DB ΓòÉΓòÉΓòÉ
  1527.  
  1528. Drop a database. 
  1529.  
  1530. SYNTAX 
  1531.  
  1532. DBM DROP_DB  DB=database_name        [,PW=password] 
  1533. [,RC=expected_return_code]; 
  1534.  
  1535. Where: 
  1536.  
  1537.  DB          is the database name. 
  1538.  
  1539.  PW          is the password, if required. 
  1540.  
  1541.  RC          is the expected return code.  COMET will compare the actual return 
  1542.              code with this value.  If they are not the same, an error will be 
  1543.              flagged.  If this parameter is not specified, an error will be 
  1544.              flagged if the return code is not good. 
  1545.  
  1546.  Sample Code 
  1547.  
  1548.  
  1549. ΓòÉΓòÉΓòÉ 4.6.6. Export_from ΓòÉΓòÉΓòÉ
  1550.  
  1551. Copy data from a database table or view into an OS/2 file. 
  1552.  
  1553. The DCOLDATA parameter used by the EXPORT function is set to null by COMET. 
  1554. That parameter can not be specified in the input file. 
  1555.  
  1556. Note: A SQL COMMIT command should be issued after issuing previous database 
  1557. environment commands (such as CREATE DB, CREATE TABLE, ...) and before issuing 
  1558. the database utility IMPORT or EXPORT commands. 
  1559.  
  1560. SYNTAX 
  1561.  
  1562. DBM EXPORT_FROM DB=database_name         [,PW=password] 
  1563. ,DATAFILE=data_file_specification         ,TCOLSTRG="select statement" 
  1564. ,FILETYPE= < DEL | IXF | WSF >         [,FILETMOD="file type modifier"] 
  1565. [,MSGFILE=message_file_specification]         [,RC=expected_return_code]; 
  1566.  
  1567. Where: 
  1568.  
  1569.  DB          is the database name. 
  1570.  
  1571.  PW          is the password, if required. 
  1572.  
  1573.  DATAFILE    is the name of the file into which the data is to exported. 
  1574.  
  1575.  TCOLSTRG    is a SELECT statement specification, used to tell the database 
  1576.              manager which items to export to the file.  It must be enclosed in 
  1577.              quotes. 
  1578.  
  1579.  FILETYPE    is type of file to be created. 
  1580.  
  1581.     DEL  is Delimited ASCII 
  1582.  
  1583.     IXF  is PC version for exchange with host products via IWX-CPSI. 
  1584.  
  1585.     WSF  is Work Sheet Formats (lotus and symphony) 
  1586.  
  1587.  FILETMOD    modifies the file type.  Refer to Database Manager documentation 
  1588.              for valid FILETMOD strings.  If this parameter is not specified, 
  1589.              the database managers default values will be used. For  FILETYPE= 
  1590.              WSF, the following values are valid for FILETMOD. They must be 
  1591.              enclosed in quotes.  The specified character string is passed 
  1592.              directly, as is. Other values may be specified, if error 
  1593.              conditions are being tested. 
  1594.  
  1595.     "1"  specifies a first generation WSF file (lotus 123/1 or lotus 123/A). 
  1596.  
  1597.     "2"  specifies a second generation WSF file (symphony/1.0). 
  1598.  
  1599.     "3"  specifies a third generation WSF file (lotus 123/2 or symphony/1.1). 
  1600.          If just "3" is used, the default product type is lotus. 
  1601.  
  1602.     "3L" specifies a third generation WSF file (lotus 123/2 or symphony/1.1). 
  1603.          The L specifies that the product type is lotus. 
  1604.  
  1605.     "3S" specifies a third generation WSF file (lotus 123/2 or symphony/1.1). 
  1606.          The S specifies that the product type is symphony. 
  1607.  
  1608.  MSGFILE     specifies the desired destination of EXPORT messages, if any 
  1609.              occur. A file specification may be set, or a standard device such 
  1610.              as LPT1 or NUL my be used. 
  1611.  
  1612.  RC          is the expected return code.  COMET will compare the actual return 
  1613.              code with this value.  If they are not the same, an error will be 
  1614.              flagged.  If this parameter is not specified, an error will be 
  1615.              flagged if the return code is not good. 
  1616.  
  1617.  Sample Code 
  1618.  
  1619.  
  1620. ΓòÉΓòÉΓòÉ 4.6.7. Import_to ΓòÉΓòÉΓòÉ
  1621.  
  1622. Insert data into a database table or view from an OS/2 file. 
  1623.  
  1624. The DCOLDATA parameter used by the IMPORT function is set to null by COMET. 
  1625. That parameter can not be specified in the input file. 
  1626.  
  1627. Note: A SQL COMMIT command should be issued after issuing previous database 
  1628. environment commands (such as CREATE DB, CREATE TABLE, ...) and before issuing 
  1629. the database utility IMPORT or EXPORT commands. 
  1630.  
  1631. SYNTAX 
  1632.  
  1633. DBM IMPORT_TO DB=database_name        [,PW=password] 
  1634. ,DATAFILE=data_file_name        ,TCOLSTRG="column description string" 
  1635. ,FILETYPE= < DEL | ASC | IXF | WSF >        [,FILETMOD="file type modifier"] 
  1636. [,MSGFILE=message_file_specification]        [,RC=expected_return_code]; 
  1637.  
  1638. Where: 
  1639.  
  1640.  DB          is the database name. 
  1641.  
  1642.  PW          is the password, if required. 
  1643.  
  1644.  DATAFILE    is the name of the file containing the data to be imported. 
  1645.  
  1646.  TCOLSTRG    is a string describing the columns into which the data should be 
  1647.              imported.  Refer to Database Manager documentation for the valid 
  1648.              format of this string.  The specified string must be enclosed in 
  1649.              quotes.  The string specified within the quotes is a REPLACE, 
  1650.              CREATE, or INSERT statement, as defined in the Database Manager 
  1651.              documentation. 
  1652.  
  1653.  FILETYPE    is type of file to be created. 
  1654.  
  1655.     DEL  is Delimited ASCII 
  1656.  
  1657.     ASC  is Non-delimited ASCII 
  1658.  
  1659.     IXF  is PC version for exchange with host products via IWX-CPSI. 
  1660.  
  1661.     WSF  is Work Sheet Formats (lotus and symphony) 
  1662.  
  1663.  FILETMOD    modifies the file type.  Refer to Database Manager documentation 
  1664.              for valid FILETMOD strings.  If this parameter is not specified, 
  1665.              the database managers default values will be used. 
  1666.  
  1667.  MSGFILE     specifies the desired destination of EXPORT messages, if any 
  1668.              occur. A file specification may be set, or a standard device such 
  1669.              as LPT1 or NUL may be used. 
  1670.  
  1671.  RC          is the expected return code.  COMET will compare the actual return 
  1672.              code with this value.  If they are not the same, an error will be 
  1673.              flagged.  If this parameter is not specified, an error will be 
  1674.              flagged if the return code is not good. 
  1675.  
  1676.  Sample Code 
  1677.  
  1678.  
  1679. ΓòÉΓòÉΓòÉ 4.6.8. Restore ΓòÉΓòÉΓòÉ
  1680.  
  1681. (Remote Database Services command) Restores a database. 
  1682.  
  1683. SYNTAX 
  1684.  
  1685. DBM RESTORE_DB DB=database_name        ,DRIVE=drive_to_restore_from 
  1686. [,DB_DRIVE=drive_to_restore_to]        [,RC=expected_return_code]; 
  1687.  
  1688. Where: 
  1689.  
  1690.  DB          is the restore database name. 
  1691.  
  1692.  DRIVE       is the drive where database backup files are located. 
  1693.  
  1694.  DB_DRIVE    is the drive where the restored database should be written to. The 
  1695.              default is drive C:. 
  1696.  
  1697.  RC          is the expected return code.  COMET will compare the actual return 
  1698.              code with this value.  If they are not the same, an error will be 
  1699.              flagged.  If this parameter is not specified, an error will be 
  1700.              flagged if the return code is not good. 
  1701.  
  1702.  Sample Code 
  1703.  
  1704.  
  1705. ΓòÉΓòÉΓòÉ 4.6.9. StartDBM ΓòÉΓòÉΓòÉ
  1706.  
  1707. Start the database manager. 
  1708.  
  1709. This function can also be done using the OS/2 SHELL command, if it is desired 
  1710. to start the database manager from the OS/2 command prompt. 
  1711.  
  1712. SYNTAX 
  1713.  
  1714. DBM STARTDBM [RC=expected_return_code]; 
  1715.  
  1716. Where: 
  1717.  
  1718.  RC          is the expected return code.  COMET will compare the actual return 
  1719.              code with this value.  If they are not the same, an error will be 
  1720.              flagged.  If this parameter is not specified, an error will be 
  1721.              flagged if the return code is not good. 
  1722.  
  1723.  Sample Code 
  1724.  
  1725.  
  1726. ΓòÉΓòÉΓòÉ 4.6.10. Start_Using_DB ΓòÉΓòÉΓòÉ
  1727.  
  1728. Connect to a database for database manipulation. 
  1729.  
  1730. SYNTAX 
  1731.  
  1732. DBM START_USING_DB DB=database_name           [,PW=password] 
  1733. [,USE=<S|X>]           [,RC=expected_return_code]; 
  1734.  
  1735. Where: 
  1736.  
  1737.  DB          is the database name. 
  1738.  
  1739.  PW          is the password, if required. 
  1740.  
  1741.  USE         is the exclusive use indicator.  USE=S means the database is 
  1742.              shared.  USE=X means that exclusive use is requested.  If not 
  1743.              specified, USE=S is the default. 
  1744.  
  1745.              Note: For exclusive use of a database, the SQLUSER environment 
  1746.              string must be set prior to issuing the START_USING_DB command. 
  1747.              This can be done from within COMET by issuing an OS2_SHELL 
  1748.              command. For example: OS2_SHELL "SET SQLUSER sqluser_name"; 
  1749.  
  1750.  RC          is the expected return code.  COMET will compare the actual return 
  1751.              code with this value.  If they are not the same, an error will be 
  1752.              flagged.  If this parameter is not specified, an error will be 
  1753.              flagged if the return code is not good. 
  1754.  
  1755.  Sample Code 
  1756.  
  1757.  
  1758. ΓòÉΓòÉΓòÉ 4.6.11. StopDBM ΓòÉΓòÉΓòÉ
  1759.  
  1760. Terminate the Database Manager. 
  1761.  
  1762. SYNTAX 
  1763.  
  1764. DBM STOPDBM [RC=expected_return_code]; 
  1765.  
  1766. Where: 
  1767.  
  1768.  RC          is the expected return code.  COMET will compare the actual return 
  1769.              code with this value.  If they are not the same, an error will be 
  1770.              flagged.  If this parameter is not specified, an error will be 
  1771.              flagged if the return code is not good. 
  1772.  
  1773.  Sample Code 
  1774.  
  1775.  
  1776. ΓòÉΓòÉΓòÉ 4.6.12. Stop_Using_DB ΓòÉΓòÉΓòÉ
  1777.  
  1778. Disconnect from a database. 
  1779.  
  1780. SYNTAX 
  1781.  
  1782. DBM STOP_USING_DB [RC=expected_return_code]; 
  1783.  
  1784. Where: 
  1785.  
  1786.  RC          is the expected return code.  COMET will compare the actual return 
  1787.              code with this value.  If they are not the same, an error will be 
  1788.              flagged.  If this parameter is not specified, an error will be 
  1789.              flagged if the return code is not good. 
  1790.  
  1791.  Sample Code 
  1792.  
  1793.  
  1794. ΓòÉΓòÉΓòÉ 4.6.13. Uncatalog_DB ΓòÉΓòÉΓòÉ
  1795.  
  1796. (Remote Database Services command) Uncatalogs a remote database. 
  1797.  
  1798. SYNTAX 
  1799.  
  1800. DBM UNCATALOG_DB DB=database_name        [,RC=expected_return_code]; 
  1801.  
  1802. Where: 
  1803.  
  1804.  DB          is the name the database alias to be uncataloged. 
  1805.  
  1806.  RC          is the expected return code.  COMET will compare the actual return 
  1807.              code with this value.  If they are not the same, an error will be 
  1808.              flagged.  If this parameter is not specified, an error will be 
  1809.              flagged if the return code is not good. 
  1810.  
  1811.  Sample Code 
  1812.  
  1813.  
  1814. ΓòÉΓòÉΓòÉ 4.6.14. Uncatalog_Node ΓòÉΓòÉΓòÉ
  1815.  
  1816. (Remote Database Services command) Uncatalogs a node. 
  1817.  
  1818. SYNTAX 
  1819.  
  1820. DBM UNCATALOG_NODE NODENAME=node_name        [,RC=expected_return_code]; 
  1821.  
  1822. Where: 
  1823.  
  1824.  NODENAME    is the name to be used when referring this node. 
  1825.  
  1826.  RC          is the expected return code.  COMET will compare the actual return 
  1827.              code with this value.  If they are not the same, an error will be 
  1828.              flagged.  If this parameter is not specified, an error will be 
  1829.              flagged if the return code is not good. 
  1830.  
  1831.  Sample Code 
  1832.  
  1833.  
  1834. ΓòÉΓòÉΓòÉ 4.6.15. Unsupported Database Utility commands ΓòÉΓòÉΓòÉ
  1835.  
  1836. The following database utility commands are not supported in this version of 
  1837. COMET.  This means that the input file containing a test case script may not 
  1838. issue these instructions. Support of these commands will be added as time 
  1839. permits. 
  1840.  
  1841.  BACKUP DATABASE 
  1842.  REORG TABLE UTILITY 
  1843.  RUNSTATS 
  1844.  
  1845.  
  1846. ΓòÉΓòÉΓòÉ 4.7. SQL (Structured Query Language) commands ΓòÉΓòÉΓòÉ
  1847.  
  1848. The SQL (structured Query Language) commands described in this section include 
  1849. Data Definition Language (DDL) commands, Data Manipulation Language (DML) 
  1850. commands, as defined in the Database Manager documentation.  The Dynamic SQL 
  1851. EXECUTE IMMEDIATE command is used to implement the SQL functions, with the 
  1852. exception of the SELECT operation. 
  1853.  
  1854. When adding a SQL command to a COMET input file, the keyword SQL should be the 
  1855. first word of the instruction.  The actual SQL instruction must be enclosed in 
  1856. quotes. The general syntax to be followed when using SQL statements in the 
  1857. COMET test case input file is this: 
  1858.  
  1859. SQL "sql command string",    other parameters; 
  1860.  
  1861. The following sections describe the formats of some valid SQL commands. Other 
  1862. SQL commands (or invalid commands) may be enclosed within the quotes, if 
  1863. desired.  The character string specified in SQL statements are be passed 
  1864. directly to the Database Manager using the EXECUTE IMMEDIATE function.  If the 
  1865. string specified in the input file contains an invalid SQL statement, the 
  1866. return code from the database manager should reflect the error. 
  1867.  
  1868.  
  1869. ΓòÉΓòÉΓòÉ 4.7.1. Alter Table ΓòÉΓòÉΓòÉ
  1870.  
  1871. Used to add columns to a table. 
  1872.  
  1873. SYNTAX 
  1874.  
  1875. SQL "ALTER TABLE table_name ADD column_name datatype         [FOR BIT DATA] 
  1876. [ADD column_name datatype         [FOR BIT DATA]]..." 
  1877. [,RC=expected_return_code]; 
  1878.  
  1879. Where: 
  1880.  
  1881.  "ALTER..."  is the ALTER TABLE string. 
  1882.  
  1883.  RC          is the expected return code.  COMET will compare the actual return 
  1884.              code with this value.  If they are not the same, an error will be 
  1885.              flagged.  If this parameter is not specified, an error will be 
  1886.              flagged if the return code is not good. 
  1887.  
  1888.  Sample Code 
  1889.  
  1890.  
  1891. ΓòÉΓòÉΓòÉ 4.7.2. Create Index ΓòÉΓòÉΓòÉ
  1892.  
  1893. Create an index on an existing table. 
  1894.  
  1895. SYNTAX 
  1896.  
  1897. SQL "CREATE [UNIQUE] INDEX index_name ON table_name       (column_name [ASC | 
  1898. DESC]       [,column_name [ASC | DESC]] ...)"       [,RC=expected_return_code]; 
  1899.  
  1900. Where: 
  1901.  
  1902.  "CREATE.."  is the CREATE INDEX string. 
  1903.  
  1904.  RC          is the expected return code.  COMET will compare the actual return 
  1905.              code with this value.  If they are not the same, an error will be 
  1906.              flagged.  If this parameter is not specified, an error will be 
  1907.              flagged if the return code is not good. 
  1908.  
  1909.  Sample Code 
  1910.  
  1911.  
  1912. ΓòÉΓòÉΓòÉ 4.7.3. Create Table ΓòÉΓòÉΓòÉ
  1913.  
  1914. Create a table in a database. 
  1915.  
  1916. SYNTAX 
  1917.  
  1918. The parentheses () shown in the following syntax are required. 
  1919.  
  1920. SQL "CREATE TABLE tablename (column_name datatype [FOR BIT DATA]          [NOT 
  1921. NULL] [, column_name datatype          [FOR BIT DATA]          [NOT NULL]]...)" 
  1922. [,RC=expected_return_code]; 
  1923.  
  1924. Where: 
  1925.  
  1926.  "CREATE.."  is the CREATE TABLE string. 
  1927.  
  1928.  RC          is the expected return code.  COMET will compare the actual return 
  1929.              code with this value.  If they are not the same, an error will be 
  1930.              flagged.  If this parameter is not specified, an error will be 
  1931.              flagged if the return code is not good. 
  1932.  
  1933.  Sample Code 
  1934.  
  1935.  
  1936. ΓòÉΓòÉΓòÉ 4.7.4. Create View ΓòÉΓòÉΓòÉ
  1937.  
  1938. Define a view on a table. 
  1939.  
  1940. SYNTAX 
  1941.  
  1942. SQL "CREATE VIEW view_name         [(column_name [,column_name]...)         AS 
  1943. select_statement [WITH CHECK OPTION]"         [,RC=expected_return_code]; 
  1944.  
  1945. Where: 
  1946.  
  1947.  "CREATE.."  is the CREATE VIEW string. 
  1948.  
  1949.  RC          is the expected return code.  COMET will compare the actual return 
  1950.              code with this value.  If they are not the same, an error will be 
  1951.              flagged.  If this parameter is not specified, an error will be 
  1952.              flagged if the return code is not good. 
  1953.  
  1954.  Sample Code 
  1955.  
  1956.  
  1957. ΓòÉΓòÉΓòÉ 4.7.5. Drop Index ΓòÉΓòÉΓòÉ
  1958.  
  1959. Drop an index. 
  1960.  
  1961. SYNTAX 
  1962.  
  1963. SQL "DROP index_name"      [,RC=expected_return_code]; 
  1964.  
  1965. Where: 
  1966.  
  1967.  "DROP..."   is the DROP INDEX string. 
  1968.  
  1969.  RC          is the expected return code.  COMET will compare the actual return 
  1970.              code with this value.  If they are not the same, an error will be 
  1971.              flagged.  If this parameter is not specified, an error will be 
  1972.              flagged if the return code is not good. 
  1973.  
  1974.  Sample Code 
  1975.  
  1976.  
  1977. ΓòÉΓòÉΓòÉ 4.7.6. Drop Table ΓòÉΓòÉΓòÉ
  1978.  
  1979. Drop a drop a table from the database. 
  1980.  
  1981. SYNTAX 
  1982.  
  1983. SQL "DROP TABLE table_name"         [,RC=expected_return_code]; 
  1984.  
  1985. Where: 
  1986.  
  1987.  "DROP..."   is the DROP TABLE string. 
  1988.  
  1989.  RC          is the expected return code.  COMET will compare the actual return 
  1990.              code with this value.  If they are not the same, an error will be 
  1991.              flagged.  If this parameter is not specified, an error will be 
  1992.              flagged if the return code is not good. 
  1993.  
  1994.  Sample Code 
  1995.  
  1996.  
  1997. ΓòÉΓòÉΓòÉ 4.7.7. Drop View ΓòÉΓòÉΓòÉ
  1998.  
  1999. Drop a view definition. 
  2000.  
  2001. SYNTAX 
  2002.  
  2003. SQL "DROP VIEW view_name" [,RC=expected_return_code]; 
  2004.  
  2005. Where: 
  2006.  
  2007.  "DROP..."   is the DROP VIEW string. 
  2008.  
  2009.  RC          is the expected return code.  COMET will compare the actual return 
  2010.              code with this value.  If they are not the same, an error will be 
  2011.              flagged.  If this parameter is not specified, an error will be 
  2012.              flagged if the return code is not good. 
  2013.  
  2014.  Sample Code 
  2015.  
  2016.  
  2017. ΓòÉΓòÉΓòÉ 4.7.8. Commit ΓòÉΓòÉΓòÉ
  2018.  
  2019. Commit work previously performed for a database transaction. 
  2020.  
  2021. SYNTAX 
  2022.  
  2023. SQL "COMMIT [WORK] [HOLD]"       [,RC=expected_return_code]; 
  2024.  
  2025. Where: 
  2026.  
  2027.  "COMMIT.."  is the COMMIT string. 
  2028.  
  2029.  RC          is the expected return code.  COMET will compare the actual return 
  2030.              code with this value.  If they are not the same, an error will be 
  2031.              flagged.  If this parameter is not specified, an error will be 
  2032.              flagged if the return code is not good. 
  2033.  
  2034.  Sample Code 
  2035.  
  2036.  
  2037. ΓòÉΓòÉΓòÉ 4.7.9. Delete ΓòÉΓòÉΓòÉ
  2038.  
  2039. Remove rows from a data base table. 
  2040.  
  2041. SYNTAX 
  2042.  
  2043. SQL "DELETE FROM tablename [correlname]         [WHERE predicate]" 
  2044. [,RC=expected_return_code]; 
  2045.  
  2046. Where: 
  2047.  
  2048.  "DELETE.."  is the DELETE string. 
  2049.  
  2050.  RC          is the expected return code.  COMET will compare the actual return 
  2051.              code with this value.  If they are not the same, an error will be 
  2052.              flagged.  If this parameter is not specified, an error will be 
  2053.              flagged if the return code is not good. 
  2054.  
  2055.  Sample Code 
  2056.  
  2057.  
  2058. ΓòÉΓòÉΓòÉ 4.7.10. Insert ΓòÉΓòÉΓòÉ
  2059.  
  2060. Add new rows to a database table. 
  2061.  
  2062. SYNTAX 
  2063.  
  2064. SQL "INSERT INTO tablename [(column_name list)]         VALUES (value list)" 
  2065. [,RC=expected_return_code]; 
  2066.  
  2067. Where: 
  2068.  
  2069.  "INSERT.."  is the INSERT string. 
  2070.  
  2071.  RC          is the expected return code.  COMET will compare the actual return 
  2072.              code with this value.  If they are not the same, an error will be 
  2073.              flagged.  If this parameter is not specified, an error will be 
  2074.              flagged if the return code is not good. 
  2075.  
  2076.  Sample Code 
  2077.  
  2078.  
  2079. ΓòÉΓòÉΓòÉ 4.7.11. Rollback ΓòÉΓòÉΓòÉ
  2080.  
  2081. Back out unwanted work performed for a database transaction. 
  2082.  
  2083. SYNTAX 
  2084.  
  2085. SQL "ROLLBACK [WORK]"       [,RC=expected_return_code]; 
  2086.  
  2087. Where: 
  2088.  
  2089.  "ROLLBACK.." is the ROLLBACK string. 
  2090.  
  2091.  RC          is the expected return code.  COMET will compare the actual return 
  2092.              code with this value.  If they are not the same, an error will be 
  2093.              flagged.  If this parameter is not specified, an error will be 
  2094.              flagged if the return code is not good. 
  2095.  
  2096.  Sample Code 
  2097.  
  2098.  
  2099. ΓòÉΓòÉΓòÉ 4.7.12. Select ΓòÉΓòÉΓòÉ
  2100.  
  2101. Selectively choose a list of information from a database. 
  2102.  
  2103. The Dynamic SQL version of the select_statement definition is supported by 
  2104. COMET.  The INTO clause is not supported. 
  2105.  
  2106. COMET does not issue a SELECT directly, but must issue several other commands 
  2107. to accomplish the task in a dynamic SQL environment. Those commands include 
  2108. Open Cursor, Prepare, Fetch, and Close Cursor. 
  2109.  
  2110. SYNTAX 
  2111.  
  2112. SQL "SELECT [ALL | DISTINCT] < * | select-list >      FROM tablename 
  2113. [correlname]      [,tablename [correlname]] ...      [WHERE predicate] 
  2114. [GROUP BY colname[,colname] ...]      [HAVING predicate]      [FOR UPDATE OF 
  2115. colname[,colname] ...] |      ORDER BY <colname | colnum [ASC | DESC]>      [, 
  2116. <colname | colnum [ASC | DESC]>...]]",      FILE=pcfile_specification 
  2117. [,RC=expected_return_code]; 
  2118.  
  2119. Where: 
  2120.  
  2121.  "SELECT.."  is the SELECT string. 
  2122.  
  2123.  FILE        is the name of the file into which the selected rows are stored. 
  2124.              If the file already exists, the data will be appended to the end 
  2125.              of the file. 
  2126.  
  2127.  RC          is the expected return code.  COMET will compare the actual return 
  2128.              code with this value.  If they are not the same, an error will be 
  2129.              flagged.  If this parameter is not specified, an error will be 
  2130.              flagged if the return code is not good. 
  2131.  
  2132.  Sample Code 
  2133.  
  2134.  
  2135. ΓòÉΓòÉΓòÉ 4.7.13. Update ΓòÉΓòÉΓòÉ
  2136.  
  2137. Change the data in specified rows of a database table. 
  2138.  
  2139. SYNTAX 
  2140.  
  2141. SQL "UPDATE tablename [(correlname)]       SET colname = <expression | NULL> 
  2142. [, colname = <expression | NULL>]...       [WHERE predicate]" 
  2143. [,RC=expected_return_code]; 
  2144.  
  2145. Where: 
  2146.  
  2147.  "UPDATE.."  is the UPDATE string. 
  2148.  
  2149.  RC          is the expected return code.  COMET will compare the actual return 
  2150.              code with this value.  If they are not the same, an error will be 
  2151.              flagged.  If this parameter is not specified, an error will be 
  2152.              flagged if the return code is not good. 
  2153.  
  2154.  Sample Code 
  2155.  
  2156.  
  2157. ΓòÉΓòÉΓòÉ 4.7.14. Dynamic SQL Language ΓòÉΓòÉΓòÉ
  2158.  
  2159. These commands are used by COMET, but can not be issued from the test case 
  2160. input file. 
  2161.  
  2162.  DECLARE CURSOR 
  2163.  
  2164.  EXECUTE 
  2165.  
  2166.  EXECUTE IMMEDIATE 
  2167.  
  2168.  PREPARE 
  2169.  
  2170.  
  2171. ΓòÉΓòÉΓòÉ 4.8. Query Manager Callable Interface ΓòÉΓòÉΓòÉ
  2172.  
  2173. The Query Manager Callable Interface function provides a mechanism for 
  2174. executing Query Manager functions through a CPI. COMET passes Query Manager 
  2175. commands through this CPI which are then executed by Query Manager. Return 
  2176. codes and status information, resulting from the execution, are returned to 
  2177. COMET When required, Query Manger windows are displayed if the Callable 
  2178. Interface is started in Interactive mode. 
  2179.  
  2180. When adding a Query Manager Callable Interface (QRYCI) command to a COMET input 
  2181. file, the keyword QRYCI should be the first word of the instruction.  The 
  2182. actual QRYCI instruction must be enclosed in quotes. The general syntax to be 
  2183. followed when using QRYCI commands in the COMET test case input file is this: 
  2184.  
  2185. QRYCI "Query Manger command string"    [,other parameters]; 
  2186.  
  2187. The following sections describe the formats of some valid QRYCI commands. Other 
  2188. QRYCI commands (or invalid commands) may be enclosed within the quotes, if 
  2189. desired.  The character string specified in QRYCI statements are be passed 
  2190. directly to the Query Manager.  If the string specified in the input file 
  2191. contains an invalid QRYCI statement, the return code from the Query Manager 
  2192. should reflect the error. 
  2193.  
  2194.  
  2195. ΓòÉΓòÉΓòÉ 4.8.1. START ΓòÉΓòÉΓòÉ
  2196.  
  2197. Issued only once, before any other QRYCI commands to start Query Manager 
  2198. Callable Interface. 
  2199.  
  2200. SYNTAX 
  2201.  
  2202. QRYCI "START"         [,MODE=INTERACTIVE|BATCH]         [,DB=database_name] 
  2203. [,QUALIFIER=qualifier_name]         [,RC=expected_return_code]; 
  2204.  
  2205. Where: 
  2206.  
  2207.  START       is the command issued start Query Manager Callable Interface. 
  2208.  
  2209.  MODE        is the desired Query Manager Callable Interface mode of execution. 
  2210.              If the mode is batch, then user interface will not be permitted 
  2211.              since Query Manager Callable Interface will not display any panels 
  2212.              (windows). The default mode is INTERACTIVE, this means panels will 
  2213.              be displayed. For example, when a query is executed the results 
  2214.              will be displayed on a report panel and will require user 
  2215.              intervention for process continuation to next input script 
  2216.              command. 
  2217.  
  2218.  DB          The name of the database to open. If this parameter is not 
  2219.              specified, the QRYCI panel displayed will be the Query Manager 
  2220.              Databases List and one will require to be selected. 
  2221.  
  2222.  Qualifier   is the qualifier to be used. If not specified, the default is the 
  2223.              local logon id used. 
  2224.  
  2225.  RC          is the expected return code.  COMET will compare the actual return 
  2226.              code with this value.  If they are not the same, an error will be 
  2227.              flagged.  If this parameter is not specified, an error will be 
  2228.              flagged if the return code is not good. 
  2229.  
  2230.  Sample Code 
  2231.  
  2232.  
  2233. ΓòÉΓòÉΓòÉ 4.8.2. Example of QRYCI commands other than START. ΓòÉΓòÉΓòÉ
  2234.  
  2235. Used to execute objects that are located in the database. 
  2236.  
  2237. SYNTAX 
  2238.  
  2239. QRYCI "RUN QUERY query_name USING ...."         [,RC=expected_return_code]; 
  2240.  
  2241. Where: 
  2242.  
  2243.  "RUN QUERY ..." is the example QRYCI command (issued to run a predefined 
  2244.              query). 
  2245.  
  2246.  RC          is the expected return code.  COMET will compare the actual return 
  2247.              code with this value.  If they are not the same, an error will be 
  2248.              flagged.  If this parameter is not specified, an error will be 
  2249.              flagged if the return code is not good. 
  2250.  
  2251.  Sample Code 
  2252.  
  2253.  
  2254. ΓòÉΓòÉΓòÉ 4.9. ACDI (Asynchronous Communication Device Interface) commands ΓòÉΓòÉΓòÉ
  2255.  
  2256. The Communication Manager's ACDI interface supports a number of commands.  Only 
  2257. a subset of those commands are supported by COMET. The following sections 
  2258. describe the syntax to be used when including ACDI instructions in a COMET test 
  2259. case input file. 
  2260.  
  2261. Refer to General Instruction Syntax for general information about the command 
  2262. syntax. 
  2263.  
  2264. Each ACDI instruction begins with the keyword: ACDI 
  2265.  
  2266.  
  2267. ΓòÉΓòÉΓòÉ 4.9.1. ComClose ΓòÉΓòÉΓòÉ
  2268.  
  2269. Close the async communications adapter, making it unavailable for use. When 
  2270. this command is issued, the send and receive threads dropped. 
  2271.  
  2272. SYNTAX 
  2273.  
  2274. ACDI CLOSE [RC=expected_return_code]; 
  2275.  
  2276. Where: 
  2277.  
  2278.  RC          is the expected return code.  COMET will compare the actual return 
  2279.              code with this value.  If they are not the same, an error will be 
  2280.              flagged.  If this parameter is not specified, an error will be 
  2281.              flagged if the return code is not good. 
  2282.  
  2283.  Sample Code 
  2284.  
  2285.  
  2286. ΓòÉΓòÉΓòÉ 4.9.2. ComConnect ΓòÉΓòÉΓòÉ
  2287.  
  2288. Establish a connection on an ASYNC line. 
  2289.  
  2290. SYNTAX 
  2291.  
  2292. ACDI CONNECT TYPE=connection_type        [,TIMEOUT1=connect_timeout_1] 
  2293. [,TIMEOUT2=connect_timeout_2]        [,PREFIX="Telephone network prefix 
  2294. string"]        [,SUFFIX="Telephone network suffix string"] 
  2295. [,NUMBER="Telephone number"]        [,RC=expected_return_code]; 
  2296.  
  2297. Where: 
  2298.  
  2299.  TYPE        is the connection type. See the Communication Manager 
  2300.              documentation for valid values. 
  2301.  
  2302.  TIMEOUT1    is timeout value 1.  See the Communication Manager documentation 
  2303.              for valid values. 
  2304.  
  2305.  TIMEOUT2    is timeout value 2.  See the Communication Manager documentation 
  2306.              for valid values. 
  2307.  
  2308.  PREFIX      is the telephone network prefix string.  See your modem 
  2309.              documentation to see if this is required, and for valid values. 
  2310.  
  2311.  SUFFIX      is the telephone network suffix string.  See your modem 
  2312.              documentation to see if this is required, and for valid values. 
  2313.  
  2314.  NUMBER      is the telephone number to be dialed, if autocall is used. 
  2315.  
  2316.  RC          is the expected return code.  COMET will compare the actual return 
  2317.              code with this value.  If they are not the same, an error will be 
  2318.              flagged.  If this parameter is not specified, an error will be 
  2319.              flagged if the return code is not good. 
  2320.  
  2321.  Sample Code 
  2322.  
  2323.  
  2324. ΓòÉΓòÉΓòÉ 4.9.3. ComDisconnect ΓòÉΓòÉΓòÉ
  2325.  
  2326. Disconnect the Async line. 
  2327.  
  2328. SYNTAX 
  2329.  
  2330. ACDI DISCONNECT [RC=expected_return_code]; 
  2331.  
  2332. Where: 
  2333.  
  2334.  RC          is the expected return code.  COMET will compare the actual return 
  2335.              code with this value.  If they are not the same, an error will be 
  2336.              flagged.  If this parameter is not specified, an error will be 
  2337.              flagged if the return code is not good. 
  2338.  
  2339.  Sample Code 
  2340.  
  2341.  
  2342. ΓòÉΓòÉΓòÉ 4.9.4. ComOpen ΓòÉΓòÉΓòÉ
  2343.  
  2344. Open the async communications adapter, making it available for use. When this 
  2345. command is issued two background threads are created; one for sending and 
  2346. another for receiving. 
  2347.  
  2348. SYNTAX 
  2349.  
  2350. ACDI OPEN DEV=Com_Device_Name      [,RC=expected_return_code]; 
  2351.  
  2352. Where: 
  2353.  
  2354.  DEV         is the communication device name.  Valid values are COM1, COM2, 
  2355.              etc. 
  2356.  
  2357.  RC          is the expected return code.  COMET will compare the actual return 
  2358.              code with this value.  If they are not the same, an error will be 
  2359.              flagged.  If this parameter is not specified, an error will be 
  2360.              flagged if the return code is not good. 
  2361.  
  2362.  Where Com_Device_Name is COM1, COM2, etc. 
  2363.  
  2364.  Sample Code 
  2365.  
  2366.  
  2367. ΓòÉΓòÉΓòÉ 4.9.5. ComRetBitRate ΓòÉΓòÉΓòÉ
  2368.  
  2369. Get the current bit rate settings from ACDI. 
  2370.  
  2371. SYNTAX 
  2372.  
  2373. ACDI RETBIT SEND=send_bit_rate,       RCV=receive_bit_rate 
  2374. [,RC=expected_return_code]; 
  2375.  
  2376. Where: 
  2377.  
  2378.  SEND        is the send bit rate expected to be returned by the communication 
  2379.              manager.  COMET will compare this value with the value actually 
  2380.              returned from ACDI.  If they are not the same, an error will be 
  2381.              flagged. 
  2382.  
  2383.  RCV         is the receive bit rate expected to be returned by the 
  2384.              communication manager.  COMET will compare this value with the 
  2385.              value actually returned from ACDI.  If they are not the same, an 
  2386.              error will be flagged. 
  2387.  
  2388.  RC          is the expected return code.  COMET will compare the actual return 
  2389.              code with this value.  If they are not the same, an error will be 
  2390.              flagged.  If this parameter is not specified, an error will be 
  2391.              flagged if the return code is not good. 
  2392.  
  2393.  See ComSetBitRate for the valid parameter values. 
  2394.  
  2395.  Sample Code 
  2396.  
  2397.  
  2398. ΓòÉΓòÉΓòÉ 4.9.6. ComRetLineCtrl ΓòÉΓòÉΓòÉ
  2399.  
  2400. Get the current Line Control parameters from ACDI and compare the parameters to 
  2401. those specified here. 
  2402.  
  2403. SYNTAX 
  2404.  
  2405. ACDI RETLINECTRL STOPBITS=number_of_stop_bits,          PARITY=parity, 
  2406. DATABITS=number_of_data_bits          [,RC=expected_return_code]; 
  2407.  
  2408. Where: 
  2409.  
  2410.  STOPBITS    is the value expected to be returned by the communication manager 
  2411.              denoting the number of stop bits being used.  COMET will compare 
  2412.              this value with the value actually returned from ACDI. If they are 
  2413.              not the same, an error will be flagged. 
  2414.  
  2415.  PARITY      is the parity value expected to be returned by the communication 
  2416.              manager.  COMET will compare this value with the value actually 
  2417.              returned from ACDI.  If they are not the same, an error will be 
  2418.              flagged. 
  2419.  
  2420.  DATABITS    is the value expected to be returned by the communication manager 
  2421.              denoting the number of data bits being used.  COMET will compare 
  2422.              this value with the value actually returned from ACDI.  If they 
  2423.              are not the same, an error will be flagged. 
  2424.  
  2425.  RC          is the expected return code.  COMET will compare the actual return 
  2426.              code with this value.  If they are not the same, an error will be 
  2427.              flagged.  If this parameter is not specified, an error will be 
  2428.              flagged if the return code is not good. 
  2429.  
  2430.  See ComSetLineCtrl for valid values for the parameters. 
  2431.  
  2432.  Sample Code 
  2433.  
  2434.  
  2435. ΓòÉΓòÉΓòÉ 4.9.7. ComSetBitRate ΓòÉΓòÉΓòÉ
  2436.  
  2437. Set the bit rates for send and receive. 
  2438.  
  2439. SYNTAX 
  2440.  
  2441. ACDI SETBIT SEND=send_bit_rate,       RCV=receive_bit_rate 
  2442. [,RC=expected_return_code]; 
  2443.  
  2444. Where: 
  2445.  
  2446.  SEND        is the send bit rate. Valid numbers are 110, 150, 300, 600, 1200, 
  2447.              2400, and 9600. 
  2448.  
  2449.  RCV         is the receive bit rate.  Valid numbers are the same as in SEND. 
  2450.  
  2451.  RC          is the expected return code.  COMET will compare the actual return 
  2452.              code with this value.  If they are not the same, an error will be 
  2453.              flagged.  If this parameter is not specified, an error will be 
  2454.              flagged if the return code is not good. 
  2455.  
  2456.  Sample Code 
  2457.  
  2458.  
  2459. ΓòÉΓòÉΓòÉ 4.9.8. ComSetLineCtrl ΓòÉΓòÉΓòÉ
  2460.  
  2461. Set the line control parameters. 
  2462.  
  2463. SYNTAX 
  2464.  
  2465. ACDI SETLINECTRL STOPBITS=number_of_stop_bits,          PARITY=parity, 
  2466. DATABITS=number_of_data_bits          [,RC=expected_return_code]; 
  2467.  
  2468. Where: 
  2469.  
  2470.  STOPBITS    is the number of stop bits.  Valid values are 1, 1.5, or 2. 
  2471.  
  2472.  PARITY      is the parity used for each character.  Valid values are NONE, 
  2473.              ODD, EVEN, MARK, or SPACE. 
  2474.  
  2475.  DATABITS    is the number of data bits in each character.  Valid values are 5, 
  2476.              6, 7, and 8. 
  2477.  
  2478.  RC          is the expected return code.  COMET will compare the actual return 
  2479.              code with this value.  If they are not the same, an error will be 
  2480.              flagged.  If this parameter is not specified, an error will be 
  2481.              flagged if the return code is not good. 
  2482.  
  2483.  Sample Code 
  2484.  
  2485.  
  2486. ΓòÉΓòÉΓòÉ 4.9.9. ACDI SEND command ΓòÉΓòÉΓòÉ
  2487.  
  2488. This is a COMET command used to send data across the ASYNC link.  Various ACDI 
  2489. API commands will be used by COMET to accomplish the SEND function. The remote 
  2490. pc should also have an ACDI communication session started before the SEND 
  2491. command is issued. 
  2492.  
  2493. NOTE:  The ACDI SEND runs in a background thread which will be used for 
  2494. transmission of data.  This allows COMET to continue processing instructions in 
  2495. the foreground thread. Therefore, the user should make certain that the ACDI 
  2496. SEND has completed before COMET terminates, otherwise the background thread may 
  2497. be stopped and the file transfer may not be successful. The DosSleep command 
  2498. can be used in this case to stall COMET in processing succeeding instructions 
  2499. for the time specified. For more information on the DosSleep command refer to 
  2500. OS2_API commands. A future version of COMET will automatically wait for the 
  2501. data transfer to be completed before processing the next instruction. 
  2502.  
  2503. SYNTAX 
  2504.  
  2505. ACDI SEND FILE=file_specification; 
  2506.  
  2507. Where: 
  2508.  
  2509.  FILE        is the name of a file containing data to be transmitted. 
  2510.  
  2511.  
  2512. ΓòÉΓòÉΓòÉ 4.9.10. ACDI RCV command ΓòÉΓòÉΓòÉ
  2513.  
  2514. This command will be supported in a future version of COMET. 
  2515.  
  2516. This is a COMET command used when the test case expects to receive data from 
  2517. the ASYNC link.  Various ACDI API commands will be used by COMET to accomplish 
  2518. the RCV function. 
  2519.  
  2520. SYNTAX 
  2521.  
  2522. ACDI RCV FILE=file_specification; 
  2523.  
  2524. Where: 
  2525.  
  2526.  FILE        is the name of a file into which the received data should be 
  2527.              stored. 
  2528.  
  2529.  
  2530. ΓòÉΓòÉΓòÉ 4.9.11. Unsupported ACDI commands ΓòÉΓòÉΓòÉ
  2531.  
  2532. The following verbs are not supported by this version of COMET  This means that 
  2533. the COMET input file can not include these commands in the test case script. 
  2534. Some of these commands are used internally by COMET to process the SEND and 
  2535. RECEIVE functions described previously. 
  2536.  
  2537.  ComDefInputBuff 
  2538.  ComDefOutputBuff 
  2539.  ComDrainOutput 
  2540.  ComFlushInput 
  2541.  ComFlushOutput 
  2542.  ComGetLineInfo 
  2543.  ComReadBlock 
  2544.  ComReadCharString 
  2545.  ComReadEvent 
  2546.  ComRetCharXmitRate 
  2547.  ComRetErrorCharSub 
  2548.  ComRetFlowChar 
  2549.  ComRetFlowMode 
  2550.  ComRetFlowThresh 
  2551.  ComRetTimeouts 
  2552.  ComSendBreak 
  2553.  ComSetCharXmitRate 
  2554.  ComSetErrorCharSub 
  2555.  ComSetFlowChar 
  2556.  ComSetFlowMode 
  2557.  ComSetFlowThresh 
  2558.  ComSetInputMode 
  2559.  ComSetMinBreak 
  2560.  ComSetTimeouts 
  2561.  ComStartTrans 
  2562.  ComStopTrans 
  2563.  ComTransImm 
  2564.  ComUnblockThreads 
  2565.  ComWriteCharString 
  2566.  
  2567.  
  2568. ΓòÉΓòÉΓòÉ 4.10. APPC (Advanced Program to Program Communications) commands ΓòÉΓòÉΓòÉ
  2569.  
  2570. The following sections describe the commands supported by COMET for the APPC 
  2571. programming interface.  In the initial version of COMET, only Mapped 
  2572. conversations will be supported. COMET does not support program level security 
  2573. or PIP data. 
  2574.  
  2575. Before a test case containing APPC instructions can be run, the proper LU 
  2576. configurations must be set up using the Communication Manager's configuration 
  2577. utilities.  Refer to the Communication Manager Installation and Configuration 
  2578. documentation for further information. 
  2579.  
  2580.  This section is concerned only with the syntax of the COMET APPC instructions, 
  2581. and does not describe the APPC functions actually performed by the various 
  2582. verbs. Refer to an APPC manual such as the "Transaction Programmer's Guide for 
  2583. APPC," the OS/2 Communication Manager APPC Programmer's Guide, or other 
  2584. Communication Manager documentation for a more complete description of the 
  2585. meaning of the APPC verbs. 
  2586.  
  2587. Refer to General Instruction Syntax for general information about the command 
  2588. syntax. 
  2589.  
  2590. Each APPC instruction begins with the keyword: APPC 
  2591.  
  2592.  
  2593. ΓòÉΓòÉΓòÉ 4.10.1. Mc_Allocate ΓòÉΓòÉΓòÉ
  2594.  
  2595. Allocate a conversation with a remote transaction program. 
  2596.  
  2597. SYNTAX 
  2598.  
  2599. APPC MC_ALLOC [CONV=conversation_number,]        REMOTE_LU="remote_lu_alias", 
  2600. MODE="mode_name",        TP="remote_tp_name",        SYNC=<NONE | CONFIRM> 
  2601. [,PRC=expected_primary_return_code] 
  2602. [,SRC=expected_secondary_return_code]; 
  2603.  
  2604. Where: 
  2605.  
  2606.  CONV        is the conversation number (from 1 to 5).  Up to 5 conversations 
  2607.              can be running at any time.  If not specified, the default is 
  2608.              CONV=1. 
  2609.  
  2610.  REMOTE_LU   is the locally known name for the remote LU (from Communication 
  2611.              Manager Configuration). 
  2612.  
  2613.  MODE        is the mode name (from Communication Manager Configuration). 
  2614.  
  2615.  TP          is the remote Transaction Program name (the name of the program in 
  2616.              the remote machine). 
  2617.  
  2618.  SYNC        is the sync level: either NONE or CONFIRM.  NONE means a 
  2619.              synchronization level of "none" will be used.  CONFIRM means a 
  2620.              sync level of confirm will be set. 
  2621.  
  2622.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2623.              the value specified here with the value actually returned by APPC, 
  2624.              and flag an error if they are not the same. If this parameter is 
  2625.              not specified, an error will be flagged if the return code is not 
  2626.              okay. 
  2627.  
  2628.  SRC         is the secondary return code expected from APPC.  COMET will 
  2629.              compare the value specified here with the value actually returned 
  2630.              by APPC, and flag an error if they are not the same. If this 
  2631.              parameter is not specified, an error will be flagged if the return 
  2632.              code is not okay. 
  2633.  
  2634.  Sample Code 
  2635.  
  2636.  
  2637. ΓòÉΓòÉΓòÉ 4.10.2. Mc_Confirm ΓòÉΓòÉΓòÉ
  2638.  
  2639. Request the the remote transaction program confirm receipt of the data which 
  2640. has been sent. 
  2641.  
  2642. SYNTAX 
  2643.  
  2644. APPC MC_CONFIRM  [CONV=conversation_number] 
  2645. [,PRC=expected_primary_return_code] 
  2646. [,SRC=expected_secondary_return_code]; 
  2647.  
  2648. Where: 
  2649.  
  2650.  CONV        is the conversation number, to allow COMET to keep track of the 
  2651.              conversations if more than one is active at a time.  If not 
  2652.              specified, the default is CONV=1. 
  2653.  
  2654.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2655.              the value specified here with the value actually returned by APPC, 
  2656.              and flag an error if they are not the same. If this parameter is 
  2657.              not specified, an error will be flagged if the return code is not 
  2658.              okay. 
  2659.  
  2660.  SRC         is the secondary return code expected from APPC.  COMET will 
  2661.              compare the value specified here with the value actually returned 
  2662.              by APPC, and flag an error if they are not the same. If this 
  2663.              parameter is not specified, an error will be flagged if the return 
  2664.              code is not okay. 
  2665.  
  2666.  EXAMPLES 
  2667.  
  2668.  Here is an example of a confirm verb instruction. 
  2669.  
  2670.  appc CONFIRM conv=1; 
  2671.  
  2672.  Sample Code 
  2673.  
  2674.  
  2675. ΓòÉΓòÉΓòÉ 4.10.3. Mc_Confirmed ΓòÉΓòÉΓòÉ
  2676.  
  2677. Confirm the receipt of data as requested by the remote transaction program. 
  2678.  
  2679. SYNTAX 
  2680.  
  2681. APPC MC_CONFIRMED  [CONV=conversation_number] 
  2682. [,PRC=expected_primary_return_code] 
  2683. [,SRC=expected_secondary_return_code]; 
  2684.  
  2685. Where: 
  2686.  
  2687.  CONV        is the conversation number, to allow COMET to keep track of the 
  2688.              conversations if more than one is active at a time.  If not 
  2689.              specified, the default is CONV=1. 
  2690.  
  2691.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2692.              the value specified here with the value actually returned by APPC, 
  2693.              and flag an error if they are not the same. If this parameter is 
  2694.              not specified, an error will be flagged if the return code is not 
  2695.              okay. 
  2696.  
  2697.  SRC         is the secondary return code expected from APPC.  COMET will 
  2698.              compare the value specified here with the value actually returned 
  2699.              by APPC, and flag an error if they are not the same. If this 
  2700.              parameter is not specified, an error will be flagged if the return 
  2701.              code is not okay. 
  2702.  
  2703.  EXAMPLES 
  2704.  
  2705.  Here is an example of a confirmed verb instruction. 
  2706.  
  2707.  APPC confirmed conv=1; 
  2708.  
  2709.  Sample Code 
  2710.  
  2711.  
  2712. ΓòÉΓòÉΓòÉ 4.10.4. Mc_Deallocate ΓòÉΓòÉΓòÉ
  2713.  
  2714. Deallocate a conversation.  A deallocate type sync level will be issued. 
  2715.  
  2716. SYNTAX 
  2717.  
  2718. APPC MC_DEALLOC [CONV=conversation_number] 
  2719. [,PRC=expected_primary_return_code] 
  2720. [,SRC=expected_secondary_return_code]; 
  2721.  
  2722. Where: 
  2723.  
  2724.  CONV        is the conversation number, to allow COMET to keep track of the 
  2725.              conversations if more than one is active at a time.  If not 
  2726.              specified, the default is CONV=1. 
  2727.  
  2728.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2729.              the value specified here with the value actually returned by APPC, 
  2730.              and flag an error if they are not the same. If this parameter is 
  2731.              not specified, an error will be flagged if the return code is not 
  2732.              okay. 
  2733.  
  2734.  SRC         is the secondary return code expected from APPC.  COMET will 
  2735.              compare the value specified here with the value actually returned 
  2736.              by APPC, and flag an error if they are not the same. If this 
  2737.              parameter is not specified, an error will be flagged if the return 
  2738.              code is not okay. 
  2739.  
  2740.  EXAMPLE 
  2741.  
  2742.  Here is an example of a deallocate. 
  2743.  
  2744.  appc mc_dealloc conv=1; 
  2745.  
  2746.  Sample Code 
  2747.  
  2748.  
  2749. ΓòÉΓòÉΓòÉ 4.10.5. Mc_Receive_And_Wait ΓòÉΓòÉΓòÉ
  2750.  
  2751. Wait for something to arrive on a specific conversation. 
  2752.  
  2753. SYNTAX 
  2754.  
  2755. APPC MC_RCV_WAIT  [CONV=conversation_number] 
  2756. [,LENGTH=user_specified_length]          [,WHAT=< DATA_COMP | DATA_INC | SEND | 
  2757. CONF | CONF_SND | CONF_DEALLOC >]          [,< DATA="user data" 
  2758. [,DATA="more user data", ...] |           FILE=file_specification | 
  2759. CRC=file_specification >]          [,PRC=expected_primary_return_code] 
  2760. [,SRC=expected_secondary_return_code]; 
  2761.  
  2762. Where: 
  2763.  
  2764.  CONV        is the conversation number, to allow COMET to keep track of the 
  2765.              conversations if more than one is active at a time.  If not 
  2766.              specified, the default is CONV=1. 
  2767.  
  2768.  LENGTH      is the MAX LENGTH parameter, indicating the maximum amount of data 
  2769.              to be received at this time.  If not specified, the maximum length 
  2770.              of 4K (4096) will be used.  The MAX LENGTH parameter is supplied 
  2771.              to APPC to limit the amount of data returned by APPC. 
  2772.  
  2773.  WHAT        is the WHAT RECEIVED parameter.  COMET will compare this value 
  2774.              with the value actually returned by APPC.  DATA_COMP is data 
  2775.              complete.  DATA_INC is data incomplete.  SEND is the send 
  2776.              indication, changing the conversation to send state.  CONF is the 
  2777.              confirm indication. CONF_SND is confirm send.  CONF_DEALLOC is for 
  2778.              confirm deallocate. 
  2779.  
  2780.  DATA        is user specified data. The data defined here will be compared to 
  2781.              the received data.  An error will be flagged if they are not 
  2782.              equal. More than one line of data can be defined, if desired, 
  2783.              using multiple DATA= parameters.  If using DATA=, the FILE= 
  2784.              parameter must not be used. The DATA parameter is valid only if 
  2785.              the WHAT RECEIVED parameter is DATA COMPLETE or DATA INCOMPLETE. 
  2786.  
  2787.  FILE        is a pc file specification, telling COMET to store the received 
  2788.              data into the specified pc file. The FILE parameter is valid only 
  2789.              if the WHAT RECEIVED parameter is DATA COMPLETE or DATA 
  2790.              INCOMPLETE. 
  2791.  
  2792.  CRC         tells COMET to compute a checksum of the specified file, and 
  2793.              compare the computed checksum with the received data.  If the WHAT 
  2794.              RECEIVED parameter is specified, it should equal Data_Complete. 
  2795.  
  2796.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2797.              the value specified here with the value actually returned by APPC, 
  2798.              and flag an error if they are not the same. If this parameter is 
  2799.              not specified, an error will be flagged if the return code is not 
  2800.              okay. 
  2801.  
  2802.  SRC         is the secondary return code expected from APPC.  COMET will 
  2803.              compare the value specified here with the value actually returned 
  2804.              by APPC, and flag an error if they are not the same. If this 
  2805.              parameter is not specified, an error will be flagged if the return 
  2806.              code is not okay. 
  2807.  
  2808.  EXAMPLES 
  2809.  
  2810.  Here is an example of data complete being received, with the received data 
  2811.  compared with expected data. 
  2812.  
  2813.  APPC MC_RCV_WAIT CONV=1,          WHAT=DATA_COMP,          DATA="This is the 
  2814.  data I expect.",          DATA="I expect this data too."; 
  2815.  
  2816.  Here is an example asking COMET to store the received data into a file in the 
  2817.  current directory of the default drive. 
  2818.  
  2819.  APPC MC_RCV_WAIT WHAT=DATA_COMP,           FILE=myfile.ext; 
  2820.  
  2821.  This example would instruct COMET to compute a checksum on the file named 
  2822.  myfile.dat, and compare the result with the data received. 
  2823.  
  2824.  appc mc_rcv_wait conv=1,          what=data_comp, crc=myfile.dat; 
  2825.  
  2826.  This example expects to receive data incomplete, and verify the received data. 
  2827.  
  2828.  APPC MC_RCV_WAIT CONV=2, LENGTH=24,          WHAT=DATA_INC, 
  2829.  DATA="This is the data I expec"; 
  2830.  
  2831.  This example expects a send indication. 
  2832.  
  2833.  APPC MC_RCV_WAIT  CONV=1,            WHAT=SEND; 
  2834.  
  2835.  Sample Code 
  2836.  
  2837.  
  2838. ΓòÉΓòÉΓòÉ 4.10.6. Mc_Send_Data ΓòÉΓòÉΓòÉ
  2839.  
  2840. SYNTAX and EXAMPLES 
  2841.  
  2842. COMET will issue a MC_SEND_DATA command with the specified data. 
  2843.  
  2844. APPC MC_SEND_DATA [CONV=conversation_number]          < ,DATA="user data", 
  2845. [,DATA="more user data", ...] |           ,FILE=file_specification | 
  2846. ,CRC=file_specification >          [,PRC=expected_primary_return_code] 
  2847. [,SRC=expected_secondary_return_code]; 
  2848.  
  2849. Where: 
  2850.  
  2851.  CONV        is the conversation number, to allow COMET to keep track of the 
  2852.              conversations if more than one is active at a time.  If not 
  2853.              specified, the default is CONV=1. 
  2854.  
  2855.  DATA        is user specified data.  More than one line of data can be 
  2856.              defined, if desired, using multiple DATA= parameters.  If using 
  2857.              DATA=, the FILE= parameter must not be used. 
  2858.  
  2859.  FILE        is a pc file specification, telling COMET to transmit the entire 
  2860.              file. 
  2861.  
  2862.  CRC         tells COMET to compute a checksum of the specified file, and 
  2863.              transmit the results of the checksum.  The checksum is two bytes 
  2864.              long. 
  2865.  
  2866.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2867.              the value specified here with the value actually returned by APPC, 
  2868.              and flag an error if they are not the same. If this parameter is 
  2869.              not specified, an error will be flagged if the return code is not 
  2870.              okay. 
  2871.  
  2872.  SRC         is the secondary return code expected from APPC.  COMET will 
  2873.              compare the value specified here with the value actually returned 
  2874.              by APPC, and flag an error if they are not the same. If this 
  2875.              parameter is not specified, an error will be flagged if the return 
  2876.              code is not okay. 
  2877.  
  2878.  EXAMPLES: 
  2879.  
  2880.  Here is an example of a single line of data to be transmitted. 
  2881.  
  2882.  APPC MC_SEND_DATA DATA="I'm sending this data"; 
  2883.  
  2884.  Here is an example of more than one line of data being transmitted. 
  2885.  
  2886.  APPC MC_SEND_DATA CONV=1,            DATA="This is the first line of data", 
  2887.  DATA="This is the 2nd line of data"; 
  2888.  
  2889.  Here is an example of a file being sent. 
  2890.  
  2891.  APPC MC_SEND_DATA CONV=1, FILE=c:\directory\filename.ext; 
  2892.  
  2893.  This example tells COMET to compute a checksum of a file called myfile.dat, 
  2894.  and send the result to the remote program.  The remote program should issue a 
  2895.  Receive And Wait with the CRC option if it is desired to compare the checksums 
  2896.  for two files to see if they are equal. 
  2897.  
  2898.  appc mc_send_data conv=1, crc=myfile.dat; 
  2899.  
  2900.  Sample Code 
  2901.  
  2902.  
  2903. ΓòÉΓòÉΓòÉ 4.10.7. Receive_Allocate ΓòÉΓòÉΓòÉ
  2904.  
  2905. Issue a Receive Allocate verb.  COMET will wait for the allocate to be received 
  2906. before continuing with the next statement in the input file. 
  2907.  
  2908. SYNTAX 
  2909.  
  2910. APPC RECEIVE_ALLOC TP="transaction_program_name" 
  2911. [,CONV=conversation_number]           [,PRC=expected_primary_return_code] 
  2912. [,SRC=expected_secondary_return_code]           [,SYNC=<NONE | CONFIRM>] 
  2913. [,TYPE=<BASIC | MAPPED>]           [,LOCAL_LU="local_lu_alias"] 
  2914. [,PARTNER_LU="partner_lu_alias"]           [,MODE="mode_name"]; 
  2915.  
  2916. Where: 
  2917.  
  2918.  TP          is the transaction program name. 
  2919.  
  2920.  CONV        is the conversation number, to allow COMET to keep track of the 
  2921.              conversations if more than one is active at a time.  If not 
  2922.              specified, the default is CONV=1. 
  2923.  
  2924.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2925.              the value specified here with the value actually returned by APPC, 
  2926.              and flag an error if they are not the same. If this parameter is 
  2927.              not specified, an error will be flagged if the return code is not 
  2928.              okay. 
  2929.  
  2930.  SRC         is the secondary return code expected from APPC.  COMET will 
  2931.              compare the value specified here with the value actually returned 
  2932.              by APPC, and flag an error if they are not the same. If this 
  2933.              parameter is not specified, an error will be flagged if the return 
  2934.              code is not okay. 
  2935.  
  2936.  TYPE        is the expected conversation type (basic or mapped).  If not 
  2937.              specified, the returned type will be ignored. 
  2938.  
  2939.  LOCAL_LU    is the expected local LU alias.  If not specified, the returned 
  2940.              alias will not be verified. 
  2941.  
  2942.  PARTNER_LU  is the expected partner LU alias.  If not specified, the returned 
  2943.              alias will not be verified. 
  2944.  
  2945.  MODE        is the expected mode name.  If not specified, the returned mode 
  2946.              name sill be ignored. 
  2947.  
  2948.  Sample Code 
  2949.  
  2950.  
  2951. ΓòÉΓòÉΓòÉ 4.10.8. TP_Ended ΓòÉΓòÉΓòÉ
  2952.  
  2953. Tell APPC that the transaction program is ending, and will not be using the 
  2954. APPC facilities any longer.  This allows APPC to free the resources being used 
  2955. by the Transaction Program. 
  2956.  
  2957. SYNTAX 
  2958.  
  2959. APPC TP_ENDED [PRC=expected_primary_return_code] 
  2960. [,SRC=expected_secondary_return_code]; 
  2961.  
  2962. Where: 
  2963.  
  2964.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2965.              the value specified here with the value actually returned by APPC, 
  2966.              and flag an error if they are not the same. If this parameter is 
  2967.              not specified, an error will be flagged if the return code is not 
  2968.              okay. 
  2969.  
  2970.  SRC         is the secondary return code expected from APPC.  COMET will 
  2971.              compare the value specified here with the value actually returned 
  2972.              by APPC, and flag an error if they are not the same. If this 
  2973.              parameter is not specified, an error will be flagged if the return 
  2974.              code is not okay. 
  2975.  
  2976.  Sample Code 
  2977.  
  2978.  
  2979. ΓòÉΓòÉΓòÉ 4.10.9. TP_Started ΓòÉΓòÉΓòÉ
  2980.  
  2981. Register a transaction program with APPC. 
  2982.  
  2983. SYNTAX 
  2984.  
  2985. APPC TP_STARTED LOCAL_LU="lu_alias",         TP="transaction_program_name" 
  2986. [,.PRC=expected_primary_return_code] 
  2987. [,.SRC=expected_secondary_return_code]; 
  2988.  
  2989. Where: 
  2990.  
  2991.  LOCAL_LU    is the LU alias for the locally known LU name. 
  2992.  
  2993.  TP          is the transaction program name. 
  2994.  
  2995.  PRC         is the primary return code expected from APPC.  COMET will compare 
  2996.              the value specified here with the value actually returned by APPC, 
  2997.              and flag an error if they are not the same. If this parameter is 
  2998.              not specified, an error will be flagged if the return code is not 
  2999.              okay. 
  3000.  
  3001.  SRC         is the secondary return code expected from APPC.  COMET will 
  3002.              compare the value specified here with the value actually returned 
  3003.              by APPC, and flag an error if they are not the same. If this 
  3004.              parameter is not specified, an error will be flagged if the return 
  3005.              code is not okay. 
  3006.  
  3007.  Sample Code 
  3008.  
  3009.  
  3010. ΓòÉΓòÉΓòÉ 4.10.10. Unsupported APPC commands ΓòÉΓòÉΓòÉ
  3011.  
  3012. The following mapped conversation verbs are not supported by this version of 
  3013. COMET  This means that the COMET input file can not include these commands in 
  3014. the test case script.  Some of these commands are used internally by COMET to 
  3015. process the SEND and RECEIVE functions described previously. Please also note 
  3016. that none of the Basic conversation APPC verbs are supported by COMET 
  3017.  
  3018.  Mc_Flush 
  3019.  Mc_Get_Attributes 
  3020.  Mc_Prepare_To_Receive 
  3021.  Mc_Receive_Immediate 
  3022.  Mc_Receive_And_Post 
  3023.  Mc_Request_To_Send 
  3024.  Mc_Send_Error 
  3025.  Mc_Test_RTS 
  3026.  
  3027.  
  3028. ΓòÉΓòÉΓòÉ 4.11. SRPI (Server/Requester Programming Interface) commands ΓòÉΓòÉΓòÉ
  3029.  
  3030. There is only one command supported by COMET for the SRPI programming 
  3031. interface, since the SRPI interface itself only has a single verb.  That is the 
  3032. Send_Request verb. 
  3033.  
  3034. Refer to General Instruction Syntax for general information about the command 
  3035. syntax. 
  3036.  
  3037. Each SRPI instruction begins with the keyword: SRPI 
  3038.  
  3039.  
  3040. ΓòÉΓòÉΓòÉ 4.11.1. Send_Request ΓòÉΓòÉΓòÉ
  3041.  
  3042. Issues a SEND_REQUEST verb to the SRPI interface. 
  3043.  
  3044. SYNTAX 
  3045.  
  3046. SRPI SENDREQ  SERVER="server_name",        FUNCTION=function_id 
  3047. [,<PARM="request parameters",| PFILE=filename.ext>]        [,<DATA="request 
  3048. data"| DFILE=filename.ext>]        [,RCSRPI=srpi_return_code] 
  3049. [,RCSRVR=server_return_code]        [,<RPARM="reply parameters"| 
  3050. RPFILE=filename.ext>]        [,<RDATA="reply data"| RDFILE=filename.ext>]; 
  3051.  
  3052. Where: 
  3053.  
  3054.  SERVER      is the server name.  This should be an 8 ASCII character string 
  3055.              enclosed in quotes. If the server name is less than 8 characters 
  3056.              long, then the string within the quotes should be padded with 
  3057.              spaces. See the Communication Manager SRPI Server profiles for the 
  3058.              valid server_names which are configured to be called from the PC 
  3059.              being used. 
  3060.  
  3061.  FUNCTION    is the Function_ID. This is a number made up of 4 hex digits (from 
  3062.              0000 to FFFF).  Valid function codes are determined by the SRPI 
  3063.              server (specified in the SERVER parameter).  See the server's 
  3064.              documentation for valid function_id's. 
  3065.  
  3066.  PARM        is a Request Parameter string.  This is a character string 
  3067.              enclosed in quotes. The data specified will be copied into the 
  3068.              request parameter buffer which is sent to the SRPI interface. If 
  3069.              this parameter is used, the PFILE parameter may not be specified. 
  3070.  
  3071.  PFILE        is a Request Parameter file.  This is a PC filename 
  3072.              specification. The specified file should contain all of the 
  3073.              Request Parameters to be copied into the request parameter buffer. 
  3074.              If this parameter is used, the PARM parameter may not be 
  3075.              specified. 
  3076.  
  3077.  DATA        is a Request Data string.  This is a character string enclosed in 
  3078.              quotes. The data specified will be copied into the request data 
  3079.              buffer which is sent to the SRPI interface.  If this parameter is 
  3080.              used, the DFILE parameter may not be specified. 
  3081.  
  3082.  DFILE       is a Request Data file.  This is a PC filename specification.  The 
  3083.              specified file should contain all of the Request Data to be copied 
  3084.              into the request data buffer.  If this parameter is used, the DATA 
  3085.              parameter may not be specified. 
  3086.  
  3087.  RCSRPI      is the expected SRPI Return Code.  This is a number made up of 8 
  3088.              hex digits representing a 4 byte SRPI return code.  See the 
  3089.              Communication Manager SRPI documentation for valid values.  COMET 
  3090.              will compare the value specified in this parameter with the return 
  3091.              code actually received from SRPI.  If they don't match, an error 
  3092.              is logged. If this parameter is not specified, an error will be 
  3093.              flagged if the return code is not okay. 
  3094.  
  3095.  RCSRVR      is the expected Server Return Code.  This is a number made up of 8 
  3096.              hex digits representing a 4 byte server return code.  Valid values 
  3097.              for this parameter are defined by the server specified in the 
  3098.              SERVER parameter.  COMET will compare the value specified in this 
  3099.              parameter with the return code actually received from SRPI. If 
  3100.              they don't match, an error is logged. If this parameter is not 
  3101.              specified, an error will be flagged if the return code is not 
  3102.              zero. 
  3103.  
  3104.  RPARM       is a Reply Parameter string.  The data specified here will be 
  3105.              compared with the data returned from the Server at the completion 
  3106.              of the SRPI function call.  An error will be flagged if they are 
  3107.              not equal.  More than one RPARM line may be specified.  If the 
  3108.              RPARM parameter is specified, the RPFILE parameter must not be 
  3109.              used. 
  3110.  
  3111.  RPFILE      Reply Parameter file.  This is a PC filename specification.  If 
  3112.              this parameter is specified, the indicated file will be opened and 
  3113.              the reply parameters (returned from the server), if any, will be 
  3114.              stored into the file. No validation is done on the reply 
  3115.              parameters which are received.  If validation is desired, the OS2 
  3116.              SHELL instruction may be used to compare this file with another 
  3117.              file containing the expected reply parameters. If this parameter 
  3118.              is specified, the RPARM parameter must not be used. 
  3119.  
  3120.  RDATA       is a Reply Data string.  The data specified here will be compared 
  3121.              with the data returned from the Server at the completion of the 
  3122.              SRPI function call.  An error will be flagged if they are not 
  3123.              equal.  More than one RDATA line may be specified.  If the RDATA 
  3124.              parameter is specified, the RDFILE parameter must not be used. 
  3125.  
  3126.  RDFILE      is a Reply Data file.  This is a PC filename specification.  If 
  3127.              this parameter is specified, the indicated file will be opened and 
  3128.              the reply data (returned from the server), if any, will be stored 
  3129.              into the file. No validation is done on the received reply data. 
  3130.              If validation is desired, the OS2 SHELL instruction may be used to 
  3131.              compare this file with another file containing the expected reply 
  3132.              data. If this parameter is specified, the RDATA parameter must not 
  3133.              be used. 
  3134.  
  3135.  Sample Code 
  3136.  
  3137.  
  3138. ΓòÉΓòÉΓòÉ 4.12. IEEE 802.2 API ΓòÉΓòÉΓòÉ
  3139.  
  3140. The Communication Manager's 802.2 API provides access to the functions provided 
  3141. by the different local area networks available on the PC. It can be used to 
  3142. communicate on Token Ring, PC Network Baseband, or PC Network Broadband 
  3143. networks.  See the Local Area Network Technical Reference for more detailed 
  3144. information about the 802.2 commands. 
  3145.  
  3146.  
  3147. ΓòÉΓòÉΓòÉ 4.12.1. Dir_Close_Adapter ΓòÉΓòÉΓòÉ
  3148.  
  3149. Terminate the network communications on a LAN adapter, and close the adapter. 
  3150. There are two types of Close which can be done: logical and physical.  If the 
  3151. system key is specified, (the KEY parameter, below), then a physical close of 
  3152. the adapter is done, which results in the termination of all communication on 
  3153. the specified adapter. If the system key is not used, then a logical close is 
  3154. done. 
  3155.  
  3156. SYNTAX 
  3157.  
  3158. 802.2  DIR_CLOSE_ADAPTER  [ADAPTER=number]               [,KEY=system_key] 
  3159. [,RC=expected_return_code]; 
  3160.  
  3161. Where: 
  3162.  
  3163.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3164.              numbers, although any number may be specified. The adapter number 
  3165.              is a configuration parameter of the LAN adapter used in the PC. If 
  3166.              not specified, this defaults to the value used in the last 
  3167.              Dir.Open.Adapter command processed by COMET. 
  3168.  
  3169.  KEY         is the system key, which may be needed to successfully complete 
  3170.              the close adapter command. The system key is needed if it was 
  3171.              defined when creating the LAN definitions in the Communications 
  3172.              Manager's configuration file. 
  3173.  
  3174.  RC          is the expected return code.  COMET will compare the actual return 
  3175.              code with this value.  If they are not the same, an error will 
  3176.              logged.  If this parameter is not specified, an error will be 
  3177.              logged if the return code is not good. 
  3178.  
  3179.  Sample Code 
  3180.  
  3181.  
  3182. ΓòÉΓòÉΓòÉ 4.12.2. Dir_Initialize ΓòÉΓòÉΓòÉ
  3183.  
  3184. Initilize the adapter support program, reset adapter tables and buffers, and 
  3185. run start-up tests on the LAN adapter. 
  3186.  
  3187. SYNTAX 
  3188.  
  3189. 802.2  DIR_INITIALIZE  [ADAPTER=number,]             KEY=system_key 
  3190. [,RC=expected_return_code]; 
  3191.  
  3192. Where 
  3193.  
  3194.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3195.              numbers, although any number may be specified. The adapter number 
  3196.              is a configuration parameter of the LAN adapter used in the PC. If 
  3197.              not specified, this defaults to the value used in the last 
  3198.              Dir.Open.Adapter command processed by COMET. 
  3199.  
  3200.  KEY         is the system key, which is necessary to allow completion of this 
  3201.              command.  The system key is set in the Communications Manager's 
  3202.              configuration file, when creating the LAN definitions. 
  3203.  
  3204.  RC          is the expected return code.  COMET will compare the actual return 
  3205.              code with this value.  If they are not the same, an error will 
  3206.              logged.  If this parameter is not specified, an error will be 
  3207.              logged if the return code is not good. 
  3208.  
  3209.  
  3210. ΓòÉΓòÉΓòÉ 4.12.3. Dir_Open_Adapter ΓòÉΓòÉΓòÉ
  3211.  
  3212. Make a LAN adapter ready for communication. 
  3213.  
  3214. SYNTAX 
  3215.  
  3216. 802.2  DIR_OPEN_ADAPTER  [,ADAPTER=number] 
  3217. [,NODE_ADDRESS=hex_number]              [,GROUP_ADDRESS=hex_number] 
  3218. [,FUNCTIONAL_ADDRESS=hex_number]              [,MAX_SAP=number] 
  3219. [,MAX_STATION=number]              [,OPEN_OPTIONS=hex_number] 
  3220. [,RC=expected_return_code]; 
  3221.  
  3222. Where 
  3223.  
  3224.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3225.              numbers, although any number may be specified. The adapter number 
  3226.              is a configuration parameter of the LAN adapter used in the PC. If 
  3227.              not specified, this defaults to 0. 
  3228.  
  3229.  NODE_ADDRESS The desired adapter network address.  This should be specified as 
  3230.              a 6 byte hex number of the form x'nnnnnnnnnnnn'. If not specified, 
  3231.              the default is adapter's encoded address. 
  3232.  
  3233.  GROUP_ADDRESS The desired adapter group network address. If not specified, 
  3234.              this defaults to 0. 
  3235.  
  3236.  FUNCTIONAL_ADDRESS The desired adapter functional network address. If not 
  3237.              specified, this defaults to 0. 
  3238.  
  3239.  MAX_SAP     The maximum number of SAPs to be allowed. If not specified, this 
  3240.              defaults to 10.  The maximum allowed by COMET is 10. 
  3241.  
  3242.  MAX_STATION The maximum number of link stations to be allowed. If not 
  3243.              specified, this defaults to 10.  The maximum allowed by COMET is 
  3244.              100. 
  3245.  
  3246.  OPEN_OPTIONS is a two byte field which should be specified as a hex number 
  3247.              with the following format:  x'nnnn'. See the LAN Technical 
  3248.              Reference manual for details on the content of this field.  If not 
  3249.              specified, this defaults to x'0100'. 
  3250.  
  3251.  RC          is the expected return code.  COMET will compare the actual return 
  3252.              code with this value.  If they are not the same, an error will 
  3253.              logged.  If this parameter is not specified, an error will be 
  3254.              logged if the return code is not good. 
  3255.  
  3256.  Sample Code 
  3257.  
  3258.  
  3259. ΓòÉΓòÉΓòÉ 4.12.4. Dir_Status ΓòÉΓòÉΓòÉ
  3260.  
  3261. Get the current status information for the LAN adapter. 
  3262.  
  3263. All of the parameters except ADAPTER are used for verification of the 
  3264. parameters returned by the 802.2 interface.  COMET will compare the values 
  3265. listed in the input file with those actually returned from the interface.  If 
  3266. the values are not the same, an error will be logged. 
  3267.  
  3268. SYNTAX 
  3269.  
  3270. 802.2  DIR_STATUS  [ADAPTER=number]           [,NODE_ADDRESS=hex_number] 
  3271. [,GROUP_ADDRESS=hex_number]           [,FUNCTIONAL_ADDRESS=hex_number] 
  3272. [,MAX_SAP=number]           [,OPEN_SAP=number]           [,MAX_STATION=number] 
  3273. [,OPEN_STATION=number]           [,AVAIL_STATION=number] 
  3274. [,ADAPTER_TYPE=hex_number]           [,RC=expected_return_code]; 
  3275.  
  3276. Where 
  3277.  
  3278.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3279.              numbers, although any number may be specified. The adapter number 
  3280.              is a configuration parameter of the LAN adapter used in the PC. If 
  3281.              not specified, this defaults to the value used in the last 
  3282.              Dir.Open.Adapter command processed by COMET. 
  3283.  
  3284.  NODE_ADDRESS The adapter's network address (as set by the dir.open.adapter 
  3285.              command). If not specified, this defaults to the adapter encoded 
  3286.              address. 
  3287.  
  3288.  GROUP_ADDRESS The adapter's group network address (as set by the 
  3289.              dir.open.adapter command). 
  3290.  
  3291.  FUNCTIONAL_ADDRESS The adapter's functional network address (as set by the 
  3292.              dir.open.adapter command). 
  3293.  
  3294.  MAX_SAP     The maximum number of SAPs allowed (as set by the dir.open.adapter 
  3295.              command). 
  3296.  
  3297.  OPEN_SAP    The number of SAPs that are currently open (by dlc.open.sap 
  3298.              commands). 
  3299.  
  3300.  MAX_STATION The maximum number of link stations allowed (as set by the 
  3301.              dir.open.adapter command). 
  3302.  
  3303.  OPEN_STATION The number of link stations currently open (by dlc.open.station 
  3304.              commands). 
  3305.  
  3306.  AVAIL_STATION The number of link stations that have not been reserved by 
  3307.              dlc.open.sap commands. 
  3308.  
  3309.  ADAPTER_TYPE The network adapter type.  The adapter types which currently may 
  3310.              be returned are as follows: 
  3311.  
  3312.     x'0001'   Token Ring Network PC Adapter 
  3313.     x'0002'   Token Ring Network PC Adapter II 
  3314.     x'0004'   Token Ring Network 16/4 Mbps Adapter 
  3315.     x'0008'   Token Ring Network Adapter/A 
  3316.     x'0010'   Token Ring Network Adapter/A (short version) 
  3317.     x'0012'   Token Ring Network 16/4 Mbps Adapter/A 
  3318.     x'4000'   PC Network Adapter 
  3319.     x'8000'   PC Network Adapter 
  3320.  
  3321.  RC          is the expected return code.  COMET will compare the actual return 
  3322.              code with this value.  If they are not the same, an error will 
  3323.              logged.  If this parameter is not specified, an error will be 
  3324.              logged if the return code is not good. 
  3325.  
  3326.  
  3327. ΓòÉΓòÉΓòÉ 4.12.5. Dlc_Close_SAP ΓòÉΓòÉΓòÉ
  3328.  
  3329. Close (deactivate) a Service Access Point.  If successful, communication will 
  3330. no longer be allowed through the specified SAP. 
  3331.  
  3332. SYNTAX 
  3333.  
  3334. 802.2  DLC_CLOSE_SAP  [ADAPTER=adapter_number,]             SAP=sap_number 
  3335. [,RC=expected_return_code]; 
  3336.  
  3337. Where 
  3338.  
  3339.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3340.              numbers, although any number may be specified. The adapter number 
  3341.              is a configuration parameter of the LAN adapter used in the PC. If 
  3342.              not specified, this defaults to the value used in the last 
  3343.              Dir.Open.Adapter command processed by COMET. 
  3344.  
  3345.  SAP         is the sap number.  It can be specified in hex or decimal. Only 
  3346.              values from 0 to 255 (x'0' to x'ff') are allowed. 
  3347.  
  3348.  RC          is the expected return code.  COMET will compare the actual return 
  3349.              code with this value.  If they are not the same, an error will 
  3350.              logged.  If this parameter is not specified, an error will be 
  3351.              logged if the return code is not good. 
  3352.  
  3353.  Sample Code 
  3354.  
  3355.  
  3356. ΓòÉΓòÉΓòÉ 4.12.6. Dlc_Close_Station ΓòÉΓòÉΓòÉ
  3357.  
  3358. Close (deactivate) a link station.  If successful, communication will no longer 
  3359. be allowed through the specified link station. 
  3360.  
  3361. SYNTAX 
  3362.  
  3363. 802.2  DLC_CLOSE_STATION  [ADAPTER=adapter_number,] 
  3364. SAP=sap_number,               STATION=link_station_number 
  3365. [,RC=expected_return_code]; 
  3366.  
  3367. Where 
  3368.  
  3369.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3370.              numbers, although any number may be specified. The adapter number 
  3371.              is a configuration parameter of the LAN adapter used in the PC. If 
  3372.              not specified, this defaults to the value used in the last 
  3373.              Dir.Open.Adapter command processed by COMET. 
  3374.  
  3375.  SAP         is the sap number.  It can be specified in hex or decimal. Only 
  3376.              values from 0 to 255 (x'0' to x'ff') are allowed. 
  3377.  
  3378.  STATION     is the link station number.  It can be specified in hex or 
  3379.              decimal.  Only values of 0 to 255 (x'0' to x'ff') are allowed. 
  3380.  
  3381.  RC          is the expected return code.  COMET will compare the actual return 
  3382.              code with this value.  If they are not the same, an error will 
  3383.              logged.  If this parameter is not specified, an error will be 
  3384.              logged if the return code is not good. 
  3385.  
  3386.  Sample Code 
  3387.  
  3388.  
  3389. ΓòÉΓòÉΓòÉ 4.12.7. Dlc_Connect_Station ΓòÉΓòÉΓòÉ
  3390.  
  3391. Start communication between a local and a remote link station. If successful, 
  3392. the link stations enter a data transfer state. 
  3393.  
  3394. SYNTAX 
  3395.  
  3396. 802.2  DLC_CONNECT_STATION  [ADAPTER=adapter_number,] 
  3397. SAP=sap_number,              STATION=link_station_number 
  3398. [,RC=expected_return_code]; 
  3399.  
  3400. Where 
  3401.  
  3402.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3403.              numbers, although any number may be specified. The adapter number 
  3404.              is a configuration parameter of the LAN adapter used in the PC. If 
  3405.              not specified, this defaults to the value used in the last 
  3406.              Dir.Open.Adapter command processed by COMET. 
  3407.  
  3408.  SAP         is the number of the SAP to be used.  This is the same number as 
  3409.              was used when issuing the dlc.open.sap command. 
  3410.  
  3411.  STATION     is the link station to be used.  This is the same number as was 
  3412.              used when issuing the dlc_open_station command. This field should 
  3413.              be specified as a decimal number from 1 to 10, since there is a 
  3414.              maximum of 10 link stations per SAP. 
  3415.  
  3416.  RC          is the expected return code.  COMET will compare the actual return 
  3417.              code with this value.  If they are not the same, an error will 
  3418.              logged.  If this parameter is not specified, an error will be 
  3419.              logged if the return code is not good. 
  3420.  
  3421.  Sample Code 
  3422.  
  3423.  
  3424. ΓòÉΓòÉΓòÉ 4.12.8. Dlc_Flow_Control ΓòÉΓòÉΓòÉ
  3425.  
  3426. Set or Reset a local busy condition. 
  3427.  
  3428. SYNTAX 
  3429.  
  3430. 802.2  DLC_FLOW_CONTROL [ADAPTER=adapter_number,]             SAP=sap_number 
  3431. [,STATION=link_station_number]             [,SET_USER_BUSY=YES|NO] 
  3432. [,RESET=USER|BUFFER|NO]             [,RC=expected_return_code]; 
  3433.  
  3434. Where 
  3435.  
  3436.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3437.              numbers, although any number may be specified. The adapter number 
  3438.              is a configuration parameter of the LAN adapter used in the PC. If 
  3439.              not specified, this defaults to the value used in the last 
  3440.              Dir.Open.Adapter command processed by COMET. 
  3441.  
  3442.  SAP         is the sap number, specified as a decimal number from 1 to 10. Ten 
  3443.              local saps will be allowed.  This parameter is used as an index 
  3444.              into a table in which the actual SAP station id will be saved when 
  3445.              it is returned from the 802.2 interface. 
  3446.  
  3447.  STATION     is the link station to be used.  This is the same number as was 
  3448.              used when issuing the dlc_open_station command. This field should 
  3449.              be specified as a decimal number from 1 to 10, since there is a 
  3450.              maximum of 10 link stations per SAP. 
  3451.  
  3452.  SET_USER_BUSY tells the 802.2 interface whether or not to set a user local 
  3453.              busy condition. The valid options are YES and NO. Either 
  3454.              SET_USER_BUSY or RESET must be specified in order for the flow 
  3455.              control instruction to be called by COMET. SET_USER_BUSY and RESET 
  3456.              together are an invalid combination. 
  3457.  
  3458.  RESET       tells the 802.2 interface whether or not to remove a local busy 
  3459.              condition and the type of local busy condition which will be 
  3460.              removed. The valid options are USER, BUFFER, and NO. 
  3461.  
  3462.  RC          is the expected return code.  COMET will compare the actual return 
  3463.              code with this value.  If they are not the same, an error will 
  3464.              logged.  If this parameter is not specified, an error will be 
  3465.              logged if the return code is not good. 
  3466.  
  3467.  Sample Code 
  3468.  
  3469.  
  3470. ΓòÉΓòÉΓòÉ 4.12.9. Dlc_Open_Sap ΓòÉΓòÉΓòÉ
  3471.  
  3472. Allocate resources for a link station. 
  3473.  
  3474. SYNTAX 
  3475.  
  3476. 802.2  DLC_OPEN_SAP  [ADAPTER=adapter_number,]            SAP=sap_number 
  3477. [,TIMER_T1=response_timer_value]            [,TIMER_T2=acknowledge_timer_value] 
  3478. [,TIMER_TI=inactivity_timer_value]            [,MAXIN=max_receive_count] 
  3479. [,MAXOUT=max_transmit_count]            [,MAX_RETRY=max_retry_count] 
  3480. [,STATION_COUNT=link_station_count]            [,RC=expected_return_code]; 
  3481.  
  3482. Where 
  3483.  
  3484.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3485.              numbers, although any number may be specified. The adapter number 
  3486.              is a configuration parameter of the LAN adapter used in the PC. If 
  3487.              not specified, this defaults to the value used in the last 
  3488.              Dir.Open.Adapter command processed by COMET. 
  3489.  
  3490.  SAP         is the sap number, specified as a decimal number from 1 to 10. Ten 
  3491.              local saps will be allowed.  This parameter is used as an index 
  3492.              into a table in which the actual SAP station id will be saved when 
  3493.              it is returned from the 802.2 interface. 
  3494.  
  3495.  TIMER_T1    is the response timer value (in seconds).  Any value from 0 to 255 
  3496.              may be entered, but only values from 0 to 10 are valid. If not 
  3497.              specified, COMET specifies a value of 0, which causes 802.2 to use 
  3498.              its default value. 
  3499.  
  3500.  TIMER_T2    is the acknowledgement timer value (in seconds), which specifies 
  3501.              how long to delay the transmission of an acknowledgement frame. 
  3502.              Any value from 0 to 255 may be entered, but only values from 0 to 
  3503.              10 are valid. If not specified, COMET specifies a value of 0, 
  3504.              which causes 802.2 to use its default value. 
  3505.  
  3506.  TIMER_TI    is the inactivity timer value (in seconds), used to determine when 
  3507.              an inactive condition exists on the link.  Any value from 0 to 255 
  3508.              may be entered, but only values from 0 to 10 are valid. If not 
  3509.              specified, COMET specifies a value of 0, which causes 802.2 to use 
  3510.              its default value. 
  3511.  
  3512.  MAXIN       is the maximum number of information frames that may be received 
  3513.              by this SAP before an acknowledgement must be sent.  This 
  3514.              basically corresponds to the number of receive buffers available 
  3515.              for the SAP. Any value from 0 to 255 may be entered, but only 
  3516.              values from 0 to 127 are valid. If not specified, COMET specifies 
  3517.              a value of 0, which causes 802.2 to use its default value. 
  3518.  
  3519.  MAXOUT      is the maximum number of frames which may be transmitted before 
  3520.              requiring an acknowledgement from the remote station. Any value 
  3521.              from 0 to 255 may be entered, but only values from 0 to 127 are 
  3522.              valid. If not specified, COMET specifies a value of 0, which 
  3523.              causes 802.2 to use its default value. 
  3524.  
  3525.  MAX_RETRY   is the maximum number of times a frame should be retried when it 
  3526.              is not acknowledged by the remote station.  This is used in 
  3527.              conjunction with the response timer value (TIMER_T1). Any value 
  3528.              from 0 to 255 may be entered. 
  3529.  
  3530.  STATION_COUNT is the number of link stations to reserve for this SAP. The 
  3531.              maximum value supported by COMET is 100. If not specified, the 
  3532.              default used by COMET is 2. 
  3533.  
  3534.  RC          is the expected return code.  COMET will compare the actual return 
  3535.              code with this value.  If they are not the same, an error will 
  3536.              logged.  If this parameter is not specified, an error will be 
  3537.              logged if the return code is not good. 
  3538.  
  3539.  Sample Code 
  3540.  
  3541.  
  3542. ΓòÉΓòÉΓòÉ 4.12.10. Dlc_Open_Station ΓòÉΓòÉΓòÉ
  3543.  
  3544. Allocate resources for a link station. 
  3545.  
  3546. SYNTAX 
  3547.  
  3548. 802.2  DLC_OPEN_STATION   [ADAPTER=adapter_number,] 
  3549. SAP=sap_number,               STATION=link_station_number, 
  3550. RSAP=remote_sap_number,               DEST_NODE_ADDR=destination_node_address 
  3551. [,RC=expected_return_code]; 
  3552.  
  3553. Where 
  3554.  
  3555.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3556.              numbers, although any number may be specified. The adapter number 
  3557.              is a configuration parameter of the LAN adapter used in the PC. If 
  3558.              not specified, this defaults to the value used in the last 
  3559.              Dir.Open.Adapter command processed by COMET. 
  3560.  
  3561.  SAP         is the sap number, specified as a decimal number from 1 to 10. Ten 
  3562.              local saps will be allowed.  This parameter is used as an index 
  3563.              into a table in which the actual SAP station id will be saved when 
  3564.              it is returned from the 802.2 interface. 
  3565.  
  3566.  STATION     is the link station number, specified as a decimal number from 1 
  3567.              to 10.  There are 10 link stations allowed per SAP, so a total of 
  3568.              100 link stations are available (since 10 SAPs are allowed). 
  3569.  
  3570.  RSAP        is the remote sap number.  This is the sap number used on the 
  3571.              remote PC when issuing the dlc.open.sap command. 
  3572.  
  3573.  DEST_NODE_ADDR is the destination node address.  This is the address used by 
  3574.              the LAN adapter on the remote PC.  It is set when the remote PC 
  3575.              issues a dir.open.adapter command.  This is a 6 byte hex number, 
  3576.              and should be specified with the form: x'nnnnnnnnnnnn'. 
  3577.  
  3578.  RC          is the expected return code.  COMET will compare the actual return 
  3579.              code with this value.  If they are not the same, an error will 
  3580.              logged.  If this parameter is not specified, an error will be 
  3581.              logged if the return code is not good. 
  3582.  
  3583.  Sample Code 
  3584.  
  3585.  
  3586. ΓòÉΓòÉΓòÉ 4.12.11. Dlc_Statistics ΓòÉΓòÉΓòÉ
  3587.  
  3588. Display 802.2 resource statistics for a SAP or a link station. 
  3589.  
  3590. SYNTAX 
  3591.  
  3592. 802.2  DLC_STATISTICS  [ADAPTER=adapter_number,]             SAP=sap_number 
  3593. [,STATION=link_station_number]             [,COUNTER_RESET=YES|NO] 
  3594. [,FILE=file_name]             [,DISPLAY=YES|NO] 
  3595. [,RC=expected_return_code]; 
  3596.  
  3597. Where 
  3598.  
  3599.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3600.              numbers, although any number may be specified. The adapter number 
  3601.              is a configuration parameter of the LAN adapter used in the PC. If 
  3602.              not specified, this defaults to the value used in the last 
  3603.              Dir.Open.Adapter command processed by COMET. 
  3604.  
  3605.  SAP         is the sap number, specified as a decimal number from 1 to 10. Ten 
  3606.              local saps will be allowed.  This parameter is used as an index 
  3607.              into a table in which the actual SAP station id will be saved when 
  3608.              it is returned from the 802.2 interface. 
  3609.  
  3610.  STATION     is the link station to be used.  This is the same number as was 
  3611.              used when issuing the dlc_open_station command. This field should 
  3612.              be specified as a decimal number from 1 to 10, since there is a 
  3613.              maximum of 10 link stations per SAP. 
  3614.  
  3615.  COUNTER_RESET tells whether or not to reset certain statistics counter values. 
  3616.              The valid options are YES and NO. The default is NO. 
  3617.  
  3618.  FILE        is the name of a file in which status information will be stored. 
  3619.  
  3620.  DISPLAY     tells COMET to display status information to the screen. The valid 
  3621.              options are YES and NO. YES is the default if this parameter is 
  3622.              not specified. 
  3623.  
  3624.  RC          is the expected return code.  COMET will compare the actual return 
  3625.              code with this value.  If they are not the same, an error will 
  3626.              logged.  If this parameter is not specified, an error will be 
  3627.              logged if the return code is not good. 
  3628.  
  3629.  
  3630. ΓòÉΓòÉΓòÉ 4.12.12. Read ΓòÉΓòÉΓòÉ
  3631.  
  3632. The READ command is used either to receive a connection from another PC (when 
  3633. it issues a dlc_connect_station command) or to receive data from another PC 
  3634. (when it issues a transmit_I_frame command). User and buffer local busy 
  3635. conditions are implicitly disarmed by having COMET call the flow_control 
  3636. instruction. 
  3637.  
  3638. SYNTAX 
  3639.  
  3640. 802.2  READ  [ADAPTER=adapter_number,]          EVENT_SET=<CONNECT || RECEIVE> 
  3641. [,SAP=sap_number]          [,STATION=link_station_number]          [,DATA="user 
  3642. data string"]          [,RC=expected_return_code]; 
  3643.  
  3644. Where 
  3645.  
  3646.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3647.              numbers, although any number may be specified. The adapter number 
  3648.              is a configuration parameter of the LAN adapter used in the PC. If 
  3649.              not specified, this defaults to the value used in the last 
  3650.              Dir.Open.Adapter command processed by COMET. 
  3651.  
  3652.  EVENT_SET   is the type of event which is expected.  If expecting a remote PC 
  3653.              to attempt to open a connection to this PC, then the CONNECT 
  3654.              option should be used.  If expecting data from a remote PC, then 
  3655.              the RECEIVE option should be used. 
  3656.  
  3657.  SAP         is the number of the sap expecting the link connection. The sap 
  3658.              number is as set in the open sap command. 
  3659.  
  3660.  STATION     is the link station number to be used for the expected connection. 
  3661.  
  3662.  DATA        is the user defined data which is expected from the remote PC. 
  3663.              This parameter is valid only if the RECEIVE option is specified in 
  3664.              the EVENT_SET parameter (above). 
  3665.  
  3666.  RC          is the expected return code.  COMET will compare the actual return 
  3667.              code with this value.  If they are not the same, an error will 
  3668.              logged.  If this parameter is not specified, an error will be 
  3669.              logged if the return code is not good. 
  3670.  
  3671.  Sample Code 
  3672.  
  3673.  
  3674. ΓòÉΓòÉΓòÉ 4.12.13. Receive ΓòÉΓòÉΓòÉ
  3675.  
  3676. Initiate a receive for a sap or link station.  To actually receive data or a 
  3677. connection request from another PC, use the READ command after issuing the 
  3678. RECEIVE. 
  3679.  
  3680. SYNTAX 
  3681.  
  3682. 802.2  RECEIVE  [ADAPTER=adapter_number,]          SAP=sap_number 
  3683. [,STATION=link_station_number]          [,RC=expected_return_code]; 
  3684.  
  3685. Where 
  3686.  
  3687.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3688.              numbers, although any number may be specified. The adapter number 
  3689.              is a configuration parameter of the LAN adapter used in the PC. If 
  3690.              not specified, this defaults to the value used in the last 
  3691.              Dir.Open.Adapter command processed by COMET. 
  3692.  
  3693.  SAP         is the sap number, as set in the open sap command. 
  3694.  
  3695.  STATION     is the link station number, as used in the open station and 
  3696.              connect station commands. 
  3697.  
  3698.  RC          is the expected return code.  COMET will compare the actual return 
  3699.              code with this value.  If they are not the same, an error will 
  3700.              logged.  If this parameter is not specified, an error will be 
  3701.              logged if the return code is not good. 
  3702.  
  3703.  Sample Code 
  3704.  
  3705.  
  3706. ΓòÉΓòÉΓòÉ 4.12.14. Receive_Cancel ΓòÉΓòÉΓòÉ
  3707.  
  3708. Cancels an outstanding receive for a sap or link_station. 
  3709.  
  3710. SYNTAX 
  3711.  
  3712. 802.2  RECEIVE_CANCEL  [ADAPTER=adapter_number,]          SAP=sap_number 
  3713. [,STATION=link_station_number]          [,RC=expected_return_code]; 
  3714.  
  3715. Where 
  3716.  
  3717.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3718.              numbers, although any number may be specified. The adapter number 
  3719.              is a configuration parameter of the LAN adapter used in the PC. If 
  3720.              not specified, this defaults to the value used in the last 
  3721.              Dir.Open.Adapter command processed by COMET. 
  3722.  
  3723.  SAP         is the sap number, as set in the open sap command. 
  3724.  
  3725.  STATION     is the link station number, as used in the open station and 
  3726.              connect station commands. 
  3727.  
  3728.  RC          is the expected return code.  COMET will compare the actual return 
  3729.              code with this value.  If they are not the same, an error will 
  3730.              logged.  If this parameter is not specified, an error will be 
  3731.              logged if the return code is not good. 
  3732.  
  3733.  Sample Code 
  3734.  
  3735.  
  3736. ΓòÉΓòÉΓòÉ 4.12.15. Transmit_I_Frame ΓòÉΓòÉΓòÉ
  3737.  
  3738. Transmit data to another PC on the LAN. 
  3739.  
  3740. SYNTAX 
  3741.  
  3742. 802.2  TRANSMIT_I_FRAME  [ADAPTER=adapter_number,]              SAP=sap_number, 
  3743. STATION=link_station_number              [,FILE=file_name] 
  3744. [,DATA="data string"]              [,RC=expected_return_code]; 
  3745.  
  3746. Where 
  3747.  
  3748.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3749.              numbers, although any number may be specified. The adapter number 
  3750.              is a configuration parameter of the LAN adapter used in the PC. If 
  3751.              not specified, this defaults to the value used in the last 
  3752.              Dir.Open.Adapter command processed by COMET. 
  3753.  
  3754.  SAP         is the sap number, as set in the open sap command. 
  3755.  
  3756.  STATION     is the link station number, as used in the open station and 
  3757.              connect station commands. 
  3758.  
  3759.  DATA        is the data string which is to be transmitted. 
  3760.  
  3761.  FILE        is the name of the file to be transmitted.  This option is not 
  3762.              currently supported. 
  3763.  
  3764.  RC          is the expected return code.  COMET will compare the actual return 
  3765.              code with this value.  If they are not the same, an error will 
  3766.              logged.  If this parameter is not specified, an error will be 
  3767.              logged if the return code is not good. 
  3768.  
  3769.  Sample Code 
  3770.  
  3771.  
  3772. ΓòÉΓòÉΓòÉ 4.12.16. Unsupported 802.2 commands ΓòÉΓòÉΓòÉ
  3773.  
  3774. The following 802.2 commands are not supported by COMET 
  3775.  
  3776.  Dir.cancel.timer.group 
  3777.  Dir.define.mif.environment 
  3778.  Dir.interrupt 
  3779.  Dir.modify.open.parms 
  3780.  Dir.read.log 
  3781.  Dir.restore.open.parms 
  3782.  Dir.set.functional.address 
  3783.  Dir.set.user.appendage 
  3784.  Dir.timer.cancel 
  3785.  Dir.timer.set 
  3786.  Dlc.flow.control 
  3787.  Dlc.modify 
  3788.  Dlc.reset 
  3789.  Dlc.statistics 
  3790.  Receive.modify 
  3791.  Transmit.dir.frame 
  3792.  Transmit.test.cmd 
  3793.  Transmit.ui.frame 
  3794.  Transmit.xid.cmd 
  3795.  
  3796.  
  3797. ΓòÉΓòÉΓòÉ 4.13. NETBIOS API ΓòÉΓòÉΓòÉ
  3798.  
  3799. The Communication Manager's NETBIOS API also provides access to local area 
  3800. networks.  It can be used to communicate on Token Ring, PC Network Baseband, or 
  3801. PC Network Broadband networks. See the Local Area Network Technical Reference 
  3802. for more detailed information about the Netbios commands. 
  3803.  
  3804.  
  3805. ΓòÉΓòÉΓòÉ 4.13.1. Add_group_name ΓòÉΓòÉΓòÉ
  3806.  
  3807. Add a group name to the local name table.  Several different PC's on the LAN 
  3808. can add the same group name.  This allows a datagram to be sent to all of those 
  3809. PC's using a single send_datagram command. 
  3810.  
  3811. SYNTAX 
  3812.  
  3813. NETBIOS  ADD_GROUP_NAME  [ADAPTER=adapter_number,] 
  3814. NAME=caller's_name              [,RC=expected_return_code]; 
  3815.  
  3816. Where 
  3817.  
  3818.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3819.              numbers, although any number may be specified. The adapter number 
  3820.              is a configuration parameter of the LAN adapter used in the PC. If 
  3821.              not specified, this defaults to 0. 
  3822.  
  3823.  NAME        is the name of the local station which is to be added. 
  3824.  
  3825.  RC          is the expected return code.  COMET will compare the actual return 
  3826.              code with this value.  If they are not the same, an error will 
  3827.              logged.  If this parameter is not specified, an error will be 
  3828.              logged if the return code is not good. 
  3829.  
  3830.  Sample Code 
  3831.  
  3832.  
  3833. ΓòÉΓòÉΓòÉ 4.13.2. Add_name ΓòÉΓòÉΓòÉ
  3834.  
  3835. Add a name to the local name table.  This name can be used as the local station 
  3836. name when issuing a call or listen command. COMET will allow up to 50 names to 
  3837. be added. 
  3838.  
  3839. SYNTAX 
  3840.  
  3841. NETBIOS  ADD_NAME  [ADAPTER=adapter_number,]           NAME=caller's_name 
  3842. [,RC=expected_return_code]; 
  3843.  
  3844. Where 
  3845.  
  3846.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3847.              numbers, although any number may be specified. The adapter number 
  3848.              is a configuration parameter of the LAN adapter used in the PC. If 
  3849.              not specified, this defaults to 0. 
  3850.  
  3851.  NAME        is the name of the local station which is to be added. 
  3852.  
  3853.  RC          is the expected return code.  COMET will compare the actual return 
  3854.              code with this value.  If they are not the same, an error will 
  3855.              logged.  If this parameter is not specified, an error will be 
  3856.              logged if the return code is not good. 
  3857.  
  3858.  Sample Code 
  3859.  
  3860.  
  3861. ΓòÉΓòÉΓòÉ 4.13.3. Call ΓòÉΓòÉΓòÉ
  3862.  
  3863. Call a remote PC to establish a communication session. 
  3864.  
  3865. SYNTAX 
  3866.  
  3867. NETBIOS  CALL  [ADAPTER=adapter_number,]         NAME=caller's_name, 
  3868. CALL_NAME=remote_name,         SESSION=COMET_session_number 
  3869. [,RCV_TIMEOUT=receive_timeout]         [,SND_TIMEOUT=send_timeout] 
  3870. [,RC=expected_return_code]; 
  3871.  
  3872. Where 
  3873.  
  3874.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3875.              numbers, although any number may be specified. The adapter number 
  3876.              is a configuration parameter of the LAN adapter used in the PC. If 
  3877.              not specified, this defaults to 0. 
  3878.  
  3879.  NAME        is the name of the person making the call, as set up with the add 
  3880.              name command. 
  3881.  
  3882.  CALL_NAME   is the name of the person being called at the remote station. 
  3883.  
  3884.  SESSION     is a COMET session number used with any following commands being 
  3885.              issued for this same session.  This may be a number between 1 and 
  3886.              30.  COMET limits the number of Netbios calls to 30. 
  3887.  
  3888.  RCV_TIMEOUT is the receive timeout (in seconds) to be set for this session. If 
  3889.              this parameter is not specified, a default of 60 seconds will be 
  3890.              used. 
  3891.  
  3892.  SND_TIMEOUT is the send timeout (in seconds) to be set for this session. If 
  3893.              this parameter is not specified, a default of 60 seconds will be 
  3894.              used. 
  3895.  
  3896.  RC          is the expected return code.  COMET will compare the actual return 
  3897.              code with this value.  If they are not the same, an error will 
  3898.              logged.  If this parameter is not specified, an error will be 
  3899.              logged if the return code is not good. 
  3900.  
  3901.  Sample Code 
  3902.  
  3903.  
  3904. ΓòÉΓòÉΓòÉ 4.13.4. Delete_name ΓòÉΓòÉΓòÉ
  3905.  
  3906. Delete a name which was previously added to the local name table. 
  3907.  
  3908. SYNTAX 
  3909.  
  3910. NETBIOS  DELETE_NAME  [ADAPTER=adapter_number,]             NAME=caller's_name 
  3911. [,RC=expected_return_code]; 
  3912.  
  3913. Where 
  3914.  
  3915.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3916.              numbers, although any number may be specified. The adapter number 
  3917.              is a configuration parameter of the LAN adapter used in the PC. If 
  3918.              not specified, this defaults to 0. 
  3919.  
  3920.  NAME        is the name of the local station which is to be deleted. 
  3921.  
  3922.  RC          is the expected return code.  COMET will compare the actual return 
  3923.              code with this value.  If they are not the same, an error will 
  3924.              logged.  If this parameter is not specified, an error will be 
  3925.              logged if the return code is not good. 
  3926.  
  3927.  Sample Code 
  3928.  
  3929.  
  3930. ΓòÉΓòÉΓòÉ 4.13.5. Find_name ΓòÉΓòÉΓòÉ
  3931.  
  3932. Find a name on the network, if it exists. 
  3933.  
  3934. SYNTAX 
  3935.  
  3936. NETBIOS  FIND_NAME  [ADAPTER=adapter_number,]           NAME=local_name 
  3937. [,NUMBER_RESPONDING=number]           [,NAME_STATUS=<UNIQUE|GROUP>] 
  3938. [,RC=expected_return_code]; 
  3939.  
  3940. Where 
  3941.  
  3942.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3943.              numbers, although any number may be specified. The adapter number 
  3944.              is a configuration parameter of the LAN adapter used in the PC. If 
  3945.              not specified, this defaults to 0. 
  3946.  
  3947.  NAME        is the name of the station to search for. 
  3948.  
  3949.  NUMBER_RESPONDING is the number of stations expected to respond to the find. 
  3950.              COMET will compare this value to the number actually returned by 
  3951.              netbios.  If the numbers are not the same, an error will be 
  3952.              logged. 
  3953.  
  3954.  NAME_STATUS tells what kind of name was found.  The valid options for this 
  3955.              parameter are UNIQUE and GROUP. 
  3956.  
  3957.  RC          is the expected return code.  COMET will compare the actual return 
  3958.              code with this value.  If they are not the same, an error will 
  3959.              logged.  If this parameter is not specified, an error will be 
  3960.              logged if the return code is not good. 
  3961.  
  3962.  Sample Code 
  3963.  
  3964.  
  3965. ΓòÉΓòÉΓòÉ 4.13.6. Hang_up ΓòÉΓòÉΓòÉ
  3966.  
  3967. Disconnect an existing call. 
  3968.  
  3969. SYNTAX 
  3970.  
  3971. NETBIOS  HANG_UP  [ADAPTER=adapter_number,] 
  3972. SESSION=COMET_session_number           [,RC=expected_return_code]; 
  3973.  
  3974. Where 
  3975.  
  3976.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  3977.              numbers, although any number may be specified. The adapter number 
  3978.              is a configuration parameter of the LAN adapter used in the PC. If 
  3979.              not specified, this defaults to 0. 
  3980.  
  3981.  SESSION     is a COMET session number, as set in the call or listen command. 
  3982.  
  3983.  RC          is the expected return code.  COMET will compare the actual return 
  3984.              code with this value.  If they are not the same, an error will 
  3985.              logged.  If this parameter is not specified, an error will be 
  3986.              logged if the return code is not good. 
  3987.  
  3988.  Sample Code 
  3989.  
  3990.  
  3991. ΓòÉΓòÉΓòÉ 4.13.7. Listen ΓòÉΓòÉΓòÉ
  3992.  
  3993. Listen for an incoming call. 
  3994.  
  3995. SYNTAX 
  3996.  
  3997. NETBIOS  LISTEN  [ADAPTER=adapter_number,]          NAME=caller's_name, 
  3998. CALL_NAME=remote_name,          SESSION=COMET_session_number 
  3999. [,RCV_TIMEOUT=receive_timeout]          [,SND_TIMEOUT=send_timeout] 
  4000. [,RC=expected_return_code]; 
  4001.  
  4002. Where 
  4003.  
  4004.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4005.              numbers, although any number may be specified. The adapter number 
  4006.              is a configuration parameter of the LAN adapter used in the PC. If 
  4007.              not specified, this defaults to 0. 
  4008.  
  4009.  NAME        is the name of the local station which is expecting to receive the 
  4010.              call. 
  4011.  
  4012.  CALL_NAME   is the name of the remote station from which the call is expected. 
  4013.              If the call name is '*', then the listen will accept a call from 
  4014.              any remote station. 
  4015.  
  4016.  SESSION     is a COMET session number used with any following commands being 
  4017.              issued for this same session.  This may be a number between 1 and 
  4018.              30.  COMET limits the number of Netbios calls to 30. 
  4019.  
  4020.  RCV_TIMEOUT is the receive timeout (in seconds) to be set for this session. If 
  4021.              this parameter is not specified, a default of 60 seconds will be 
  4022.              used. 
  4023.  
  4024.  SND_TIMEOUT is the send timeout (in seconds) to be set for this session. If 
  4025.              this parameter is not specified, a default of 60 seconds will be 
  4026.              used. 
  4027.  
  4028.  RC          is the expected return code.  COMET will compare the actual return 
  4029.              code with this value.  If they are not the same, an error will 
  4030.              logged.  If this parameter is not specified, an error will be 
  4031.              logged if the return code is not good. 
  4032.  
  4033.  Sample Code 
  4034.  
  4035.  
  4036. ΓòÉΓòÉΓòÉ 4.13.8. Receive ΓòÉΓòÉΓòÉ
  4037.  
  4038. Receive data from the remote PC. 
  4039.  
  4040. SYNTAX 
  4041.  
  4042. NETBIOS  RECV  [ADAPTER=adapter_number,]           SESSION=COMET_session_number 
  4043. [,DATA="data string"]           [,FILE=file_name] 
  4044. [,RC=expected_return_code]; 
  4045.  
  4046. Where 
  4047.  
  4048.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4049.              numbers, although any number may be specified. The adapter number 
  4050.              is a configuration parameter of the LAN adapter used in the PC. If 
  4051.              not specified, this defaults to 0. 
  4052.  
  4053.  SESSION     is a COMET session number used with any following commands being 
  4054.              issued for this same session.  This may be a number between 1 and 
  4055.              30.  COMET limits the number of Netbios calls to 30. 
  4056.  
  4057.  DATA        is a string of characters to be compared to the data which is 
  4058.              actually received.  If the two strings are not the same, an error 
  4059.              will be logged. If this parameter is not specified, the FILE 
  4060.              parameter must be used. 
  4061.  
  4062.  FILE        is the name of a file into which the received data should be 
  4063.              stored. If this parameter is not specified, the DATA parameter 
  4064.              must be used. 
  4065.  
  4066.  RC          is the expected return code.  COMET will compare the actual return 
  4067.              code with this value.  If they are not the same, an error will 
  4068.              logged.  If this parameter is not specified, an error will be 
  4069.              logged if the return code is not good. 
  4070.  
  4071.  Sample Code 
  4072.  
  4073.  
  4074. ΓòÉΓòÉΓòÉ 4.13.9. Receive_any ΓòÉΓòÉΓòÉ
  4075.  
  4076. Receive data from any of the open sessions. 
  4077.  
  4078. SYNTAX 
  4079.  
  4080. NETBIOS  RECV_ANY  [ADAPTER=adapter_number]             [,DATA="data string"] 
  4081. [,FILE=file_name]             [,RC=expected_return_code]; 
  4082.  
  4083. Where 
  4084.  
  4085.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4086.              numbers, although any number may be specified. The adapter number 
  4087.              is a configuration parameter of the LAN adapter used in the PC. If 
  4088.              not specified, this defaults to 0. 
  4089.  
  4090.  DATA        is a string of characters to send. If this parameter is not 
  4091.              specified, the FILE parameter must be used. 
  4092.  
  4093.  FILE        is the name of a file to be sent.  If this parameter is not 
  4094.              specified, the DATA parameter must be used. 
  4095.  
  4096.  RC          is the expected return code.  COMET will compare the actual return 
  4097.              code with this value.  If they are not the same, an error will 
  4098.              logged.  If this parameter is not specified, an error will be 
  4099.              logged if the return code is not good. 
  4100.  
  4101.  Sample Code 
  4102.  
  4103.  
  4104. ΓòÉΓòÉΓòÉ 4.13.10. Receive_broadcast_datagram ΓòÉΓòÉΓòÉ
  4105.  
  4106. Receive a broadcast datagram which was transmitted by a remote station. 
  4107.  
  4108. SYNTAX 
  4109.  
  4110. NETBIOS  RECV_BROADCAST_DATAGRAM  [ADAPTER=adapter_number,] 
  4111. NAME=caller's_name                 [,DATA="data string"] 
  4112. [,FILE=file_name]                 [,RC=expected_return_code]; 
  4113.  
  4114. Where 
  4115.  
  4116.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4117.              numbers, although any number may be specified. The adapter number 
  4118.              is a configuration parameter of the LAN adapter used in the PC. If 
  4119.              not specified, this defaults to 0. 
  4120.  
  4121.  NAME        is the name of the local station which is expecting to receive a 
  4122.              datagram.  An '*' can be specified to indicate that a datagram 
  4123.              will be accepted from any station. 
  4124.  
  4125.  DATA        is a string of characters to be compared to the data which is 
  4126.              actually received.  If the two strings are not the same, an error 
  4127.              will be logged. If this parameter is not specified, the FILE 
  4128.              parameter must be used. 
  4129.  
  4130.  FILE        is the name of a file into which the received data should be 
  4131.              stored. If this parameter is not specified, the DATA parameter 
  4132.              must be used. 
  4133.  
  4134.  RC          is the expected return code.  COMET will compare the actual return 
  4135.              code with this value.  If they are not the same, an error will 
  4136.              logged.  If this parameter is not specified, an error will be 
  4137.              logged if the return code is not good. 
  4138.  
  4139.  Sample Code 
  4140.  
  4141.  
  4142. ΓòÉΓòÉΓòÉ 4.13.11. Receive_datagram ΓòÉΓòÉΓòÉ
  4143.  
  4144. Receive a datagram from a remote station. 
  4145.  
  4146. SYNTAX 
  4147.  
  4148. NETBIOS  RECV_DATAGRAM  [ADAPTER=adapter_number,] 
  4149. NAME=caller's_name                [,DATA="data string"] 
  4150. [,FILE=file_name]                [,RC=expected_return_code]; 
  4151.  
  4152. Where 
  4153.  
  4154.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4155.              numbers, although any number may be specified. The adapter number 
  4156.              is a configuration parameter of the LAN adapter used in the PC. If 
  4157.              not specified, this defaults to 0. 
  4158.  
  4159.  NAME        is the name of the local station which is expecting to receive a 
  4160.              datagram.  An '*' can be specified to indicate that a datagram 
  4161.              will be accepted from any station. 
  4162.  
  4163.  DATA        is a string of characters to be compared to the data which is 
  4164.              actually received.  If the two strings are not the same, an error 
  4165.              will be logged. If this parameter is not specified, the FILE 
  4166.              parameter must be used. 
  4167.  
  4168.  FILE        is the name of a file into which the received data should be 
  4169.              stored. If this parameter is not specified, the DATA parameter 
  4170.              must be used. 
  4171.  
  4172.  RC          is the expected return code.  COMET will compare the actual return 
  4173.              code with this value.  If they are not the same, an error will 
  4174.              logged.  If this parameter is not specified, an error will be 
  4175.              logged if the return code is not good. 
  4176.  
  4177.  Sample Code 
  4178.  
  4179.  
  4180. ΓòÉΓòÉΓòÉ 4.13.12. Reset ΓòÉΓòÉΓòÉ
  4181.  
  4182. Reset the sessions on a specified adapter. 
  4183.  
  4184. SYNTAX 
  4185.  
  4186. NETBIOS  RESET  [ADAPTER=adapter_number]         [,SESSIONS=decimal_number] 
  4187. [,COMMANDS=decimal_number]         [,NAMES=decimal_number] 
  4188. [,NAME1=decimal_number]         [,FREE_ALL=<YES||NO>] 
  4189. [,RC=expected_return_code]; 
  4190.  
  4191. Where 
  4192.  
  4193.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4194.              numbers, although any number may be specified. The adapter number 
  4195.              is a configuration parameter of the LAN adapter used in the PC. If 
  4196.              not specified, this defaults to 0. 
  4197.  
  4198.  SESSIONS    is the maximum number of sessions to be allowed on the adapter 
  4199.              after the reset.  Values from 0 to 255 are allowed. If not 
  4200.              specified or if 0 is specified, this defaults to 16. 
  4201.  
  4202.  COMMANDS    is the maximum number of outstanding commands to be allowed on the 
  4203.              adapter after the reset.  Values from 0 to 255 are allowed. If not 
  4204.              specified or if 0 is specified, this defaults to 16. 
  4205.  
  4206.  NAMES       is the maximum number of names to be allowed in the local name 
  4207.              table after the reset.  Values from 0 to 255 are allowed. If not 
  4208.              specified or if 0 is specified, this defaults to 8. 
  4209.  
  4210.  NAME1       ??? 
  4211.  
  4212.  FREE_ALL    ??? tells Netbios whether to reset the resources for all processes 
  4213.              or just the current process.  The valid options are YES or NO. 
  4214.  
  4215.  RC          is the expected return code.  COMET will compare the actual return 
  4216.              code with this value.  If they are not the same, an error will 
  4217.              logged.  If this parameter is not specified, an error will be 
  4218.              logged if the return code is not good. 
  4219.  
  4220.  Sample Code 
  4221.  
  4222.  
  4223. ΓòÉΓòÉΓòÉ 4.13.13. Send ΓòÉΓòÉΓòÉ
  4224.  
  4225. Send data to the remote station.  There is currently a limit to the size of a 
  4226. file which can be sent using this command. That limit is 64K bytes. 
  4227.  
  4228. SYNTAX 
  4229.  
  4230. NETBIOS  SEND  [ADAPTER=adapter_number,]         SESSION=COMET_session_number 
  4231. [,DATA="data string"]         [,FILE=file_name] 
  4232. [,RC=expected_return_code]; 
  4233.  
  4234. Where 
  4235.  
  4236.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4237.              numbers, although any number may be specified. The adapter number 
  4238.              is a configuration parameter of the LAN adapter used in the PC. If 
  4239.              not specified, this defaults to 0. 
  4240.  
  4241.  SESSION     is a COMET session number used with any following commands being 
  4242.              issued for this same session.  This may be a number between 1 and 
  4243.              30.  COMET limits the number of Netbios calls to 30. 
  4244.  
  4245.  DATA        is a string of characters to send. If this parameter is not 
  4246.              specified, the FILE parameter must be used. 
  4247.  
  4248.  FILE        is the name of a file to be sent. There is currently a 64K limit 
  4249.              on the size of a file to be sent with the SEND command. If this 
  4250.              parameter is not specified, the DATA parameter must be used. 
  4251.  
  4252.  RC          is the expected return code.  COMET will compare the actual return 
  4253.              code with this value.  If they are not the same, an error will 
  4254.              logged.  If this parameter is not specified, an error will be 
  4255.              logged if the return code is not good. 
  4256.  
  4257.  Sample Code 
  4258.  
  4259.  
  4260. ΓòÉΓòÉΓòÉ 4.13.14. Send_broadcast_datagram ΓòÉΓòÉΓòÉ
  4261.  
  4262. Send a broadcast datagram.  A broadcast datagram will be received by any 
  4263. station which has issued a receive broadcast datagram command. 
  4264.  
  4265. SYNTAX 
  4266.  
  4267. NETBIOS  SEND_BROADCAST_DATAGRAM  [ADAPTER=adapter_number,] 
  4268. NAME=caller's_name                   [,DATA="data string"] 
  4269. [,FILE=file_name]                   [,RC=expected_return_code]; 
  4270.  
  4271. Where 
  4272.  
  4273.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4274.              numbers, although any number may be specified. The adapter number 
  4275.              is a configuration parameter of the LAN adapter used in the PC. If 
  4276.              not specified, this defaults to 0. 
  4277.  
  4278.  NAME        is the name of the local station which is sending the datagram. 
  4279.  
  4280.  DATA        is a string of characters to send. If this parameter is not 
  4281.              specified, the FILE parameter must be used. 
  4282.  
  4283.  FILE        is the name of a file to be sent. There is currently a 64K limit 
  4284.              on the size of a file to be sent with the SEND command. If this 
  4285.              parameter is not specified, the DATA parameter must be used. 
  4286.  
  4287.  RC          is the expected return code.  COMET will compare the actual return 
  4288.              code with this value.  If they are not the same, an error will 
  4289.              logged.  If this parameter is not specified, an error will be 
  4290.              logged if the return code is not good. 
  4291.  
  4292.  Sample Code 
  4293.  
  4294.  
  4295. ΓòÉΓòÉΓòÉ 4.13.15. Send_datagram ΓòÉΓòÉΓòÉ
  4296.  
  4297. Send a datagram. 
  4298.  
  4299. SYNTAX 
  4300.  
  4301. NETBIOS  SEND_DATAGRAM  [ADAPTER=adapter_number,] 
  4302. NAME=caller's_name,              CALL_NAME=remote_name 
  4303. [,DATA="data string"]              [,FILE=file_name] 
  4304. [,RC=expected_return_code]; 
  4305.  
  4306. Where 
  4307.  
  4308.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4309.              numbers, although any number may be specified. The adapter number 
  4310.              is a configuration parameter of the LAN adapter used in the PC. If 
  4311.              not specified, this defaults to 0. 
  4312.  
  4313.  NAME        is the name of the local station which is sending the datagram. 
  4314.  
  4315.  CALL_NAME   is the name of the remote station to which the datagram is to be 
  4316.              sent. 
  4317.  
  4318.  DATA        is a string of characters to send. If this parameter is not 
  4319.              specified, the FILE parameter must be used. 
  4320.  
  4321.  FILE        is the name of a file to be sent. There is currently a 64K limit 
  4322.              on the size of a file to be sent with the SEND command. If this 
  4323.              parameter is not specified, the DATA parameter must be used. 
  4324.  
  4325.  RC          is the expected return code.  COMET will compare the actual return 
  4326.              code with this value.  If they are not the same, an error will 
  4327.              logged.  If this parameter is not specified, an error will be 
  4328.              logged if the return code is not good. 
  4329.  
  4330.  Sample Code 
  4331.  
  4332.  
  4333. ΓòÉΓòÉΓòÉ 4.13.16. Session_Status ΓòÉΓòÉΓòÉ
  4334.  
  4335. Get the status of a local session. 
  4336.  
  4337. SYNTAX 
  4338.  
  4339. NETBIOS  SESSION_STATUS  [ADAPTER=adapter_number,]              NAME=local_name 
  4340. [,FILE=file_name]              [,DISPLAY] 
  4341. [,RC=expected_return_code]; 
  4342.  
  4343. Where 
  4344.  
  4345.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4346.              numbers, although any number may be specified. The adapter number 
  4347.              is a configuration parameter of the LAN adapter used in the PC. If 
  4348.              not specified, this defaults to 0. 
  4349.  
  4350.  NAME        is the name of the local station for which status is desired. 
  4351.  
  4352.  FILE        is the name of a file into which the status should be stored. If 
  4353.              this parameter is not specified, the status data will be displayed 
  4354.              on the screen. 
  4355.  
  4356.  DISPLAY     tells COMET to display the status information on the screen. This 
  4357.              is required only if the FILE parameter is also used, to display 
  4358.              the data in addition to storing it into the specified file. If the 
  4359.              FILE parameter is not used, then the DISPLAY parameter is not 
  4360.              required, since displaying the data to the screen is the default. 
  4361.  
  4362.  RC          is the expected return code.  COMET will compare the actual return 
  4363.              code with this value.  If they are not the same, an error will 
  4364.              logged.  If this parameter is not specified, an error will be 
  4365.              logged if the return code is not good. 
  4366.  
  4367.  Sample Code 
  4368.  
  4369.  
  4370. ΓòÉΓòÉΓòÉ 4.13.17. Status ΓòÉΓòÉΓòÉ
  4371.  
  4372. Get the current status of the Netbios communications. 
  4373.  
  4374. SYNTAX 
  4375.  
  4376. NETBIOS  STATUS  [ADAPTER=adapter_number,]          CALL_NAME=caller's_name 
  4377. [,FILE=file_name]          [,DISPLAY]          [,RC=expected_return_code]; 
  4378.  
  4379. Where 
  4380.  
  4381.  ADAPTER     is the adapter number.  The numbers 0 and 1 are valid adapter 
  4382.              numbers, although any number may be specified. The adapter number 
  4383.              is a configuration parameter of the LAN adapter used in the PC. If 
  4384.              not specified, this defaults to 0. 
  4385.  
  4386.  CALL_NAME   is the name of the remote station. 
  4387.  
  4388.  FILE        is the name of a file into which the status should be stored. The 
  4389.              status information will be appended to the end of the file. If 
  4390.              this parameter is not specified, the status data will be displayed 
  4391.              on the screen. 
  4392.  
  4393.  DISPLAY     tells COMET to display the status information on the screen. This 
  4394.              is required only if the FILE parameter is also used, to display 
  4395.              the data in addition to storing it into the specified file. If the 
  4396.              FILE parameter is not used, then the DISPLAY parameter is not 
  4397.              required, since displaying the data to the screen is the default. 
  4398.  
  4399.  RC          is the expected return code.  COMET will compare the actual return 
  4400.              code with this value.  If they are not the same, an error will 
  4401.              logged.  If this parameter is not specified, an error will be 
  4402.              logged if the return code is not good. 
  4403.  
  4404.  Sample Code 
  4405.  
  4406.  
  4407. ΓòÉΓòÉΓòÉ 4.13.18. Unsupported Netbios Commands ΓòÉΓòÉΓòÉ
  4408.  
  4409. The following Netbios API commands are not supported by COMET 
  4410.  
  4411.  Chain_send 
  4412.  Chain_send_no_ack 
  4413.  Send_no_ack 
  4414.  Trace 
  4415.  
  4416.  
  4417. ΓòÉΓòÉΓòÉ 4.14. EHLLAPI API ΓòÉΓòÉΓòÉ
  4418.  
  4419. The Communication Manager's EHLLAPI API provides user program access to the 
  4420. 3270 Emulator functions. (EHLLAPI stands for Emulator High Level Language 
  4421. Application Programming Interface.) 
  4422.  
  4423.  
  4424. ΓòÉΓòÉΓòÉ 4.14.1. EHLLAPI command syntax ΓòÉΓòÉΓòÉ
  4425.  
  4426. SYNTAX 
  4427.  
  4428. The syntax of an EHLLAPI command in the COMET input file is as follows: 
  4429.  
  4430. EHLLAPI  FUNCTION=function      [,STRING="string"]      [,LENGTH=length] 
  4431. [,RC=rc]; 
  4432.  
  4433. Where 
  4434.  
  4435.  FUNCTION    is the function code to be issued.  This is an integer from 0 to 
  4436.              255. 
  4437.  
  4438.  STRING      is the data string to pass to the API.  The data string must be 
  4439.              enclosed in quotes.  If not specified it will default to a NULL 
  4440.              string. 
  4441.  
  4442.  LENGTH      is the data length, that is, the length of the STRING parameter. 
  4443.              This is an integer from 0 to 65,535.  This is also used as a 
  4444.              numeric parameter to some EHLLAPI function calls.  If a STRING 
  4445.              parameter is specified the LENGTH does not need to specified, as 
  4446.              COMET will determine the length of the STRING.  If a LENGTH is 
  4447.              specified, COMET will use that LENGTH.  If neither STRING nor 
  4448.              LENGTH is specified, LENGTH will default to 0. 
  4449.  
  4450.  RC          is the expected return code. This is an integer from 0 to 65,535. 
  4451.              It will default to 0 if not specified. 
  4452.  
  4453.  Sample Code 
  4454.  
  4455.  
  4456. ΓòÉΓòÉΓòÉ 5. CREATING LAN INPUT FILES ΓòÉΓòÉΓòÉ
  4457.  
  4458. This chapter contains the instructions on creating an input file for testing 
  4459. the OS/2 LAN API functions. The OS/2 LAN API functios are listed by categories. 
  4460. Information for API functions are described under each function category. 
  4461.  
  4462.  
  4463. ΓòÉΓòÉΓòÉ 5.1. LAN API - Configuration ΓòÉΓòÉΓòÉ
  4464.  
  4465. The functions in the Configuration category retrieve network configuration 
  4466. information from the IBMLAN.INI file. 
  4467.  
  4468.  
  4469. ΓòÉΓòÉΓòÉ 5.1.1. NetConfigGet2 (Admin) ΓòÉΓòÉΓòÉ
  4470.  
  4471. Retrieve a specified parameter value for a given network component in the 
  4472. IBMLAN.INI file of a remote server. 
  4473.  
  4474. Syntax 
  4475.  
  4476. LAN CONFIG_GET2   [SERVER=\\servername,]         [COMPONENT=component,] 
  4477. [PARAMETER=parameter,]         [BUFLEN=buffer_size,] 
  4478. [OUTFILE=file_name,]         [RC=expected_return_code]; 
  4479.  
  4480. Where: 
  4481.  
  4482.  SERVER          Name of the remote server. A NULL string is passed to API call 
  4483.                  if this parameter is not specified. A NULL pointer is passed 
  4484.                  to API call if this parameter has value of NULL. Local 
  4485.                  computer is assumed if this parameter contains NULL string or 
  4486.                  NULL pointer. 
  4487.  
  4488.  COMPONENT       The name of service component to be searched, such as 
  4489.                  requester, server, or messenger. A NULL string is passed to 
  4490.                  API call if this parameter is not specified and an error 
  4491.                  return code is expected. 
  4492.  
  4493.  PARAMETER       The parameter whose value is to be returned. A NULL string is 
  4494.                  passed to API call if this parameter is not specified and an 
  4495.                  error return code is expected. 
  4496.  
  4497.  BUFLEN          The size of buffer for the returned parameter's value. If this 
  4498.                  parameter is not specified, the default size 256 is assumed. 
  4499.  
  4500.  OUTFILE         The name of file where the returned data is stored. The 
  4501.                  returned information will be appended to this file. If this 
  4502.                  parameter is not specified, the returned information will be 
  4503.                  displayed to the screen when the debug is on. The returned 
  4504.                  data includes: 
  4505.  
  4506.      the value of the parameter requested 
  4507.      number of bytes returned to buffer 
  4508.  
  4509.  RC              is the expected return code.  COMET will compare the actual 
  4510.                  return code with this value.  If they are not the same, an 
  4511.                  error will be flagged.  If this parameter is not specified, an 
  4512.                  error will be flagged if the return code is not good. 
  4513.  
  4514.  Sample Code 
  4515.  
  4516.  
  4517. ΓòÉΓòÉΓòÉ 5.1.2. NetConfigGetAll2 (Admin) ΓòÉΓòÉΓòÉ
  4518.  
  4519. Retrieve all parameter information for a given network component in the 
  4520. IBMLAN.INI file of a remote server. 
  4521.  
  4522. Syntax 
  4523.  
  4524. LAN CONFIG_GET_ALL2 [SERVER=\\servername,]         [COMPONENT=component,] 
  4525. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  4526. [RC=expected_return_code]; 
  4527.  
  4528. Where: 
  4529.  
  4530.  SERVER          The name of service component to be searched, such as 
  4531.                  requester, server, or messenger. A NULL string is passed to 
  4532.                  API call if this parameter is not specified. A NULL pointer is 
  4533.                  passed to API call if this parameter has value of NULL. Local 
  4534.                  computer is assumed if this parameter contains NULL string or 
  4535.                  NULL pointer. 
  4536.  
  4537.  COMPONENT       The name of string to be searched. A NULL string is passed to 
  4538.                  API call if this parameter is not specified. and an error 
  4539.                  return code is expected. 
  4540.  
  4541.  BUFLEN          The size of buffer for the returned parameter's value. If this 
  4542.                  parameter is not specified, the default size 256 is assumed. 
  4543.  
  4544.  OUTFILE         The name of file where the returned data is stored. The 
  4545.                  returned information will be appended to this file. If this 
  4546.                  parameter is not specified, the returned information will be 
  4547.                  displayed to the screen when the debug is on. The returned 
  4548.                  data includes: 
  4549.  
  4550.      all parameter values of the requested component 
  4551.      number of bytes returned to buffer 
  4552.      number of bytes of the available data 
  4553.  
  4554.  RC              is the expected return code.  COMET will compare the actual 
  4555.                  return code with this value.  If they are not the same, an 
  4556.                  error will be flagged.  If this parameter is not specified, an 
  4557.                  error will be flagged if the return code is not good. 
  4558.  
  4559.  Sample Code 
  4560.  
  4561.  
  4562. ΓòÉΓòÉΓòÉ 5.2. LAN API - Connection ΓòÉΓòÉΓòÉ
  4563.  
  4564. The function list all connections made to a server by a requester client, or of 
  4565. all connections made to a server's shared resource. 
  4566.  
  4567.  
  4568. ΓòÉΓòÉΓòÉ 5.2.1. NetConnectionEnum (Admin, Server) ΓòÉΓòÉΓòÉ
  4569.  
  4570. List all connections made to a server by a requester, or of all connections 
  4571. made to a server's shared resource. 
  4572.  
  4573. Syntax 
  4574.  
  4575. LAN CONNECTION_ENUM [SERVER=\\servername,]         PARAMETER=qualifier, 
  4576. [LEVEL=<0 | 1>,]         [BUFLEN=buffer_size,] 
  4577. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  4578.  
  4579. Where: 
  4580.  
  4581.  SERVER          Name of the remote server. A NULL string is passed to API call 
  4582.                  if this parameter is not specified. A NULL pointer is passed 
  4583.                  to API call if this parameter has value of NULL. Local 
  4584.                  computer is assumed if this parameter contains NULL string or 
  4585.                  NULL pointer. 
  4586.  
  4587.  PARAMETER       The netname of the shared resource, or the client name of the 
  4588.                  requester. This parameter must be specified. 
  4589.  
  4590.  LEVEL           Specify the level of detail for the requested information. 
  4591.                  Valid value for this parameter is either 0 or 1. Any other 
  4592.                  value will cause an error return code. If this parameter is 
  4593.                  not specified, the default value 0 is assumed. 
  4594.  
  4595.  BUFLEN          The size of buffer that holds the returned data. If not 
  4596.                  specified, the default size 256 is assumed. 
  4597.  
  4598.  OUTFILE         The file where the returned data is stored. The returned 
  4599.                  information will be appended to this file. If this parameter 
  4600.                  is not specified, the returned information will be displayed 
  4601.                  to the screen when the debug is on. The returned data include: 
  4602.  
  4603.      level 0 or level 1 information of each entry 
  4604.      number of entries returned 
  4605.      number of entries that are available 
  4606.  
  4607.  RC              is the expected return code.  COMET will compare the actual 
  4608.                  return code with this value.  If they are not the same, an 
  4609.                  error will be flagged.  If this parameter is not specified, an 
  4610.                  error will be flagged if the return code is not good. 
  4611.  
  4612.  Sample Code 
  4613.  
  4614.  
  4615. ΓòÉΓòÉΓòÉ 5.3. LAN API - Mailslot ΓòÉΓòÉΓòÉ
  4616.  
  4617. The functions in Mailslot category provide one-way interprocess communication 
  4618. (IPC). 
  4619.  
  4620.  
  4621. ΓòÉΓòÉΓòÉ 5.3.1. DosDeleteMailslot (Local) ΓòÉΓòÉΓòÉ
  4622.  
  4623. Delete a mailslot and discard all messages. 
  4624.  
  4625. Syntax 
  4626.  
  4627. LAN DELETE_MAILSLOT [HANDLE=handle,]         [NAME=\mailslot\name,] 
  4628. [RC=expected_return_code]; 
  4629.  
  4630. Where: 
  4631.  
  4632.  HANDLE      is the handle returned from DosMakeMailslot. If this parameter is 
  4633.              not specified, COMET will search the mailslot name specified in 
  4634.              the NAME parameter for the associated handle, and pass the handle 
  4635.              to API call. is 
  4636.  
  4637.  NAME        is the name of mailslot to be deleted. The handle that was 
  4638.              associated with the mailslot is passed to API call. If this 
  4639.              mailslot name is not valid, an arbitrary handle (0xFFFF) is passed 
  4640.              to API call and an error return code is expected. 
  4641.  
  4642.  RC          is the expected return code.  COMET will compare the actual return 
  4643.              code with this value.  If they are not the same, an error will be 
  4644.              flagged.  If this parameter is not specified, an error will be 
  4645.              flagged if the return code is not good. 
  4646.  
  4647.  Sample Code 
  4648.  
  4649.  
  4650. ΓòÉΓòÉΓòÉ 5.3.2. DosMailslotInfo (Local) ΓòÉΓòÉΓòÉ
  4651.  
  4652. Retrieve information about a particular mailslot. 
  4653.  
  4654. Syntax 
  4655.  
  4656. LAN MAILSLOT_INFO [HANDLE=handle,]         [NAME=\mailslot\name,] 
  4657. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  4658.  
  4659. Where: 
  4660.  
  4661.  HANDLE      is the handle returned from DosMakeMailslot. If this parameter is 
  4662.              not specified, COMET will search the mailslot name specified in 
  4663.              the NAME parameter for the associated handle, and pass the handle 
  4664.              to API call. 
  4665.  
  4666.  NAME        is the name of mailslot to get information from. If this mailslot 
  4667.              name is not valid, an arbitrary handle (0xFFFF) is passed to API 
  4668.              call and an error return code is expected. 
  4669.  
  4670.  OUTFILE     is the file name that the returned information on this mailslot is 
  4671.              kept. The returned information will be appended to this file. If 
  4672.              this parameter is not specified, the returned information will be 
  4673.              displayed to the screen when the debug is on. The information 
  4674.              includes: 
  4675.  
  4676.      maximum size of message the mailslot can accept 
  4677.      size of the mailslot 
  4678.      size of the next message in the mailslot 
  4679.      priority of the next message in the mailslot 
  4680.      number of messages the mailslot contains 
  4681.  
  4682.  RC          is the expected return code.  COMET will compare the actual return 
  4683.              code with this value.  If they are not the same, an error will be 
  4684.              flagged.  If this parameter is not specified, an error will be 
  4685.              flagged if the return code is not good. 
  4686.  
  4687.  Sample Code 
  4688.  
  4689.  
  4690. ΓòÉΓòÉΓòÉ 5.3.3. DosMakeMailslot (Local) ΓòÉΓòÉΓòÉ
  4691.  
  4692. Create a mailslot and return its handle. 
  4693.  
  4694. Syntax 
  4695.  
  4696. LAN MAKE_MAILSLOT NAME=\mailslot\name,        MSGSIZE=size, 
  4697. SLOTSIZE=size,        [RC=expected_return_code]; 
  4698.  
  4699. Where: 
  4700.  
  4701.  NAME        is an ASCII string assigning a name to the mailslot. The format is 
  4702.              \mailslot\name for local computer. 
  4703.  
  4704.  MSGSIZE     is the maximum message size in bytes the mailslot can accept. 
  4705.              Generally, mailslot cannot accept messages larger then 65,475 
  4706.              bytes. 
  4707.  
  4708.  SLOTSIZE    is the size in bytes of the mailslot. This value must equal or 
  4709.              exceed MSGSIZE. 
  4710.  
  4711.  RC          is the expected return code.  COMET will compare the actual return 
  4712.              code with this value.  If they are not the same, an error will be 
  4713.              flagged.  If this parameter is not specified, an error will be 
  4714.              flagged if the return code is not good. 
  4715.  
  4716.  Sample Code 
  4717.  
  4718.  
  4719. ΓòÉΓòÉΓòÉ 5.3.4. DosPeekMailslot (Local) ΓòÉΓòÉΓòÉ
  4720.  
  4721. Read the most current message in a mailslot without removing it. 
  4722.  
  4723. Syntax 
  4724.  
  4725. LAN PEEK_MAILSLOT [HANDLE=handle,]         [NAME=\mailslot\name,] 
  4726. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  4727.  
  4728. Where: 
  4729.  
  4730.  HANDLE      is the handle returned from DosMakeMailslot. If this parameter is 
  4731.              not specified, COMET will search the mailslot name specified in 
  4732.              the NAME parameter for the associated handle, and pass the handle 
  4733.              to API call. 
  4734.  
  4735.  NAME        is the name of mailslot to peek. If this mailslot name is not 
  4736.              valid, an arbitrary handle (0xFFFF) is passed to API call and an 
  4737.              error return code is expected. 
  4738.  
  4739.  OUTFILE     is the file name that the returned information on this mailslot is 
  4740.              kept. The returned information will be appended to this file. If 
  4741.              this parameter is not specified, the returned information will be 
  4742.              displayed to the screen when the debug is on. The information 
  4743.              includes: 
  4744.  
  4745.      size of buffer allocated for the returned buffer. This size is specified 
  4746.       in the MSGSIZE of DosMakeMailslot. 
  4747.      number of bytes returned 
  4748.      size of next message in the mailslot 
  4749.      priority of next message in the mailslot 
  4750.  
  4751.  RC          is the expected return code.  COMET will compare the actual return 
  4752.              code with this value.  If they are not the same, an error will be 
  4753.              flagged.  If this parameter is not specified, an error will be 
  4754.              flagged if the return code is not good. 
  4755.  
  4756.  Sample Code 
  4757.  
  4758.  
  4759. ΓòÉΓòÉΓòÉ 5.3.5. DosReadMailslot (Local) ΓòÉΓòÉΓòÉ
  4760.  
  4761. Read and remove the most current message from a mailslot. 
  4762.  
  4763. Syntax 
  4764.  
  4765. LAN READ_MAILSLOT [HANDLE=handle,]         [NAME=\mailslot\name,] 
  4766. [TIMEOUT=milliseconds,]         [OUTFILE=output_file_name,] 
  4767. [RC=expected_return_code]; 
  4768.  
  4769. Where: 
  4770.  
  4771.  HANDLE      is the handle returned from DosMakeMailslot. If this parameter is 
  4772.              not specified, COMET will search the mailslot name specified in 
  4773.              the NAME parameter for the associated handle, and pass the handle 
  4774.              to API call. 
  4775.  
  4776.  NAME        is the name of mailslot to read message from. If this mailslot 
  4777.              name is not valid, an arbitrary handle (0xFFFF) is passed to API 
  4778.              call and error return code is expected. 
  4779.  
  4780.  TIMEOUT     is the the number of milliseconds to wait if a message is not 
  4781.              available immediately. A value of 0 specifies the API does not 
  4782.              wait; -1 specifies the API waits indefinitely. If timeout value is 
  4783.              not specified, the default is 0. 
  4784.  
  4785.  OUTFILE     is the file name that the returned information on this milslot is 
  4786.              kept. The returned information will be appended to this file. If 
  4787.              this parameter is not specified, the returned information will be 
  4788.              displayed to the screen when the debug is on. The information 
  4789.              includes: 
  4790.  
  4791.      the message returned 
  4792.      number of bytes read 
  4793.      size of next message in the mailslot 
  4794.      priority of next message in the mailslot 
  4795.  
  4796.  RC          is the expected return code.  COMET will compare the actual return 
  4797.              code with this value.  If they are not the same, an error will be 
  4798.              flagged.  If this parameter is not specified, an error will be 
  4799.              flagged if the return code is not good. 
  4800.  
  4801.  Sample Code 
  4802.  
  4803.  
  4804. ΓòÉΓòÉΓòÉ 5.3.6. DosWriteMailslot (Local) ΓòÉΓòÉΓòÉ
  4805.  
  4806. Write a message to a particular mailslot. 
  4807.  
  4808. Syntax 
  4809.  
  4810. LAN WRITE_MAILSLOT  NAME=\mailslot\name,         MESSAGE=text, 
  4811. [PRIORITY=priority,]         [CLASS= < 0 | 1 > ,] 
  4812. [TIMEOUT=milliseconds,]         [RC=expected_return_code]; 
  4813.  
  4814. Where: 
  4815.  
  4816.  NAME        is the name of mailslot to write to. Use \mailslot\name for local 
  4817.              computer. Use \\computername\mailslot\name for a remote mailslot. 
  4818.              Use \\*\mailslot\name for all mailslots with the same name, but on 
  4819.              different computers. 
  4820.  
  4821.  MESSAGE     is the ASCII string containing the message to be written to the 
  4822.              mailslot. 
  4823.  
  4824.  PRIORITY    is the priority assigned to the message. The value is between 0 to 
  4825.              9. If priority is not specified, the default is 9. 
  4826.  
  4827.  CLASS       is the class of mail service to be provided. The class is either 1 
  4828.              or 2. If class is not specified, the default is 2. 
  4829.  
  4830.  TIMEOUT     is the the number of milliseconds to attempt writing a message to 
  4831.              a mailslot. A value of 0 specifies the API will attempt to write 
  4832.              the message only once; -1 specifies the API will attempt to write 
  4833.              for an indefinite time. If timeout value is not specified, the 
  4834.              default is 0. 
  4835.  
  4836.  RC          is the expected return code.  COMET will compare the actual return 
  4837.              code with this value.  If they are not the same, an error will be 
  4838.              flagged.  If this parameter is not specified, an error will be 
  4839.              flagged if the return code is not good. 
  4840.  
  4841.  Sample Code 
  4842.  
  4843.  
  4844. ΓòÉΓòÉΓòÉ 5.4. LAN API - Message ΓòÉΓòÉΓòÉ
  4845.  
  4846. The functions in the Message category are used to send, receive, read, log, and 
  4847. forward messages. Ordinary uses can issue these functions locally. The 
  4848. administrator can execute these functions remotely. 
  4849.  
  4850.  
  4851. ΓòÉΓòÉΓòÉ 5.4.1. NetMessageBufferSend (Admin) ΓòÉΓòÉΓòÉ
  4852.  
  4853. Send a buffer of information to a registered messaging-name. 
  4854.  
  4855. SYNTAX 
  4856.  
  4857. LAN MESSAGE_BUFFER_SEND [SERVER=\\servername,]         NAME=username, 
  4858. MESSAGE=text,         [RC=expected_return_code]; 
  4859.  
  4860. Where: 
  4861.  
  4862.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  4863.              this parameter is not specified. A NULL pointer is passed to API 
  4864.              call if this parameter has value of NULL. Local computer is 
  4865.              assumed if this parameter contains NULL string or NULL pointer. 
  4866.  
  4867.  NAME        Name of the registered user or application to receive the message. 
  4868.              An asterisk (*) indicates broadcasting. 
  4869.  
  4870.  MESSAGE     The message to be sent. 
  4871.  
  4872.  RC          is the expected return code.  COMET will compare the actual return 
  4873.              code with this value.  If they are not the same, an error will be 
  4874.              flagged.  If this parameter is not specified, an error will be 
  4875.              flagged if the return code is not good. 
  4876.  
  4877.  Sample Code 
  4878.  
  4879.  
  4880. ΓòÉΓòÉΓòÉ 5.4.2. NetMessageFileSend (Admin) ΓòÉΓòÉΓòÉ
  4881.  
  4882. Send a file to a registered messaging-name. 
  4883.  
  4884. SYNTAX 
  4885.  
  4886. LAN MESSAGE_FILE_SEND  [SERVER=\\servername,]         NAME=username, 
  4887. FILE=file_name,         [RC=expected_return_code]; 
  4888.  
  4889. Where: 
  4890.  
  4891.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  4892.              this parameter is not specified. A NULL pointer is passed to API 
  4893.              call if this parameter has value of NULL. Local computer is 
  4894.              assumed if this parameter contains NULL string or NULL pointer. 
  4895.  
  4896.  NAME        Name of the registered user or application to receive the message. 
  4897.              An asterisk (*) indicates broadcasting. 
  4898.  
  4899.  FILE        Pathname of the file to be sent. 
  4900.  
  4901.  RC          is the expected return code.  COMET will compare the actual return 
  4902.              code with this value.  If they are not the same, an error will be 
  4903.              flagged.  If this parameter is not specified, an error will be 
  4904.              flagged if the return code is not good. 
  4905.  
  4906.  Sample Code 
  4907.  
  4908.  
  4909. ΓòÉΓòÉΓòÉ 5.4.3. NetMessageLogFileGet(Admin) ΓòÉΓòÉΓòÉ
  4910.  
  4911. Retrieve the name of the message log file and the current logging status (on or 
  4912. off). 
  4913.  
  4914. SYNTAX 
  4915.  
  4916. LAN MESSAGE_LOG_FILE_GET   [SERVER=\\servername,]         [BUFLEN=buffer_size,] 
  4917. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  4918.  
  4919. Where: 
  4920.  
  4921.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  4922.              this parameter is not specified. A NULL pointer is passed to API 
  4923.              call if this parameter has value of NULL. Local computer is 
  4924.              assumed if this parameter contains NULL string or NULL pointer. 
  4925.  
  4926.  BUFLEN      The size of buffer for the returned parameter's value. If this 
  4927.              parameter is not specified, the default size 256 is assumed. 
  4928.  
  4929.  OUTFILE     Specify the file name where the returned information will be 
  4930.              stored. The returned information will be appended to this file. If 
  4931.              this parameter is not specified, the returned information will be 
  4932.              displayed to the screen when the debug is on. Information returned 
  4933.              include: 
  4934.  
  4935.      name of the log file 
  4936.      message logging flag ( 1 for enabled, 0 for disabled) 
  4937.  
  4938.  RC          is the expected return code.  COMET will compare the actual return 
  4939.              code with this value.  If they are not the same, an error will be 
  4940.              flagged.  If this parameter is not specified, an error will be 
  4941.              flagged if the return code is not good. 
  4942.  
  4943.  Sample Code 
  4944.  
  4945.  
  4946. ΓòÉΓòÉΓòÉ 5.4.4. NetMessageLogFileSet (Admin) ΓòÉΓòÉΓòÉ
  4947.  
  4948. Specify a file to log messages received by registered users and enable or 
  4949. disable logging. 
  4950.  
  4951. SYNTAX 
  4952.  
  4953. LAN MESSAGE_LOG_FILE_SET   [SERVER=\\servername,]         [DEVICE=filespec,] 
  4954. LOGGING=< 0 | 1 >,         [RC=expected_return_code]; 
  4955.  
  4956. Where: 
  4957.  
  4958.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  4959.              this parameter is not specified. A NULL pointer is passed to API 
  4960.              call if this parameter has value of NULL. Local computer is 
  4961.              assumed if this parameter contains NULL string or NULL pointer. 
  4962.  
  4963.  DEVICE      The filename of a file or device (LPTn or COMn) to which the 
  4964.              messages are logged. A NULL string is passed to API call if this 
  4965.              parameter is not specified. A NULL pointer is passed to API call 
  4966.              if this parameter has value of NULL. A NULL pointer indicates the 
  4967.              name of the current message log file does not change. If this 
  4968.              parameter is not specified, the LOGGING parameter must be 0, and 
  4969.              no message file is used for message logging. If the file extension 
  4970.              is not specified, the .LOG file extension is appended. 
  4971.  
  4972.  LOGGING     A flag to indicate whether or not logging is enabled. A value of 0 
  4973.              indicates disabled, 1 indicates enabled. Any other value may cause 
  4974.              an error return code. 
  4975.  
  4976.  RC          is the expected return code.  COMET will compare the actual return 
  4977.              code with this value.  If they are not the same, an error will be 
  4978.              flagged.  If this parameter is not specified, an error will be 
  4979.              flagged if the return code is not good. 
  4980.  
  4981.  Sample Code 
  4982.  
  4983.  
  4984. ΓòÉΓòÉΓòÉ 5.4.5. NetMessageNameAdd (Admin) ΓòÉΓòÉΓòÉ
  4985.  
  4986. Register a user's name in the message-name table. 
  4987.  
  4988. SYNTAX 
  4989.  
  4990. LAN MESSAGE_NAME_ADD   [SERVER=\\servername,]         NAME=username, 
  4991. [FWDACTION=< 0 | non-zero >,]         [RC=expected_return_code]; 
  4992.  
  4993. Where: 
  4994.  
  4995.  SERVER          Name of the remote server. A NULL string is passed to API call 
  4996.                  if this parameter is not specified. A NULL pointer is passed 
  4997.                  to API call if this parameter has value of NULL. Local 
  4998.                  computer is assumed if this parameter contains NULL string or 
  4999.                  NULL pointer. 
  5000.  
  5001.  NAME            A user name to add to the message-name table. 
  5002.  
  5003.  FWDACTION       Specify the action to take if the name. is already forwarded. 
  5004.                  If this parameter is 0, the name is added to the message-name 
  5005.                  table. A non-zero value causes an error to be returned if the 
  5006.                  name has already been forwarded. If this parameter is not 
  5007.                  specified, a non-zero value is assumed. 
  5008.  
  5009.  RC              is the expected return code.  COMET will compare the actual 
  5010.                  return code with this value.  If they are not the same, an 
  5011.                  error will be flagged.  If this parameter is not specified, an 
  5012.                  error will be flagged if the return code is not good. 
  5013.  
  5014.  Sample Code 
  5015.  
  5016.  
  5017. ΓòÉΓòÉΓòÉ 5.4.6. NetMessageNameDel (Admin) ΓòÉΓòÉΓòÉ
  5018.  
  5019. Delete a user's name from the message-name table. 
  5020.  
  5021. SYNTAX 
  5022.  
  5023. LAN MESSAGE_NAME_DEL   [SERVER=\\servername,]         NAME=username, 
  5024. [FWDACTION=< 1 | other value >,]         [RC=expected_return_code]; 
  5025.  
  5026. Where: 
  5027.  
  5028.  SERVER          Name of the remote server. A NULL string is passed to API call 
  5029.                  if this parameter is not specified. A NULL pointer is passed 
  5030.                  to API call if this parameter has value of NULL. Local 
  5031.                  computer is assumed if this parameter contains NULL string or 
  5032.                  NULL pointer. 
  5033.  
  5034.  NAME            A user name to be removed from the message-name table. 
  5035.  
  5036.  FWDACTION       Specify the action to take if the message for name are being 
  5037.                  forwarded to another username. If the value is 1, the 
  5038.                  forwarded name is deleted. Any other value prevents the name 
  5039.                  from being deleted. If this parameter is not specified, 0 is 
  5040.                  assumed. 
  5041.  
  5042.  RC              is the expected return code.  COMET will compare the actual 
  5043.                  return code with this value.  If they are not the same, an 
  5044.                  error will be flagged.  If this parameter is not specified, an 
  5045.                  error will be flagged if the return code is not good. 
  5046.  
  5047.  Sample Code 
  5048.  
  5049.  
  5050. ΓòÉΓòÉΓòÉ 5.4.7. NetMessageNameEnum (Admin) ΓòÉΓòÉΓòÉ
  5051.  
  5052. List the username entries in a message-name table. 
  5053.  
  5054. SYNTAX 
  5055.  
  5056. LAN MESSAGE_NAME_ENUM  [SERVER=\\servername,]         [LEVEL=< 0 | 1 > ,] 
  5057. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5058. [RC=expected_return_code]; 
  5059.  
  5060. Where: 
  5061.  
  5062.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5063.              this parameter is not specified. A NULL pointer is passed to API 
  5064.              call if this parameter has value of NULL. Local computer is 
  5065.              assumed if this parameter contains NULL string or NULL pointer. 
  5066.  
  5067.  LEVEL       Specify the level of detail to be returned. Valid value for this 
  5068.              parameter is either 0 or 1. Any other value will cause an error 
  5069.              return code. If this parameter is omitted, the default value 0 is 
  5070.              assumed. 
  5071.  
  5072.  BUFLEN      The size of buffer that holds the returned data. If not specified, 
  5073.              the default size 256 is assumed. 
  5074.  
  5075.  OUTFILE     Specify the file name where the returned information will be 
  5076.              stored. The returned information will be appended to this file. If 
  5077.              this parameter is not specified, the returned information will be 
  5078.              displayed to the screen when the debug is on. Information returned 
  5079.              include: 
  5080.  
  5081.      information of level 0 or 1 of each entry 
  5082.      number of entries read 
  5083.      number of entries available 
  5084.  
  5085.  RC          is the expected return code.  COMET will compare the actual return 
  5086.              code with this value.  If they are not the same, an error will be 
  5087.              flagged.  If this parameter is not specified, an error will be 
  5088.              flagged if the return code is not good. 
  5089.  
  5090.  Sample Code 
  5091.  
  5092.  
  5093. ΓòÉΓòÉΓòÉ 5.4.8. NetMessageNameFwd (Admin) ΓòÉΓòÉΓòÉ
  5094.  
  5095. Modify the message-name table to forward a user's message to another user. 
  5096.  
  5097. SYNTAX 
  5098.  
  5099. LAN MESSAGE_NAME_FWD   [SERVER=\\servername,]         [NAME=username,] 
  5100. [FWDNAME=name,]         [ACTION=< 1 | other value>,] 
  5101. [RC=expected_return_code]; 
  5102.  
  5103. Where: 
  5104.  
  5105.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5106.              this parameter is not specified. A NULL pointer is passed to API 
  5107.              call if this parameter has value of NULL. Local computer is 
  5108.              assumed if this parameter contains NULL string or NULL pointer. 
  5109.  
  5110.  NAME        The username receiving messages. If this parameter is not 
  5111.              specified, a NULL string is passed to API and an error return code 
  5112.              is expected. 
  5113.  
  5114.  FWDNAME     The username to receive name's forwarded message. If this 
  5115.              parameter is not specified, a NULL string is passed to API and an 
  5116.              error return code is expected. 
  5117.  
  5118.  ACTION      Specify the action to take if name forwards messages to another 
  5119.              username. If 1, any previous forwarded username is deleted; any 
  5120.              other value will return an error. If this parameter is not 
  5121.              specified, default value 0 is assumed. 
  5122.  
  5123.  RC          is the expected return code.  COMET will compare the actual return 
  5124.              code with this value.  If they are not the same, an error will be 
  5125.              flagged.  If this parameter is not specified, an error will be 
  5126.              flagged if the return code is not good. 
  5127.  
  5128.  Sample Code 
  5129.  
  5130.  
  5131. ΓòÉΓòÉΓòÉ 5.4.9. NetMessageNameGetInfo (Admin) ΓòÉΓòÉΓòÉ
  5132.  
  5133. Retrieve information about a user's entry in the message-name table. 
  5134.  
  5135. SYNTAX 
  5136.  
  5137. LAN MESSAGE_NAME_GET_INFO [SERVER=\\servername,]          [NAME=name,] 
  5138. [LEVEL=< 0 | 1 >,]          [BUFLEN=buffer_size,] 
  5139. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  5140.  
  5141. Where: 
  5142.  
  5143.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5144.              this parameter is not specified. A NULL pointer is passed to API 
  5145.              call if this parameter has value of NULL. Local computer is 
  5146.              assumed if this parameter contains NULL string or NULL pointer. 
  5147.  
  5148.  NAME        The name of the user of interest. If this parameter is not 
  5149.              specified, a NULL string is passed to API and an error return code 
  5150.              is expected. 
  5151.  
  5152.  LEVEL       Specify the level of detail to be returned. Valid value for this 
  5153.              parameter is either 0 or 1. Any other value will cause an error 
  5154.              return code. If this parameter is not specified, 0 is assumed for 
  5155.              this parameter. 
  5156.  
  5157.  BUFLEN      The size of buffer that holds the returned data. If not specified, 
  5158.              the default size 256 is assumed. 
  5159.  
  5160.  OUTFILE     Specify the file name where the returned information will be 
  5161.              stored. The returned information will be appended to this file. If 
  5162.              this parameter is not specified, the returned information will be 
  5163.              displayed to the screen when the debug is on. Information returned 
  5164.              include: 
  5165.  
  5166.      information in the data structure of level 0 or 1 
  5167.      number of bytes of information were available 
  5168.  
  5169.  RC          is the expected return code.  COMET will compare the actual return 
  5170.              code with this value.  If they are not the same, an error will be 
  5171.              flagged.  If this parameter is not specified, an error will be 
  5172.              flagged if the return code is not good. 
  5173.  
  5174.  Sample Code 
  5175.  
  5176.  
  5177. ΓòÉΓòÉΓòÉ 5.4.10. NetMessageNameUnFwd (Admin) ΓòÉΓòÉΓòÉ
  5178.  
  5179. Stop forwarding a user's message to another user. 
  5180.  
  5181. SYNTAX 
  5182.  
  5183. LAN MESSAGE_NAME_UN_FWD  [SERVER=\\servername,]          [NAME=name,] 
  5184. [RC=expected_return_code]; 
  5185.  
  5186. Where: 
  5187.  
  5188.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5189.              this parameter is not specified. A NULL pointer is passed to API 
  5190.              call if this parameter has value of NULL. Local computer is 
  5191.              assumed if this parameter contains NULL string or NULL pointer. 
  5192.  
  5193.  NAME        The username whose message forwarding is to be cancelled. If this 
  5194.              parameter is not specified, a NULL string is passed to API and an 
  5195.              error return code is expected. 
  5196.  
  5197.  RC          is the expected return code.  COMET will compare the actual return 
  5198.              code with this value.  If they are not the same, an error will be 
  5199.              flagged.  If this parameter is not specified, an error will be 
  5200.              flagged if the return code is not good. 
  5201.  
  5202.  Sample Code 
  5203.  
  5204.  
  5205. ΓòÉΓòÉΓòÉ 5.5. LAN API - Server ΓòÉΓòÉΓòÉ
  5206.  
  5207. The functions in the Server category allow an application to perform remote 
  5208. administrative tasks on a local or remote server. 
  5209.  
  5210.  
  5211. ΓòÉΓòÉΓòÉ 5.5.1. NetServerAdminCommand (Admin, Server) ΓòÉΓòÉΓòÉ
  5212.  
  5213. Execute a command on a server. 
  5214.  
  5215. Syntax 
  5216.  
  5217. LAN SERVER_ADMIN_COMMAND   [SERVER=\\servername,]         COMMAND=command, 
  5218. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5219. [RC=expected_return_code]; 
  5220.  
  5221. Where: 
  5222.  
  5223.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5224.              this parameter is not specified. A NULL pointer is passed to API 
  5225.              call if this parameter has value of NULL. Local computer is 
  5226.              assumed if this parameter contains NULL string or NULL pointer. 
  5227.  
  5228.  COMMAND     The command to execute. 
  5229.  
  5230.  BUFLEN      The size of buffer allocated for the returned information. If this 
  5231.              parameter is not specified, the default size 256 is assumed. 
  5232.  
  5233.  OUTFILE     The file where the returned data is stored. The returned 
  5234.              information will be appended to this file. If this parameter is 
  5235.              not specified, the returned information will be displayed to the 
  5236.              screen when the debug is on. The information include: 
  5237.  
  5238.      returned exit code of the executed command. 
  5239.      returned command's output. 
  5240.      number of bytes of information returned. 
  5241.      number of bytes of information available. 
  5242.  
  5243.  RC          is the expected return code.  COMET will compare the actual return 
  5244.              code with this value.  If they are not the same, an error will be 
  5245.              flagged.  If this parameter is not specified, an error will be 
  5246.              flagged if the return code is not good. 
  5247.  
  5248.  Sample Code 
  5249.  
  5250.  
  5251. ΓòÉΓòÉΓòÉ 5.5.2. NetServerDiskEnum (Admin) ΓòÉΓòÉΓòÉ
  5252.  
  5253. Retrieve a list of disk drives on a server. 
  5254.  
  5255. Syntax 
  5256.  
  5257. LAN SERVER_DISK_ENUM   [SERVER=\\servername,]         [LEVEL=0,] 
  5258. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5259. [RC=expected_return_code]; 
  5260.  
  5261. Where: 
  5262.  
  5263.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5264.              this parameter is not specified. A NULL pointer is passed to API 
  5265.              call if this parameter has value of NULL. Local computer is 
  5266.              assumed if this parameter contains NULL string or NULL pointer. 
  5267.  
  5268.  LEVEL       This parameter must be 0. Other value will cause an error return 
  5269.              code. If this parameter is not specified, 0 is assumed. 
  5270.  
  5271.  BUFLEN      The size of buffer allocated for the returned information. If this 
  5272.              parameter is not specified, the default size 256 is assumed. 
  5273.  
  5274.  OUTFILE     The file where the returned data is stored. The returned 
  5275.              information will be appended to this file. If this parameter is 
  5276.              not specified, the returned information will be displayed to the 
  5277.              screen when the debug is on. The information include: 
  5278.  
  5279.      list of disk drive names returned 
  5280.      number of entries returned 
  5281.      number of entries that are available 
  5282.  
  5283.  RC          is the expected return code.  COMET will compare the actual return 
  5284.              code with this value.  If they are not the same, an error will be 
  5285.              flagged.  If this parameter is not specified, an error will be 
  5286.              flagged if the return code is not good. 
  5287.  
  5288.  Sample Code 
  5289.  
  5290.  
  5291. ΓòÉΓòÉΓòÉ 5.5.3. NetServerEnum2 ΓòÉΓòÉΓòÉ
  5292.  
  5293. Enumate the set of all machine names visible on the network. 
  5294.  
  5295. Syntax 
  5296.  
  5297. LAN SERVER_ENUM2 [SERVER=\\servername,]         [TYPE=service_type,] 
  5298. [LEVEL=< 0 | 1 >,]         [BUFLEN=buffer_size,]         [DOMAIN=domain_name,] 
  5299. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  5300.  
  5301. Where: 
  5302.  
  5303.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5304.              this parameter is not specified. A NULL pointer is passed to API 
  5305.              call if this parameter has value of NULL. Local computer is 
  5306.              assumed if this parameter contains NULL string or NULL pointer. 
  5307.  
  5308.  TYPE        Bit mask type to find. See the API FPFS for detailed description. 
  5309.              This parameter can be entered as hex value, e.g. 0x80, or integer. 
  5310.              The default is 2. 
  5311.  
  5312.  LEVEL       Specify the level of details for the returned information. Valid 
  5313.              value for this parameter is either 0 or 1. Any other value will 
  5314.              cause an error return code. If this parameter is not specified, 0 
  5315.              is assumed. 
  5316.  
  5317.  BUFLEN      The size of buffer allocated for the returned information. If this 
  5318.              parameter is not specified, the default size 256 is assumed. 
  5319.  
  5320.              Name of the domain to logon to. A null pointer is passed to API if 
  5321.              this parameter is not specified. 
  5322.  
  5323.  DOMAIN      Name of the domain to search for the server type. A null pointer 
  5324.              is passed to API if this parameter is not specified, and the 
  5325.              default domain of this requester is assumed. 
  5326.  
  5327.  OUTFILE     The file where the returned data is stored. The returned 
  5328.              information will be appended to this file. If this parameter is 
  5329.              not specified, the returned information will be displayed to the 
  5330.              screen when the debug is on. The information include: 
  5331.  
  5332.      information of level 0 or 1 of each entry 
  5333.      number of entries returned 
  5334.      number of entries that are available 
  5335.      list of servers in the domain 
  5336.  
  5337.  RC          is the expected return code.  COMET will compare the actual return 
  5338.              code with this value.  If they are not the same, an error will be 
  5339.              flagged.  If this parameter is not specified, an error will be 
  5340.              flagged if the return code is not good. 
  5341.  
  5342.  Sample Code 
  5343.  
  5344.  
  5345. ΓòÉΓòÉΓòÉ 5.5.4. NetServerGetInfo (Partially admin, Server) ΓòÉΓòÉΓòÉ
  5346.  
  5347. Retrieve information about a particular server. 
  5348.  
  5349. Syntax 
  5350.  
  5351. LAN SERVER_GET_INFO [SERVER=\\servername,]         [LEVEL=<0 | 1 | 2 | 3>,] 
  5352. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5353. [RC=expected_return_code]; 
  5354.  
  5355. Where: 
  5356.  
  5357.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5358.              this parameter is not specified. A NULL pointer is passed to API 
  5359.              call if this parameter has value of NULL. Local computer is 
  5360.              assumed if this parameter contains NULL string or NULL pointer. 
  5361.  
  5362.  LEVEL       Specify the level of detail for the returned information. The 
  5363.              value is either 0, 1, 2, or 3. Any other value will cause an error 
  5364.              return code. If this parameter is omitted, the default value 0 is 
  5365.              assumed. 
  5366.  
  5367.  BUFLEN      The size of buffer allocated for the returned information. If this 
  5368.              parameter is not specified, the default size 256 is assumed. 
  5369.  
  5370.  OUTFILE     The file where the returned data is stored. The returned 
  5371.              information will be appended to this file. If this parameter is 
  5372.              not specified, the returned information will be displayed to the 
  5373.              screen when the debug is on. The information include: 
  5374.  
  5375.      information of level 0, 1, 2, or 3 
  5376.      number of bytes of information returned 
  5377.      number of bytes of information available 
  5378.  
  5379.  RC          is the expected return code.  COMET will compare the actual return 
  5380.              code with this value.  If they are not the same, an error will be 
  5381.              flagged.  If this parameter is not specified, an error will be 
  5382.              flagged if the return code is not good. 
  5383.  
  5384.  Sample Code 
  5385.  
  5386.  
  5387. ΓòÉΓòÉΓòÉ 5.5.5. NetServerSetInfo (Admin, Server) ΓòÉΓòÉΓòÉ
  5388.  
  5389. Set a server's operation parameters. 
  5390.  
  5391. Syntax 
  5392.  
  5393. LAN SERVER_SET_INFO [SERVER=\\servername,]         [LEVEL=<1 | 2 | 3>,] 
  5394. [BUFLEN=buffer_size,]         PARMNUM=parameter_position, 
  5395. [PARMVAL=parameter_value,]         [RC=expected_return_code]; 
  5396.  
  5397. Where: 
  5398.  
  5399.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5400.              this parameter is not specified. A NULL pointer is passed to API 
  5401.              call if this parameter has value of NULL. Local computer is 
  5402.              assumed if this parameter contains NULL string or NULL pointer. 
  5403.  
  5404.  LEVEL       Specify the level of detail for the returned information. Valid 
  5405.              value for this parameter is either 1, 2 or 3. Any other value will 
  5406.              cause an error return code. If this parameter is not specified, 
  5407.              the default value is 1. 
  5408.  
  5409.  BUFLEN      The size of buffer allocated for the returned information. If this 
  5410.              parameter is not specified, the default size 256 is assumed. 
  5411.  
  5412.  PARMNUM     Specifies the ordinal position value for the data structure 
  5413.              component. The value can be one of the following: 0, 5, 10, 11, 
  5414.              17, 18, 37, 38, 39, 40, 41, 42, 43. Any other value may cause an 
  5415.              error return code. When this parameter is 0, the current data 
  5416.              structure of server_info of the server is passed to API call, and 
  5417.              the value of PARMVAL is ignored. 
  5418.  
  5419.  PARMVAL     The value of the parameter specified by PARMNUM. This parameter 
  5420.              can be omitted only when PARMNUM is 0. 
  5421.  
  5422.  RC          is the expected return code.  COMET will compare the actual return 
  5423.              code with this value.  If they are not the same, an error will be 
  5424.              flagged.  If this parameter is not specified, an error will be 
  5425.              flagged if the return code is not good. 
  5426.  
  5427.  Sample Code 
  5428.  
  5429.  
  5430. ΓòÉΓòÉΓòÉ 5.6. LAN API - Services ΓòÉΓòÉΓòÉ
  5431.  
  5432. The functions in the Service category start and control network service 
  5433. programs. All functions can be called on a local machine with ordinary user's 
  5434. privilege. Administrator's privilege is required for remote execution. 
  5435.  
  5436.  
  5437. ΓòÉΓòÉΓòÉ 5.6.1. NetServiceControl (Admin) ΓòÉΓòÉΓòÉ
  5438.  
  5439. Control the operation of network services. 
  5440.  
  5441. Syntax 
  5442.  
  5443. LAN SERVICE_CONTROL [SERVER=\\servername,]         SERVICE=service_name, 
  5444. OPCODE=code,         ARG=arg,         [BUFLEN=buffer_size,] 
  5445. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  5446.  
  5447. Where: 
  5448.  
  5449.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5450.              this parameter is not specified. A NULL pointer is passed to API 
  5451.              call if this parameter has value of NULL. Local computer is 
  5452.              assumed if this parameter contains NULL string or NULL pointer. 
  5453.  
  5454.  SERVICE     Name of the network service being controlled. 
  5455.  
  5456.  OPCODE      The action to perform on the service. 
  5457.  
  5458.      0 - interrogate service status 
  5459.      1 - pause service 
  5460.      2 - continue service 
  5461.      3 - uninstall service 
  5462.  
  5463.  ARG         Specify which service-specific operation to perform. The values 
  5464.              are: 
  5465.  
  5466.      1 - disk resource 
  5467.      2 - print resource 
  5468.      4 - serial device 
  5469.  
  5470.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5471.              parameter is not specified, the default size 256 is assumed. 
  5472.  
  5473.  OUTFILE     The file where the returned data is stored. The returned 
  5474.              information will be appended to this file. If this parameter is 
  5475.              not specified, the returned information will be displayed to the 
  5476.              screen when the debug is on. The returned information include: 
  5477.  
  5478.      status of the service 
  5479.      error code 
  5480.      service's program ID (PID) 
  5481.      error message if any when the service is stopped 
  5482.  
  5483.  RC          is the expected return code.  COMET will compare the actual return 
  5484.              code with this value.  If they are not the same, an error will be 
  5485.              flagged.  If this parameter is not specified, an error will be 
  5486.              flagged if the return code is not good. 
  5487.  
  5488.              REMARKS: 
  5489.  
  5490.              If the operation requested by the control opcode takes a long time 
  5491.              to complete, the status and code values returned by the API may be 
  5492.              intermediate. For long-running operations, an application should 
  5493.              issue successive calls to NetServiceControl to verify that the 
  5494.              operation has completed. 
  5495.  
  5496.  Sample Code 
  5497.  
  5498.  
  5499. ΓòÉΓòÉΓòÉ 5.6.2. NetServiceEnum ΓòÉΓòÉΓòÉ
  5500.  
  5501. Retrieve information about all network services that are started. 
  5502.  
  5503. Syntax 
  5504.  
  5505. LAN SERVICE_ENUM   [SERVER=\\servername,]         [LEVEL=< 0 | 1 | 2 >,] 
  5506. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5507. [RC=expected_return_code]; 
  5508.  
  5509. Where: 
  5510.  
  5511.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5512.              this parameter is not specified. A NULL pointer is passed to API 
  5513.              call if this parameter has value of NULL. Local computer is 
  5514.              assumed if this parameter contains NULL string or NULL pointer. 
  5515.  
  5516.  LEVEL       The level of detail requested. The value can be 0, 1, or 2. Any 
  5517.              other value will cause an error return code. If this parameter is 
  5518.              omitted, the default value 2 is assumed. 
  5519.  
  5520.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5521.              parameter is not specified, the default size 256 is assumed. 
  5522.  
  5523.  OUTFILE     The file where the returned data is stored. The returned 
  5524.              information will be appended to this file. If this parameter is 
  5525.              not specified, the returned information will be displayed to the 
  5526.              screen when the debug is on. The information include: 
  5527.  
  5528.      returned data of level 0, 1 or 2 of each entry 
  5529.      number of entries returned 
  5530.      number of entries available 
  5531.  
  5532.  RC          is the expected return code.  COMET will compare the actual return 
  5533.              code with this value.  If they are not the same, an error will be 
  5534.              flagged.  If this parameter is not specified, an error will be 
  5535.              flagged if the return code is not good. 
  5536.  
  5537.  Sample Code 
  5538.  
  5539.  
  5540. ΓòÉΓòÉΓòÉ 5.6.3. NetServiceGetInfo (Admin) ΓòÉΓòÉΓòÉ
  5541.  
  5542. Retrieve information about a particular installed network service. 
  5543.  
  5544. Syntax 
  5545.  
  5546. LAN SERVICE_GET_INFO [SERVER=\\servername,]         [SERVICE=servicename,] 
  5547. [LEVEL=< 0 | 1 | 2 >,]         [BUFLEN=buffer_size,] 
  5548. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  5549.  
  5550. Where: 
  5551.  
  5552.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5553.              this parameter is not specified. A NULL pointer is passed to API 
  5554.              call if this parameter has value of NULL. Local computer is 
  5555.              assumed if this parameter contains NULL string or NULL pointer. 
  5556.  
  5557.  SERVICE     Name of the network service being requested. If this parameter is 
  5558.              not specified, a NULL string is passed to the API and an error 
  5559.              return code is expected. 
  5560.  
  5561.  LEVEL       The level of detail requested. The value can be 0, 1, or 2. Any 
  5562.              other value will cause an error return code. If this parameter is 
  5563.              omitted, the default value 2 is assumed. 
  5564.  
  5565.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5566.              parameter is not specified, the default size 256 is assumed. 
  5567.  
  5568.  OUTFILE     The file where the returned data is stored. The returned 
  5569.              information will be appended to this file. If this parameter is 
  5570.              not specified, the returned information will be displayed to the 
  5571.              screen when the debug is on. The information include: 
  5572.  
  5573.      returned data of level 0, 1 or 2 
  5574.      number of bytes of available information 
  5575.  
  5576.  RC          is the expected return code.  COMET will compare the actual return 
  5577.              code with this value.  If they are not the same, an error will be 
  5578.              flagged.  If this parameter is not specified, an error will be 
  5579.              flagged if the return code is not good. 
  5580.  
  5581.  Sample Code 
  5582.  
  5583.  
  5584. ΓòÉΓòÉΓòÉ 5.6.4. NetServiceInstall (Admin) ΓòÉΓòÉΓòÉ
  5585.  
  5586. Start a network service. 
  5587.  
  5588. Syntax 
  5589.  
  5590. LAN SERVICE_INSTALL [SERVER=\\servername,]         [SERVICE=servicename,] 
  5591. [CMDARGS=parameter_lists,]         [BUFLEN=buffer_size,] 
  5592. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  5593.  
  5594. Where: 
  5595.  
  5596.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5597.              this parameter is not specified. A NULL pointer is passed to API 
  5598.              call if this parameter has value of NULL. Local computer is 
  5599.              assumed if this parameter contains NULL string or NULL pointer. 
  5600.  
  5601.  SERVICE     Name of the network service being requested. If this parameter is 
  5602.              not specified, a NULL string is passed to the API and an error 
  5603.              return code is expected. 
  5604.  
  5605.  CMDARGS     Specify the command arguments of the specified service. This 
  5606.              parameter can contain one or several arguments. When more than one 
  5607.              arguments are specified, one space must exists between the 
  5608.              arguments. e.g. 
  5609.  
  5610.               CMDARGS="COMPUTER:NEW CHARWAIT:30",  or 
  5611.  
  5612.               CMDARGS=COMPUTERNAME=NEW, A NULL pointer is passed to API call if 
  5613.              this parameter is not specified, or has value of NULL. 
  5614.  
  5615.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5616.              parameter is not specified, the default size 256 is assumed. 
  5617.  
  5618.  OUTFILE     The file where the returned data is stored. The returned 
  5619.              information will be appended to this file. If this parameter is 
  5620.              not specified, the returned information will be displayed to the 
  5621.              screen when the debug is on. The information include: 
  5622.  
  5623.      status of the service 
  5624.      error code 
  5625.      service's program identification number (PID) 
  5626.  
  5627.  RC          is the expected return code.  COMET will compare the actual return 
  5628.              code with this value.  If they are not the same, an error will be 
  5629.              flagged.  If this parameter is not specified, an error will be 
  5630.              flagged if the return code is not good. 
  5631.  
  5632.  Sample Code 
  5633.  
  5634.  
  5635. ΓòÉΓòÉΓòÉ 5.6.5. NetServiceStatus ΓòÉΓòÉΓòÉ
  5636.  
  5637. Set status and code information for a network service. 
  5638.  
  5639. (Note: Only the service application programs can call this API to update their 
  5640. status and code table. In COMET, this API will return with error code 2184.) 
  5641.  
  5642. Syntax 
  5643.  
  5644. LAN SERVICE_STATUS         [SERVICE=service,]         [STATUS=status,] 
  5645. [CODE1=error_code,]         [CODE2=error_code,] 
  5646. [RC=expected_return_code]; 
  5647.  
  5648. Where: 
  5649.  
  5650.  SERVICE     Specify the name of service application. The default is NULL 
  5651.              string. 
  5652.  
  5653.  STATUS      The bit mask of status of the service. This parameter is entered 
  5654.              as hex format. The default value is 0. 
  5655.  
  5656.  CODE1       Specify the high word error code when a service uninstalls or 
  5657.              fails to install properly. This parameter is entered as integer 
  5658.              format. The default value is 0. 
  5659.  
  5660.  CODE2       Specify the low word error code when a service uninstalls or fails 
  5661.              to install properly. This parameter is entered as integer format. 
  5662.              The default value is 0. CODE1 and CODE2 are combined to an 
  5663.              unsigned long interger and passed to API. 
  5664.  
  5665.  RC          is the expected return code.  COMET will compare the actual return 
  5666.              code with this value.  If they are not the same, an error will be 
  5667.              flagged.  If this parameter is not specified, an error will be 
  5668.              flagged if the return code is not good. 
  5669.  
  5670.  Sample Code 
  5671.  
  5672.  
  5673. ΓòÉΓòÉΓòÉ 5.7. LAN API - Sessions ΓòÉΓòÉΓòÉ
  5674.  
  5675. The functions in the Sessions category control network sessions established 
  5676. between requesters and servers. 
  5677.  
  5678.  
  5679. ΓòÉΓòÉΓòÉ 5.7.1. NetSessionDel (Admin, Server) ΓòÉΓòÉΓòÉ
  5680.  
  5681. End a session between a requester and a server. 
  5682.  
  5683. Syntax 
  5684.  
  5685. LAN SESSION_DEL  [SERVER=\\servername,]        CNAME=computer_name, 
  5686. [RC=expected_return_code]; 
  5687.  
  5688. Where: 
  5689.  
  5690.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5691.              this parameter is not specified. A NULL pointer is passed to API 
  5692.              call if this parameter has value of NULL. Local computer is 
  5693.              assumed if this parameter contains NULL string or NULL pointer. 
  5694.  
  5695.  CNAME       Name of the computer that established the session being 
  5696.              discontinued. 
  5697.  
  5698.  RC          is the expected return code.  COMET will compare the actual return 
  5699.              code with this value.  If they are not the same, an error will be 
  5700.              flagged.  If this parameter is not specified, an error will be 
  5701.              flagged if the return code is not good. 
  5702.  
  5703.  Sample Code 
  5704.  
  5705.  
  5706. ΓòÉΓòÉΓòÉ 5.7.2. NetSessionEnum (Partially Admin, Server) ΓòÉΓòÉΓòÉ
  5707.  
  5708. Provide information on all current sessions to a server. Non-admin users can 
  5709. get session information at level 0 or level 10. 
  5710.  
  5711. Syntax 
  5712.  
  5713. LAN SESSION_ENUM  [SERVER=\\servername,]        [LEVEL=< 0 | 1 | 2 | 10 >,] 
  5714. [BUFLEN=buffer_size,]        [OUTFILE=output_file_name,] 
  5715. [RC=expected_return_code]; 
  5716.  
  5717. Where: 
  5718.  
  5719.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5720.              this parameter is not specified. A NULL pointer is passed to API 
  5721.              call if this parameter has value of NULL. Local computer is 
  5722.              assumed if this parameter contains NULL string or NULL pointer. 
  5723.  
  5724.  LEVEL       Specify the level of detail for the requested information. Valid 
  5725.              value for this parameter is either 0, 1, 2, or 10. Any other value 
  5726.              will cause an error return code. If this parameter is no 
  5727.              specified, the default value 0 is assumed. 
  5728.  
  5729.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5730.              parameter is not specified, the default size 256 is assumed. 
  5731.  
  5732.  OUTFILE     The file where the returned data is stored. The returned 
  5733.              information will be appended to this file. If this parameter is 
  5734.              not specified, the returned information will be displayed to the 
  5735.              screen when the debug is on. The returned data include: 
  5736.  
  5737.      level 0 , level 1 or level 10 information of each entry 
  5738.      number of entries returned 
  5739.      number of entries that are available 
  5740.  
  5741.  RC          is the expected return code.  COMET will compare the actual return 
  5742.              code with this value.  If they are not the same, an error will be 
  5743.              flagged.  If this parameter is not specified, an error will be 
  5744.              flagged if the return code is not good. 
  5745.  
  5746.  Sample Code 
  5747.  
  5748.  
  5749. ΓòÉΓòÉΓòÉ 5.7.3. NetSessionGetInfo(Partially Admin, Server) ΓòÉΓòÉΓòÉ
  5750.  
  5751. Retrieve information about a session established between a requester and 
  5752. server. Non-admin users can get session information at level 0 or level 10. 
  5753.  
  5754. Syntax 
  5755.  
  5756. LAN SESSION_GET_INFO  [SERVER=\\servername,]         CNAME=compueter_name, 
  5757. [LEVEL=< 0 | 1 | 2 | 10 >,]         [BUFLEN=buffer_size,] 
  5758. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  5759.  
  5760. Where: 
  5761.  
  5762.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5763.              this parameter is not specified. A NULL pointer is passed to API 
  5764.              call if this parameter has value of NULL. Local computer is 
  5765.              assumed if this parameter contains NULL string or NULL pointer. 
  5766.  
  5767.  CNAME       Name of the computer whose session is to be monitored. 
  5768.  
  5769.  LEVEL       Specify the level of detail for the requested information. Valid 
  5770.              value for this parameter is either 0, 1, 2, or 10. Any other value 
  5771.              will cause an error return code. If this parameter is no 
  5772.              specified, the default value 0 is assumed. 
  5773.  
  5774.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5775.              parameter is not specified, the default size 256 is assumed. 
  5776.  
  5777.  OUTFILE     The file where the returned data is stored. The returned 
  5778.              information will be appended to this file. If this parameter is 
  5779.              not specified, the returned information will be displayed to the 
  5780.              screen when the debug is on. The returned data include: 
  5781.  
  5782.      level 0, level 1 or level 10 information 
  5783.      number of bytes of the available information 
  5784.  
  5785.  RC          is the expected return code.  COMET will compare the actual return 
  5786.              code with this value.  If they are not the same, an error will be 
  5787.              flagged.  If this parameter is not specified, an error will be 
  5788.              flagged if the return code is not good. 
  5789.  
  5790.  Sample Code 
  5791.  
  5792.  
  5793. ΓòÉΓòÉΓòÉ 5.8. LAN API - Requester ΓòÉΓòÉΓòÉ
  5794.  
  5795. The functions in the Requester category control the operation of requesters. 
  5796.  
  5797.  
  5798. ΓòÉΓòÉΓòÉ 5.8.1. NetWkstaGetInfo (Partially Admin) ΓòÉΓòÉΓòÉ
  5799.  
  5800. Retrieve information about a requester's configuration components. 
  5801.  
  5802. Syntax 
  5803.  
  5804. LAN WKSTA_GET_INFO  [SERVER=\\servername,]         [LEVEL=<0 | 1 | 10>,] 
  5805. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5806. [RC=expected_return_code]; 
  5807.  
  5808. Where: 
  5809.  
  5810.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5811.              this parameter is not specified. A NULL pointer is passed to API 
  5812.              call if this parameter has value of NULL. Local computer is 
  5813.              assumed if this parameter contains NULL string or NULL pointer. 
  5814.  
  5815.  LEVEL       Specify the level of detail for the returned information. The 
  5816.              value is either 0, 1, or 10. Any other value will cause an error 
  5817.              return code. If this parameter is not specified, the default value 
  5818.              is 0. 
  5819.  
  5820.  BUFLEN      Size of buffer to allocate for the returned information. If this 
  5821.              parameter is not specified, the default size 256 is assumed. 
  5822.  
  5823.  OUTFILE     The file where the returned data is stored. The returned 
  5824.              information will be appended to this file. If this parameter is 
  5825.              not specified, the returned information will be displayed to the 
  5826.              screen when the debug is on. The information include: 
  5827.  
  5828.      information in level 0, 1, or 10. 
  5829.      number of bytes of information available. 
  5830.  
  5831.  RC          is the expected return code.  COMET will compare the actual return 
  5832.              code with this value.  If they are not the same, an error will be 
  5833.              flagged.  If this parameter is not specified, an error will be 
  5834.              flagged if the return code is not good. 
  5835.  
  5836.  Sample Code 
  5837.  
  5838.  
  5839. ΓòÉΓòÉΓòÉ 5.8.2. NetWkstaSetInfo (Admin) ΓòÉΓòÉΓòÉ
  5840.  
  5841. Configure a requester. 
  5842.  
  5843. Syntax 
  5844.  
  5845. LAN WKSTA_SET_INFO  [SERVER=\\servername,]         [LEVEL=<0 | 1 | 10>,] 
  5846. [BUFLEN=buffer_size,]         PARMNUM=parameter_number, 
  5847. [PARMVAL=parameter_value,]         [RC=expected_return_code]; 
  5848.  
  5849. Where: 
  5850.  
  5851.  SERVER      Name of the remote server. A NULL string is passed to API call if 
  5852.              this parameter is not specified. A NULL pointer is passed to API 
  5853.              call if this parameter has value of NULL. Local computer is 
  5854.              assumed if this parameter contains NULL string or NULL pointer. 
  5855.  
  5856.  LEVEL       Specify the level of detail for the returned information. Valid 
  5857.              value for this parameter is either 0, 1, or 10. Any other value 
  5858.              will cause an error return code. If this parameter is not 
  5859.              specified, the default value is 0. 
  5860.  
  5861.  BUFLEN      The size in bytes of buffer allocated for the returned 
  5862.              information. If not specified, the default size 256 is assumed. 
  5863.  
  5864.  PARMNUM     Specifies the ordinal position value for the wksta_info data 
  5865.              structure. Valid value for this parameter are: 0, 10, 11, 12, 27, 
  5866.              28, and 32. Any other value may cause an error return code. When 
  5867.              this parameter is 0, the current data structure of wksta_info of 
  5868.              the requester is passed to API call, and the value of PARMVAL is 
  5869.              ignored. 
  5870.  
  5871.  PARMVAL     The value of the parameter specified by PARMNUM. This parameter 
  5872.              can be omitted only when PARMNUM is 0. 
  5873.  
  5874.  RC          is the expected return code.  COMET will compare the actual return 
  5875.              code with this value.  If they are not the same, an error will be 
  5876.              flagged.  If this parameter is not specified, an error will be 
  5877.              flagged if the return code is not good. 
  5878.  
  5879.  Sample Code 
  5880.  
  5881.  
  5882. ΓòÉΓòÉΓòÉ 5.8.3. NetWkstaSetUID2 (Admin) ΓòÉΓòÉΓòÉ
  5883.  
  5884. Logon or logoff to the network, or change a username's password. 
  5885.  
  5886. Syntax 
  5887.  
  5888. LAN WKSTA_SET_UID2  [DOMAIN=domain_name,]         [USER=username,] 
  5889. [PASSWORD=password,]         [ACTION=<0 | 1 | 2 | 3>,]         [LEVEL=1,] 
  5890. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  5891. [RC=expected_return_code]; 
  5892.  
  5893. Where: 
  5894.  
  5895.  DOMAIN          Name of the domain to logon to. A null pointer is passed to 
  5896.                  API if this parameter is not specified, and the default domain 
  5897.                  of this requester is assumed. 
  5898.  
  5899.  USER            A username to be logged onto the requester. When this 
  5900.                  parameter is not specified, a NULL pointer is passed to API 
  5901.                  call, and the current username is logged off the requester. 
  5902.  
  5903.  PASSWORD        The password for user logon. A NULL string is passed to API 
  5904.                  when this parameter is not specified. A NULL pointer is passed 
  5905.                  to API if this parameter has value of NULL. A NULL string or 
  5906.                  NULL pointer in this parameter indicates no password is 
  5907.                  needed. 
  5908.  
  5909.  ACTION          Specify which action to take if another username is logged on 
  5910.                  the requester. 
  5911.  
  5912.     0 - Do not change UID and the function call fails. 
  5913.     1 - Logoff current user, disconnect any connections to redirected 
  5914.     resources, and logon the new username. 
  5915.     2 - Cancel any connections and other pending activities. The function call 
  5916.     fails if any connection is used by a process as the current drive. 
  5917.     3 - Always succeed by forcing all disconnections. 
  5918.  
  5919.  LEVEL           This parameter must be 1. If this parameter is not specified, 
  5920.                  the default value 1 is assumed. Any other value may cause an 
  5921.                  error return code. 
  5922.  
  5923.  BUFLEN          Size of buffer to allocate for the returned information. If 
  5924.                  this parameter is not specified, the default size 256 is 
  5925.                  assumed. 
  5926.  
  5927.  OUTFILE         The file where the returned data is stored. The returned 
  5928.                  information will be appended to this file. If this parameter 
  5929.                  is not specified, the returned information will be displayed 
  5930.                  to the screen when the debug is on. The returned data include: 
  5931.  
  5932.      level 1 information 
  5933.      number of bytes of the available information 
  5934.  
  5935.  RC              is the expected return code.  COMET will compare the actual 
  5936.                  return code with this value.  If they are not the same, an 
  5937.                  error will be flagged.  If this parameter is not specified, an 
  5938.                  error will be flagged if the return code is not good. 
  5939.  
  5940.  Sample Code 
  5941.  
  5942.  
  5943. ΓòÉΓòÉΓòÉ 5.9. LAN API - Auditing ΓòÉΓòÉΓòÉ
  5944.  
  5945. The functions in the Auditing category control the audit log file, which 
  5946. contains an audit trail of operations that occur on a server. 
  5947.  
  5948.  
  5949. ΓòÉΓòÉΓòÉ 5.9.1. NetAuditClear (admin) ΓòÉΓòÉΓòÉ
  5950.  
  5951. This function clears (and optionally saves) a server's audit log file. 
  5952.  
  5953. SYNTAX 
  5954.  
  5955. LAN AUDIT_CLEAR  [SERVER=\\servername,]          [BACKUP=backup_file_name,] 
  5956. [RC=expected_return_code]; 
  5957.  
  5958. Where: 
  5959.  
  5960.  SERVER      is the name of the remote server on which the function is to 
  5961.              execute. If this parameter is not specified then a local computer 
  5962.              will be used. 
  5963.  
  5964.  BACKUP      is a filename for an optional backup file. If the filename has a 
  5965.              relative pathname, it is assumed to be relative to the IBMLAN\LOG 
  5966.              directory. If BACKUP is not specified then the audit log entries 
  5967.              will not be saved. 
  5968.  
  5969.  RC          is the expected return code.  COMET will compare the actual return 
  5970.              code with this value.  If they are not the same, an error will be 
  5971.              flagged.  If this parameter is not specified, an error will be 
  5972.              flagged if the return code is not good. 
  5973.  
  5974.  Sample Code 
  5975.  
  5976.  
  5977. ΓòÉΓòÉΓòÉ 5.9.2. NetAuditRead (admin) ΓòÉΓòÉΓòÉ
  5978.  
  5979. This function opens and returns an OS/2 file handle to a server's audit log 
  5980. file. 
  5981.  
  5982. SYNTAX 
  5983.  
  5984. LAN AUDIT_READ  [SERVER=\\servername,]          [OFFSET=offset,] 
  5985. [FLAG=<0|1|2|3>,]          [BUFLEN=buffer_size,] 
  5986. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  5987.  
  5988. Where: 
  5989.  
  5990.  SERVER      is the name of the remote server on which the function is to 
  5991.              execute. If this parameter is not specified then a local computer 
  5992.              will be used. 
  5993.  
  5994.  OFFSET      is used to determine the number of records from the beginning of 
  5995.              the of the audit log to start reading. 
  5996.  
  5997.  FLAG        is used to determine which direction the log file is to be read. 
  5998.              The following table shows how FLAGS affects the read. 
  5999.  
  6000.                                  FLAG   RESULT
  6001.                                  ----   ---------------------------------------------------
  6002.                                   0     File read normally oldest entry first
  6003.                                   1     File read normally newest entry first
  6004.                                   2     File read starting at OFFSET from the oldest record
  6005.                                   3     File read starting at OFFSET from the newest record
  6006.              If FLAG is not specified, 0 will be used. 
  6007.  
  6008.  BUFLEN      is the size of the buffer allocated for the information returned 
  6009.              from the API. The default size is 256 bytes. 
  6010.  
  6011.  OUTFILE     is the file name where returned information is stored. The 
  6012.              returned information will be appended to the file. If this 
  6013.              parameter is not specified, the returned information will be 
  6014.              displayed to the screen if LAN DEBUG is on. The returned data 
  6015.              includes: 
  6016.  
  6017.      the audit record information 
  6018.  
  6019.  RC          is the expected return code.  COMET will compare the actual return 
  6020.              code with this value.  If they are not the same, an error will be 
  6021.              flagged.  If this parameter is not specified, an error will be 
  6022.              flagged if the return code is not good. 
  6023.  
  6024.  Sample Code 
  6025.  
  6026.  
  6027. ΓòÉΓòÉΓòÉ 5.9.3. NetAuditWrite (admin, local, server) ΓòÉΓòÉΓòÉ
  6028.  
  6029. This function writes an audit trail entry to the local audit log file. 
  6030.  
  6031. SYNTAX 
  6032.  
  6033. LAN AUDIT_WRITE  TYPE=<0|1|2|3|4|5|6|7|8|9|11|12|13|14|15|16|17|1000>, 
  6034. [RC=expected_return_code]; 
  6035.  
  6036. Where: 
  6037.  
  6038.  TYPE        is the type of audit entry to write to the audit log file. The 
  6039.              following table describes the different types of entries. 
  6040.  
  6041.                                    TYPE     ENTRY
  6042.                                    ----     -----
  6043.                                       0     Status of server changed
  6044.                                       1     Session logged on
  6045.                                       2     Session logged off
  6046.                                       3     Password error
  6047.                                       4     Connection started
  6048.                                       5     Connection stopped
  6049.                                       6     Password rejected
  6050.                                       7     Access granted
  6051.                                       8     Access rejected
  6052.                                       9     File/device/pipe closed
  6053.                                      11     Service status code or text changed
  6054.                                      12     Access control list modified
  6055.                                      13     User Profile Management database modified
  6056.                                      14     Network logon of the user
  6057.                                      15     Network logoff of the user
  6058.                                      16     Network logon denied
  6059.                                      17     Account limit exceeded
  6060.                                    1000     Unique application defined entry
  6061.  
  6062.  RC          is the expected return code.  COMET will compare the actual return 
  6063.              code with this value.  If they are not the same, an error will be 
  6064.              flagged.  If this parameter is not specified, an error will be 
  6065.              flagged if the return code is not good. 
  6066.  
  6067.  Sample Code 
  6068.  
  6069.  
  6070. ΓòÉΓòÉΓòÉ 5.10. LAN API - Error Logging (admin) ΓòÉΓòÉΓòÉ
  6071.  
  6072. The functions in the Error Logging category control the error log file. 
  6073.  
  6074.  
  6075. ΓòÉΓòÉΓòÉ 5.10.1. NetErrorLogClear ΓòÉΓòÉΓòÉ
  6076.  
  6077. This function clears and optionally saves a computer's error log file. 
  6078.  
  6079. SYNTAX 
  6080.  
  6081. LAN ERROR_LOG_CLEAR  [SERVER=\\servername,]            [BACKUP,] 
  6082. [RC=expected_return_code]; 
  6083.  
  6084. Where: 
  6085.  
  6086.  SERVER      is the name of the remote server on which the function is to 
  6087.              execute. If this parameter is not specified then a local computer 
  6088.              will be used. 
  6089.  
  6090.  BACKUP      is the name of the backup file used to save the audit trail 
  6091.              entries. If no BACKUP is specified then not entries will be saved. 
  6092.  
  6093.  RC          is the expected return code.  COMET will compare the actual return 
  6094.              code with this value.  If they are not the same, an error will be 
  6095.              flagged.  If this parameter is not specified, an error will be 
  6096.              flagged if the return code is not good. 
  6097.  
  6098.  Sample Code 
  6099.  
  6100.  
  6101. ΓòÉΓòÉΓòÉ 5.10.2. NetErrorLogRead (admin) ΓòÉΓòÉΓòÉ
  6102.  
  6103. This function opens and returns an OS/2 file handle to a computer's error log 
  6104. file. 
  6105.  
  6106. SYNTAX 
  6107.  
  6108. LAN ERROR_LOG_READ  [SERVER=\\servername,]            [OFFSET=offset,] 
  6109. [FLAG=<0|1|2|3>,]            [BUFLEN=buffer_size,] 
  6110. [OUTFILE=output_file_name,]            [RC=expected_return_code]; 
  6111.  
  6112. Where: 
  6113.  
  6114.  SERVER      is the name of the remote server on which the function is to 
  6115.              execute. If this parameter is not specified then a local computer 
  6116.              will be used. 
  6117.  
  6118.  OFFSET      is used to determine the number of records from the beginning of 
  6119.              the of the audit log to start reading. 
  6120.  
  6121.  FLAG        is used to determine which direction the log file is to be read. 
  6122.              The following table shows how FLAGS affects the read. 
  6123.  
  6124.                                  FLAG                       RESULT
  6125.                                  ----   ---------------------------------------------------
  6126.                                   0     File read normally oldest entry first
  6127.                                   1     File read normally newest entry first
  6128.                                   2     File read starting at OFFSET from the oldest record
  6129.                                   3     File read starting at OFFSET from the newest record
  6130.              If FLAG is not specified, 0 will be used. 
  6131.  
  6132.  BUFLEN      is the size of the buffer allocated for the information returned 
  6133.              from the API. The default size is 256 bytes. 
  6134.  
  6135.  OUTFILE     is the file name where returned information is stored. The 
  6136.              returned information will be appended to the file. If this 
  6137.              parameter is not specified, the returned information will be 
  6138.              displayed to the screen if LAN DEBUG is on. The returned data 
  6139.              includes: 
  6140.  
  6141.      the error log record 
  6142.  
  6143.  RC          is the expected return code.  COMET will compare the actual return 
  6144.              code with this value.  If they are not the same, an error will be 
  6145.              flagged.  If this parameter is not specified, an error will be 
  6146.              flagged if the return code is not good. 
  6147.  
  6148.  Sample Code 
  6149.  
  6150.  
  6151. ΓòÉΓòÉΓòÉ 5.10.3. NetErrorLogWrite (admin, local) ΓòÉΓòÉΓòÉ
  6152.  
  6153. This function writes an entry to a computer's error log file. 
  6154.  
  6155. SYNTAX 
  6156.  
  6157. LAN ERROR_LOG_WRITE  [COMPONENT=component_name,]            [CODE=<0-9999>,] 
  6158. [TEXT=error_text,]            [DATA=raw_error_data,] 
  6159. [BUFLEN=buffer_size,]            [RC=expected_return_code]; 
  6160.  
  6161. Where: 
  6162.  
  6163.  COMPONENT   is the name of the component that logged the error. Any string may 
  6164.              be specified. The default is COMET. 
  6165.  
  6166.  CODE        is the error code. The default is 9999. 
  6167.  
  6168.  TEXT        is the error text to be logged. Any string can be specified. The 
  6169.              default is no text. If a string is not specified, then a NULL 
  6170.              string will be passed to the function. 
  6171.  
  6172.  DATA        is the raw error data associated with the error. Any string can be 
  6173.              specified. The default is one null character. If a string is not 
  6174.              specified, one NULL character will be passed as data to the 
  6175.              function. 
  6176.  
  6177.  BUFLEN      is the buffer length of the DATA being passed. If BUFLEN is not 
  6178.              specified then the buffer length will be set to the size of the 
  6179.              DATA that was specified. 
  6180.  
  6181.  RC          is the expected return code.  COMET will compare the actual return 
  6182.              code with this value.  If they are not the same, an error will be 
  6183.              flagged.  If this parameter is not specified, an error will be 
  6184.              flagged if the return code is not good. 
  6185.  
  6186.  Sample Code 
  6187.  
  6188.  
  6189. ΓòÉΓòÉΓòÉ 5.11. LAN API - Files ΓòÉΓòÉΓòÉ
  6190.  
  6191. The functions in the Files category provide a system for monitoring which file, 
  6192. device, and pipe resources are opened on a server, and closing one of these 
  6193. resources if necessary. 
  6194.  
  6195.  
  6196. ΓòÉΓòÉΓòÉ 5.11.1. NetFileClose2 (admin, server) ΓòÉΓòÉΓòÉ
  6197.  
  6198. This function forces a resource closed. 
  6199.  
  6200. SYNTAX 
  6201.  
  6202. LAN FILE_CLOSE2  [SERVER=\\servername,]          FILE=file_name, 
  6203. [FILEID=file_id,]          [RC=expected_return_code]; 
  6204.  
  6205. Where: 
  6206.  
  6207.  SERVER      is the name of the remote server on which the function is to 
  6208.              execute. If this parameter is not specified then a local computer 
  6209.              will be used. 
  6210.  
  6211.  FILE        is the name of the file to close. 
  6212.  
  6213.  FILEID      is the id number of the file to close. If FILEID is specified, 
  6214.              then the FILE parameter is ignored. 
  6215.  
  6216.  RC          is the expected return code.  COMET will compare the actual return 
  6217.              code with this value.  If they are not the same, an error will be 
  6218.              flagged.  If this parameter is not specified, an error will be 
  6219.              flagged if the return code is not good. 
  6220.  
  6221.  Sample Code 
  6222.  
  6223.  
  6224. ΓòÉΓòÉΓòÉ 5.11.2. NetFileGetInfo2 (admin, server) ΓòÉΓòÉΓòÉ
  6225.  
  6226. This function retrieves information about a particular opening of a server 
  6227. resource. 
  6228.  
  6229. SYNTAX 
  6230.  
  6231. LAN FILE_GET_INFO2  [SERVER=\\servername,]            FILE=file_name, 
  6232. [FILEID=file_id,]            [LEVEL=<0|1>,]            [BUFLEN=buffer_size,] 
  6233. [OUTFILE=output_file_name,]            [RC=expected_return_code]; 
  6234.  
  6235. Where: 
  6236.  
  6237.  SERVER      is the name of the remote server on which the function is to 
  6238.              execute. If this parameter is not specified then a local computer 
  6239.              will be used. 
  6240.  
  6241.  FILE        is the name of the file for which information is being requested. 
  6242.  
  6243.  FILEID      is the id number of the file for which information is being 
  6244.              requested. If FILEID is specified, then the FILE parameter is 
  6245.              ignored. 
  6246.  
  6247.  LEVEL       is the level of detail returned. 0 is the lowest level of detail. 
  6248.              1 is the highest. 0 and 1 are the only acceptable values. If LEVEL 
  6249.              is not specified, then 0 is used. 
  6250.  
  6251.  BUFLEN      is the size of the buffer allocated for the information returned 
  6252.              from the API. The default size is 256 bytes. 
  6253.  
  6254.  OUTFILE     is the file name where returned information is stored. The 
  6255.              returned information will be appended to the file. If this 
  6256.              parameter is not specified, the returned information will be 
  6257.              displayed to the screen if LAN DEBUG is on. The returned data 
  6258.              includes: 
  6259.  
  6260.      how many bytes of information were available 
  6261.      the file id number 
  6262.      the opening application's access permissions 
  6263.      how many file-locks are on the file 
  6264.      the pathname to the file 
  6265.      the user that opened the file 
  6266.  
  6267.  RC          is the expected return code.  COMET will compare the actual return 
  6268.              code with this value.  If they are not the same, an error will be 
  6269.              flagged.  If this parameter is not specified, an error will be 
  6270.              flagged if the return code is not good. 
  6271.  
  6272.  Sample Code 
  6273.  
  6274.  
  6275. ΓòÉΓòÉΓòÉ 5.11.3. NetFileEnum2 (admin) ΓòÉΓòÉΓòÉ
  6276.  
  6277. This function supplies information about some or all open files on the server, 
  6278. allowing the user to supply a key to get the required information through 
  6279. iterated calls to the API. 
  6280.  
  6281. SYNTAX 
  6282.  
  6283. LAN FILE_ENUM2  [SERVER=\\servername,]          [BASEPATH=pathname,] 
  6284. [USER=username,]          [LEVEL=<0|1>,]          [BUFLEN=buffer_size,] 
  6285. [ITERATIONS=max_iterations,]          [OUTFILE=output_file_name,] 
  6286. [RC=expected_return_code]; 
  6287.  
  6288. Where: 
  6289.  
  6290.  SERVER      is the name of the remote server on which the function is to 
  6291.              execute. If this parameter is not specified then a local computer 
  6292.              will be used. 
  6293.  
  6294.  BASEPATH    is the base pathname for all list entries. If no BASEPATH is 
  6295.              specified, then all entries will be returned regardless of where 
  6296.              they reside on the server. 
  6297.  
  6298.  USER        is the name of a user that can be specified as a quantifier for 
  6299.              the enumeration. If no USER is specified then no user will be used 
  6300.              as a quantifier. 
  6301.  
  6302.  LEVEL       is the level of detail returned. 0 is the lowest level of detail. 
  6303.              1 is the highest. 0 and 1 are the only acceptable values. If LEVEL 
  6304.              is not specified, then 0 is used. 
  6305.  
  6306.  ITERATIONS  is the maximum number of times NetFileEnum2 will be called to 
  6307.              retrieve information. When this parameter is specified, 
  6308.              NetFileEnum2 will be called until all file information has been 
  6309.              retrieved or the number of ITERATIONS has been reached, whichever 
  6310.              occurs first. If this parameter is not specified then the 
  6311.              NetFileEnum2 function will be called until all file information 
  6312.              has been returned. 
  6313.  
  6314.  BUFLEN      is the size of the buffer allocated for the information returned 
  6315.              from the API. The default size is 256 bytes. 
  6316.  
  6317.  OUTFILE     is the file name where returned information is stored. The 
  6318.              returned information will be appended to the file. If this 
  6319.              parameter is not specified, the returned information will be 
  6320.              displayed to the screen if LAN DEBUG is on. The returned data 
  6321.              includes: 
  6322.  
  6323.      how many entries were returned 
  6324.      how many entries were available 
  6325.      the file id number 
  6326.      the opening application's access permissions 
  6327.      how many file-locks are on the file 
  6328.      the pathname to the file 
  6329.      the user that opened the file 
  6330.  
  6331.  RC          is the expected return code.  COMET will compare the actual return 
  6332.              code with this value.  If they are not the same, an error will be 
  6333.              flagged.  If this parameter is not specified, an error will be 
  6334.              flagged if the return code is not good. 
  6335.  
  6336.  Sample Code 
  6337.  
  6338.  
  6339. ΓòÉΓòÉΓòÉ 5.12. LAN API - Handle ΓòÉΓòÉΓòÉ
  6340.  
  6341. The functions in the Handle category are provided to get and set information on 
  6342. a per-handle basis. 
  6343.  
  6344.  
  6345. ΓòÉΓòÉΓòÉ 5.12.1. NetHandleGetInfo ΓòÉΓòÉΓòÉ
  6346.  
  6347. This function gets handle-specific information. 
  6348.  
  6349. SYNTAX 
  6350.  
  6351. LAN HANDLE_GET_INFO  NAME=identification,            LEVEL=<1|2>, 
  6352. [BUFLEN=buffer_size,]            [OUTFILE=output_file_name,] 
  6353. [RC=expected_return_code]; 
  6354.  
  6355. Where: 
  6356.  
  6357.  NAME        is the identification of a communication device queue or a named 
  6358.              pipe. 
  6359.  
  6360.  LEVEL       is the level of detail returned. 1 is for Communication Device 
  6361.              handle information. 2 is for Named Pipe handle information. 
  6362.  
  6363.  BUFLEN      is the size of the buffer allocated for the information returned 
  6364.              from the API. The default size is 256 bytes. 
  6365.  
  6366.  OUTFILE     is the file name where returned information is stored. The 
  6367.              returned information will be appended to the file. If this 
  6368.              parameter is not specified, the returned information will be 
  6369.              displayed to the screen if LAN DEBUG is on. The returned data 
  6370.              includes: 
  6371.  
  6372.      how many bytes of information were available 
  6373.      the amount of time, in milliseconds, the requester collects data to send 
  6374.       to a shared serial device queue or a named pipe 
  6375.      the number of characters, in bytes, the requester stores before sending 
  6376.       data to a serial device queue or named pipe 
  6377.      the username of the user attached to the named pipe 
  6378.  
  6379.  RC          is the expected return code.  COMET will compare the actual return 
  6380.              code with this value.  If they are not the same, an error will be 
  6381.              flagged.  If this parameter is not specified, an error will be 
  6382.              flagged if the return code is not good. 
  6383.  
  6384.  Sample Code 
  6385.  
  6386.  
  6387. ΓòÉΓòÉΓòÉ 5.12.2. NetHandleSetInfo ΓòÉΓòÉΓòÉ
  6388.  
  6389. This function sets handle-specific information. 
  6390.  
  6391. SYNTAX 
  6392.  
  6393. LAN HANDLE_SET_INFO  NAME=identification,            LEVEL=1, 
  6394. CHARTIME=milliseconds,            CHARCOUNT=bytes, 
  6395. [BUFLEN=buffer_size,]            [RC=expected_return_code]; 
  6396.  
  6397. Where: 
  6398.  
  6399.  NAME        is the identification of a communication device queue or a named 
  6400.              pipe. 
  6401.  
  6402.  LEVEL       is the level of detail returned. 1 is for Communication Device 
  6403.              handle information. 
  6404.  
  6405.  CHARTIME    is the number of milliseconds the requester collects data to send 
  6406.              to a shared serial device queue or a named pipe. 
  6407.  
  6408.  CHARCOUNT   is the number of characters, in bytes, the requester stores before 
  6409.              sending data to a serial device queue or named pipe. 
  6410.  
  6411.  BUFLEN      is the size of the buffer allocated for the information returned 
  6412.              from the API. The default size is 256 bytes. 
  6413.  
  6414.  RC          is the expected return code.  COMET will compare the actual return 
  6415.              code with this value.  If they are not the same, an error will be 
  6416.              flagged.  If this parameter is not specified, an error will be 
  6417.              flagged if the return code is not good. 
  6418.  
  6419.  Sample Code 
  6420.  
  6421.  
  6422. ΓòÉΓòÉΓòÉ 5.13. LAN API - Remote Utilities ΓòÉΓòÉΓòÉ
  6423.  
  6424. The functions in the Remote Utilities category enable applications to copy and 
  6425. move remote files, remotely execute a program, and access the time-of-day 
  6426. information on a remote server. 
  6427.  
  6428.  
  6429. ΓòÉΓòÉΓòÉ 5.13.1. NetRemoteCopy (local) ΓòÉΓòÉΓòÉ
  6430.  
  6431. This function copies one or more files from one location to another on a remote 
  6432. server. 
  6433.  
  6434. SYNTAX 
  6435.  
  6436. LAN REMOTE_COPY  SOURCE=source_pathname, 
  6437. DESTINATION=destination_pathname,          [OPENFLAG=open_flags,] 
  6438. [COPYFLAG=copy_flags,]          [BUFLEN=buffer_size,] 
  6439. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  6440.  
  6441. Where: 
  6442.  
  6443.  SOURCE      is the pathname, including the remote server's name, of the 
  6444.              file(s) to be copied (wildcards can be used). 
  6445.  
  6446.  DESTINATION is the pathname to which the SOURCE is to be copied. For a 
  6447.              wildcard SOUCE and DESTINATION must be directories. 
  6448.  
  6449.  OPENFLAG    specifies how DESTINATION will be opened. Acceptable values are 0, 
  6450.              1, 2, 16 17, and 18. The following table shows how OPENFLAG 
  6451.              affects the opening of DESTINATION. 
  6452.  
  6453.  
  6454.                                 OPENFLAG                      RESULT
  6455.                                 ----------------------------  -------------------------------------
  6456.                                 0,16                          If DESTINATION already exists, the open
  6457.                                                                  will fail.
  6458.                                 1,17                          If DESTINATION already exists, the file
  6459.                                                                  will be appended.
  6460.                                 2,18                          If DESTINATION already exists, the file
  6461.                                                                  will be overwritten.
  6462.  
  6463.                                 0,1,2                         If DESTINATION does not exist, the open
  6464.                                                                  will fail.
  6465.                                 16,17,18                      If DESTINATION does not exist, the file
  6466.                                                                  will be created.
  6467.              If OPENFLAG is not specified, then 18 is used. 
  6468.  
  6469.  COPYFLAG    specifies how the file copy is done. Acceptable values are 1, 2, 
  6470.              5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 29, or 30. The 
  6471.              following table describes how the copy is affected by the COPYFLAG 
  6472.              value. The table shows the values which produce the desired 
  6473.              results. 
  6474.  
  6475.  
  6476.                                 COPYFLAG                      RESULT
  6477.                                 ----------------------------  -------------------------------------
  6478.                                 odd value (i.e. 1,5,etc...)   DESTINATION must be a file.
  6479.                                 even value                    DESTINATION must be a directory.
  6480.  
  6481.                                 1,2,5,6,17,18,21,22           SOURCE is opened in binary mode.
  6482.                                 9,10,13,14,25,26,29,30        SOURCE is opened in text mode.
  6483.  
  6484.                                 1,2,9,10,17,18,25,26          DESTINATION is opened in binary mode.
  6485.                                 5,6,13,14,21,22,29,30         DESTINATION is opened in text mode.
  6486.  
  6487.                                 17-30                         All writes are verified.
  6488.              If COPYFLAG is not specified, then 1 is used. 
  6489.  
  6490.  BUFLEN      is the size of the buffer allocated for the information returned 
  6491.              from the API. The default size is 256 bytes. 
  6492.  
  6493.  OUTFILE     is the file name where returned information is stored. The 
  6494.              returned information will be appended to the file. If this 
  6495.              parameter is not specified, the returned information will be 
  6496.              displayed to the screen if LAN DEBUG is on. The returned data 
  6497.              includes: 
  6498.  
  6499.      the number of files copied 
  6500.      any error information pertaining to the file copy 
  6501.  
  6502.  RC          is the expected return code.  COMET will compare the actual return 
  6503.              code with this value.  If they are not the same, an error will be 
  6504.              flagged.  If this parameter is not specified, an error will be 
  6505.              flagged if the return code is not good. 
  6506.  
  6507.  Sample Code 
  6508.  
  6509.  
  6510. ΓòÉΓòÉΓòÉ 5.13.2. NetRemoteExec (local,server) ΓòÉΓòÉΓòÉ
  6511.  
  6512. This function executes a program located on a remote server. 
  6513.  
  6514. SYNTAX 
  6515.  
  6516. LAN REMOTE_EXEC  [ASYNCTRACEFLAG=<0|1|2>,] 
  6517. [ARGUMENTS=program_arguments,]          [ENVIRONMENT=program_environment,] 
  6518. PROGRAM=program_name,          [REMEXECFLAG=<0|1|2|3|4|5|6|7>,] 
  6519. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  6520.  
  6521. Where: 
  6522.  
  6523.  ASYNCTRACEFLAG specifies the asynchronous and trace flags. 0, 1, and 2 are 
  6524.              acceptable values. 0 indicates a Synchronous process. 1 is an 
  6525.              Asynchronous process without a result code. 2 is an Asynchronous 
  6526.              process with a result code. If ASYNCTRACEFLAG is not specified 
  6527.              then 0 is used. 
  6528.  
  6529.  ARGUMENTS   is a list of program arguments. If no arguments are specified, 
  6530.              none will be passed to the program being executed. 
  6531.  
  6532.  ENVIRONMENT specifies the environment for the program to be executed. 
  6533.  
  6534.  PROGRAM     is the name and extension of the program to be executed. No drive 
  6535.              or path should be specified. 
  6536.  
  6537.  REMEXECFLAG specifies the remote executable flags that control program 
  6538.              execution. The acceptable values are 0, 1, 2, 3, 4, 5, 6, and 7. 
  6539.              The following table describes how the REMEXECFLAG affects 
  6540.              execution. 
  6541.  
  6542.  
  6543.                                 REMEXECFLAG                   RESULT
  6544.                                 ----------------------------  -------------------------------------
  6545.                                 odd value (i.e. 1,3,etc...)   A character mode pipe is used for
  6546.                                                                  standard input.
  6547.                                 even value                    A message mode pipe is used for
  6548.                                                                  standard input.
  6549.                                 0,1,4,5                       OS/2 DosCWait function waits for
  6550.                                                                  the child process to finish
  6551.                                                                  before returning.
  6552.                                 2,3,6,7                       OS/2 DosCWait function waits for all
  6553.                                                                  spawned processes to finish
  6554.                                                                  before returning.
  6555.                                 4-7                           OS/2 signals SIGINTR and SIGBREAK are
  6556.                                                                  sent as they are received.
  6557.                                 0-3                           OS/2 signals SIGINTR and SIGBREAK are
  6558.                                                                  mapped to SIGKILL when remoting
  6559.                                                                  standard signals.
  6560.              If REMEXECFLAG is not specified, then 6 is used. 
  6561.  
  6562.  OUTFILE     is the file name where returned information is stored. The 
  6563.              returned information will be appended to the file. If this 
  6564.              parameter is not specified, the returned information will be 
  6565.              displayed to the screen if LAN DEBUG is on. The returned data 
  6566.              includes: 
  6567.  
  6568.      return codes 
  6569.  
  6570.  RC          is the expected return code.  COMET will compare the actual return 
  6571.              code with this value.  If they are not the same, an error will be 
  6572.              flagged.  If this parameter is not specified, an error will be 
  6573.              flagged if the return code is not good. 
  6574.  
  6575.  Sample Code 
  6576.  
  6577.  
  6578. ΓòÉΓòÉΓòÉ 5.13.3. NetRemoteMove (local) ΓòÉΓòÉΓòÉ
  6579.  
  6580. This function moves one or more files from one location to another on a remote 
  6581. server. 
  6582.  
  6583. SYNTAX 
  6584.  
  6585. LAN REMOTE_MOVE  SOURCE=source_pathname, 
  6586. DESTINATION=destination_pathname,          [OPENFLAG=<0|1|2|16|17|18>,] 
  6587. [MOVEFLAG=<0|1>,]          [BUFLEN=buffer_size,] 
  6588. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  6589.  
  6590. Where: 
  6591.  
  6592.  SOURCE      is the pathname, including the remote server's name, of the 
  6593.              file(s) to be copied (wildcards can be used). 
  6594.  
  6595.  DESTINATION is the pathname to which the SOURCE is to be copied. For a 
  6596.              wildcard SOUCE and DESTINATION must be directories. 
  6597.  
  6598.  OPENFLAG    specifies how DESTINATION will be opened. Acceptable values are 0, 
  6599.              1, 2, 16 17, and 18. The following table shows how OPENFLAG 
  6600.              affects the opening of DESTINATION. 
  6601.  
  6602.  
  6603.                                 OPENFLAG                      RESULT
  6604.                                 ----------------------------  -------------------------------------
  6605.                                 0,16                          If DESTINATION already exists, the open
  6606.                                                                  will fail.
  6607.                                 1,17                          If DESTINATION already exists, the file
  6608.                                                                  will be appended.
  6609.                                 2,18                          If DESTINATION already exists, the file
  6610.                                                                  will be overwritten.
  6611.  
  6612.                                 0,1,2                         If DESTINATION does not exist, the open
  6613.                                                                  will fail.
  6614.                                 16,17,18                      If DESTINATION does not exist, the file
  6615.                                                                  will be created.
  6616.              If OPENFLAG is not specified, then 16 is used. 
  6617.  
  6618.  MOVEFLAG    specifies how the file move is done. Acceptable values are 1 or 2. 
  6619.              If MOVEFLAG is 1 then DESTINATION must be a file. If MOVEFLAG is 2 
  6620.              then DESTINATION must be a directory. If MOVEFLAG is not 
  6621.              specified, then 1 is used. 
  6622.  
  6623.  BUFLEN      is the size of the buffer allocated for the information returned 
  6624.              from the API. The default size is 256 bytes. 
  6625.  
  6626.  OUTFILE     is the file name where returned information is stored. The 
  6627.              returned information will be appended to the file. If this 
  6628.              parameter is not specified, the returned information will be 
  6629.              displayed to the screen if LAN DEBUG is on. The returned data 
  6630.              includes: 
  6631.  
  6632.      how many files were moved 
  6633.      any error information pertaining to the move operation 
  6634.  
  6635.  RC          is the expected return code.  COMET will compare the actual return 
  6636.              code with this value.  If they are not the same, an error will be 
  6637.              flagged.  If this parameter is not specified, an error will be 
  6638.              flagged if the return code is not good. 
  6639.  
  6640.  Sample Code 
  6641.  
  6642.  
  6643. ΓòÉΓòÉΓòÉ 5.13.4. NetRemoteTOD (local) ΓòÉΓòÉΓòÉ
  6644.  
  6645. This function returns a server's time of day. 
  6646.  
  6647. SYNTAX 
  6648.  
  6649. LAN REMOTE_TOD  [SERVER=\\servername,]          [BUFLEN=buffer_size,] 
  6650. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  6651.  
  6652. Where: 
  6653.  
  6654.  SERVER      is the name of the remote server on which the function is to 
  6655.              execute. If this parameter is not specified then a local computer 
  6656.              will be used. 
  6657.  
  6658.  BUFLEN      is the size of the buffer allocated for the information returned 
  6659.              from the API. The default size is 256 bytes. 
  6660.  
  6661.  OUTFILE     is the file name where returned information is stored. The 
  6662.              returned information will be appended to the file. If this 
  6663.              parameter is not specified, the returned information will be 
  6664.              displayed to the screen if LAN DEBUG is on. The returned data 
  6665.              includes: 
  6666.  
  6667.      how many seconds have elapsed since January 1, 1970 
  6668.      the current millisecond 
  6669.      the current hour 
  6670.      the current minute 
  6671.      the current second 
  6672.      the current hundredths of a second 
  6673.      the timezone of the server; calculated (in minutes) from the Greenwich 
  6674.       Mean Time (GMT) zone 
  6675.      the time interval for each tick of the clock. Each integral integer 
  6676.       represents 0.0001 second 
  6677.      the day of the month 
  6678.      the month 
  6679.      the year, starting with 1980 
  6680.      the day of the week (0=Sunday, 6=Saturday) 
  6681.  
  6682.  RC          is the expected return code.  COMET will compare the actual return 
  6683.              code with this value.  If they are not the same, an error will be 
  6684.              flagged.  If this parameter is not specified, an error will be 
  6685.              flagged if the return code is not good. 
  6686.  
  6687.  Sample Code 
  6688.  
  6689.  
  6690. ΓòÉΓòÉΓòÉ 5.14. LAN API - Serial Device ΓòÉΓòÉΓòÉ
  6691.  
  6692. The functions in the Serial Device category control shared serial devices and 
  6693. their associated queues. 
  6694.  
  6695.  
  6696. ΓòÉΓòÉΓòÉ 5.14.1. NetCharDevControl (admin, server) ΓòÉΓòÉΓòÉ
  6697.  
  6698. This function forces closed a serial device. 
  6699.  
  6700. SYNTAX 
  6701.  
  6702. LAN CHAR_DEV_CONTROL  [SERVER=\\servername,]             DEVICE=devicename, 
  6703. [OPCODE=0,]             [RC=expected_return_code]; 
  6704.  
  6705. Where: 
  6706.  
  6707.  SERVER      is the name of the remote server on which the function is to 
  6708.              execute. If this parameter is not specified then a local computer 
  6709.              will be used. 
  6710.  
  6711.  DEVICE      is the name of the device to modify. 
  6712.  
  6713.  OPCODE      specifies how to modify the DEVICE. The only acceptable value is 0 
  6714.              which means close the serial device. If OPCODE is not specified, 
  6715.              then 0 is used. 
  6716.  
  6717.  RC          is the expected return code.  COMET will compare the actual return 
  6718.              code with this value.  If they are not the same, an error will be 
  6719.              flagged.  If this parameter is not specified, an error will be 
  6720.              flagged if the return code is not good. 
  6721.  
  6722.  
  6723. ΓòÉΓòÉΓòÉ 5.14.2. NetCharDevEnum (admin, server) ΓòÉΓòÉΓòÉ
  6724.  
  6725. This function provides information on all available serial devices pooled in 
  6726. shared serial device queues on a server. 
  6727.  
  6728. SYNTAX 
  6729.  
  6730. LAN CHAR_DEV_ENUM  [SERVER=\\servername,]           [LEVEL=<0|1>,] 
  6731. [BUFLEN=buffer_size,]           [OUTFILE=output_file_name,] 
  6732. [RC=expected_return_code]; 
  6733.  
  6734. Where: 
  6735.  
  6736.  SERVER      is the name of the remote server on which the function is to 
  6737.              execute. If this parameter is not specified then a local computer 
  6738.              will be used. 
  6739.  
  6740.  LEVEL       specifies the level of detail returned. The acceptable values are 
  6741.              0 and 1. 0 is the least amount of data. If LEVEL is not specified, 
  6742.              then 0 is used. 
  6743.  
  6744.  BUFLEN      is the size of the buffer allocated for the information returned 
  6745.              from the API. The default size is 256 bytes. 
  6746.  
  6747.  OUTFILE     is the file name where returned information is stored. The 
  6748.              returned information will be appended to the file. If this 
  6749.              parameter is not specified, the returned information will be 
  6750.              displayed to the screen if LAN DEBUG is on. The returned data 
  6751.              includes: 
  6752.  
  6753.      how many entries were returned 
  6754.      how many entries were available 
  6755.      the devicename associated with the serial device 
  6756.      the status of the device 
  6757.      the device's current user 
  6758.      how many seconds the current application has been connected to the serial 
  6759.       device 
  6760.  
  6761.  RC          is the expected return code.  COMET will compare the actual return 
  6762.              code with this value.  If they are not the same, an error will be 
  6763.              flagged.  If this parameter is not specified, an error will be 
  6764.              flagged if the return code is not good. 
  6765.  
  6766.  
  6767. ΓòÉΓòÉΓòÉ 5.14.3. NetCharDevGetInfo (server) ΓòÉΓòÉΓòÉ
  6768.  
  6769. This function provides information about a particular serial device in a shared 
  6770. serial device queue on a server. 
  6771.  
  6772. SYNTAX 
  6773.  
  6774. LAN CHAR_DEV_GET_INFO  [SERVER=\\servername,]             DEVICE=devicename, 
  6775. [LEVEL=<0|1>,]             [BUFLEN=buffer_size,] 
  6776. [OUTFILE=output_file_name,]             [RC=expected_return_code]; 
  6777.  
  6778. Where: 
  6779.  
  6780.  SERVER      is the name of the remote server on which the function is to 
  6781.              execute. If this parameter is not specified then a local computer 
  6782.              will be used. 
  6783.  
  6784.  DEVICE      is the name of the serial device. 
  6785.  
  6786.  LEVEL       specifies the level of detail returned. The acceptable values are 
  6787.              0 and 1. 0 is the least amount of data. If LEVEL is not specified, 
  6788.              then 0 is used. 
  6789.  
  6790.  BUFLEN      is the size of the buffer allocated for the information returned 
  6791.              from the API. The default size is 256 bytes. 
  6792.  
  6793.  OUTFILE     is the file name where returned information is stored. The 
  6794.              returned information will be appended to the file. If this 
  6795.              parameter is not specified, the returned information will be 
  6796.              displayed to the screen if LAN DEBUG is on. The returned data 
  6797.              includes: 
  6798.  
  6799.      how many bytes of information were available 
  6800.      the devicename associated with the serial device 
  6801.      the status of the device 
  6802.      the device's current user 
  6803.      how many seconds the current application has been connected to the serial 
  6804.       device 
  6805.  
  6806.  RC          is the expected return code.  COMET will compare the actual return 
  6807.              code with this value.  If they are not the same, an error will be 
  6808.              flagged.  If this parameter is not specified, an error will be 
  6809.              flagged if the return code is not good. 
  6810.  
  6811.  
  6812. ΓòÉΓòÉΓòÉ 5.14.4. NetCharDevQEnum (server) ΓòÉΓòÉΓòÉ
  6813.  
  6814. This function enumerates all serial device queues on a server. 
  6815.  
  6816. SYNTAX 
  6817.  
  6818. LAN CHAR_DEV_Q_ENUM  [SERVER=\\servername,]            [USER=username,] 
  6819. [LEVEL=<0|1>,]            [BUFLEN=buffer_size,] 
  6820. [OUTFILE=output_file_name,]            [RC=expected_return_code]; 
  6821.  
  6822. Where: 
  6823.  
  6824.  SERVER      is the name of the remote server on which the function is to 
  6825.              execute. If this parameter is not specified then a local computer 
  6826.              will be used. 
  6827.  
  6828.  USER        is the name of a user which can be used to calculate how many 
  6829.              requests are pending ahead in the queue. The default is no USER 
  6830.              specified. 
  6831.  
  6832.  LEVEL       specifies the level of detail returned. The acceptable values are 
  6833.              0 and 1. 0 is the least amount of data. If LEVEL is not specified 
  6834.              then 0 is used. 
  6835.  
  6836.  BUFLEN      is the size of the buffer allocated for the information returned 
  6837.              from the API. The default size is 256 bytes. 
  6838.  
  6839.  OUTFILE     is the file name where returned information is stored. The 
  6840.              returned information will be appended to the file. If this 
  6841.              parameter is not specified, the returned information will be 
  6842.              displayed to the screen if LAN DEBUG is on. The returned data 
  6843.              includes: 
  6844.  
  6845.      how many entries were returned 
  6846.      how many entries were available 
  6847.      the queuename 
  6848.      the queue priority 
  6849.      the devicenames assigned to the queue 
  6850.      the number of usernames in the queue 
  6851.      the number of users in front of a particular user 
  6852.  
  6853.  RC          is the expected return code.  COMET will compare the actual return 
  6854.              code with this value.  If they are not the same, an error will be 
  6855.              flagged.  If this parameter is not specified, an error will be 
  6856.              flagged if the return code is not good. 
  6857.  
  6858.  
  6859. ΓòÉΓòÉΓòÉ 5.14.5. NetCharDevQGetInfo (server) ΓòÉΓòÉΓòÉ
  6860.  
  6861. This function retrieves information about a particular serial device queue on a 
  6862. server. 
  6863.  
  6864. SYNTAX 
  6865.  
  6866. LAN CHAR_DEV_Q_GET_INFO  [SERVER=\\servername,]              QUEUE=queuename, 
  6867. [USER=username,]              [LEVEL=<0|1>,]              [BUFLEN=buffer_size,] 
  6868. [OUTFILE=output_file_name,]              [RC=expected_return_code]; 
  6869.  
  6870. Where: 
  6871.  
  6872.  SERVER      is the name of the remote server on which the function is to 
  6873.              execute. If this parameter is not specified then a local computer 
  6874.              will be used. 
  6875.  
  6876.  QUEUE       is the serial device queue for which information is being 
  6877.              requested. 
  6878.  
  6879.  USER        is the name of a user which can be used to calculate how many 
  6880.              requests are pending ahead in the queue. The default is no USER 
  6881.              specified. 
  6882.  
  6883.  LEVEL       specifies the level of detail returned. The acceptable values are 
  6884.              0 and 1. 0 is the least amount of data. If LEVEL is not specified, 
  6885.              then 0 is used. 
  6886.  
  6887.  BUFLEN      is the size of the buffer allocated for the information returned 
  6888.              from the API. The default size is 256 bytes. 
  6889.  
  6890.  OUTFILE     is the file name where returned information is stored. The 
  6891.              returned information will be appended to the file. If this 
  6892.              parameter is not specified, the returned information will be 
  6893.              displayed to the screen if LAN DEBUG is on. The returned data 
  6894.              includes: 
  6895.  
  6896.      how many bytes of information were available 
  6897.      the queuename 
  6898.      the queue priority 
  6899.      the devicenames assigned to the queue 
  6900.      the number of usernames in the queue 
  6901.      the number of users in front of a particular user 
  6902.      the devicename associated with the serial device 
  6903.      the status of the device 
  6904.      the device's current user 
  6905.      how many seconds the current application has been connected to the serial 
  6906.       device 
  6907.  
  6908.  RC          is the expected return code.  COMET will compare the actual return 
  6909.              code with this value.  If they are not the same, an error will be 
  6910.              flagged.  If this parameter is not specified, an error will be 
  6911.              flagged if the return code is not good. 
  6912.  
  6913.  
  6914. ΓòÉΓòÉΓòÉ 5.14.6. NetCharDevQPurge (admin, server) ΓòÉΓòÉΓòÉ
  6915.  
  6916. This function deletes all pending requests on a serial device queue. 
  6917.  
  6918. SYNTAX 
  6919.  
  6920. LAN CHAR_DEV_Q_PURGE  [SERVER=\\servername,]             QUEUE=queuename, 
  6921. [RC=expected_return_code]; 
  6922.  
  6923. Where: 
  6924.  
  6925.  SERVER      is the name of the remote server on which the function is to 
  6926.              execute. If this parameter is not specified then a local computer 
  6927.              will be used. 
  6928.  
  6929.  QUEUE       is the serial device queue to purge pending requests. 
  6930.  
  6931.  RC          is the expected return code.  COMET will compare the actual return 
  6932.              code with this value.  If they are not the same, an error will be 
  6933.              flagged.  If this parameter is not specified, an error will be 
  6934.              flagged if the return code is not good. 
  6935.  
  6936.  
  6937. ΓòÉΓòÉΓòÉ 5.14.7. NetCharDevQPurgeSelf (server) ΓòÉΓòÉΓòÉ
  6938.  
  6939. This function deletes all pending requests on a serial device queue which were 
  6940. submitted by a particular computer. 
  6941.  
  6942. SYNTAX 
  6943.  
  6944. LAN CHAR_DEV_Q_PURGE_SELF  [SERVER=\\servername,] 
  6945. QUEUE=queuename,               COMPUTER=computername; 
  6946. [RC=expected_return_code]; 
  6947.  
  6948. Where: 
  6949.  
  6950.  SERVER      is the name of the remote server on which the function is to 
  6951.              execute. If this parameter is not specified then a local computer 
  6952.              will be used. 
  6953.  
  6954.  QUEUE       is the serial device queue to purge pending requests. 
  6955.  
  6956.  COMPUTER    is the name of the computer whose requests are to be deleted from 
  6957.              the QUEUE. 
  6958.  
  6959.  RC          is the expected return code.  COMET will compare the actual return 
  6960.              code with this value.  If they are not the same, an error will be 
  6961.              flagged.  If this parameter is not specified, an error will be 
  6962.              flagged if the return code is not good. 
  6963.  
  6964.  
  6965. ΓòÉΓòÉΓòÉ 5.14.8. NetCharDevQSetInfo (admin, server) ΓòÉΓòÉΓòÉ
  6966.  
  6967. This function modifies the state of a serial device queue on a server. 
  6968.  
  6969. SYNTAX 
  6970.  
  6971. LAN CHAR_DEV_Q_SET_INFO  [SERVER=\\servername,]              QUEUE=queuename, 
  6972. [LEVEL=1,]              [PARAMNUM=<0|2|3>,] 
  6973. [PRIORITY=<1|2|3|4|5|6|7|8|9>,]              [DEVICE=devicename,] 
  6974. [RC=expected_return_code]; 
  6975.  
  6976. Where: 
  6977.  
  6978.  SERVER      is the name of the remote server on which the function is to 
  6979.              execute. If this parameter is not specified then a local computer 
  6980.              will be used. 
  6981.  
  6982.  QUEUE       is the serial device queue to set. 
  6983.  
  6984.  LEVEL       is the level of detail supplied. 1 is the only acceptable value. 
  6985.              If LEVEL is not specified, then 1 is used. 
  6986.  
  6987.  PARAMNUM    determines which components are to be set. 0 means all components 
  6988.              are to be set. In this case both PRIORITY and DEVICE should be 
  6989.              specified. 2 means only set PRIORITY and 3 means only set DEVICE. 
  6990.              If PARAMNUM is not specified, then 0 is used. 
  6991.  
  6992.  PRIORITY    specifies the queue priority. Acceptable values are 1 though 9, 
  6993.              where 1 has the highest priority. If PRIORITY is not specified, 
  6994.              then 9 is used. 
  6995.  
  6996.  DEVICE      is a list of devices assigned to the queue (e.g. COM1, COM3, 
  6997.              etc...). 
  6998.  
  6999.  RC          is the expected return code.  COMET will compare the actual return 
  7000.              code with this value.  If they are not the same, an error will be 
  7001.              flagged.  If this parameter is not specified, an error will be 
  7002.              flagged if the return code is not good. 
  7003.  
  7004.  
  7005. ΓòÉΓòÉΓòÉ 5.15. LAN API - Statistics ΓòÉΓòÉΓòÉ
  7006.  
  7007. The function in the Statistics category retrieve and clear the opera ting 
  7008. statistics for requesters and servers. 
  7009.  
  7010.  
  7011. ΓòÉΓòÉΓòÉ 5.15.1. NetStatisticsGet2 (admin) ΓòÉΓòÉΓòÉ
  7012.  
  7013. This function gets and optionally clears operating statistics for a service. 
  7014.  
  7015. SYNTAX 
  7016.  
  7017. LAN STATISTICS_GET_2  [SERVER=\\servername,] 
  7018. [SERVICE=<REQUESTER|SERVER>,]             [LEVEL=0,] 
  7019. [OPTIONS=<0|1>,]             [BUFLEN=buffer_size,] 
  7020. [OUTFILE=output_file_name,]             [RC=expected_return_code]; 
  7021.  
  7022. Where: 
  7023.  
  7024.  SERVER      is the name of the remote server on which the function is to 
  7025.              execute. If this parameter is not specified then a local computer 
  7026.              will be used. 
  7027.  
  7028.  SERVICE     is the name of the service for which to get the statistics. Then 
  7029.              only valid values are REQUESTER and SERVER. If SERVICE is not 
  7030.              specified, then REQUESTER is used. 
  7031.  
  7032.  LEVEL       is the level of detail returned. 0 is the only acceptable value. 
  7033.              If LEVEL is not specified, then 0 is used. 
  7034.  
  7035.  OPTIONS     specifies whether or not to clear the statistics. 0 means keep the 
  7036.              statistics. 1 means clear them. If OPTIONS is not specified then 0 
  7037.              is used. 
  7038.  
  7039.  BUFLEN      is the size of the buffer allocated for the information returned 
  7040.              from the API. The default size is 256 bytes. 
  7041.  
  7042.  OUTFILE     is the file name where returned information is stored. The 
  7043.              returned information will be appended to the file. If this 
  7044.              parameter is not specified, the returned information will be 
  7045.              displayed to the screen if LAN DEBUG is on. The returned data 
  7046.              includes: 
  7047.  
  7048.      how many byte of information were available 
  7049.      a timestamp telling the period of time over which statistics were 
  7050.       gathered 
  7051.      how many network control blocks (NCBs) the requester submitted 
  7052.      how many NCBs failed issue 
  7053.      how many NCBs failed completion 
  7054.      how many requester sessions were started 
  7055.      how many requester sessions failed 
  7056.      how many requester connections were started 
  7057.      how many requester connections failed 
  7058.      how many sessions were broken and then automatically reestablished 
  7059.      the number of redirector NCBs issued 
  7060.      the number of server NCB's issued 
  7061.      the number of NCBs issued 
  7062.      how many files or named pipes have been opened on the server 
  7063.      how many communication devices have been opened on the server 
  7064.      how many print jobs have been spooled on the server 
  7065.      how many how many sessions were started on the server 
  7066.      how many sessions were disconnected automatically due to timeout on the 
  7067.       server 
  7068.      how many sessions disconnected due to an error on the server 
  7069.      how many bad password violations the server encountered 
  7070.      how many access permission errors the server encountered 
  7071.      how many system errors the server encountered 
  7072.      how many bytes were sent the network from the server 
  7073.      how many bytes were received from the network 
  7074.      the average response time (in milliseconds) 
  7075.  
  7076.  RC          is the expected return code.  COMET will compare the actual return 
  7077.              code with this value.  If they are not the same, an error will be 
  7078.              flagged.  If this parameter is not specified, an error will be 
  7079.              flagged if the return code is not good. 
  7080.  
  7081.  Sample Code 
  7082.  
  7083.  
  7084. ΓòÉΓòÉΓòÉ 5.16. LAN API - Use ΓòÉΓòÉΓòÉ
  7085.  
  7086. The functions in the Use category examine or control connections (uses) between 
  7087. requesters and servers. Ordinary users can call these functions locally. It 
  7088. requires administrator's privilege to call them remotely. 
  7089.  
  7090.  
  7091. ΓòÉΓòÉΓòÉ 5.16.1. NetUseAdd (admin) ΓòÉΓòÉΓòÉ
  7092.  
  7093. This function establishes a connection between a local or NULL devicename and a 
  7094. shared resource by redirecting the local or NULL (UNC) devicename to the shared 
  7095. resource. 
  7096.  
  7097. SYNTAX 
  7098.  
  7099. LAN USE_ADD  [SERVER=\\servername,]        [LEVEL=1,] 
  7100. [DEVICE=local_devicename,]        NETNAME=remote_netname, 
  7101. TYPE=<-1|0|1|2|3>,        [BUFLEN=buffer_size,] 
  7102. [RC=expected_return_code]; 
  7103.  
  7104. Where: 
  7105.  
  7106.  SERVER      is the name of the remote server on which the function is to 
  7107.              execute. If this parameter is not specified then a local computer 
  7108.              will be used. 
  7109.  
  7110.  LEVEL       is the level of detail provided. 1 is the only acceptable value. 
  7111.              If LEVEL is not specified, then 1 is used. 
  7112.  
  7113.  DEVICE      is the name of the local device to be redirected. If DEVICE is not 
  7114.              specified then NULL is used by default. 
  7115.  
  7116.  NETNAME     is the UNC name of the remote resource being accessed. It must be 
  7117.              in the form \\servername\netname. 
  7118.  
  7119.  TYPE        specifies the type of remote resource being accessed. The 
  7120.              acceptable values are -1, 0, 1, 2, and 3. -1 matches with the 
  7121.              server's share. This is only valid when DEVICE is NULL. 0 means a 
  7122.              Disk resource. 1 means a Spooled printer. 2 means a Serial device. 
  7123.              3 means an Interprocess communication (IPC). 
  7124.  
  7125.  BUFLEN      is the size of the buffer allocated for the information returned 
  7126.              from the API. The default size is 256 bytes. 
  7127.  
  7128.  RC          is the expected return code.  COMET will compare the actual return 
  7129.              code with this value.  If they are not the same, an error will be 
  7130.              flagged.  If this parameter is not specified, an error will be 
  7131.              flagged if the return code is not good. 
  7132.  
  7133.  Sample Code 
  7134.  
  7135.  
  7136. ΓòÉΓòÉΓòÉ 5.16.2. NetUseDel (admin) ΓòÉΓòÉΓòÉ
  7137.  
  7138. This function ends a connection between a local or UNC devicename and a shared 
  7139. resource. 
  7140.  
  7141. SYNTAX 
  7142.  
  7143. LAN USE_DEL  [SERVER=\\servername,]        [DEVICE=local_devicename,] 
  7144. [FORCE=<0|1|2>,]        [RC=expected_return_code]; 
  7145.  
  7146. Where: 
  7147.  
  7148.  SERVER      is the name of the remote server on which the function is to 
  7149.              execute. If this parameter is not specified then a local computer 
  7150.              will be used. 
  7151.  
  7152.  DEVICE      is the name of the local device that was redirected. If DEVICE is 
  7153.              not specified then NULL is used by default. 
  7154.  
  7155.  FORCE       is the amount of force used for the disconnection. the acceptable 
  7156.              values are 0, 1, and 2. 0 uses no force. In this case, the 
  7157.              connection is actually maintained in a dormant state. A dormant 
  7158.              session can quickly be activated as soon as reconnection is 
  7159.              needed, improving system performance. 1 is normal force. Here the 
  7160.              connection will be removed only is no file, directory, or drive is 
  7161.              opened. 2 means use lots of force. All files, directories, and 
  7162.              drives on the connection are forced closed. If FORCE is not 
  7163.              specified, then 1 is used. 
  7164.  
  7165.  RC          is the expected return code.  COMET will compare the actual return 
  7166.              code with this value.  If they are not the same, an error will be 
  7167.              flagged.  If this parameter is not specified, an error will be 
  7168.              flagged if the return code is not good. 
  7169.  
  7170.  Sample Code 
  7171.  
  7172.  
  7173. ΓòÉΓòÉΓòÉ 5.16.3. NetUseEnum (admin) ΓòÉΓòÉΓòÉ
  7174.  
  7175. This function lists all the current connections between the local computer and 
  7176. resources on a remote server. 
  7177.  
  7178. SYNTAX 
  7179.  
  7180. LAN USE_ENUM  [SERVER=\\servername,]         [LEVEL=<0|1>,] 
  7181. [BUFLEN=buffer_size,]         [OUTFILE=output_file_name,] 
  7182. [RC=expected_return_code]; 
  7183.  
  7184. Where: 
  7185.  
  7186.  SERVER      is the name of the remote server on which the function is to 
  7187.              execute. If this parameter is not specified then a local computer 
  7188.              will be used. 
  7189.  
  7190.  LEVEL       is the level of detail returned. The acceptable values are 0 and 
  7191.              1. 0 is the least amount of information. If LEVEL is not specified 
  7192.              then 0 is used. 
  7193.  
  7194.  BUFLEN      is the size of the buffer allocated for the information returned 
  7195.              from the API. The default size is 256 bytes. 
  7196.  
  7197.  OUTFILE     is the file name where returned information is stored. The 
  7198.              returned information will be appended to the file. If this 
  7199.              parameter is not specified, the returned information will be 
  7200.              displayed to the screen if LAN DEBUG is on. The returned data 
  7201.              includes: 
  7202.  
  7203.      how many entries were returned 
  7204.      how many entries were available 
  7205.      the devicename being redirected 
  7206.      the remote server being accessed 
  7207.      the status of the connection 
  7208.      the type of remote resource being accessed 
  7209.      how many files, directories, and other processes are open on the remote 
  7210.       resource 
  7211.      how many explicit connections (redirection of a local devicename) or 
  7212.       implicit UNC connections (redirection of a NULL local device name) are 
  7213.       established with the resource. 
  7214.  
  7215.  RC          is the expected return code.  COMET will compare the actual return 
  7216.              code with this value.  If they are not the same, an error will be 
  7217.              flagged.  If this parameter is not specified, an error will be 
  7218.              flagged if the return code is not good. 
  7219.  
  7220.  Sample Code 
  7221.  
  7222.  
  7223. ΓòÉΓòÉΓòÉ 5.16.4. NetUseGetInfo (admin) ΓòÉΓòÉΓòÉ
  7224.  
  7225. This function retrieves information about a connection between a local computer 
  7226. and a shared resources. 
  7227.  
  7228. SYNTAX 
  7229.  
  7230. LAN USE_GET_INFO  [SERVER=\\servername,] 
  7231. [DEVICE=redirected_devicename_or_UNC_name,]           [LEVEL=<0|1>,] 
  7232. [BUFLEN=buffer_size,]           [OUTFILE=output_file_name,] 
  7233. [RC=expected_return_code]; 
  7234.  
  7235. Where: 
  7236.  
  7237.  SERVER      is the name of the remote server on which the function is to 
  7238.              execute. If this parameter is not specified then a local computer 
  7239.              will be used. 
  7240.  
  7241.  DEVICE      is the name of the redirected device or a UNC name for the 
  7242.              resource. If DEVICE is not specified then NULL is used by default. 
  7243.  
  7244.  LEVEL       is the level of detail returned. The acceptable values are 0 and 
  7245.              1. 0 is the least amount of information. If LEVEL is not specified 
  7246.              then 0 is used. 
  7247.  
  7248.  BUFLEN      is the size of the buffer allocated for the information returned 
  7249.              from the API. The default size is 256 bytes. 
  7250.  
  7251.  OUTFILE     is the file name where returned information is stored. The 
  7252.              returned information will be appended to the file. If this 
  7253.              parameter is not specified, the returned information will be 
  7254.              displayed to the screen if LAN DEBUG is on. The returned data 
  7255.              includes: 
  7256.  
  7257.      how many bytes of information were available 
  7258.      the devicename being redirected 
  7259.      the remote server being accessed 
  7260.      the status of the connection 
  7261.      the type of remote resource being accessed 
  7262.      how many files, directories, and other processes are open on the remote 
  7263.       resource 
  7264.      how many explicit connections (redirection of a local devicename) or 
  7265.       implicit UNC connections (redirection of a NULL local device name) are 
  7266.       established with the resource. 
  7267.  
  7268.  RC          is the expected return code.  COMET will compare the actual return 
  7269.              code with this value.  If they are not the same, an error will be 
  7270.              flagged.  If this parameter is not specified, an error will be 
  7271.              flagged if the return code is not good. 
  7272.  
  7273.  Sample Code 
  7274.  
  7275.  
  7276. ΓòÉΓòÉΓòÉ 5.17. LAN API - Alert ΓòÉΓòÉΓòÉ
  7277.  
  7278. The functions in the ALERT category provide a system for notifying network 
  7279. service programs and applications of network events.  An event is a particular 
  7280. instance of a process or state of hardware defined by an application or by the 
  7281. OS/2 LAN Server software.  The OS/2 LAN Server sends out an alert, in the form 
  7282. of a message or the resetting of a semaphore, when certain events occur.  Other 
  7283. programs, network services, or internal network components use the 
  7284. NetAlertRaise function to raise an alert, notifying various applications or 
  7285. users when a particular type of event occurs. 
  7286.  
  7287. The OS/2 LAN Server defines five types of alerts: "ADMIN", "ERRORLOG", 
  7288. "MESSAGE", "PRINTING", "USER". 
  7289.  
  7290.  
  7291. ΓòÉΓòÉΓòÉ 5.17.1. NetAlertRaise (Local) ΓòÉΓòÉΓòÉ
  7292.  
  7293. The NetAlertRaise function notifies all clients registered in the alert table 
  7294. that a particular event occurred. 
  7295.  
  7296. SYNTAX 
  7297.  
  7298. LAN ALERT_RAISE  EVENT = event_type,          [TIMEOUT = milliseconds,] 
  7299. [OUTFILE = output_filename,]          [RC = expected_return_code]; 
  7300.  
  7301. Where: 
  7302.  
  7303.  EVENT       is a string telling which type of alert to raise. 
  7304.  
  7305.  TIMEOUT     is the length of time in milliseconds to wait for event 
  7306.              information to be written to the mailslot.  Default time length is 
  7307.              10000. 
  7308.  
  7309.  OUTFILE     is the output file name containing the information of a defined 
  7310.              alert type.  The information includes: 
  7311.  
  7312.      timestamp, tells the time and date of the event 
  7313.      eventname, tells the alert type 
  7314.      servicename, tells which application is raising the alert 
  7315.      information specific to the type of event 
  7316.  
  7317.  RC          is the expected return code.  COMET will compare the actual return 
  7318.              code with this value.  If they are not the same, an error will be 
  7319.              flagged.  If this parameter is not specified, an error will be 
  7320.              flagged if the return code is not good. 
  7321.  
  7322.  Sample Code 
  7323.  
  7324.  
  7325. ΓòÉΓòÉΓòÉ 5.17.2. NetAlertStart (Local) ΓòÉΓòÉΓòÉ
  7326.  
  7327. The NetAlertStart function registers a client to be notified of a particular 
  7328. type of network event. 
  7329.  
  7330. SYNTAX 
  7331.  
  7332. LAN ALERT_START  EVENT = event_type,          RECIPIENT = client_name, 
  7333. [MAXDATA = bytes,]          [RC = expected_return_code]; 
  7334.  
  7335. Where: 
  7336.  
  7337.  EVENT       is a string telling which type of event the client is to be 
  7338.              notified of. 
  7339.  
  7340.  RECIPIENT   is a string specifying the mailslot or semaphore client to receive 
  7341.              the alerts. A local mailslot name is in the format of 
  7342.              "\mailslot\name", where "name" is a unique set of characters 
  7343.              distinguishing the mailslot from other mailslots on the computer. 
  7344.              A remote mailslot name is in the format of 
  7345.              "\\computername\mailslot\name". A system created semaphore name is 
  7346.              in the format of "\SEM\name", where "name" is consisted of up to 
  7347.              eight letters followed by an optional three-letter extention. 
  7348.  
  7349.  MAXDATA     is the limit (in bytes) to the information the mailslot client 
  7350.              will receive about events in that type.  Default is 1024. 
  7351.  
  7352.  RC          is the expected return code.  COMET will compare the actual return 
  7353.              code with this value.  If they are not the same, an error will be 
  7354.              flagged.  If this parameter is not specified, an error will be 
  7355.              flagged if the return code is not good. 
  7356.  
  7357.  Sample Code 
  7358.  
  7359.  
  7360. ΓòÉΓòÉΓòÉ 5.17.3. NetAlertStop (Local) ΓòÉΓòÉΓòÉ
  7361.  
  7362. The NetAlertStop function removes a registered client from the alert table. 
  7363.  
  7364. SYNTAX 
  7365.  
  7366. LAN ALERT_STOP  EVENT = event_type,         RECIPIENT = client_name, 
  7367. [RC = expected_return_code]; 
  7368.  
  7369. Where: 
  7370.  
  7371.  EVENT       is a string telling which type of alerts the registered client is 
  7372.              to be excluded from. 
  7373.  
  7374.  RECIPIENT   is a string containing the username of the client whose 
  7375.              registration is to be canceled. 
  7376.  
  7377.  RC          is the expected return code.  COMET will compare the actual return 
  7378.              code with this value.  If they are not the same, an error will be 
  7379.              flagged.  If this parameter is not specified, an error will be 
  7380.              flagged if the return code is not good. 
  7381.  
  7382.  Sample Code 
  7383.  
  7384.  
  7385. ΓòÉΓòÉΓòÉ 5.18. LAN API - Spooler ΓòÉΓòÉΓòÉ
  7386.  
  7387. The functions in the Spooler category control the print jobs, the spooler queue 
  7388. or the spooler queue manager, and the spooler queue processor. 
  7389.  
  7390.  
  7391. ΓòÉΓòÉΓòÉ 5.18.1. SplQmAbort ΓòÉΓòÉΓòÉ
  7392.  
  7393. This function stops the generation of the spool file(s).  It automatically 
  7394. closes the spooler queue manager. 
  7395.  
  7396. SYNTAX 
  7397.  
  7398. LAN QM_ABORT  [RC = expected_return_code]; 
  7399.  
  7400. Where: 
  7401.  
  7402.  RC          is the expected return code.  The return code TRUE (1) indicates 
  7403.              successful completion, FALSE (0) indicates error occurred. COMET 
  7404.              will compare the actual return code with this value.  If they are 
  7405.              not the same, an error will be flagged.  If this parameter is not 
  7406.              specified, an error will be flagged if the return code is not 
  7407.              good. 
  7408.  
  7409.  
  7410. ΓòÉΓòÉΓòÉ 5.18.2. SplQmClose ΓòÉΓòÉΓòÉ
  7411.  
  7412. This function corresponds to the DevCloseDC function: it closes the spooler 
  7413. Queue Manager. 
  7414.  
  7415. SYNTAX 
  7416.  
  7417. LAN QM_CLOSE  [RC = expected_return_code]; 
  7418.  
  7419. Where: 
  7420.  
  7421.  RC          is the expected return code.  The return code TRUE (1) indicates 
  7422.              successful completion, FALSE (0) indicates error occurred. COMET 
  7423.              will compare the actual return code with this value.  If they are 
  7424.              not the same, an error will be flagged.  If this parameter is not 
  7425.              specified, an error will be flagged if the return code is not 
  7426.              good. 
  7427.  
  7428.  
  7429. ΓòÉΓòÉΓòÉ 5.18.3. SplQmEndDoc ΓòÉΓòÉΓòÉ
  7430.  
  7431. This function corresponds to the DevEscape (DEVESC_ENDDOC) function: it ends a 
  7432. print job, and returns JOB, that is a unique number to identify the job. 
  7433.  
  7434. SYNTAX 
  7435.  
  7436. LAN QM_END_DOC  [OUTFILE = output_filename,]         [RC = 
  7437. expected_return_code]; 
  7438.  
  7439. Where: 
  7440.  
  7441.  OUTFILE     is the output filename containing the returned JOB#. 
  7442.  
  7443.  RC          is the expected return code.  The return code 0 indicates error 
  7444.              occurred and Nonzero indicates the job-id. COMET will compare the 
  7445.              actual return code with this value.  If they are not the same, an 
  7446.              error will be flagged.  If this parameter is not specified, an 
  7447.              error will be flagged if the return code is not good. 
  7448.  
  7449.  
  7450. ΓòÉΓòÉΓòÉ 5.18.4. SplQmOpen ΓòÉΓòÉΓòÉ
  7451.  
  7452. This function corresponds to the DevOpenDC function: it opens the spooler Queue 
  7453. Manager for generating a print job. 
  7454.  
  7455. SYNTAX 
  7456.  
  7457. LAN QM_OPEN  [TOKEN = string,]        [LOGADDR = print queue name,] 
  7458. [DRIVER = print device driver name,]        [DATATYPE = queued datatype,] 
  7459. [COMMENT = file description,]        [OUTFILE = output_filename,]        [RC = 
  7460. expected_return_code]; 
  7461.  
  7462. Where: 
  7463.  
  7464.  TOKEN       is a string containing a token (nickname) which identifies Spooler 
  7465.              information held in the PRESSERV.INI file.  If not specified, "*" 
  7466.              is used. 
  7467.  
  7468.  LOG_ADDR    is the logical address of the output print queue (eg. LPT1Q). Use 
  7469.              '\\servername\queuename' for a remote print queue and 'queuename' 
  7470.              for a local print queue. If not specified, LPT1Q is used. 
  7471.  
  7472.  DRIVER      is a string containing the name of the Device Driver (eg. 
  7473.              "IBM4201"). If not specified, "IBM4201" is used. 
  7474.  
  7475.  DATATYPE    defines the type of data which is to be queued, as follows: 
  7476.  
  7477.      PM_Q_STD 
  7478.      PM_Q_ESC 
  7479.      PM_Q_RAW if not specified, PM_Q_RAW is used. 
  7480.  
  7481.  COMMENT     is a natural language description of the file.  This may be 
  7482.              displayed by the spooler to the end user.  If not specified, "File 
  7483.              comment goes here" is used. *.
  7484.  
  7485.  NETWORK_PARMS *.are the network options for spooler queues.  The values must 
  7486.              be in *.upper case, and take the form of OPTION=VALUE. Valid 
  7487.              option value is *.USER="XXXXXXXX".  The default value is a blank 
  7488.              string. 
  7489.  
  7490.  OUTFILE     is the output filename containing the information of the specified 
  7491.              device driver and queue processor. 
  7492.  
  7493.  RC          is the expected return code.  The return code TRUE (1) indicates 
  7494.              successful completion, FALSE (0) indicates error occurred. COMET 
  7495.              will compare the actual return code with this value.  If they are 
  7496.              not the same, an error will be flagged.  If this parameter is not 
  7497.              specified, an error will be flagged if the return code is not 
  7498.              good. 
  7499.  
  7500.  
  7501. ΓòÉΓòÉΓòÉ 5.18.5. SplQmStartDoc ΓòÉΓòÉΓòÉ
  7502.  
  7503. This function corresponds to the DevEscape (DEVESC_STARTDOC) function: it 
  7504. signifies the start of a print job.  It allows the application to specify a 
  7505. document name to be associated withe the print job. 
  7506.  
  7507. SYNTAX 
  7508.  
  7509. LAN QM_START_DOC  DOCNAME = document_name,          [RC = 
  7510. expected_return_code]; 
  7511.  
  7512. Where: 
  7513.  
  7514.  DOC_NAME    is the document name that is part of the job description displayed 
  7515.              to the end user by the spooler. 
  7516.  
  7517.  RC          is the expected return code.  The return code TRUE (1) indicates 
  7518.              successful completion, FALSE (0) indicates error occurred. COMET 
  7519.              will compare the actual return code with this value.  If they are 
  7520.              not the same, an error will be flagged.  If this parameter is not 
  7521.              specified, an error will be flagged if the return code is not 
  7522.              good. 
  7523.  
  7524.  
  7525. ΓòÉΓòÉΓòÉ 5.18.6. SplQmWrite ΓòÉΓòÉΓòÉ
  7526.  
  7527. This function writes a buffer to the spool file for the print job. 
  7528.  
  7529. SYNTAX 
  7530.  
  7531. LAN QM_WRITE  [DATA = input_data,]         [RC = expected_return_code]; 
  7532.  
  7533. Where: 
  7534.  
  7535.  DATA        is the buffer of data to be written to the spool file. 
  7536.  
  7537.  RC          is the expected return code.  The return code TRUE (1) indicates 
  7538.              successful completion, FALSE (0) indicates error occurred. COMET 
  7539.              will compare the actual return code with this value.  If they are 
  7540.              not the same, an error will be flagged.  If this parameter is not 
  7541.              specified, an error will be flagged if the return code is not 
  7542.              good. 
  7543.  
  7544.  
  7545. ΓòÉΓòÉΓòÉ 5.19. LAN API - Share ΓòÉΓòÉΓòÉ
  7546.  
  7547. The Shares category control shared resources. 
  7548.  
  7549.  
  7550. ΓòÉΓòÉΓòÉ 5.19.1. NetShareAdd (Server, Admin) ΓòÉΓòÉΓòÉ
  7551.  
  7552. The NetShareAdd shares a Server's resource. 
  7553.  
  7554. SYNTAX 
  7555.  
  7556.  LAN SHARE_ADD [SERVER=\\servername,]        [LEVEL=2,] 
  7557. NETNAME=sharename,        DEVICE=path_or_device,        TYPE=>0|1|2|3<, 
  7558. [MAXUSES=max_uses,]        [REMARK=remark,]        [BUFLEN=buffer_length,] 
  7559. [RC=expected_return_code]; 
  7560.  
  7561. Where: 
  7562.  
  7563.  SERVER      is the name of the remote servername where the function is to 
  7564.              execute.  Server is a UNC styled servername string, i.e. 
  7565.              \\Servername.  If servername is absent then a local server is 
  7566.              assumed. 
  7567.  
  7568.  LEVEL       is the level of detail provided.  Level 2 is the only valid level, 
  7569.              although any number may be specified.  Level 2 is the default. 
  7570.  
  7571.  NETNAME     is the share name of the resource.  No default provided, a netname 
  7572.              must be provided. 
  7573.  
  7574.  DEVICE      is the path of a disk type share or a device name if the share is 
  7575.              a character device.  If the share is a printer, then the path and 
  7576.              the netname must be that of an existing print queue.  If the share 
  7577.              is an IPC, then path must be NULL.  Note, a pipe must be created 
  7578.              before it can be shared. 
  7579.  
  7580.  TYPE        is the type of share.  Numbers 0,1,2, and 3 are valid share types. 
  7581.              Types are mapped as follows: disk share =0, print queue = 1, 
  7582.              character device = 2, and an IPC share = 3. 
  7583.  
  7584.  MAXUSES     is the maximum number of concurrent connections that the shared 
  7585.              resource can accommodate.  Default is 10. 
  7586.  
  7587.  REMARK      is a string which is an optional comment about the shared 
  7588.              resource.  The default is no remark. 
  7589.  
  7590.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  7591.              The default buffer is dynamically calculated and set large enough 
  7592.              for any share. 
  7593.  
  7594.  RC          is the expected return code.  COMET will compare the actual return 
  7595.              code with this value.  If they are not the same, an error will be 
  7596.              logged.  If this parameter is not specified, an error will be 
  7597.              logged if the return code is not good. 
  7598.  
  7599.  Sample Code 
  7600.  
  7601.  
  7602. ΓòÉΓòÉΓòÉ 5.19.2. NetShareEnum (Server, Admin user if level 2 is requested) ΓòÉΓòÉΓòÉ
  7603.  
  7604. The NetShareEnum function retrieves share information about each shared 
  7605. resource on a Server. 
  7606.  
  7607. SYNTAX 
  7608.  
  7609. LAN SHARE_ENUM [SERVER=\\servername,]         [LEVEL=>0|1|2<,] 
  7610. [OUTFILE=output_file_name,]         [BUFLEN=buffer_length,] 
  7611. [RC=expected_return_code]; 
  7612.  
  7613. Where: 
  7614.  
  7615.  SERVER      is the name of the remote servername where the function is to 
  7616.              execute.  Server is a UNC styled servername string, i.e. 
  7617.              \\Servername.  If servername is absent then a local server is 
  7618.              assumed. 
  7619.  
  7620.  LEVEL       is the level of detail returned.  Levels 0, 1, or 2 are the only 
  7621.              valid levels, although any number may be specified.  Level 2 is 
  7622.              the default. 
  7623.  
  7624.  OUTFILE     the name of the file where the returned data is stored.  The 
  7625.              returned information will be appended to this file.  If this 
  7626.              parameter is not specified, the returned information will be 
  7627.              displayed to the screen if LAN DEBUG is on. The returned data 
  7628.              includes: 
  7629.  
  7630.      the number of bytes returned 
  7631.      the total number of bytes available 
  7632.      the contents of the returned data structure. 
  7633.  
  7634.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  7635.              The default buffer length is set large enough for 50 users, 
  7636.              however, this buffer will probably be sufficient for more than 50 
  7637.              users if the variable length data is not used.  Increase this 
  7638.              value if a return code of 234 is returned. 
  7639.  
  7640.  RC          is the expected return code.  COMET will compare the actual return 
  7641.              code with this value.  If they are not the same, an error will be 
  7642.              logged.  If this parameter is not specified, an error will be 
  7643.              logged if the return code is not good. 
  7644.  
  7645.  Sample Code 
  7646.  
  7647.  
  7648. ΓòÉΓòÉΓòÉ 5.19.3. NetShareDel (Server,Admin) ΓòÉΓòÉΓòÉ
  7649.  
  7650. NetShareDel deletes a sharename from a Server's list of shared resources. 
  7651.  
  7652. SYNTAX 
  7653.  
  7654.  LAN SHARE_DEL [SERVER=\\servername,]        NETNAME=sharename, 
  7655. [RC=expected_return_code]; 
  7656.  
  7657. Where: 
  7658.  
  7659.  SERVER      is the name of the remote servername where the function is to 
  7660.              execute.  Server is a UNC styled servername string, i.e. 
  7661.              \\Servername.  If servername is absent then a local server is 
  7662.              assumed. 
  7663.  
  7664.  NETNAME     is the share name of the resource.  No default provided, a netname 
  7665.              must be provided. 
  7666.  
  7667.  RC          is the expected return code.  COMET will compare the actual return 
  7668.              code with this value.  If they are not the same, an error will be 
  7669.              logged.  If this parameter is not specified, an error will be 
  7670.              logged if the return code is not good. 
  7671.  
  7672.  Sample Code 
  7673.  
  7674.  
  7675. ΓòÉΓòÉΓòÉ 5.19.4. NetShareCheck (Server) ΓòÉΓòÉΓòÉ
  7676.  
  7677. NetShareCheck queries the server whether a specified device is shared. 
  7678.  
  7679. SYNTAX 
  7680.  
  7681.  LAN SHARE_CHECK [SERVER=\\servername,]         DEVICE=device_name, 
  7682. [OUTFILE=output_file_name,]         [RC=expected_return_code]; 
  7683.  
  7684. Where: 
  7685.  
  7686.  SERVER      is the name of the remote servername where the function is to 
  7687.              execute.  Server is a UNC styled servername string, i.e. 
  7688.              \\Servername.  If servername is absent then a local server is 
  7689.              assumed. 
  7690.  
  7691.  DEVICE      is the name of the device to be checked.  Valid devices sample 
  7692.              types are A:\, COM1, LPT1, and etc.  Although, any string may be 
  7693.              entered. 
  7694.  
  7695.  OUTFILE     the name of the file where the returned data is stored.  The 
  7696.              returned information will be appended to this file.  If this 
  7697.              parameter is not specified, the returned information will be 
  7698.              displayed to the screen if LAN DEBUG is on. The returned data 
  7699.              includes: 
  7700.  
  7701.      the server name 
  7702.      the device name 
  7703.      the type of device, disk share =0, print queue = 1, character device = 2, 
  7704.       and IPC = 3 
  7705.  
  7706.  RC          is the expected return code.  COMET will compare the actual return 
  7707.              code with this value.  If they are not the same, an error will be 
  7708.              logged.  If this parameter is not specified, an error will be 
  7709.              logged if the return code is not good. 
  7710.  
  7711.  Sample Code 
  7712.  
  7713.  
  7714. ΓòÉΓòÉΓòÉ 5.19.5. NetShareGetInfo ΓòÉΓòÉΓòÉ
  7715.  
  7716. NetShareGetInfo retrieves information about a particular shared resource on a 
  7717. Server. 
  7718.  
  7719. SYNTAX 
  7720.  
  7721.  LAN SHARE_GET_INFO [SERVER=\\servername,]           NETNAME=sharename, 
  7722. [LEVEL=>0|1|2<,]           [OUTFILE=output_file_name,] 
  7723. [BUFLEN=buffer_length,]           [RC=expected_return_code]; 
  7724.  
  7725. Where: 
  7726.  
  7727.  SERVER      is the name of the remote servername where the function is to 
  7728.              execute.  Server is a UNC styled servername string, i.e. 
  7729.              \\Servername.  If servername is absent then a local server is 
  7730.              assumed. 
  7731.  
  7732.  NETNAME     is the share name of the resource.  No default provided, a netname 
  7733.              must be provided. 
  7734.  
  7735.  LEVEL       is the level of detail provided by the share_info_x data 
  7736.              structure.  Levels 0, 1, or 2 are valid values and the default is 
  7737.              2. Although, any number can be used. 
  7738.  
  7739.  OUTFILE     the name of the file where the returned data is stored.  The 
  7740.              returned information will be appended to this file.  If this 
  7741.              parameter is not specified, the returned information will be 
  7742.              displayed to the screen if LAN DEBUG is on. The returned data 
  7743.              includes: 
  7744.  
  7745.      the total number of bytes available 
  7746.      the contents of the returned data structure. 
  7747.  
  7748.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  7749.              The default buffer length is dynamically calculated and allocated 
  7750.              to satisfy the ShareGetInfo API call. 
  7751.  
  7752.  RC          is the expected return code.  COMET will compare the actual return 
  7753.              code with this value.  If they are not the same, an error will be 
  7754.              logged.  If this parameter is not specified, an error will be 
  7755.              logged if the return code is not good. 
  7756.  
  7757.  Sample Code 
  7758.  
  7759.  
  7760. ΓòÉΓòÉΓòÉ 5.19.6. NetShareSetInfo ΓòÉΓòÉΓòÉ
  7761.  
  7762. NetShareSetInfo sets a shared resource's parameters. 
  7763.  
  7764. SYNTAX 
  7765.  
  7766.  LAN SHARE_SET_INFO [SERVER=\\servername,]           NETNAME=sharename, 
  7767. [LEVEL=>1|2<,]           [MAXUSES=max_uses,]           [REMARK=remark,] 
  7768. [PARMNUM=>0|4|6<,]           [BUFLEN=buffer_length] 
  7769. [RC=expected_return_code]; 
  7770.  
  7771. Where: 
  7772.  
  7773.  SERVER      is the name of the remote servername where the function is to 
  7774.              execute.  Server is a UNC styled servername string, i.e. 
  7775.              \\Servername.  If servername is absent then a local server is 
  7776.              assumed. 
  7777.  
  7778.  NETNAME     is the share name of the resource.  No default provided, a netname 
  7779.              must be provided. 
  7780.  
  7781.  LEVEL       is the level of detail provided by the share_info_x data 
  7782.              structures.  Valid level values are 1 or 2 (2 is the default). 
  7783.              Although any number can be used. 
  7784.  
  7785.  MAXUSES     is the maximum number of concurrent connections that the shared 
  7786.              resource can accommodate.  Default is 10. 
  7787.  
  7788.  REMARK      is a string which is an optional comment about the shared 
  7789.              resource.  The default remark is NULL, no remark. 
  7790.  
  7791.  PARMNUM     specifies if NetShareSetInfo will specify a single share_info 
  7792.              component or if an entire share_info data structure.  If PARMNUM 
  7793.              is 0, or absent, then an entire data structure will be used.  In 
  7794.              this instance both MAXUSES and REMARK are expected.  PARNMUM can 
  7795.              specify the following data structure components: 
  7796.  
  7797.                                    VALUE            COMPONENT
  7798.                                    4                level 1 or 2 remark
  7799.                                    6                level 2 maxuses
  7800.               So, if values 4 or 6 will be used, then the level must correspond 
  7801.              and a REMARK or MAXUSES should be entered.  Any value can be used 
  7802.              for PARMNUM, however. 
  7803.  
  7804.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  7805.              The default buffer length is dynamically calculated to satisfy the 
  7806.              ShareSetInfo API call. 
  7807.  
  7808.  RC          is the expected return code.  COMET will compare the actual return 
  7809.              code with this value.  If they are not the same, an error will be 
  7810.              logged.  If this parameter is not specified, and error will be 
  7811.              logged if the return code is not good. 
  7812.  
  7813.  Sample Code 
  7814.  
  7815.  
  7816. ΓòÉΓòÉΓòÉ 5.20. Access Permissions APIs ΓòÉΓòÉΓòÉ
  7817.  
  7818. The APIs in the Access Permissions category examine or modify user or group 
  7819. access permission records for server resources.  The Access Permission category 
  7820. consist of the following seven functions: NetAccessAdd, NetAccessCheck, 
  7821. NetAccessDel, NetAccessEnum, NetAccessGetInfo, NetAccessGetUserPerms, and 
  7822. NetAccessSetInfo. 
  7823.  
  7824.  
  7825. ΓòÉΓòÉΓòÉ 5.20.1. NetAccessAdd (Admin or have Perm permission, Server) ΓòÉΓòÉΓòÉ
  7826.  
  7827. The NetAccessAdd function defines a username or groupname access permission 
  7828. record for a new resource.  One to three users and or groups can be added added 
  7829. to a resources access permission record with this routine. 
  7830.  
  7831. SYNTAX 
  7832.  
  7833.  LAN ACCESS_ADD [SERVER=\\servername,]         [LEVEL=1,] 
  7834. RESOURCE=resource_type,         [AUDIT=> 1 | 0 <,]         COUNT=> 1 | 0 <, 
  7835. UGNAME=ugname:Perms [ugname:Perms]         [ugname:Perms], 
  7836. [RC=expected_return_code]; 
  7837.  
  7838. Where: 
  7839.  
  7840.  SERVER      is the name of the remote servername where the function is to 
  7841.              execute.  Server is a UNC styled servername string, i.e. 
  7842.              \\Servername.  If servername is absent then a local server is 
  7843.              assumed. 
  7844.  
  7845.  LEVEL       is the level of detail provided.  The number 1 is the expected 
  7846.              level, although any number may be specified.  Level 1 is the 
  7847.              default. 
  7848.  
  7849.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  7850.              type. 
  7851.  
  7852.  
  7853.                           Resource Type           Name Format
  7854.  
  7855.                           Directory               drive:pathname
  7856.                           File                    drive:pathname
  7857.                           Pipe                    \pipe\pipename
  7858.                           Printer queue           \print\queuename
  7859.                           Character device queue  \comm\chardevqueue
  7860.  
  7861.  AUDIT       is one of the following:  The default is 0, no auditing. 
  7862.  
  7863.      Audit None              0 
  7864.      Audit All              1 
  7865.      Audit Successful Closes       CL 
  7866.      Audit Successful Opens        SO 
  7867.      Audit Successful Writes       SW 
  7868.      Audit Successful Deletes       SD 
  7869.      Audit Successful Changes       SP 
  7870.      Audit Failed Opens          FO 
  7871.      Audit Failed Writes         FW 
  7872.      Audit Failed Deletes         FD 
  7873.      Audit Failed Changes         FP 
  7874.  
  7875.  COUNT       is either 1 or 0. If COUNT is 0, then UGNAME and PERMS are not 
  7876.              required and will be ignored if provided.  When COUNT is 0, then 
  7877.              an access permission record is created for the resource but, no 
  7878.              users or groups will permissions will be added. 
  7879.  
  7880.  UGNAME      is the user or group name and permissions to be added to 
  7881.              resource's access permission record.  can be specified.  Up to 
  7882.              three user or group names and their permissions may be listed. 
  7883.              This is a limitaion of COMET and not the API.  UGNAME is not 
  7884.              required if COUNT is 0.  If COUNT is zero, then an access 
  7885.              permission record is created for the resource but no users are 
  7886.              defined in the access list.  If COUNT is non-zero, then a user or 
  7887.              group name and a colon (:) Must be supplied.  The permission 
  7888.              string that follows the UGNAME is optional.  If the permission 
  7889.              string is not provided, then that user's permissions will be None 
  7890.              (no access). 
  7891.  
  7892.              Perms is a string that describes the user's or group's permissions 
  7893.              described as follows. Example "PERMS=RWC" for Read, Write and 
  7894.              Create permissions. 
  7895.  
  7896.  
  7897.                           PERMS letter   Meaning
  7898.  
  7899.                           R              Read, and by default execute.
  7900.                           W              Write permission.
  7901.                           C              Create an instance of the resource; data may
  7902.                                          be written to the resource when creating it.
  7903.                           X              Execute permission.
  7904.                           D              Delete the permission.
  7905.                           A              Permission to modify resource's attributes
  7906.                                          (such as date and time).
  7907.                           P              Permission to modify the permissions (read,
  7908.                                          write, create, execute, and delete) assigned to
  7909.                                          a resource for a user or application.
  7910.  
  7911.  RC          is the expected return code.  COMET will compare the actual return 
  7912.              code with this value.  If they are not the same, an error will be 
  7913.              logged.  If this parameter is not specified, an error will be 
  7914.              logged if the return code is not good. 
  7915.  
  7916.  Sample Code 
  7917.  
  7918.  
  7919. ΓòÉΓòÉΓòÉ 5.20.2. NetAccessCheck (Admin, Local) ΓòÉΓòÉΓòÉ
  7920.  
  7921. NetAccessCheck verifies that a username or groupname has the requested 
  7922. permissions for a particular resource. 
  7923.  
  7924. SYNTAX 
  7925.  
  7926. LAN ACCESS_CHECK UGNAME=user_or_group_name,          RESOURCE=resource_name, 
  7927. [OPERATION=>RWCXDAP<,[          [OUTFILE=output_file_name,] 
  7928. [RC=expected_return_cod] 
  7929.  
  7930. Where: 
  7931.  
  7932.  SERVER      is the name of the remote servername where the function is to 
  7933.              execute.  Server is a UNC styled servername string, i.e. 
  7934.              \\Servername.  If servername is absent then a local server is 
  7935.              assumed. 
  7936.  
  7937.  UGNAME      is the user or group name to be checked against a resource's 
  7938.              access permission record. 
  7939.  
  7940.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  7941.              type.  See the description for valid resource names in the LAN 
  7942.              ACCESS_ADD discussion. 
  7943.  
  7944.  OPERATION   is a string that describes the type of access operation requested. 
  7945.              Example, "OPERATION=RWC" for Read, Write and Create access.  Any 
  7946.              combination of the following may be requested.  The default is 
  7947.              "P". 
  7948.  
  7949.                           OPERATION letter   Meaning
  7950.  
  7951.                           R              Read, and by default execute.
  7952.                           W              Write permission.
  7953.                           C              Create an instance of the resource; data may
  7954.                                          be written to the resource when creating it.
  7955.                           X              Execute permission.
  7956.                           D              Delete the permission.
  7957.                           A              Permission to modify resource's attributes
  7958.                                          (such as date and time).
  7959.                           P              Permission to modify the permissions (read,
  7960.                                          write, create, execute, and delete) assigned to
  7961.                                          a resource for a user or application.
  7962.  
  7963.  OUTFILE     the name of the file where the returned data is stored.  The 
  7964.              returned information will be appended to this file.  If this 
  7965.              parameter is not specified, the returned information will be 
  7966.              displayed to the screen if LAN DEBUG is on. The returned data 
  7967.              includes: 
  7968.  
  7969.      the user name 
  7970.      the resource 
  7971.      the operation requested 
  7972.      and the result returned from the API 
  7973.  
  7974.  RC          is the expected return code.  COMET will compare the actual return 
  7975.              code with this value.  If they are not the same, an error will be 
  7976.              logged.  If this parameter is not specified, an error will be 
  7977.              logged if the return code is not good.  A zero (0) return code 
  7978.              means the requested operation is permitted. 
  7979.  
  7980.  The "result" returned by the API is only valid when the LAN return code is 
  7981.  zero.  When both the result and the LAN return code are 0, this indicates the 
  7982.  requested OPERATION is allowed. 
  7983.  
  7984.  Sample Code 
  7985.  
  7986.  
  7987. ΓòÉΓòÉΓòÉ 5.20.3. NetAccessDel (Admin, Server) ΓòÉΓòÉΓòÉ
  7988.  
  7989. NetAccessDel deletes all access permission records for a particular shared 
  7990. resource. 
  7991.  
  7992. SYNTAX 
  7993.  
  7994. LAN ACCESS_DEL [SERVER=\\servername,]         RESOURCE=resource_type, 
  7995. [RC=expected_return_code]; 
  7996.  
  7997. Where: 
  7998.  
  7999.  SERVER      is the name of the remote servername where the function is to 
  8000.              execute.  Server is a UNC styled servername string, i.e. 
  8001.              \\Servername.  If servername is absent then a local server is 
  8002.              assumed. 
  8003.  
  8004.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  8005.              type.  See the description for valid resource names in the LAN 
  8006.              ACCESS_ADD discussion. 
  8007.  
  8008.  RC          is the expected return code.  COMET will compare the actual return 
  8009.              code with this value.  If they are not the same, an error will be 
  8010.              logged.  If this parameter is not specified, an error will be 
  8011.              logged if the return code is not good. 
  8012.  
  8013.  Sample Code 
  8014.  
  8015.  
  8016. ΓòÉΓòÉΓòÉ 5.20.4. NetAccessEnum (partially Admin) ΓòÉΓòÉΓòÉ
  8017.  
  8018. NetAccessEnum enumerates all access permission records. 
  8019.  
  8020. SYNTAX 
  8021.  
  8022. LAN ACCESS_ENUM [SERVER=\\servername]            [BASEPATH=path_name,] 
  8023. [LEVEL=>O | 1<,]            [RECURSIVE=> 0 | 1<,] 
  8024. [BUFLEN=buffer_length,]            [OUTFILE=output_file_name,] 
  8025. [RC=expected_return_code]; 
  8026.  
  8027. Where: 
  8028.  
  8029.  SERVER      is the name of the remote servername where the function is to 
  8030.              execute.  Server is a UNC styled servername string, i.e. 
  8031.              \\Servername.  If servername is absent then a local server is 
  8032.              assumed. 
  8033.  
  8034.  BASEPATH    is a base pathname for a shared resources.  If this entry is 
  8035.              absent, then no base path will be used.  The default is no base 
  8036.              path (NULL). 
  8037.  
  8038.  LEVEL       specifies the level of detail (0 or 1) requested for the returned 
  8039.              data structure.  The default is 0 although, any number may be 
  8040.              entered. 
  8041.  
  8042.  RECURSIVE   enables or disables recursive searching.  If RECURSIVE is 0, 
  8043.              NetAccessEnum returns entries only for the resource named as 
  8044.              basepath. If RECURSIVE is 1 (or non-zero), then entries for all 
  8045.              access control records whose resource matches basepath will be 
  8046.              returned. 
  8047.  
  8048.  BUFLEN      is the length of the buffer provided to the API.  The default is 
  8049.              1024 although, any value may be entered. 
  8050.  
  8051.  OUTFILE     the name of the file where the returned data is stored.  The 
  8052.              returned information will be appended to this file.  If this 
  8053.              parameter is not specified, the returned information will be 
  8054.              displayed to the screen if LAN DEBUG is on. The returned data 
  8055.              includes: 
  8056.  
  8057.      the server name 
  8058.      the basepath 
  8059.      the level requested 
  8060.      the API return code 
  8061.      the number of entries returned 
  8062.      the total number of entries available 
  8063.      the resource(s) 
  8064.      all user names and their permissions in the access list, if level 1 is 
  8065.       requested 
  8066.  
  8067.  RC          is the expected return code.  COMET will compare the actual return 
  8068.              code with this value.  If they are not the same, an error will be 
  8069.              logged.  If this parameter is not specified, an error will be 
  8070.              logged if the return code is not good.  A zero (0) return code 
  8071.              means the requested operation is permitted. 
  8072.  
  8073.  Where: 
  8074.  
  8075.  SERVER      is the name of the remote servername where the function is to 
  8076.              execute.  Server is a UNC styled servername string, i.e. 
  8077.              \\Servername.  If servername is absent then a local server is 
  8078.              assumed. 
  8079.  
  8080.  Sample Code 
  8081.  
  8082.  
  8083. ΓòÉΓòÉΓòÉ 5.20.5. NetAccessGetInfo (Admin or have Perm permission, Server) ΓòÉΓòÉΓòÉ
  8084.  
  8085. NetAccessGetInfo retrieves information about a resource's access permission 
  8086. record. 
  8087.  
  8088. SYNTAX 
  8089.  
  8090. LAN ACCESS_GET_INFO [SERVER=\\servername,]           RESOURCE=resource_type, 
  8091. [LEVEL=1,]           [BUFLEN=buffer_length,] 
  8092. [OUTFILE=output_file_name,]           [RC=expected_return_code]; 
  8093.  
  8094. Where: 
  8095.  
  8096.  SERVER      is the name of the remote servername where the function is to 
  8097.              execute.  Server is a UNC styled servername string, i.e. 
  8098.              \\Servername.  If servername is absent then a local server is 
  8099.              assumed. 
  8100.  
  8101.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  8102.              type.  See the description for valid resource names in the LAN 
  8103.              ACCESS_ADD discussion. 
  8104.  
  8105.  LEVEL       is the level of detail returned.  The number 1 is the expected 
  8106.              level, although any number may be specified.  Level 1 is the 
  8107.              default. 
  8108.  
  8109.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8110.              The default buffer length will be dynamically allocated to satisfy 
  8111.              a successful API call so, the size is unknown. 
  8112.  
  8113.  OUTFILE     the name of the file where the returned data is stored.  The 
  8114.              returned information will be appended to this file.  If this 
  8115.              parameter is not specified, the returned information will be 
  8116.              displayed to the screen if LAN DEBUG is on. The returned data 
  8117.              includes: 
  8118.  
  8119.      the name of the resource 
  8120.      the total number of bytes available 
  8121.      a list of all users and groups, and their permissions, who are in the 
  8122.       resource's access permission record 
  8123.  
  8124.  RC          is the expected return code.  COMET will compare the actual return 
  8125.              code with this value.  If they are not the same, an error will be 
  8126.              logged.  If this parameter is not specified, an error will be 
  8127.              logged if the return code is not good. 
  8128.  
  8129.  Sample Code 
  8130.  
  8131.  
  8132. ΓòÉΓòÉΓòÉ 5.20.6. NetAccessGetUserPerms ( partially Admin) ΓòÉΓòÉΓòÉ
  8133.  
  8134. NetAccessGetUserPerms supplies a specified user's or group's permission to a 
  8135. resource. 
  8136.  
  8137. SYNTAX 
  8138.  
  8139. LAN ACCESS_GET_USER_PERMS [SERVER=\\servername,] 
  8140. UGNAME=user_or_group_name,              RESOURCE=resource_type, 
  8141. [OUTFILE=output_file_name,]              [RC=expected_return_code]; 
  8142.  
  8143. Where: 
  8144.  
  8145.  SERVER      is the name of the remote servername where the function is to 
  8146.              execute.  Server is a UNC styled servername string, i.e. 
  8147.              \\Servername.  If servername is absent then a local server is 
  8148.              assumed. 
  8149.  
  8150.  UGNAME      is the user or group name to be inquired. 
  8151.  
  8152.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  8153.              type.  See the description for valid resource names in the LAN 
  8154.              ACCESS_ADD discussion. 
  8155.  
  8156.  OUTFILE     the name of the file where the returned data is stored.  The 
  8157.              returned information will be appended to this file.  If this 
  8158.              parameter is not specified, the returned information will be 
  8159.              displayed to the screen if LAN DEBUG is on. The returned data 
  8160.              includes: 
  8161.  
  8162.      the name of the resource 
  8163.      a list of all users and groups, and their permissions, who are in the 
  8164.       resource's access permission record 
  8165.  
  8166.  RC          is the expected return code.  COMET will compare the actual return 
  8167.              code with this value.  If they are not the same, an error will be 
  8168.              logged.  If this parameter is not specified, an error will be 
  8169.              logged if the return code is not good. 
  8170.  
  8171.  Remarks 
  8172.  
  8173.  The permissions returned are based on the user's entry and any groups to which 
  8174.  the use belongs.  Priority is always given to the user's entry if one exists. 
  8175.  
  8176.  Sample Code 
  8177.  
  8178.  
  8179. ΓòÉΓòÉΓòÉ 5.20.7. NetAccessSetInfo (Admin, Server) ΓòÉΓòÉΓòÉ
  8180.  
  8181. NetAccessSetInfo changes an access permission record for a resource. 
  8182.  
  8183. SYNTAX 
  8184.  
  8185. LAN ACCESS_SET_INFO [SERVER=\\servername,]           RESOURCE=resource_type, 
  8186. [LEVEL=>0|1<,]           [BUFLEN=buffer_length,]           [PARMNUM=>0|2<,] 
  8187. [AUDIT=> 1 | 0 <,]           [UGNAME=ugname:Perms [ugname:Perms] 
  8188. [ugname:Perms,]           [COUNT=number_of_access_list,] 
  8189. [RC=expected_return_code]; 
  8190.  
  8191. Where: 
  8192.  
  8193.  SERVER      is the name of the remote servername where the function is to 
  8194.              execute.  Server is a UNC styled servername string, i.e. 
  8195.              \\Servername.  If servername is absent then a local server is 
  8196.              assumed. 
  8197.  
  8198.  RESOURCE    is an ASCII string specifying the name of a particular resource 
  8199.              type.  See the description for valid resource names in the LAN 
  8200.              ACCESS_ADD discussion. 
  8201.  
  8202.  LEVEL       is the level of detail provided.  The number 1 is the expected 
  8203.              level, although any number may be specified.  Level 1 is the 
  8204.              default. 
  8205.  
  8206.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8207.              The default buffer length is 100 bytes??????????????????????? 
  8208.  
  8209.  PARMNUM     if PARMNUM is 0, specifies if a user or group name and permissions 
  8210.              are to be added to the resources access permission record.  An 
  8211.              UGNAME should be provided if PARMNUM is 0.  If PARMNUM is 2, then 
  8212.              specifies only if auditing to be on or off for the resource. 
  8213.  
  8214.  AUDIT       is either 1 (turn auditing on), or 0 (no auditing).  The default 
  8215.              is 0, no auditing. 
  8216.  
  8217.  UGNAME      is the user or group name and permissions to be added to 
  8218.              resource's access permission record.  can be specified.  Up to 
  8219.              three user or group names and their permissions may be listed. 
  8220.              This is a limitaion of COMET and not the API.  UGNAME is not 
  8221.              required if COUNT is 0.  If COUNT is zero, then an access 
  8222.              permission record is created for the resource but no users are 
  8223.              defined in the access list.  If COUNT is non-zero, then a user or 
  8224.              group name and a colon (:) Must be supplied.  The permission 
  8225.              string that follows the UGNAME is optional.  If the permission 
  8226.              string is not provided, then that user's permissions will be None 
  8227.              (no access). 
  8228.  
  8229.              Perms is a string that describes the user's or group's permissions 
  8230.              described as follows. Example "PERMS=RWC" for Read, Write and 
  8231.              Create permissions. 
  8232.  
  8233.  COUNT       is the number of ugname:Perms lists in the UGNAME parameter. 
  8234.              Default is 0. 
  8235.  
  8236.  RC          is the expected return code.  COMET will compare the actual return 
  8237.              code with this value.  If they are not the same, an error will be 
  8238.              logged.  If this parameter is not specified, an error will be 
  8239.              logged if the return code is not good. 
  8240.  
  8241.  Remarks 
  8242.  
  8243.  Care must be taken when using this COMET command.  If more than 3 access lists 
  8244.  (user or group name and their associated permission(s)) exist for a resource, 
  8245.  this command will re-set the access lists with the new UGNAME and permissions. 
  8246.  For example, suppose the following resource had these access lists: 
  8247.  
  8248.  
  8249.   Resource Name   : C:
  8250.   Attribute       : Audit OFF
  8251.   Access Lists    : 3
  8252.  
  8253.           User Name     : PAM
  8254.           Permissions   : RWC
  8255.  
  8256.           Group Name     : GROUP2
  8257.           Permissions   : None
  8258.  
  8259.           Group Name     : GROUP1
  8260.           Permissions   : P
  8261.  
  8262.  Now if the following command is executed by COMET: 
  8263.  
  8264.   LAN ACCESS_SET_INFO resource=c:, level=1,count=1,
  8265.   ugname=PAM:P, parmnum=0;
  8266.  this is what the new access list would look like: 
  8267.  
  8268.  
  8269.   Resource Name   : C:
  8270.   Attribute       : Audit OFF
  8271.   Access Lists    : 1
  8272.  
  8273.           User Name     : PAM
  8274.           Permissions   : P
  8275.  
  8276.  Notice that Group2 and Group1 no longer appear in the Access List. 
  8277.  
  8278.  Sample Code 
  8279.  
  8280.  
  8281. ΓòÉΓòÉΓòÉ 5.21. Groups APIs ΓòÉΓòÉΓòÉ
  8282.  
  8283. Description 
  8284.  
  8285. A group is a set of users sharing common permissions in the User Profile 
  8286. Management (UPM) database.  The Groups functions create or delete groups and 
  8287. review or adjust their membership. 
  8288.  
  8289.  
  8290. ΓòÉΓòÉΓòÉ 5.21.1. NetGroupAdd ( Admin ) ΓòÉΓòÉΓòÉ
  8291.  
  8292. NetGroupAdd creates a new group account in the User Profile Management (UPM) 
  8293. database. 
  8294.  
  8295. SYNTAX 
  8296.  
  8297. LAN GROUP_ADD [SERVER=\\servernamename,]        [LEVEL=>0|1<,] 
  8298. GNAME=group_name,        [REMARK=comment,]        [BUFLEN=buffer_length,] 
  8299. [RC=expected_return_code]; 
  8300.  
  8301. Where: 
  8302.  
  8303.  SERVER      is the name of the remote servername where the function is to 
  8304.              execute.  Server is a UNC styled servername string, i.e. 
  8305.              \\Servername.  If servername is absent then a local server is 
  8306.              assumed. 
  8307.  
  8308.  LEVEL       is the level of detail provided.  The numbers 0 and 1 are valid 
  8309.              levels, although any number may be specified.  If a REMARK is 
  8310.              specified then the Level should be 1. Level 0 is the default. 
  8311.  
  8312.  GNAME       is the name of the group to add. 
  8313.  
  8314.  REMARK      is an optional comment or remark about the group.  If a Remark is 
  8315.              specified, then Level should be set to 1. 
  8316.  
  8317.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8318.              The default buffer length is the size of a group_info_1 data 
  8319.              structure plus the variable length data. 
  8320.  
  8321.  RC          is the expected return code.  COMET will compare the actual return 
  8322.              code with this value.  If they are not the same, an error will be 
  8323.              logged.  If this parameter is not specified, an error will be 
  8324.              logged if the return code is not good. 
  8325.  
  8326.  Sample Code 
  8327.  
  8328.  
  8329. ΓòÉΓòÉΓòÉ 5.21.2. NetGroupAddUser ( Admin ) ΓòÉΓòÉΓòÉ
  8330.  
  8331. NetGroupAddUser adds a user to a group in the UPM database. 
  8332.  
  8333. SYNTAX 
  8334.  
  8335. LAN GROUP_ADD_USER [SERVER=\\servernamename,]           GNAME=group_name, 
  8336. UNAME=user_name,           [RC=expected_return_code]; 
  8337.  
  8338. Where: 
  8339.  
  8340.  SERVER      is the name of the remote servername where the function is to 
  8341.              execute.  Server is a UNC styled servername string, i.e. 
  8342.              \\Servername.  If servername is absent then a local server is 
  8343.              assumed. 
  8344.  
  8345.  GNAME       is the name of the group the user will join. 
  8346.  
  8347.  UNAME       is the user to add to the group. 
  8348.  
  8349.  RC          is the expected return code.  COMET will compare the actual return 
  8350.              code with this value.  If they are not the same, an error will be 
  8351.              logged.  If this parameter is not specified, an error will be 
  8352.              logged if the return code is not good. 
  8353.  
  8354.  Sample Code 
  8355.  
  8356.  
  8357. ΓòÉΓòÉΓòÉ 5.21.3. NetGroupDel ( Admin ) ΓòÉΓòÉΓòÉ
  8358.  
  8359. NetGroupDel removes a group account from the UPM database. 
  8360.  
  8361. SYNTAX 
  8362.  
  8363. LAN GROUP_DEL [SERVER=\\servernamename,]        GNAME=group_name, 
  8364. [RC=expected_return_code]; 
  8365.  
  8366. Where: 
  8367.  
  8368.  SERVER      is the name of the remote servername where the function is to 
  8369.              execute.  Server is a UNC styled servername string, i.e. 
  8370.              \\Servername.  If servername is absent then a local server is 
  8371.              assumed. 
  8372.  
  8373.  GNAME       is the name of the group the user will join. 
  8374.  
  8375.  RC          is the expected return code.  COMET will compare the actual return 
  8376.              code with this value.  If they are not the same, an error will be 
  8377.              logged.  If this parameter is not specified, an error will be 
  8378.              logged if the return code is not good. 
  8379.  
  8380.  Sample Code 
  8381.  
  8382.  
  8383. ΓòÉΓòÉΓòÉ 5.21.4. NetGroupDelUser ( Admin ) ΓòÉΓòÉΓòÉ
  8384.  
  8385. NetGroupDelUser removes a user from a particular group in the UPM database. 
  8386.  
  8387. SYNTAX 
  8388.  
  8389. LAN GROUP_DEL_USER [SERVER=\\servernamename,]           GNAME=group_name, 
  8390. UNAME=user_name,           [RC=expected_return_code]; 
  8391.  
  8392. Where: 
  8393.  
  8394.  SERVER      is the name of the remote servername where the function is to 
  8395.              execute.  Server is a UNC styled servername string, i.e. 
  8396.              \\Servername.  If servername is absent then a local server is 
  8397.              assumed. 
  8398.  
  8399.  GNAME       is the name of the group the user will removed from. 
  8400.  
  8401.  UNAME       is the user to remove from the group. 
  8402.  
  8403.  RC          is the expected return code.  COMET will compare the actual return 
  8404.              code with this value.  If they are not the same, an error will be 
  8405.              logged.  If this parameter is not specified, an error will be 
  8406.              logged if the return code is not good. 
  8407.  
  8408.  Sample Code 
  8409.  
  8410.  
  8411. ΓòÉΓòÉΓòÉ 5.21.5. NetGroupEnum ( Admin ) ΓòÉΓòÉΓòÉ
  8412.  
  8413. NetGroupEnum lists all group accounts on the UPM database. 
  8414.  
  8415. SYNTAX 
  8416.  
  8417. LAN GROUP_ENUM [SERVER=\\servernamename,]         [LEVEL=>0|1<,] 
  8418. [BUFLEN=buffer_length,]         [OUTFILE=output_file_name,] 
  8419. [RC=expected_return_code]; 
  8420.  
  8421. Where: 
  8422.  
  8423.  SERVER      is the name of the remote servername where the function is to 
  8424.              execute.  Server is a UNC styled servername string, i.e. 
  8425.              \\Servername.  If servername is absent then a local server is 
  8426.              assumed. 
  8427.  
  8428.  LEVEL       is the level of detail returned.  The numbers 0, and 1 are valid 
  8429.              level numbers, although any number may be specified.  Level 0 
  8430.              provides the least amount of information while level 2 provides 
  8431.              the most. Level 2 is the default. 
  8432.  
  8433.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8434.              The default buffer length is 1000 bytes. 
  8435.  
  8436.  OUTFILE     the name of the file where the returned data is stored.  The 
  8437.              returned information will be appended to this file.  If this 
  8438.              parameter is not specified, the returned information will be 
  8439.              displayed to the screen if LAN DEBUG is on. The returned data 
  8440.              includes: 
  8441.  
  8442.      the number of entries returned 
  8443.      the total number of entries available 
  8444.      all group accounts in the UPM database. 
  8445.  
  8446.  RC          is the expected return code.  COMET will compare the actual return 
  8447.              code with this value.  If they are not the same, an error will be 
  8448.              logged.  If this parameter is not specified, an error will be 
  8449.              logged if the return code is not good. 
  8450.  
  8451.  Sample Code 
  8452.  
  8453.  
  8454. ΓòÉΓòÉΓòÉ 5.21.6. NetGroupGetInfo ( Admin ) ΓòÉΓòÉΓòÉ
  8455.  
  8456. NetGroupGetInfo gets group-related information 
  8457.  
  8458. SYNTAX 
  8459.  
  8460. LAN GROUP_GET_INFO [SERVER=\\servernamename,]           GNAME=group_name, 
  8461. [LEVEL=>0|1<,]           [BUFLEN=buffer_length,] 
  8462. [OUTFILE=output_file_name,]           [RC=expected_return_code]; 
  8463.  
  8464. Where: 
  8465.  
  8466.  SERVER      is the name of the remote servername where the function is to 
  8467.              execute.  Server is a UNC styled servername string, i.e. 
  8468.              \\Servername.  If servername is absent then a local server is 
  8469.              assumed. 
  8470.  
  8471.  GNAME       is the name of the group to get information from. 
  8472.  
  8473.  LEVEL       is the level of detail returned.  The numbers 0 and 1 are valid 
  8474.              level numbers, although any number may be specified.  Level 0 
  8475.              provides the least amount of information while level 1 provides 
  8476.              the most. Level 0 is the default. 
  8477.  
  8478.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8479.              The default buffer length is 1024 bytes. 
  8480.  
  8481.  OUTFILE     the name of the file where the returned data is stored.  The 
  8482.              returned information will be appended to this file.  If this 
  8483.              parameter is not specified, the returned information will be 
  8484.              displayed to the screen if LAN DEBUG is on. The returned data 
  8485.              includes: 
  8486.  
  8487.      the total number of bytes available 
  8488.      the contents of the returned data structure, level 0 or 1. 
  8489.  
  8490.  RC          is the expected return code.  COMET will compare the actual return 
  8491.              code with this value.  If they are not the same, an error will be 
  8492.              logged.  If this parameter is not specified, an error will be 
  8493.              logged if the return code is not good. 
  8494.  
  8495.  Sample Code 
  8496.  
  8497.  
  8498. ΓòÉΓòÉΓòÉ 5.21.7. NetGroupGetUsers ( Partially Admin ) ΓòÉΓòÉΓòÉ
  8499.  
  8500. NetGroupGetUsers returns a list of members of a particular group in the UPM 
  8501. database. 
  8502.  
  8503. SYNTAX 
  8504.  
  8505. LAN GROUP_GET_USERS [SERVER=\\servernamename,]           GNAME=group_name, 
  8506. [LEVEL=0,]           [BUFLEN=buffer_length,] 
  8507. [OUTFILE=output_file_name,]           [RC=expected_return_code]; 
  8508.  
  8509. Where: 
  8510.  
  8511.  SERVER      is the name of the remote servername where the function is to 
  8512.              execute.  Server is a UNC styled servername string, i.e. 
  8513.              \\Servername.  If servername is absent then a local server is 
  8514.              assumed. 
  8515.  
  8516.  GNAME       is the name of the group whose members will be listed. 
  8517.  
  8518.  LEVEL       is the level of detail returned.  The number 0 is the only valid 
  8519.              level, although any number may be specified.  Level Level 0 is the 
  8520.              default. 
  8521.  
  8522.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8523.              The default buffer length is 1024 bytes. 
  8524.  
  8525.  OUTFILE     the name of the file where the returned data is stored.  The 
  8526.              returned information will be appended to this file.  If this 
  8527.              parameter is not specified, the returned information will be 
  8528.              displayed to the screen if LAN DEBUG is on. The returned data 
  8529.              includes: 
  8530.  
  8531.      the number of entries returned 
  8532.      the total number of entries available 
  8533.      all members in the group of interest. 
  8534.  
  8535.  RC          is the expected return code.  COMET will compare the actual return 
  8536.              code with this value.  If they are not the same, an error will be 
  8537.              logged.  If this parameter is not specified, an error will be 
  8538.              logged if the return code is not good. 
  8539.  
  8540.  Sample Code 
  8541.  
  8542.  
  8543. ΓòÉΓòÉΓòÉ 5.21.8. NetGroupSetInfo ( Admin ) ΓòÉΓòÉΓòÉ
  8544.  
  8545. NetGroupSetInfo sets group related information. 
  8546.  
  8547. SYNTAX 
  8548.  
  8549. LAN GROUP_SET_INFO [SERVER=\\servernamename,]           GNAME=group_name, 
  8550. [REMARK=comment,]           [LEVEL=>0|1<,]           [PARMNUM=>0|2<,] 
  8551. [BUFLEN=buffer_length,]           [RC=expected_return_code]; 
  8552.  
  8553. Where: 
  8554.  
  8555.  SERVER      is the name of the remote servername where the function is to 
  8556.              execute.  Server is a UNC styled servername string, i.e. 
  8557.              \\Servername.  If servername is absent then a local server is 
  8558.              assumed. 
  8559.  
  8560.  GNAME       is the name of the group whose members will be listed. 
  8561.  
  8562.  LEVEL       is the level of detail returned.  The numbers 0 and 1 are the 
  8563.              valid only valid levels, although any number may be specified. 
  8564.              Level Level 0 is the default. 
  8565.  
  8566.  PARMNUM     is the ordinal position of data structure components.  If PARMNUM 
  8567.              is zero, or absent, then an entire data structure is passed.  The 
  8568.              only settable field is the remark parameter hence, the only valid 
  8569.              nonzero value for parmnum is 2.  If PARMNUM is 2, then only the 
  8570.              Group's comment is changed.  A REMARK should be specified if 
  8571.              PARMNUM is 2, and LEVEL should be set to 1. 
  8572.  
  8573.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8574.              The default buffer length is dynamically calculated to satisfy the 
  8575.              call. 
  8576.  
  8577.  RC          is the expected return code.  COMET will compare the actual return 
  8578.              code with this value.  If they are not the same, an error will be 
  8579.              logged.  If this parameter is not specified, an error will be 
  8580.              logged if the return code is not good. 
  8581.  
  8582.  Sample Code 
  8583.  
  8584.  
  8585. ΓòÉΓòÉΓòÉ 5.21.9. NetGroupSetUsers ( Admin ) ΓòÉΓòÉΓòÉ
  8586.  
  8587. NetGroupSetUsers sets information about users who belong to a group, i.e. this 
  8588. function acts much like NetGroupUserAdd execept, this function allows multiple 
  8589. users to be added to a group through one API call. 
  8590.  
  8591. SYNTAX 
  8592.  
  8593. LAN GROUP_SET_USERS [SERVER=\\servernamename,]           GNAME=group_name, 
  8594. UNAMES=name [name] [name]           COUNT=user_count           [LEVEL=0,] 
  8595. [BUFLEN=buffer_length,]           [RC=expected_return_code]; 
  8596.  
  8597. Where: 
  8598.  
  8599.  SERVER      is the name of the remote servername where the function is to 
  8600.              execute.  Server is a UNC styled servername string, i.e. 
  8601.              \\Servername.  If servername is absent then a local server is 
  8602.              assumed. 
  8603.  
  8604.  GNAME       is the name of the group to set the users.  No default, a group 
  8605.              name must be provided. 
  8606.  
  8607.  UNAME       is the name of the user(s).  If more than one user is provided, 
  8608.              they should be seperated by a blank space.  At least one user must 
  8609.              be provided, no default. 
  8610.  
  8611.  COUNT       is the number of users supplied at the UNNAME parameter.  The 
  8612.              COUNT must be supplied, no default. 
  8613.  
  8614.  LEVEL       Level 0 is the only valid level although and the default, although 
  8615.              any number may be used. 
  8616.  
  8617.  BUFLEN      is the length of the buffer that will be supplied to the API call. 
  8618.              The default buffer length is 1024 bytes. 
  8619.  
  8620.  RC          is the expected return code.  COMET will compare the actual return 
  8621.              code with this value.  If they are not the same, an error will be 
  8622.              logged.  If this parameter is not specified, an error will be 
  8623.              logged if the return code is not good. 
  8624.  
  8625.  Sample Code 
  8626.  
  8627.  
  8628. ΓòÉΓòÉΓòÉ 5.22. LAN API - User ΓòÉΓòÉΓòÉ
  8629.  
  8630. Description 
  8631.  
  8632. In the User Profile Management (UPM), each user or application that accesses 
  8633. the resources must have a user account in the system.  The system users this 
  8634. account to verify that the user or application has permission to connect to any 
  8635. shared resource.  The functions in the User category control a user's account 
  8636. in the UPM.  The User category consist of the following 15 functions: 
  8637. NetUserAdd, NetUserDel, NetUserEnum, NetUserGetGroups, NetUserGetInfo, 
  8638. NetUserInit, NetUserModalsGet, NetUserModalsSet, NetUserPasswordSet, 
  8639. NetUserPrimaryDBGet, NetUserPrimaryDBSet, NetUserSetGroups, NetUserSetInfo, 
  8640. NetUserValidate, and NetUserValidate2. 
  8641.  
  8642.  
  8643. ΓòÉΓòÉΓòÉ 5.22.1. NetUserAdd ( Admin ) ΓòÉΓòÉΓòÉ
  8644.  
  8645. NetUserAdd function establishes an account for a user in the User Profile 
  8646. Management (UPM) and assigns a password and privilege level. 
  8647.  
  8648. SYNTAX 
  8649.  
  8650. LAN USER_ADD [SERVER=\\servernamename,]        [LEVEL=>1|2<,] 
  8651. [BUFLEN=buffer_length,]        UNAME=user_name,        [PASSWD=password,] 
  8652. [PRIV=privilage,]        [HOMEDIR=home_directory,]        [REMARK=comment,] 
  8653. [FLAGS=value,]        [SCRIPTPATH=pathname,] 
  8654. 2[FULLNAME=full_name_of_user,]       2[UCOMMENT=user_settable_comment,] 
  8655. 2[REQUESTERS=requesters,]       2[EXPIRES=expiration_time,] 
  8656. 2[MAXSTOR=home_dir_max_size,]       2[LOGONHRS=day:hour 
  8657. 2[LOGONSVR=servername,]       2[CNTRYCODE=country_code,] 
  8658. 2[CODEPG=code_page,]        [RC=expected_return_code]; 
  8659.  
  8660. Where: 
  8661.  
  8662.  SERVER      is the name of the remote servername where the function is to 
  8663.              execute.  Server is a UNC styled servername string, i.e. 
  8664.              \\Servername.  If servername is absent then a local server is 
  8665.              assumed. 
  8666.  
  8667.  LEVEL       is the data structure level supplied to the API call.  Valid 
  8668.              levels are 1 and 2, although any level may be entered.  The 
  8669.              default is level 1.  Note, those parameters that have a 2 on the 
  8670.              left are used only when the level is 2,  if the level is 1, 
  8671.              entries in these parameters will be ignored. 
  8672.  
  8673.  BUFLEN      is the buffer length supplied to the API call.  The default is is 
  8674.              dynamically allocated to satisfy the call, however, and value may 
  8675.              be entered. 
  8676.  
  8677.  UNAME       is the name of the user the account is to be established for. 
  8678.  
  8679.  PASSWD      is the users password.  The default is no password (NULL). 
  8680.  
  8681.  PRIV        is the user's privilege. The default is User. It may be one of the 
  8682.              following: 
  8683.  
  8684.  
  8685.                              Value            Privilege
  8686.  
  8687.                                0              Guest
  8688.                                1              User
  8689.                                2              Administrator
  8690.  
  8691.  HOMEDIR     is the user's home directory.  The absolute path may be local or 
  8692.              UNC.  The default is no home directory. 
  8693.  
  8694.  REMARK      is a remark or comment.  It may contain any text.  The default is 
  8695.              no remark. 
  8696.  
  8697.  FLAGS       determines several features of a user's account.  If more than one 
  8698.              of the features below is desired, the sum of the desired features 
  8699.              should be entered.  Example, if a user is required to have a home 
  8700.              dir and have his logon script enabled, a value of 9 should be 
  8701.              entered for flags.  The default value is 33, logon script enabled 
  8702.              and no password required. 
  8703.  
  8704.  
  8705.                              Meaning                      decimal value    Bit mask
  8706.  
  8707.                              logon script enabled         1                0x1
  8708.                              user's account disabled      2                0x2
  8709.                              home directory required      8                0x8
  8710.                              password not required       32                0x20
  8711.                              password cannot change      64                0x40
  8712.  
  8713.  SCRIPTPATH  is the a string telling the pathname of the user's logon script. 
  8714.              The default is no scriptpath (NULL). 
  8715.  
  8716.  FULLNAME    is the full name of the user.  The default is NULL. 
  8717.  
  8718.  UCOMMENT    is a user-settable comment field.  The default is NULL. 
  8719.  
  8720.  REQUESTERS  is a list of requesters from which a user is permitted to log on. 
  8721.              If this entry is absent then the default is NULL which means all 
  8722.              requesters are allowed. 
  8723.  
  8724.  EXPIRES     is the date and time the the account will expire in the following 
  8725.              format:  mm/dd/yy  hh:mn:ss . An expired account is equivalent of 
  8726.              a disabled account.  The default value is never (0xFFFFFFFF). 
  8727.  
  8728.  MAXSTOR     is the maximum storage, in K bytes, allotted for the home 
  8729.              directory.  The default is unlimited (0xFFFFFFFF). 
  8730.  
  8731.  LOGONHRS    are the hours of the week the user is allowed to logon.  If not 
  8732.              given, the default is all hours. 
  8733.  
  8734.  LOGONSVR    is the server to handle logon requests for a user.  The default is 
  8735.              the domain controller (NULL). 
  8736.  
  8737.  CNTRYCODE   is the OS /2 country code for the user's language choice.  This is 
  8738.              used by the OS/2 LAN Server software to generate messages in the 
  8739.              appropriate language whenever possible.  The default is the 
  8740.              current country code on the server. 
  8741.  
  8742.  CODEPG      is the OS/2 code page for the language choice of the user. The 
  8743.              valid values are the values used to indicate a code page. 
  8744.  
  8745.  RC          is the expected return code.  COMET will compare the actual return 
  8746.              code with this value.  If they are not the same, an error will be 
  8747.              logged.  If this parameter is not specified, an error will be 
  8748.              logged if the return code is not good. 
  8749.  
  8750.  Sample Code 
  8751.  
  8752.  
  8753. ΓòÉΓòÉΓòÉ 5.22.2. NetUserDel (Admin) ΓòÉΓòÉΓòÉ
  8754.  
  8755. NetUserDel removes an account from the User Account database, ending all access 
  8756. to the resources in the system. 
  8757.  
  8758. SYNTAX 
  8759.  
  8760. LAN USER_DEL [SERVER=\\servernamename,]        UNAME=user_name, 
  8761. [RC=expected_return_code]; 
  8762.  
  8763. Where: 
  8764.  
  8765.  SERVER      is the name of the remote servername where the function is to 
  8766.              execute.  Server is a UNC styled servername string, i.e. 
  8767.              \\Servername.  If servername is absent then a local server is 
  8768.              assumed. 
  8769.  
  8770.  UNAME       is the name of the user the account is to be established for. 
  8771.  
  8772.  RC          is the expected return code.  COMET will compare the actual return 
  8773.              code with this value.  If they are not the same, an error will be 
  8774.              logged.  If this parameter is not specified, an error will be 
  8775.              logged if the return code is not good. 
  8776.  
  8777.  Sample Code 
  8778.  
  8779.  
  8780. ΓòÉΓòÉΓòÉ 5.22.3. NetUserEnum (Partially Admin) ΓòÉΓòÉΓòÉ
  8781.  
  8782. NetUserEnum returns information about all accounts on a server. 
  8783.  
  8784. SYNTAX 
  8785.  
  8786. LAN USER_ENUM [SERVER=\\servernamename,]          [LEVEL=>0|1|2|10<,] 
  8787. [BUFLEN=buffer_length,]          [OUTFILE=output_file_name,] 
  8788. [RC=expected_return_code]; 
  8789.  
  8790. Where: 
  8791.  
  8792.  SERVER      is the name of the remote servername where the function is to 
  8793.              execute.  Server is a UNC styled servername string, i.e. 
  8794.              \\Servername.  If servername is absent then a local server is 
  8795.              assumed. 
  8796.  
  8797.  LEVEL       is the level of detail returned.  Valid levels are 0, 1, 2, or 10. 
  8798.              A non-admin user may only call this API with levels 0, or 10. The 
  8799.              default level is 1. 
  8800.  
  8801.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  8802.              dynamically determined to satisfy the API call. 
  8803.  
  8804.  OUTFILE     the name of the file where the returned data is stored.  The 
  8805.              returned information will be appended to this file.  If this 
  8806.              parameter is not specified, the returned information will be 
  8807.              displayed to the screen if LAN DEBUG is on. The returned data 
  8808.              includes: 
  8809.  
  8810.      the number of entries returned 
  8811.      the contents of the returned data structure. 
  8812.      all user accounts in the UPM database. 
  8813.  
  8814.  RC          is the expected return code.  COMET will compare the actual return 
  8815.              code with this value.  If they are not the same, an error will be 
  8816.              logged.  If this parameter is not specified, an error will be 
  8817.              logged if the return code is not good. 
  8818.  
  8819.  Sample Code 
  8820.  
  8821.  
  8822. ΓòÉΓòÉΓòÉ 5.22.4. NetUserGetGroups (Partially Admin) ΓòÉΓòÉΓòÉ
  8823.  
  8824. NetUserGetGroups lists all groups in the UPM to which a particular user belongs 
  8825. to. 
  8826.  
  8827. SYNTAX 
  8828.  
  8829. LAN USER_GET_GROUPS [SERVER=\\servernamename,]           UNAME=user_name, 
  8830. [LEVEL=0,]           [BUFLEN=buffer_length,] 
  8831. [OUTFILE=output_file_name,]           [RC=expected_return_code]; 
  8832.  
  8833. Where: 
  8834.  
  8835.  SERVER      is the name of the remote servername where the function is to 
  8836.              execute.  Server is a UNC styled servername string, i.e. 
  8837.              \\Servername.  If servername is absent then a local server is 
  8838.              assumed. 
  8839.  
  8840.  UNAME       is the name of the user to search for in each group account. 
  8841.  
  8842.  LEVEL       is the level of detail returned.  Level 0 is the only valid level 
  8843.              although, and value may be entered.  The default level is 0. 
  8844.  
  8845.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  8846.              dynamically determined to satisfy the API call. 
  8847.  
  8848.  OUTFILE     the name of the file where the returned data is stored.  The 
  8849.              returned information will be appended to this file.  If this 
  8850.              parameter is not specified, the returned information will be 
  8851.              displayed to the screen if LAN DEBUG is on. The returned data 
  8852.              includes: 
  8853.  
  8854.      the number of entries returned 
  8855.      the total number of entries available 
  8856.      all the groups the user is a member of 
  8857.  
  8858.  RC          is the expected return code.  COMET will compare the actual return 
  8859.              code with this value.  If they are not the same, an error will be 
  8860.              logged.  If this parameter is not specified, an error will be 
  8861.              logged if the return code is not good. 
  8862.  
  8863.  Sample Code 
  8864.  
  8865.  
  8866. ΓòÉΓòÉΓòÉ 5.22.5. NetUserGetInfo ΓòÉΓòÉΓòÉ
  8867.  
  8868. NetUserGetInfo retrieves information about a particular account on a server. 
  8869.  
  8870. SYNTAX 
  8871.  
  8872. LAN USER_GET_INFO [SERVER=\\servernamename,]          UNAME=user_name, 
  8873. [LEVEL=>0|1|2|10|11<,]          [BUFLEN=buffer_length,] 
  8874. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  8875.  
  8876. Where: 
  8877.  
  8878.  SERVER      is the name of the remote servername where the function is to 
  8879.              execute.  Server is a UNC styled servername string, i.e. 
  8880.              \\Servername.  If servername is absent then a local server is 
  8881.              assumed. 
  8882.  
  8883.  UNAME       is the name of the user to search for in each group account. 
  8884.  
  8885.  LEVEL       is the level of detail returned.  Valid levels are 0, 1, 2, 10, or 
  8886.              11.  A non-admin user may only call this API with levels 0, 10, or 
  8887.              11. Level 11 is available only for the account the user us logged 
  8888.              on to. The default level is 1. 
  8889.  
  8890.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  8891.              dynamically determined to satisfy the API call. 
  8892.  
  8893.  OUTFILE     the name of the file where the returned data is stored.  The 
  8894.              returned information will be appended to this file.  If this 
  8895.              parameter is not specified, the returned information will be 
  8896.              displayed to the screen if LAN DEBUG is on. The returned data 
  8897.              includes: 
  8898.  
  8899.      the number of entries returned 
  8900.      the total number of entries available 
  8901.      the contents of the appropriate level of data structure (levels 0, 1, 2, 
  8902.       10 , or 11) 
  8903.  
  8904.  RC          is the expected return code.  COMET will compare the actual return 
  8905.              code with this value.  If they are not the same, an error will be 
  8906.              logged.  If this parameter is not specified, an error will be 
  8907.              logged if the return code is not good. 
  8908.  
  8909.  Sample Code 
  8910.  
  8911.  
  8912. ΓòÉΓòÉΓòÉ 5.22.6. NetUserInit ΓòÉΓòÉΓòÉ
  8913.  
  8914. NetUserInit allocates, initializes, and maps the UPM cache of the database. 
  8915.  
  8916. SYNTAX 
  8917.  
  8918. LAN USER_INIT LANROOT=IBMLAN_root,        [MAXSESSIONS=max_users_for_session,] 
  8919. [OUTFILE=output_file_name,]        [RC=expected_return_code]; 
  8920.  
  8921. Where: 
  8922.  
  8923.  LANROOT     is the root of the IBMLAN tree. 
  8924.  
  8925.  MAXSESSIONS is the maximum number of users for the session cache. The default 
  8926.              is NULL. 
  8927.  
  8928.  OUTFILE     the name of the file where the returned data is stored.  The 
  8929.              returned information will be appended to this file.  If this 
  8930.              parameter is not specified, the returned information will be 
  8931.              displayed to the screen if LAN DEBUG is on. The returned data 
  8932.              includes: 
  8933.  
  8934.      the LAN root 
  8935.      the Max Sessions 
  8936.      the API return code 
  8937.      and the cache address 
  8938.  
  8939.  RC          is the expected return code.  COMET will compare the actual return 
  8940.              code with this value.  If they are not the same, an error will be 
  8941.              logged.  If this parameter is not specified, an error will be 
  8942.              logged if the return code is not good. 
  8943.  
  8944.  Remarks 
  8945.  
  8946.   Not supported by OS/2 Extended Edition Version 1.3 
  8947.  
  8948.  Sample Code 
  8949.  
  8950.  
  8951. ΓòÉΓòÉΓòÉ 5.22.7. NetUserModalsGet ΓòÉΓòÉΓòÉ
  8952.  
  8953. NetUserModalsGet gets global modals-related information for all users and 
  8954. groups in the UPM database. 
  8955.  
  8956. SYNTAX 
  8957.  
  8958. LAN USER_MODALS_GET [SERVER=\\servernamename,]           [LEVEL=0|1] 
  8959. [BUFLEN=buffer_length,]           [OUTFILE=output_file_name,] 
  8960. [RC=expected_return_code]; 
  8961.  
  8962. Where: 
  8963.  
  8964.  SERVER      is the name of the remote servername where the function is to 
  8965.              execute.  Server is a UNC styled servername string, i.e. 
  8966.              \\Servername.  If servername is absent then a local server is 
  8967.              assumed. 
  8968.  
  8969.  LEVEL       is the level of detail returned.  Levels 0 and 1 are valid levels 
  8970.              although, and value may be entered.  The default level is 0. 
  8971.  
  8972.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  8973.              dynamically determined. 
  8974.  
  8975.  OUTFILE     the name of the file where the returned data is stored.  The 
  8976.              returned information will be appended to this file.  If this 
  8977.              parameter is not specified, the returned information will be 
  8978.              displayed to the screen if LAN DEBUG is on. The returned data 
  8979.              includes: 
  8980.  
  8981.      the total number of bytes available 
  8982.      the contents of the user_modals_info data structure 
  8983.  
  8984.  RC          is the expected return code.  COMET will compare the actual return 
  8985.              code with this value.  If they are not the same, an error will be 
  8986.              logged.  If this parameter is not specified, an error will be 
  8987.              logged if the return code is not good. 
  8988.  
  8989.  Sample Code 
  8990.  
  8991.  
  8992. ΓòÉΓòÉΓòÉ 5.22.8. NetUserModalsSet (Admin) ΓòÉΓòÉΓòÉ
  8993.  
  8994. NetUserModalsSet sets global modals-related information for all users and 
  8995. groups in the UPM database. 
  8996.  
  8997. SYNTAX 
  8998.  
  8999. LAN USER_MODALS_SET [SERVER=\\servernamename,] 
  9000. [MINPWDLEN=minumum_password_length,]  [MAXPWDAGE=maximum_password_age,] 
  9001. [MINPWDAGE=minumum_password_age,]  [FORCEOFF=force_off_time,] 
  9002. [PWDHIST=password_history_length,]  [DOMAIN=domain_name,] 
  9003. [ROLE=database_role,]  [PARMNUM=>1|2|3|4|5|6|7<]  [LEVEL=0|1,] 
  9004. [BUFLEN=buffer_length,]  [RC=expected_return_code,] 
  9005.  
  9006. Where: 
  9007.  
  9008.  SERVER      is the name of the remote servername where the function is to 
  9009.              execute.  Server is a UNC styled servername string, i.e. 
  9010.              \\Servername.  If servername is absent then a local server is 
  9011.              assumed. 
  9012.  
  9013.  MINPWDLEN   is the is the minimum password length. The valid range of values 
  9014.              is 0 to MAXPSWDLEN. 
  9015.  
  9016.  MAXPWDAGE   is the maximum time (in days) since the password was last changed, 
  9017.              and for which the current password is valid.  A value of -1 will 
  9018.              allow the password to valid forever.  The minimum value is one 
  9019.              day. 
  9020.  
  9021.  MINPWDAGE   is the minimum time (in seconds) since the password was last 
  9022.              changed, before which the current password is allowed to be 
  9023.              changed. A value of 0 means there is no delay required between 
  9024.              password updates. 
  9025.  
  9026.  FORCEOFF    is the length of time (in seconds) after the valid logon hours 
  9027.              that the user should be forced off the network.  If the value of 
  9028.              -1 is used, the user will never be forced off. 
  9029.  
  9030.  PWDHIST     is the number of passwords in the history buffer.  The range of 
  9031.              valid values is 0 to 8. 
  9032.  
  9033.  DOMAIN      is the name of the primary domain to which this database belongs. 
  9034.              It should match the primary domain  name of the requester software 
  9035.              on the local machine.  This parameter is for level 1 data 
  9036.              structures only. 
  9037.  
  9038.  ROLE        is the role of this database under a single system image (SSI). It 
  9039.              can be one of the following: 
  9040.  
  9041.                                   MANIFEST          VALUE
  9042.  
  9043.                                   STANDALONE        0
  9044.                                   MEMBER            1
  9045.                                   BACKUP            2
  9046.                                   PRIMARY           3
  9047.  
  9048.              Without SSI, this field should always be set to STANDALONE. The 
  9049.              default value is 1 (MEMBER). 
  9050.  
  9051.  PARMNUM     specifies if an entire data structure will be passed to the API or 
  9052.              if only a single component of a data structure will be passed.  If 
  9053.              PARMNUM is 0, then an entire user_modals_info_0 or 
  9054.              user_modals_info_1 data structure is passed, if the level is 0 (or 
  9055.              absent), or 1 respectively. 
  9056.  
  9057.              If PARMNUM is 0 or absent, then internally (in COMET), 
  9058.              NetUserModalsGet will be called before UserModalsSet to load the 
  9059.              current default modal values into the data structure that will be 
  9060.              used in the call to UserModalsSet. If this were not done, then 
  9061.              every call to UserModalsSet with a PARMNUM value of 0, would reset 
  9062.              all the modal values.  This would mean that all of the parameters 
  9063.              above would have to be supplied when PARMNUM is 0. 
  9064.  
  9065.              If PARMNUM is non-zero, then only one component of a data 
  9066.              structure is changed and only one should be supplied. The 
  9067.              following tables describes what the values of PARMNUM and LEVEL 
  9068.              should be to change a single data structure components. 
  9069.  
  9070.              For user_modals_info_0 data structure components, the level should 
  9071.              be 0 and PARMNUM is: 
  9072.  
  9073.                             Component                       PARMNUM value
  9074.  
  9075.                             usrmod0_min_passwd_len          1
  9076.                             usrmod0_max_passwd_age          2
  9077.                             usrmod0_min_passwd_age          3
  9078.                             usrmod0_force_logoff            4
  9079.                             usrmod0_password_hist_len       5
  9080.  
  9081.              For user_modals_info_1 data structure components, the level should 
  9082.              be 1 and PARMNUM is: 
  9083.  
  9084.                             Component                       PARMNUM value
  9085.  
  9086.                             usrmod1_primary                 6
  9087.                             usrmod1_role                    7
  9088.  
  9089.              For instance, to set only the MINPASSWDLEN to a new value of 4 on 
  9090.              a local server, the syntax would look as follows: 
  9091.  
  9092.                                    LAN USER_MODALS_SET   MINPASSWDLEN=4,
  9093.                                                          DOMAIN=whatever,
  9094.                                                          ROLE=whatever,
  9095.                                                          PARMNUM=1,
  9096.                                                          LEVEL=0;
  9097.  
  9098.  
  9099.  LEVEL       is the level of detail supplied.  LevelS 0 and 1 are the only 
  9100.              valid levels although, and value may be entered. The default level 
  9101.              is 0. 
  9102.  
  9103.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  9104.              dynamically  determined. 
  9105.  
  9106.  RC          is the expected return code.  COMET will compare the actual return 
  9107.              code with this value.  If they are not the same, an error will be 
  9108.              logged.  If this parameter is not specified, an error will be 
  9109.              logged if the return code is not good. 
  9110.  
  9111.  Remarks 
  9112.  
  9113.  This function can be called even when the UPM system is not active, provided a 
  9114.  valid UPM database exists.  The accounts system must be inactive in order to 
  9115.  change the name of the database domain. NETLOGON may not be running when 
  9116.  setting the ROLE parameter. The Domain and Role parameters are for level 1 
  9117.  data structures only. All other parameters are for level 0 data structures 
  9118.  only. 
  9119.  
  9120.  Sample Code 
  9121.  
  9122.  
  9123. ΓòÉΓòÉΓòÉ 5.22.9. NetUserPasswordSet (Partially Admin) ΓòÉΓòÉΓòÉ
  9124.  
  9125. NetUserPasswordSet changes the password stored in a user's account in the 
  9126. system. 
  9127.  
  9128. SYNTAX 
  9129.  
  9130. LAN USER_PASSWORD_SET [SERVER=\\servernamename,]           UNAME=username, 
  9131. OLDPW=old_password,           NEWPW=new_password, 
  9132. [RC=expected_return_code]; 
  9133.  
  9134. Where: 
  9135.  
  9136.  SERVER      is the name of the remote servername where the function is to 
  9137.              execute.  Server is a UNC styled servername string, i.e. 
  9138.              \\Servername.  If servername is absent then a local server is 
  9139.              assumed. 
  9140.  
  9141.  UNAME       is the name of the user whose password will be changed. 
  9142.  
  9143.  OLDPASSWD   is the user's current password. 
  9144.  
  9145.  NEWPASSWD   is the new password for the user. 
  9146.  
  9147.  RC          is the expected return code.  COMET will compare the actual return 
  9148.              code with this value.  If they are not the same, an error will be 
  9149.              logged.  If this parameter is not specified, an error will be 
  9150.              logged if the return code is not good. 
  9151.  
  9152.  Remarks 
  9153.  
  9154.  Passwords are case sensitive. 
  9155.  
  9156.  Sample Code 
  9157.  
  9158.  
  9159. ΓòÉΓòÉΓòÉ 5.22.10. NetUserRestrict ΓòÉΓòÉΓòÉ
  9160.  
  9161. NetUserRestrict registers the process itself as a user-oriented process with 
  9162. privileges. 
  9163.  
  9164. SYNTAX 
  9165.  
  9166. LAN USER_RESTRICT    ACCMODE=access_mode, 
  9167. [RC=expected_return_code]; 
  9168.  
  9169. Where: 
  9170.  
  9171.  ACCMODE     has the value of the privilege for this process. 
  9172.  
  9173.  RC          is the expected return code.  COMET will compare the actual return 
  9174.              code with this value.  If they are not the same, an error will be 
  9175.              logged.  If this parameter is not specified, an error will be 
  9176.              logged if the return code is not good. 
  9177.  
  9178.  Remarks 
  9179.  
  9180.   Not supported by OS/2 Extended Edition Version 1.3 
  9181.  
  9182.  Sample Code 
  9183.  
  9184.  
  9185. ΓòÉΓòÉΓòÉ 5.22.11. NetUserSetGroups (Admin) ΓòÉΓòÉΓòÉ
  9186.  
  9187. NetUserSetGroups sets the groups of which a user is a member. 
  9188.  
  9189. SYNTAX 
  9190.  
  9191. LAN USER_SET_GROUPS [SERVER=\\servernamename,]           UNAME=username, 
  9192. GROUP=groupname [groupname],           [LEVEL=0,] 
  9193. ENTRIES=number_of_groups,           [BUFLEN=buffer_length,] 
  9194. [RC=expected_return_code]; 
  9195.  
  9196. Where: 
  9197.  
  9198.  SERVER      is the name of the remote servername where the function is to 
  9199.              execute.  Server is a UNC styled servername string, i.e. 
  9200.              \\Servername.  If servername is absent then a local server is 
  9201.              assumed. 
  9202.  
  9203.  UNAME       is the name of the user who is to be added to the GROUP(s). 
  9204.  
  9205.  GROUP       is the name of the group(s) of which the user is a member.  At 
  9206.              least one group must be specified.  If more than one group is 
  9207.              provided, then the group name must be separated by a space.  There 
  9208.              is a limitation in the number of groups that may be specified. 
  9209.              This is a COMET restriction.  Up to five medium sized group names 
  9210.              can be entered and even more may work. 
  9211.  
  9212.  LEVEL       is the data structure level to provide to the API.  The default 
  9213.              and the only valid value is zero, however, any value may be used. 
  9214.  
  9215.  ENTRIES     is the number of group names provided to the API.  The only valid 
  9216.              values are 1 and 2, although any value may be used. 
  9217.  
  9218.  BUFLEN      is the length of the buffer supplied to the API.  The default 
  9219.              value is ?????? (will be determined). 
  9220.  
  9221.  RC          is the expected return code.  COMET will compare the actual return 
  9222.              code with this value.  If they are not the same, an error will be 
  9223.              logged.  If this parameter is not specified, an error will be 
  9224.              logged if the return code is not good. 
  9225.  
  9226.  Sample Code 
  9227.  
  9228.  
  9229. ΓòÉΓòÉΓòÉ 5.22.12. NetUserSetInfo (Partially Admin) ΓòÉΓòÉΓòÉ
  9230.  
  9231. NetUserSetInfo modifies a user's account in the system. 
  9232.  
  9233. SYNTAX 
  9234.  
  9235. LAN USER_SET_INFO [SERVER=\\servernamename,]     [LEVEL=>1|2<,] 
  9236. [BUFLEN=buffer_length,]     UNAME=user_name     [PASSWORD=password,] 
  9237. [PRIV=privilage,]     [HOMEDIR=home_directory,]     [REMARK=comment,] 
  9238. [FLAGS=value,]     [SCRIPTPATH=pathname,]     [FULLNAME=full_name_of_user,] 
  9239. [UCOMMENT=user_settable_comment,]     [PARMS=parameter_string,] 
  9240. [REQUESTERS=requesters,]     [EXPIRES=expiration_time,] 
  9241. [MAXSTOR=home_dir_max_size,]     [LOGONHRS=d:h,]     [LOGONSVR=servername,] 
  9242. [CNTRYCODE=country_code,]     [CODEPG=code_pagee,]     [PARMNUM=>0|3|5|6|7|8|9 
  9243. |11|12|13|14|17|18|20|23<   |24<|25<,]     [RC=expected_return_code]; 
  9244.  
  9245. Where: 
  9246.  
  9247.  SERVER      is the name of the remote servername where the function is to 
  9248.              execute.  Server is a UNC styled servername string, i.e. 
  9249.              \\Servername.  If servername is absent then a local server is 
  9250.              assumed. 
  9251.  
  9252.  LEVEL       is the data structure level supplied to the API call.  Valid 
  9253.              levels are 1 and 2, although any level may be entered.  The 
  9254.              default is level 1. 
  9255.  
  9256.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  9257.              2048 bytes. 
  9258.  
  9259.  UNAME       is the name of the user the account is to be established for. 
  9260.              (Level 1 and 2) 
  9261.  
  9262.  PASSWORD    is the users password.  The default is no password (NULL). (Level 
  9263.              1 and 2) 
  9264.  
  9265.  PRIV        is the user's privilege.  It may be one of the following: (Level 1 
  9266.              and 2) 
  9267.  
  9268.  
  9269.                              Value            Privilege
  9270.  
  9271.                                0              Guest
  9272.                                1              User
  9273.                                2              Administrator
  9274.  
  9275.  HOMEDIR     is the user's home directory.  The absolute path may be local or 
  9276.              UNC.  The default is no home directory. (Level 1 and 2) 
  9277.  
  9278.  REMARK      is a remark or comment.  It may contain any text.  The default is 
  9279.              no remark. (Level 1 and 2) 
  9280.  
  9281.  FLAGS       determine if the logon script is enabled and if the user's account 
  9282.              is enabled.  The following matrix describes valid values 
  9283.              (0,1,2,3), although any value may be entered.  The default value 
  9284.              is 1. (Level 1 and 2) 
  9285.  
  9286.  
  9287.                              Meaning                      decimal value    Bit mask
  9288.  
  9289.                              logon script enabled         1                0x1
  9290.                              user's account disabled      2                0x2
  9291.                              home directory required      8                0x8
  9292.                              password not required       32                0x20
  9293.                              password cannot change      64                0x40
  9294.  
  9295.  SCRIPTPATH  is the a string telling the pathname of the user's logon script. 
  9296.              The default is no scriptpath (NULL). (Level 1 and 2) 
  9297.  
  9298.  PARMNUM     determines if an entire data structure or a single component will 
  9299.              be passed to the API.  If PARMNUM is zero, the default, or absent, 
  9300.              then an entire data structure will be passed to the API. In this 
  9301.              instance, the LEVEL must be 1 or 2.  Otherwise, if only a single 
  9302.              component is to be modified then PARMNUM must be the ordinal 
  9303.              position of the component.  The following describes which 
  9304.              parameters are settable and PARNUM's value (which is the ordinal 
  9305.              position).  LEVEL must be set to 2 if any of the PARNUM values 
  9306.              after SCRIPTPATH are used.  Level 1 or 2 can be used for the 
  9307.              PARMNUM values between and including PASSWORD and SCRIPTPATH. 
  9308.              Warning, COMET will return an error if an ordinary user tries to 
  9309.              call NetUserSetInfo with a 0 value for PARMNUM.  This is because 
  9310.              COMET calls NetUserGetInfo before calling SetInfo and an ordinary 
  9311.              user does not have the authority to call NetUserGetInfo with level 
  9312.              set to 1 or 2.  This is really not a problem though because, an 
  9313.              ordinary user is not allowed to call NetUserSetInfo with PARNUM 
  9314.              set to 0, it would have been nice  to do this for testing purposes 
  9315.              however. 
  9316.  
  9317.  
  9318.                                   Parameter               PARNUM's value
  9319.  
  9320.                                   PASSWORD                3
  9321.                                   PRIVILEGE               5
  9322.                                   HOMEDIR                 6
  9323.                                   REMARK                  7
  9324.                                   FLAGS                   8
  9325.                                   SCRIPTPATH              9
  9326.                                   FULLNAME               11
  9327.                                   USER COMMENT           12
  9328.                                   PARMS                  13
  9329.                                   REQUESTERS             14
  9330.                                   EXPIRES                17
  9331.                                   MAX STORAGE            18
  9332.                                   LOGON HOURS            20
  9333.                                   LOGON SERVER           23
  9334.                                   COUNTRY CODE           24
  9335.                                   CODE PAGE              25
  9336.  
  9337.  FULLNAME    is the full name of the user. (Level 2 only) 
  9338.  
  9339.  UCOMMENT    is a user-settable comment field. (Level 2 only) 
  9340.  
  9341.  PARMS       is an ASCIIZ string not used by LAN Server but, available for use 
  9342.              by applications. 
  9343.  
  9344.  REQUESTERS  is a list of requesters from which a user is permitted to log on. 
  9345.              If this entry is absent then the default is NULL which means all 
  9346.              requesters are allowed. (Level 2 only) 
  9347.  
  9348.  EXPIRES     is date and time the account will expire in the following format: 
  9349.              mm/dd/yy  hh/mn/ss. An expired account is equivalent of a disabled 
  9350.              account.  The default value is never (0xFFFFFFFF). (Level 2 only) 
  9351.  
  9352.  MAXSTOR     is the maximum storage, in K bytes, allotted for the home 
  9353.              directory.  The default is unlimited (0xFFFFFFFF). (Level 2 only) 
  9354.  
  9355.  LOGONHRS    are the hours of the week the user is allowed to logon. The input 
  9356.              must be in the form "d:h", where d is the day of the week. 
  9357.              Starting with Sunday, valid values for d are S,M,T,W,H,F,A. The 
  9358.              value for d can be upper or lower case. The h is the hour of the 
  9359.              day, valid values are 0-23.  The 0th hour is 0:00 to 0:59.  Only 
  9360.              one hour at a time can be set, this is a limitation of COMET not 
  9361.              the API.  The logonhrs supplied are exclusive-or'ed to the logon 
  9362.              hours bitmap.  This allows the user to set a bit if it is cleared, 
  9363.              or clear a bit if it is set.  (Level 2 only) 
  9364.  
  9365.  LOGONSVR    is the server to handle logon requests for a user.  The default is 
  9366.              the domain controller (0xFFFFFFFF).???????????  Albert 
  9367.              investigating if this parameter applies to IBM. (Level 2 only) 
  9368.  
  9369.  CNTRYCODE   is the OS/2 country code for the user's language choice.  This is 
  9370.              used by the OS/2 LAN Server software to generate messages in the 
  9371.              appropriate language whenever possible.  The default is the 
  9372.              current country code on the server. (Level 2 only) 
  9373.  
  9374.  CODEPG      is the OS/2 code page for the language choice of the user. The 
  9375.              valid values are the values used to indicate a code page. 
  9376.  
  9377.  RC          is the expected return code.  COMET will compare the actual return 
  9378.              code with this value.  If they are not the same, an error will be 
  9379.              logged.  If this parameter is not specified, an error will be 
  9380.              logged if the return code is not good. 
  9381.  
  9382.  Remarks 
  9383.  
  9384.  An admin type user can set all settable fields.  Any user may change the 
  9385.  UCOMMENT, PARMS, CODEPG, or the CNTRYCODE for his own account.  To do this the 
  9386.  user must supply the correct value for PARMNUM . An ordinary user must supply 
  9387.  a value for PARMNUM and it may not be zero. 
  9388.  
  9389.  If an admin uses 0 for parmnum, then an entire user_info data structure is 
  9390.  passed.  Internally, COMET calls NetUserGetInfo to provide defaults for any 
  9391.  entries the user does not supply. Therefore, a user does not have to supply 
  9392.  all of the datastructure components when a 0 PARMNUM values is used. 
  9393.  
  9394.  Sample Code 
  9395.  
  9396.  
  9397. ΓòÉΓòÉΓòÉ 5.22.13. NetUserValidate ΓòÉΓòÉΓòÉ
  9398.  
  9399. NetUserValidate verifies that there is an account with a particular username 
  9400. and password in the system.  It does not check logon restrictions. 
  9401.  
  9402. SYNTAX 
  9403.  
  9404. LAN USER_VALIDATE UNAME=user_name,          PASSWD=user's_password, 
  9405. [OUTFILE=output_file_name,]          [RC=expected_return_code]; 
  9406.  
  9407. Where: 
  9408.  
  9409.  UNAME       is the name of the user whose account is being verified. 
  9410.  
  9411.  PASSWD      is the user's password to be verified. 
  9412.  
  9413.  OUTFILE     the name of the file where the returned data is stored.  The 
  9414.              returned information will be appended to this file.  If this 
  9415.              parameter is not specified, the returned information will be 
  9416.              displayed to the screen if LAN DEBUG is on. The returned data 
  9417.              includes: 
  9418.  
  9419.      the user's name and privilege 
  9420.  
  9421.  RC          is the expected return code.  COMET will compare the actual return 
  9422.              code with this value.  If they are not the same, an error will be 
  9423.              logged.  If this parameter is not specified, an error will be 
  9424.              logged if the return code is not good. 
  9425.  
  9426.  Remarks 
  9427.  
  9428.  This API returns the user's privilege if the password is correct. If the 
  9429.  password is not valid, the password will be matched against the password of 
  9430.  the GUEST user account.  If the passwords match, guest privileges will be 
  9431.  returned.  IF the GUEST user account has a NULL 
  9432.  
  9433.  Sample Code 
  9434.  
  9435.  
  9436. ΓòÉΓòÉΓòÉ 5.22.14. NetUserValidate2 ΓòÉΓòÉΓòÉ
  9437.  
  9438. NetUserValidate2 validates a user with its password.  It checks if the user can 
  9439. log on based on logon restrictions defined for the account. 
  9440.  
  9441. SYNTAX 
  9442.  
  9443. LAN USER_VALIDATE2 UNAME=user_name,           [PASSWD=user's_password,] 
  9444. [REQUESTER=user_machine,]           [LEVEL=1,] 
  9445. [BUFLEN=buffer_length,]           [OUTFILE=output_file_name,] 
  9446. [RC=expected_return_code]; 
  9447.  
  9448. Where: 
  9449.  
  9450.  UNAME       is the name of the account is trying to log on to. 
  9451.  
  9452.  PASSWD      is the user's password to be verified. 
  9453.  
  9454.  REQUESTER   is the name of the requester from which the user is logging on. If 
  9455.              this parameter is absent, then the local machine will be assumed 
  9456.              (this is also the default).  If this parameter is -1, then the 
  9457.              requester is unknown. 
  9458.  
  9459.  LEVEL       is the data structure level supplied to the API.  The default and 
  9460.              the only valid value is 1, although any value may be used. 
  9461.  
  9462.  BUFLEN      is the length of the buffer supplied to the API. The default value 
  9463.              has yet to be determined. 
  9464.  
  9465.  OUTFILE     the name of the file where the returned data is stored.  The 
  9466.              returned information will be appended to this file.  If this 
  9467.              parameter is not specified, the returned information will be 
  9468.              displayed to the screen if LAN DEBUG is on. The returned data 
  9469.              includes: 
  9470.  
  9471.      the logon code 
  9472.      the total number of bytes available 
  9473.      If the RC is zero and the logon code is a Validated_Logon value, then the 
  9474.       contents of the user_logon_info_1 will be out put. 
  9475.  
  9476.  RC          is the expected return code.  COMET will compare the actual return 
  9477.              code with this value.  If they are not the same, an error will be 
  9478.              logged.  If this parameter is not specified, an error will be 
  9479.              logged if the return code is not good. 
  9480.  
  9481.  Sample Code 
  9482.  
  9483.  
  9484. ΓòÉΓòÉΓòÉ 5.23. LAN API - Domain ΓòÉΓòÉΓòÉ
  9485.  
  9486. The Doamin category deals with domain-specific information. 
  9487.  
  9488.  
  9489. ΓòÉΓòÉΓòÉ 5.23.1. NetGetDCName ΓòÉΓòÉΓòÉ
  9490.  
  9491. The NetGetDCName function returns the name of the domain controller if there is 
  9492. any. 
  9493.  
  9494. SYNTAX 
  9495.  
  9496.  LAN GET_DC_NAME [SERVER=\\servername,]         [DOMAIN=domain_name,] 
  9497. [BUFLEN=buffer_length]         [OUTFILE=output_file_name,] 
  9498. [RC=expected_return_code]; 
  9499.  
  9500. Where: 
  9501.  
  9502.  SERVER      is the name of the remote servername where the function is to 
  9503.              execute.  Server is a UNC styled servername string, i.e. 
  9504.              \\Servername.  If servername is absent then a local server is 
  9505.              assumed. 
  9506.  
  9507.  DOMAIN      is the name of the domain where the name of the domain controller 
  9508.              is desired.  A NULL domain name is taken to mean to get the domain 
  9509.              controller name of the primary domain. 
  9510.  
  9511.  BUFLEN      is the length of the buffer supplied to the API. The default value 
  9512.              is 256 bytes. 
  9513.  
  9514.  OUTFILE     the name of the file where the returned data is stored.  The 
  9515.              returned information will be appended to this file.  If this 
  9516.              parameter is not specified, the returned information will be 
  9517.              displayed to the screen if LAN DEBUG is on. The returned data 
  9518.              includes: 
  9519.  
  9520.      the API return code. 
  9521.      and the domain controller's name if the API return code is 0. 
  9522.  
  9523.  RC          is the expected return code.  COMET will compare the actual return 
  9524.              code with this value.  If they are not the same, an error will be 
  9525.              logged.  If this parameter is not specified, an error will be 
  9526.              logged if the return code is not good. 
  9527.  
  9528.  Sample Code 
  9529.  
  9530.  
  9531. ΓòÉΓòÉΓòÉ 5.23.2. NetLogonEnum (partially Admin) ΓòÉΓòÉΓòÉ
  9532.  
  9533. NetLogonEnum supplies information about logged on users. 
  9534.  
  9535. SYNTAX 
  9536.  
  9537.  LAN Logon_Enum [SERVER=\\servername,]          [LEVEL=>0|1|2<,] 
  9538. [BUFLEN=buffer_length,]          [OUTFILE=output_file_name,] 
  9539. [RC=expected_return_code]; 
  9540.  
  9541. Where: 
  9542.  
  9543.  SERVER      is the name of the remote servername where the function is to 
  9544.              execute.  Server is a UNC styled servername string, i.e. 
  9545.              \\Servername.  If servername is absent then a local server is 
  9546.              assumed. 
  9547.  
  9548.  LEVEL       is the level of detail returned.  Valid levels are 0, 1, or 2. A 
  9549.              non-admin user may only call this API with level 0 or 2 only. The 
  9550.              default level is 0. 
  9551.  
  9552.  BUFLEN      is the buffer length supplied to the API call.  The default is 
  9553.              dynamically determined to satisfy the API call. 
  9554.  
  9555.  OUTFILE     the name of the file where the returned data is stored.  The 
  9556.              returned information will be appended to this file.  If this 
  9557.              parameter is not specified, the returned information will be 
  9558.              displayed to the screen if LAN DEBUG is on. The returned data 
  9559.              includes: 
  9560.  
  9561.      the API return code. 
  9562.      the number of entries returned. 
  9563.      the contents of the returned data structure. 
  9564.      if the API return code is 0, a list of the logged on users at either 
  9565.       level 0 or 1. 
  9566.  
  9567.  RC          is the expected return code.  COMET will compare the actual return 
  9568.              code with this value.  If they are not the same, an error will be 
  9569.              logged.  If this parameter is not specified, an error will be 
  9570.              logged if the return code is not good. 
  9571.  
  9572.  Sample Code 
  9573.  
  9574.  
  9575. ΓòÉΓòÉΓòÉ 6. Sample COMET Input Files ΓòÉΓòÉΓòÉ
  9576.  
  9577.  Input file issuing some COMET Utility, OS2_SHELL, and OS2_API Commands. 
  9578.  Input file issuing Database Manager and SQL commands 
  9579.  Input file issuing the SRPI command 
  9580.  Input files issuing APPC verbs to send and receive a file. 
  9581.  Input files issuing ACDI verbs to send and receive a file. 
  9582.  Input file issuing a combination of API driver commands. 
  9583.  
  9584.  
  9585. ΓòÉΓòÉΓòÉ 6.1. Input file issuing some COMET Utility, OS2_SHELL, and OS2_API Commands. ΓòÉΓòÉΓòÉ
  9586.  
  9587. This input file is a combination of COMET Utility, OS2_SHELL, and OS2_API 
  9588. commands. For more information on these commands refer to COMET Utility 
  9589. Commands for COMET Utility commands, OS/2 Shell commands for OS2_SHELL 
  9590. commands, and OS2_API commands for OS2_API commands. 
  9591.  
  9592.  OS2_SHELL "ECHO START OF COMET  INPUT FILE: SAMPLE.CMT ..."; 
  9593.  COMET DISPLAY_ON; 
  9594.  #COMET DEBUG_ON ALL;      <- This line is commented. 
  9595.  OS2_API DOSBEEP 200,200; 
  9596.  OS2_SHELL "STARTDBM"; 
  9597.  OS2_API DOSSLEEP SECONDS=30; 
  9598.  OS2_SHELL "DIR C:"; 
  9599.  OS2_SHELL "ECHO End of testcase"; 
  9600.  
  9601.  
  9602. ΓòÉΓòÉΓòÉ 6.2. Input file issuing Database Manager and SQL commands ΓòÉΓòÉΓòÉ
  9603.  
  9604. This sample input file goes through the required steps to create a database, 
  9605. insert a record, perform a Dynamic Select (writing the output of the select to 
  9606. a file), then drop the table, drop the database, and exit the Database Manager. 
  9607. Refer to DBM (Database Manager) commands, and SQL (Structured Query Language) 
  9608. commands for more information on the specific DBM and SQL command syntax and a 
  9609. brief explanation on each command supported. You may also want to refer to the 
  9610. Database Manager User documentation for indepth information on DBM and SQL 
  9611. commands. 
  9612.  
  9613.  #COMET DEBUG_ON DBM, SQL;   <- This line is commented. 
  9614.  OS2_SHELL "ECHO START OF COMET  INPUT FILE: DBMSQL.FIL ..."; 
  9615.  DBM STARTDBM; 
  9616.  DBM CREATE_DB DB=cmtdb, PW=new, RC=0; 
  9617.  DBM ALTER_DB DB=cmtdb, OLDPW=new, NEWPW=NONE, RC=0; 
  9618.  DBM START_USING_DB DB=cmtdb, USE=s, RC=0; 
  9619.  SQL "CREATE TABLE testtab 
  9620.         (name VARCHAR(10), 
  9621.         dept SMALLINT)"; 
  9622.  SQL "INSERT INTO testtab (name, dept) VALUES ('Chuck', 644)"; 
  9623.  SQL "SELECT name FROM testtab", 
  9624.       FILE=cmttest.out, 
  9625.       RC=0; 
  9626.  OS2_SHELL "TYPE cmttest.out"; 
  9627.  OS2_API DOSBEEP 200,200; 
  9628.  SQL "DROP TABLE testtab"; 
  9629.  DBM STOP_USING_DB; 
  9630.  DBM DROP_DB DB=cmtdb; 
  9631.  DBM STOPDBM; 
  9632.  
  9633.  
  9634. ΓòÉΓòÉΓòÉ 6.3. Input file issuing the SRPI command ΓòÉΓòÉΓòÉ
  9635.  
  9636. This is a sample input file specifying the required, and some optional 
  9637. parameters for making a SRPI call with COMET. Please refer to SRPI 
  9638. (Server/Requester Programming Interface) commands for a description of each 
  9639. parameter.  Further SRPI information can be obtained from Communication Manager 
  9640. documentation. 
  9641.  
  9642.  OS2_SHELL "ECHO Issuing SRPI call next"; 
  9643.  SRPI SENDREQ SERVER="driver3 ", 
  9644.         FUNCTION = x'0000', 
  9645.         PARM="12345678", 
  9646.         DATA="0987654321", 
  9647.         RCSRPI=x'00000000', 
  9648.         RCSRVR=x'00000000', 
  9649.         RPFILE=parm.r, 
  9650.         RDFILE=data.r; 
  9651.  OS2_SHELL "ECHO SRPI call done"; 
  9652.  
  9653.  
  9654. ΓòÉΓòÉΓòÉ 6.4. Input files issuing APPC verbs to send and receive a file. ΓòÉΓòÉΓòÉ
  9655.  
  9656. This input file is an example of the sending side of an APPC Communication 
  9657. session. Please refer to APPC (Advanced Program to Program Communications) 
  9658. commands for a brief description of the supported APPC commands. For more 
  9659. indepth information on APPC commands refer to Communication Manager 
  9660. documentation. 
  9661.  
  9662.  OS2_SHELL "echo tpstarted"; 
  9663.  APPC TP_STARTED LOCAL_LU = "LU1", 
  9664.          TP    = "TP1", 
  9665.          PRC=x'0'; 
  9666.  
  9667.  OS2_SHELL "echo alloc"; 
  9668.  APPC MC_ALLOC CONV=1, 
  9669.          REMOTE_LU="LU2", 
  9670.          MODE="MODE1", 
  9671.          TP="TP1", 
  9672.          SYNC=confirm, 
  9673.          PRC=x'0'; 
  9674.  
  9675.  OS2_SHELL "echo send_data"; 
  9676.  APPC MC_SEND_DATA DATA="hi there"; 
  9677.  
  9678.  OS2_SHELL "echo confirm"; 
  9679.  APPC MC_COMFIRM; 
  9680.  
  9681.  OS2_SHELL "echo send_data"; 
  9682.  APPC MC_SEND_DATA DATA="This is another test\ 
  9683.        one, two, three"; 
  9684.  OS2_SHELL "echo send file"; 
  9685.  APPC MC_SEND_DATA FILE=myfile.txt; 
  9686.  OS2_SHELL "echo receive_wait (crc)"; 
  9687.  APPC MC_RCV_WAIT CRC=myfile.txt;          # check CRC 
  9688.  OS2_SHELL "echo receive (what=send)"; 
  9689.  APPC MC_RCV_WAIT WHAT=SEND; 
  9690.  0S2_SHELL "echo dealloc"; 
  9691.  APPC MC_DEALLOC CONV=1; 
  9692.  OS2_SHELL "echo tpended"; 
  9693.  APPC TP_ENDED; 
  9694.  
  9695.  This input file is an example of the receiving side of an APPC Communication 
  9696.  session. Please refer to APPC (Advanced Program to Program Communications) 
  9697.  commands for a brief description of the supported APPC commands. For more 
  9698.  indepth information on APPC commands refer to Communication Manager 
  9699.  documentation. 
  9700.  
  9701.  OS2_SHELL "ECHO Issuing APPC call next"; 
  9702.  APPC RECEIVE_ALLOC SYNC=confirm, 
  9703.            TP="tp1", 
  9704.            CONV=1, 
  9705.            MODE="mode1", 
  9706.            PARTNER_LU="LU1", 
  9707.            TYPE=mapped; 
  9708.  APPC MC_RCV_WAIT DATA="hi there.", 
  9709.           WHAT=data_comp; 
  9710.  APPC MC_RCV_WAIT WHAT=conf; 
  9711.  APPC MC_CONFIRMED; 
  9712.  APPC TP_ENDED; 
  9713.  
  9714.  
  9715. ΓòÉΓòÉΓòÉ 6.5. Input files issuing ACDI verbs to send and receive a file. ΓòÉΓòÉΓòÉ
  9716.  
  9717. This input file is an example of the sending side of an ACDI Communication 
  9718. session. Please refer to ACDI (Asynchronous Communication Device Interface) 
  9719. commands for a brief description of the supported ACDI commands. For more 
  9720. indepth information on ACDI commands refer to Communication Manager 
  9721. documentation. 
  9722.  
  9723.  OS2_API DOSBEEP 1000, 100; 
  9724.  OS2_SHELL "ECHO Issuing APPC call next"; 
  9725.  ACDI OPEN DEV=com1; 
  9726.  ACDI SETBIT SEND=1200, RCV=1200; 
  9727.  ACDI SETLINECTRL STOPBITS=1, 
  9728.           PARITY=none, 
  9729.           DATABITS=8; 
  9730.  ACDI CONNECT TYPE=4, 
  9731.         TIMEOUT1=0, 
  9732.         TIMEOUT2=15; 
  9733.  ACDI SEND FILE=myfile.txt; 
  9734.  OS2_API DOSSLEEP SECONDS=30; 
  9735.  OS2_SHELL "ECHO End of testcase"; 
  9736.  
  9737.  This input file is an example of the receiving side of an ACDI Communication 
  9738.  session. Please refer to ACDI (Asynchronous Communication Device Interface) 
  9739.  commands for a brief description of the supported ACDI commands. For more 
  9740.  indepth information on ACDI commands refer to Communication Manager 
  9741.  documentation. 
  9742.  
  9743.  OS2_SHELL "echo type 'myfile.txt'"; 
  9744.  OS2_SHELL "type myfile.txt"; 
  9745.  
  9746.  ACDI OPEN DEV=com1; 
  9747.  ACDI SETBIT SEND=1200, RCV=1200; 
  9748.  ACDI SETLINECTRL STOPBITS=1, 
  9749.           PARITY=none, 
  9750.           DATABITS=8; 
  9751.  ACDI CONNECT TYPE=4, 
  9752.          TIMEOUT1=0, 
  9753.          TIMEOUT2=15; 
  9754.  
  9755.  OS2_SHELL "echo SLEEP for 2 minutes"; 
  9756.  OS2_API DOSSLEEP MINUTES=2; 
  9757.  
  9758.  OS2_SHELL "dir myfile.txt"; 
  9759.  os2_shell "type myfile.txt"; 
  9760.  
  9761.  
  9762. ΓòÉΓòÉΓòÉ 6.6. Input file issuing a combination of API driver commands. ΓòÉΓòÉΓòÉ
  9763.  
  9764. This input file example issues a combination of COMET Utility, OS2 API, 
  9765.  
  9766.  OS2 SHELL, Database Manager, and Communication Manager API driver commands. 
  9767.  #COMET DEBUG_ON DBM, SQL;   <- This line is commented. 
  9768.  OS2_SHELL "ECHO START OF COMET  INPUT FILE: CMTTEST.FIL ..."; 
  9769.  DBM  STARTDBM; 
  9770.  
  9771.  OS2_SHELL "ECHO Issuing APPC call next"; 
  9772.  APPC RECEIVE_ALLOC SYNC=confirm, 
  9773.            TP="tp1", 
  9774.            CONV=1, 
  9775.            MODE="mode1", 
  9776.            PARTNER_LU="LU1", 
  9777.            TYPE=mapped; 
  9778.  DBM  CREATE_DB DB=cmtdb, PW=new, RC=0; 
  9779.  DBM  ALTER_DB DB=cmtdb, OLDPW=new, NEWPW=NONE, RC=0; 
  9780.  DBM  START_USING_DB DB=cmtdb, USE=s, RC=0; 
  9781.  SQL  "CREATE TABLE testtab 
  9782.         (name VARCHAR(10), 
  9783.         dept SMALLINT)"; 
  9784.  SQL  "INSERT INTO testtab (name, dept) VALUES ('Chuck', 644)"; 
  9785.  SQL  "SELECT name FROM testtab", 
  9786.       FILE=cmttest.out, 
  9787.       RC=0; 
  9788.  OS2_API DOSBEEP 200,200; 
  9789.  APPC MC_RCV_WAIT DATA="hi there.", 
  9790.           WHAT=data_comp; 
  9791.  SQL  "DROP TABLE testtab"; 
  9792.  APPC MC_RCV_WAIT WHAT=conf; 
  9793.  DBM  STOP_USING_DB; 
  9794.  APPC MC_CONFIRMED; 
  9795.  DBM  DROP_DB DB=cmtdb; 
  9796.  APPC TP_ENDED; 
  9797.  DBM  STOPDBM; 
  9798.  
  9799.  
  9800. ΓòÉΓòÉΓòÉ 7. Sample COMET Log File ΓòÉΓòÉΓòÉ
  9801.  
  9802. This is a sample COMET log file which is the file written by COMET as a result 
  9803. of the Input file processing.  The name of this file would be the name you 
  9804. specified as the output_file when running COMET, the default file name is 
  9805. COMETLOG.TXT. 
  9806.  
  9807. This sample log file corresponds to the processing of the input file issuing 
  9808. Database Manager and Structured Query Language commands in Appendix A. LOGFILE 
  9809. created on Fri Feb 12 10:52 1988 Input file : DBMSQL.CMT 
  9810.  
  9811.  ------------------------------------------------------ 
  9812.  Line  Time:   Command type:     Parameters/Info: 
  9813.  ----  --------  --------------------  ---------------- 
  9814.   1   10:53  OS2_SHELL "ECHO START OF COMET  INPUT FILE: 
  9815.   6   10:54  DBM STARTDBM 
  9816.   7   10:59  DBM CREATE_DB      DB=cmtdb2, PW=new, RC=0 
  9817.   8   10:03  DBM ALTER_DB       DB=cmtdb2, OLDPW=new, NEWPW=NONE 
  9818.   9   10:04  DBM START_USING_DB   DB=cmtdb2, USE=s, RC=0 
  9819.   10  10:10  SQL "CREATE TABLE testtab(name VARCHAR(10),dept SM 
  9820.   13  10:13  SQL "INSERT INTO testtab (name, dept) VALUES ('Chu 
  9821.   14  10:13  SQL FILE=cmttest.out  RC=0 
  9822.   17  10:14  OS2_API DOSBEEP     200, 200 
  9823.   18  10:14  SQL "DROP TABLE testtab". 
  9824.   19  10:15  DBM STOP_USING_DB 
  9825.   20  10:16  DBM DROP_DB       DB=cmtdb2 
  9826.   21  10:21  DBM STOPDBM 
  9827.   22  10:21  COMET terminating... 
  9828.  
  9829.  
  9830. ΓòÉΓòÉΓòÉ 8. COMET Version Level Descriptions. ΓòÉΓòÉΓòÉ
  9831.  
  9832. This Appendix describes the changes made to the different COMET version levels. 
  9833.  
  9834.  
  9835. ΓòÉΓòÉΓòÉ 8.1. COMET Version 1.3 changes ΓòÉΓòÉΓòÉ
  9836.  
  9837. The following changes are for COMET version 1.3, which contains enhancements to 
  9838. support new functions provided by OS/2 Extended Edition Version 1.3. 
  9839.  
  9840.  Version 1.301 
  9841.  
  9842.      The following LAN User APIs not supported by OS/2 Extended    Edition 
  9843.       Version 1.3: 
  9844.      NetUserInit 
  9845.      NetUserRestrict 
  9846.  
  9847.  The following changes are for COMET version 1.3, which contains enhancements 
  9848.  to support new functions provided by OS/2 Extended Edition Version 1.2. 
  9849.  
  9850.  Version 1.300 
  9851.  
  9852.      COMET loads DLL files on call. 
  9853.      Add support to allow the CONTINUE and RETRY execution of COMET    cmds 
  9854.       after COMET has encountered an error in testcase execution. 
  9855.      Allow for RESTART of COMET at a specified line in the file. 
  9856.      EHLLAPI upgrade to later tool code. 
  9857.      Restructured COMET code/data segments more efficiently. 
  9858.      Inclusion of other input files into an input file. 
  9859.  
  9860.  
  9861. ΓòÉΓòÉΓòÉ 8.1.1. COMET Version 1.2 changes ΓòÉΓòÉΓòÉ
  9862.  
  9863. The following changes are for COMET version 1.2, which contains enhancements to 
  9864. support new functions provided by OS/2 Extended Edition Version 1.2. 
  9865.  
  9866.  Version 1.20 
  9867.  
  9868.      COMET converted to Presentation Manager Application. 
  9869.      Lan Server API Support added and maintained by Dept. 639. 
  9870.      ACDI code redesigned and rewritten. 
  9871.      Query Manager Callable Interface support added to COMET 
  9872.      Database Manager commands: Catalog_Node, Catalog_Db, Restore_Db, 
  9873.       Uncatalog_Node, and Uncatalog_Db added to COMET in order to    support 
  9874.       Remote Database Services enhancement to OS/2 EE 1.2. 
  9875.      IEEE 802.2 Statistics command was completed. 
  9876.      COMET Entry_points command updated for new Presentation Mgr. file. 
  9877.      COMET INT3 command is removed. 
  9878.      The 802.2 Dlc_Flow_Control code in the 802.2 Read    command and in the 
  9879.       external 802.2 Dlc_Flow_Control command was completed. 
  9880.      The COMET Log command rewrite was completed. 
  9881.      The Action parameter replaced the Pause parameter. The values for 
  9882.       Action are pause, resume, and reset. 
  9883.  
  9884.  
  9885. ΓòÉΓòÉΓòÉ 8.1.2. COMET Version 1.1 changes ΓòÉΓòÉΓòÉ
  9886.  
  9887. The following changes are for COMET version 1.1, which contains enhancements to 
  9888. support new functions provided by OS/2 Extended Edition Version 1.1. 
  9889.  
  9890.  Version 1.101 Sept 21, 1988.  The following new functions were added to 
  9891.            support OS/2 EE 1.1 functions: 
  9892.  
  9893.      IEEE 802.2 API support was completed. Added Receive_Cancel command. 
  9894.      Netbios API support no longer is dependent on outdated NETB header files. 
  9895.      Comet Entry_points command updated for new comet routines. 
  9896.  Version 1.100 September 10, 1988.  First 1.1 Driver.  The following new 
  9897.            functions were added to support new OS/2 EE 1.1 functions: 
  9898.  
  9899.      IEEE 802.2 API support, which allows access to LAN services. 
  9900.      Netbios API support, which allows access to LAN services, based on the 
  9901.       original IBM PC Network Netbios interface. 
  9902.      EHLLAPI (3270 Emulator High Level Language API) support, which allows 
  9903.       access to 3270 sessions from user programs. 
  9904.  
  9905.       The following internal COMET function enhancements were also added to 
  9906.       COMET version 1.100: 
  9907.  
  9908.      MSG command - display a message. 
  9909.      EXIT command - terminate comet with a user specified error level. 
  9910.      WAIT command - wait for input from the keyboard before continuing. 
  9911.      Subroutine CALL/RETURN commands. 
  9912.      Conditional and unconditional jumps. 
  9913.      Clear error condition to allow a test to continue. 
  9914.      Looping - timed and counted loops, breaking out of loops. 
  9915.      Line labeling, for jumps within the input file, or optional input file 
  9916.       entry point when starting COMET 
  9917.      Logging options: nolog, change log file name, stop and re-start logging. 
  9918.      Process an included COMET input file (@include). 
  9919.      User defined constants in the input file (@define). 
  9920.  
  9921.       Some minor changes in existing functions were also made: 
  9922.  
  9923.      The entire input file is now read into storage before starting execution, 
  9924.       to expedite the test once it is started. 
  9925.      The SUCCESS message in the log file has been removed.  Logging the start 
  9926.       of the next statement implies the successful completion of the previous 
  9927.       statement. 
  9928.      The Help panel (COMET ?) was updated with the new command syntax 
  9929.       description. 
  9930.      A default input file extension (.CMT) was added.  Input files must now 
  9931.       either specify a different file extension, or use this one. 
  9932.      Got rid of CMTAPPCR.DAT file, which contained APPC return code 
  9933.       information.  That file is now compiled directly into the code. 
  9934.  
  9935.  
  9936. ΓòÉΓòÉΓòÉ 8.1.3. COMET Version 1.0 changes ΓòÉΓòÉΓòÉ
  9937.  
  9938. The following changes are for COMET Version 1.0 changes. COMET Version 1.0 is 
  9939. used to test OS/2 Extended Edition Version 1.0. 
  9940.  
  9941.   COMET Version 1.04  April 19, 1988.  Fix ACDI buffer overwrite problem. 
  9942.  
  9943.   COMET Version 1.03  March 25, 1988. Added COMET Utility Commands Entry_Points 
  9944.            and INT3. 
  9945.  
  9946.   COMET Version 1.02  March 10, 1988.  Added New Drive parameter ('C:') to 
  9947.            Database API calls which required this new parameter. Also made some 
  9948.            APPC code changes to satisfy the new APPC header file changes. 
  9949.  
  9950.   COMET Version 1.01 Febuary 26, 1988. Compiled and linked with the Database 
  9951.            Manager build D07048 due to changes in Database Manager dynamic link 
  9952.            files. 
  9953.  
  9954.  
  9955. ΓòÉΓòÉΓòÉ 9. Description of Namepipe API Test ΓòÉΓòÉΓòÉ
  9956.  
  9957.  Named Pipes 
  9958.  
  9959.  
  9960. ΓòÉΓòÉΓòÉ 9.1. Named Pipes ΓòÉΓòÉΓòÉ
  9961.  
  9962. A named pipe is a bi-directional interprocess communication facility that 
  9963. allows two processes, either local or remote, to communicate with each other 
  9964. over the network.  A process that creates a named pipe is known as a Server 
  9965. Process (or Parent Process), and a process that establishes a connection to a 
  9966. named pipe is known as a Clinet Process (or Child Process). 
  9967.  
  9968. There are total twenty-three Named Pipes (12) and DOS (11) funcitons supported 
  9969. in the B/L release 1.2.  For a list and details of the Named Pipes functions, 
  9970. refer to IBM OS/2 Technical Reference Version 1.2 Programmer Reference Vol.1. 
  9971.  
  9972. A series of application programs were written in C to test these functions:
  9973.  
  9974.  L12AP300.C 
  9975.  L12AP301.C 
  9976.  L12AP302.C 
  9977.  L12AP303.C 
  9978.  L12AP304.C 
  9979.  L12AP305.C 
  9980.  L12AP306.C 
  9981.  L12AP307.C 
  9982.  L12AP308.C 
  9983.  
  9984.  
  9985. ΓòÉΓòÉΓòÉ 9.1.1. L12AP300.C ΓòÉΓòÉΓòÉ
  9986.  
  9987. This program creates the named pipe on a server machine.
  9988. /***************************************************************/
  9989. /*  FILE: L12AP300                                       */
  9990. /*                                                             */
  9991. /*  FUNCTION: Process IBM OS/2 LAN NAMED PIPES API CALLS.*/
  9992. /*    This file has to be run on a server machine while        */
  9993. /*    L12AP301.C runs on a requester machine.                  */
  9994. /*    Before running the program, make sure that LAN is started*/
  9995. /*    and users are logged on to the server and the requester. */
  9996. /*                                                             */
  9997. /*  Named Pipe functions covered in this file:           */
  9998. /*     DosMakeNmPipe,                                          */
  9999. /*     DosSetNmPHandState,                                     */
  10000. /*     DosConnectNmPipe,                                       */
  10001. /*     DosPeekNmPipe,                                          */
  10002. /*     DosQNmPHandState,                                       */
  10003. /*     DosQNmPipeInfo,                                         */
  10004. /*     DosSetNmPipeSem,                                        */
  10005. /*     DosQNmPipeSemState,                                     */
  10006. /*     DosDisConnectNmPipe.                                    */
  10007. /*                                                             */
  10008. /*  Dos functions used in this file:                     */
  10009. /*     DosSleep,                                               */
  10010. /*     DosWrite,                                               */
  10011. /*     DosCreateSem                                            */
  10012. /*                                                             */
  10013. /*  Author: Tai C. Beal                                  */
  10014. /*  Last Edited: 6/7/89                                  */
  10015. /*                                                             */
  10016. /***************************************************************/
  10017.  
  10018. /*-------------------------------*/
  10019. /* include files                 */
  10020. /*-------------------------------*/
  10021.  
  10022. #define INCL_DOS#define INCL_DOSSIGNALS
  10023. #define INCL_DOSERRORS
  10024. #define INCL_DOSSEMAPHORES
  10025.  
  10026. #include <stdio.h>
  10027. #include <malloc.h>
  10028. #include <stdlib.h>
  10029. #include <string.h>
  10030. #include <process.h>
  10031. #include <os2.h>
  10032. #include <memory.h>
  10033.  
  10034. #define WRT_BEHIND        0x0000   /* default */
  10035. #define NO_WRT_BEHIND     0x4000
  10036.  
  10037. #define INHERITANCE       0x0000   /* default */
  10038. #define NO_INHERITANCE    0x0080
  10039.  
  10040. #define ACCESS_INBOUND    0x0000   /* default */
  10041. #define ACCESS_OUTBOUND   0x0001
  10042. #define ACCESS_DUPLEX     0x0002
  10043.  
  10044. #define BLOCK             0x0000   /* & Mask  */
  10045. #define NO_BLOCK          0x8000   /* Default */
  10046.  
  10047. #define EPO_SERVER        0x4000   /* & Mask  */
  10048. #define EPO_CLIENT        0x0000   /* Default */
  10049.  
  10050. #define TYPE_AND_MASK     0x0c00
  10051. #define T_BYTE_STREAM     0x0000
  10052.                         /* Pipe/Type is Byte Stream     */
  10053. #define T_MESSAGE_STREAM  0x0400
  10054.                         /* Pipe/Type is Message Stream  */
  10055. #define READ_AND_MASK     0x0300
  10056. #define RM_BYTE_STREAM    0x0000
  10057.                         /* Read Mode is Byte Stream */
  10058. #define RM_MESSAGE_STREAM 0x0100
  10059.                         /* Read Mode is Message Stream  */
  10060. #define ICNT_AND_MASK     0x00ff
  10061. #define ICNT_INFINITE     0xffff
  10062. #define ICNT_UNIQUE       0x0001
  10063.  
  10064. typedef struct  _NPSS
  10065.     {        /* QNmPipeSemState information record */
  10066.      BYTE    npss_status;
  10067.                 /* type of record, 0 = EOI, 1 = read ok, */
  10068.                 /*   2 = write ok, 3 = pipe closed */
  10069.      BYTE    npss_flag;
  10070.                 /* additional info, 01 = waiting thread */
  10071.      USHORT  npss_key;
  10072.                 /* user's key value */
  10073.      USHORT  npss_avail;
  10074.                 /* available data/space if status = 1/2 */
  10075.     } NPSS;     /* npss */
  10076.  
  10077. main()
  10078. {
  10079.    PSZ      pipe_name;
  10080.    HFILE    pipe_handle;
  10081.    USHORT   pipe_open_mode;
  10082.    USHORT   pipe_mode;
  10083.    USHORT   outbuf_size;
  10084.    USHORT   inbuf_size;
  10085.    ULONG    timeout;
  10086.    USHORT   ret;
  10087.  
  10088.    HFILE    open_pipe_handle;
  10089.                     /* used by DosOpen to open pipe */
  10090.    USHORT   action_taken, file_size, file_attribute;
  10091.    USHORT   file_open_flag, file_open_mode;
  10092.  
  10093.    ULONG    time_out;               /* used by DosWrite */
  10094.    PVOID    outbuf;
  10095.    USHORT   buf_len;
  10096.    USHORT   bytes_written;
  10097.  
  10098.    PCH      inbuf, write_buf;
  10099.    USHORT   inbuf_len, outbuf_len, max_data_size;
  10100.    USHORT   bytesout;
  10101.  
  10102.    BYTE     output_buf;        /* DosPeekNmPipe */
  10103.    USHORT   bytes_to_be_written;
  10104.    USHORT   bytes_read, bytes_avail;
  10105.    USHORT   pipe_state;
  10106.  
  10107.    typedef struct  _NPINFO_DATA1 {
  10108.           /* PipeInfo data block (returned, level 1) */
  10109.        USHORT  npi_obuflen;  /* length of outgoing I/O buffer */
  10110.        USHORT  npi_ibuflen;  /* length of incoming I/O buffer */
  10111.        BYTE    npi_maxicnt;  /* maximum number of instances */
  10112.        BYTE    npi_curicnt;  /* current number of instances */
  10113.        BYTE    npi_namlen;   /* length of pipe name */
  10114.        CHAR    npi_name[256]; /* start of name */
  10115.    } NPINFO_DATA1;      /* npi_data1 */
  10116.  
  10117.    NPINFO_DATA1 pipe_info;          /* DosQNmPipeInfo */
  10118.  
  10119.    USHORT   handle_type, flag_word;
  10120.    USHORT   pipe_hand_state;
  10121.  
  10122.    HSEM     sem_handle;
  10123.    PSZ      sem_name;
  10124.    NPSS     infobufΓòÆ3Γûá;
  10125.  
  10126.  
  10127.  
  10128.     pipe_name = "\\pipe\\pipe1";
  10129.  
  10130.     pipe_open_mode = 0;
  10131.     pipe_mode = 0;
  10132.  
  10133.  /* set pipe mode to MESSAGE mode, and allow DUPLEX access */
  10134.  pipe_open_mode = WRT_BEHIND | INHERITANCE | ACCESS_DUPLEX;
  10135.       pipe_mode = BLOCK | T_MESSAGE_STREAM | RM_MESSAGE_STREAM
  10136.                   | 0X0020;
  10137.  
  10138.     outbuf_size = 512;
  10139.     inbuf_size  = 512;
  10140.     timeout = 50L;
  10141.     printf("Make named pipe\n");
  10142.     ret = DosMakeNmPipe((PSZ)pipe_name,
  10143.                         (PHFILE)&pipe_handle,
  10144.                         (USHORT)pipe_open_mode,
  10145.                         (USHORT)pipe_mode,
  10146.                         (USHORT)outbuf_size,
  10147.                         (USHORT)inbuf_size,
  10148.                         (ULONG)timeout);
  10149.  
  10150.     printf("   DosMakeNmPipe rc = %d\n", ret);
  10151. /*-------------------------------------------------------------*/
  10152.  
  10153.     printf("Set name pipe handle state\n");
  10154.     ret = DosSetNmPHandState((HFILE)pipe_handle,
  10155.                              (USHORT)0x0100);
  10156.                              /* message stream */
  10157.     printf("   DosSetNmPHandState rc = %d\n", ret);
  10158.     ret = DosSetNmPHandState((HFILE)pipe_handle,
  10159.                              (USHORT)0x0000);
  10160.                              /* byte stream */
  10161.     printf("   DosSetNmPHandState rc = %d\n", ret);
  10162.  
  10163. /*-------------------------------------------------------------*/
  10164.  
  10165.     printf("Connect named pipe\n");
  10166.     ret = DosConnectNmPipe(pipe_handle);
  10167.     printf("  DosConnectNmPipe rc = %d\n", ret);
  10168. /*-------------------------------------------------------------*/
  10169.  
  10170. /*    outbuf = (PBYTE)malloc(512); */
  10171.     bytes_to_be_written = 512;
  10172.  
  10173.     printf("Peek named pipe\n");
  10174.     ret = DosPeekNmPipe((HFILE)pipe_handle,
  10175.                         (PBYTE)&output_buf,
  10176.                         (USHORT)bytes_to_be_written,
  10177.                         (PUSHORT)&bytes_read,
  10178.                         (PUSHORT)&bytes_avail,
  10179.                         (PUSHORT)&pipe_state);
  10180.     printf("   DosPeekNmPipe rc = %d\n", ret);
  10181. /*-------------------------------------------------------------*/
  10182.  
  10183.     printf("Query named pipe handle state\n");
  10184.     ret = DosQNmPHandState((HFILE)pipe_handle,
  10185.                            (PUSHORT)&pipe_hand_state);
  10186.     printf("   DosQNmPHandState rc = %d\n", ret);
  10187.  
  10188. /*--------------------------------------------------------------*/
  10189.  
  10190.     printf("Query named pipe info\n");
  10191.     ret = DosQNmPipeInfo((HFILE)pipe_handle,
  10192.                          (USHORT)1,         /* info level */
  10193.                          (PBYTE)&pipe_info,
  10194.                          (USHORT)sizeof(pipe_info));
  10195.     printf("   DosQNmPipeInfo rc = %d\n", ret);
  10196.  
  10197. /*--------------------------------------------------------------*/
  10198.     ret = DosSleep(20000L);
  10199. /*--------------------------------------------------------------*/
  10200.  
  10201.     outbuf = "write a string to the named pipe";
  10202.     buf_len = strlen(outbuf)+1;
  10203.     printf("Write a string to named pipe\n");
  10204.     ret = DosWrite((HFILE)pipe_handle,
  10205.                    (PVOID)outbuf,
  10206.                    (USHORT)buf_len,
  10207.                    (PUSHORT)&bytes_written);
  10208.     printf("   DosWrite rc = %d\n", ret);
  10209.  
  10210. /*-------------------------------------------------------------*/
  10211.     ret = DosSleep(20000L);
  10212. /*-------------------------------------------------------------*/
  10213.     /* DosSetNmPipeSem call works for local named pipes only */
  10214.  
  10215.     sem_name = "\\sem\\sem1";
  10216.     printf("      Create a System Semaphore\n");
  10217.     ret = DosCreateSem((USHORT) 1,
  10218.                        (PHSEM)&sem_handle,
  10219.                        (PSZ)sem_name);
  10220.     printf("      DosCreateSem rc = %d\n", ret);
  10221.  
  10222.     printf("      Initialize the System Semaphore\n");
  10223.     ret = DosSemSet((HSEM)sem_handle);
  10224.     printf("      DosSemSet rc = %d\n", ret);
  10225.  
  10226.     printf("Set named pipe semaphore\n");
  10227.     ret = DosSetNmPipeSem((HFILE)pipe_handle,
  10228.                           (HSEM)sem_handle,
  10229.                           (USHORT)10);      /* pipe number */
  10230.     printf("   DosSetNmPipeSem rc = %d\n", ret);
  10231.  
  10232. /*---------------------------------------------------------*/
  10233.     printf("Query named pipe semaphore state\n");
  10234.     ret = DosQNmPipeSemState((HSEM)sem_handle,
  10235.                             /* system semaphore  */
  10236.                              (PBYTE)&infobufΓòÆ0Γûá,
  10237.                              /* INFOBUF output    */
  10238.                              (USHORT)sizeof(NPSS)*3);
  10239.                              /* Size of INFOBUF   */
  10240.     printf("   DosQNmPipeSemState rc = %d\n", ret);
  10241. /*---------------------------------------------------------*/
  10242.  
  10243.     outbuf = "write a string to the named pipe";
  10244.     buf_len = strlen(outbuf)+1;
  10245.     printf("Write a string to named pipe\n");
  10246.     ret = DosWrite((HFILE)pipe_handle,
  10247.                    (PVOID)outbuf,
  10248.                    (USHORT)buf_len,
  10249.                    (PUSHORT)&bytes_written);
  10250.     printf("   DosWrite rc = %d\n", ret);
  10251.  
  10252. /*-----------------------------------------------------------*/
  10253.  
  10254.     DosSleep(60000L);
  10255.  
  10256.     printf("Disconnect named pipe\n");
  10257.     ret = DosDisConnectNmPipe((HPIPE)pipe_handle);
  10258.     printf("   DosDisConnectNmPipe rc = %d\n", ret);
  10259. /*------------------------------------------------------------*/
  10260.     printf("Close named pipe\n");
  10261.     ret = DosClose((HPIPE)pipe_handle);
  10262.     printf("   DosClose rc = %d\n", ret);
  10263. }
  10264.  
  10265.  
  10266. ΓòÉΓòÉΓòÉ 9.1.2. L12AP301.C ΓòÉΓòÉΓòÉ
  10267.  
  10268. This program accesses the named pipe on a
  10269. server machine from a requester
  10270. machine.
  10271. /************************************************************/
  10272. /*                                                          */
  10273. /*  FILE: L12AP301.C                                  */
  10274. /*                                                          */
  10275. /*  FUNCTION: Processes IBM OS/2 LAN                  */
  10276. /*  NAMED PIPES API CALLS.                                  */
  10277. /*     This file has to be run on a requester machine while */
  10278. /*     L12AP300.C runs on a server machine.                 */
  10279. /*     Before running the program, make sure that LAN is    */
  10280. /*     started and users are logged on to the server        */
  10281. /*     and the requester.                                   */
  10282. /*  Named Pipe functions covered in this file:        */
  10283. /*      DosWaitNmPipe,                                      */
  10284. /*      DosWriteNmPipe,                                     */
  10285. /*      DosQFHandState,                                     */
  10286. /*      DosQHandType,                                       */
  10287. /*      DosDupHandle,                                       */
  10288. /*      DosBufReset,                                        */
  10289. /*      DosSetFHandState,                                   */
  10290. /*      DosQNmPipeInfo,                                     */
  10291. /*      DosReadAsync.                                       */
  10292. /*                                                          */
  10293. /*   Dos functions used in this file:                 */
  10294. /*      DosOpen,                                            */
  10295. /*      DosWrite,                                           */
  10296. /*      DosRead,                                            */
  10297. /*      DosSleep,                                           */
  10298. /*      DosSemset,                                          */
  10299. /*      DosSemClear,                                        */
  10300. /*      DosClose.                                           */
  10301. /*                                                          */
  10302. /*  Author: Tai C. Beal                               */
  10303. /*  Last Edited: 6/7/89                               */
  10304. /*                                                          */
  10305. /************************************************************/
  10306. #define INCL_DOS#define INCL_DOSSIGNALS
  10307. #define INCL_DOSERRORS
  10308.  
  10309. /*----------------------------*/
  10310. /*  include files             */
  10311. /*----------------------------*/
  10312. #include <stdio.h>
  10313. #include <malloc.h>
  10314. #include <stdlib.h>
  10315. #include <string.h>
  10316. #include <process.h>
  10317. #include <os2.h>
  10318. #include <string.h>
  10319. #include <memory.h>
  10320.  
  10321. HSEM  pipe_async_ram_semaphore;     /*RAM semaphore */
  10322.  
  10323.  
  10324. main(argc,argv)
  10325.  
  10326. int      argc;
  10327. char     *argvΓòÆΓûá;
  10328.  
  10329. {
  10330.    char     temp1ΓòÆ20Γûá;
  10331.    char     *temp2, *temp3;
  10332.  
  10333.    PSZ      pipe_name;
  10334.    HFILE    pipe_handle;
  10335.    USHORT   ret, waitret;
  10336.  
  10337.    HFILE    open_pipe_handle;  /* used by DosOpen to open pipe */
  10338.    USHORT   action_taken, file_size, file_attribute;
  10339.    USHORT   file_open_flag, file_open_mode;
  10340.    HFILE    dup_open_pipe_handle;
  10341.  
  10342.    PVOID    buf, outbuf;
  10343.    USHORT   buf_length, outbuf_len;
  10344.    USHORT   bytes_written, bytesout, bytes_read;
  10345.  
  10346.    USHORT   open_pipe_handle_state;
  10347.    USHORT   hand_type, flag_word;
  10348.    USHORT   file_handle_state;
  10349.  
  10350.    ULONG    timeout;
  10351.    USHORT   pipe_async_return_code;
  10352.  
  10353.    typedef struct  _NPINFO_DATA1 {
  10354.           /* PipeInfo data block (returned, level 1) */
  10355.        USHORT  npi_obuflen;  /* length of outgoing I/O buffer */
  10356.        USHORT  npi_ibuflen;  /* length of incoming I/O buffer */
  10357.        BYTE    npi_maxicnt;  /* maximum number of instances */
  10358.        BYTE    npi_curicnt;  /* current number of instances */
  10359.        BYTE    npi_namlen;   /* length of pipe name */
  10360.        CHAR    npi_name[256];  /* start of name */
  10361.    } NPINFO_DATA1;      /* npi_data1 */
  10362.  
  10363.    NPINFO_DATA1 pipe_info;          /* DosQNmPipeInfo */
  10364.  
  10365.  
  10366.    if (argc !=2 ) {
  10367.       printf("*** Input syntax:",
  10368.         "   PROC11  Machinename  ***\n\n");
  10369.       printf("    Machinename is the name of the",
  10370.         " server on which the named pipe is created.\n");
  10371.       exit(1);
  10372.    }
  10373.  
  10374.    strcpy(temp1,"\\\\");
  10375.    temp2 = strcat(temp1,argv[1]);
  10376.    pipe_name = strcat(temp1,"\\pipe\\pipe1");
  10377.  
  10378.     /* use DosOpen to open pipe */
  10379.     file_size = 0L;
  10380.     file_attribute = 0;
  10381.     file_open_flag = 1;     /* open existing pipe (file) only */
  10382.     file_open_mode = 0xB2;      /* Deny none access */
  10383.                            /* sharing mode = 2, access mode = 2 */
  10384.              /* inheritance = 1, private to the current process */
  10385.  
  10386.     printf("Open named pipe\n");
  10387.     ret = DosOpen((PSZ)pipe_name,
  10388.                   (PHFILE)&open_pipe_handle,
  10389.                   (PUSHORT)&action_taken,
  10390.                   (ULONG)file_size,
  10391.                   (USHORT)file_attribute,
  10392.                   (USHORT)file_open_flag,
  10393.                   (USHORT)file_open_mode,
  10394.                   0L);
  10395.     printf("   DosOpen rc = %d\n", ret);
  10396.  
  10397.     if (ret != 0) {
  10398.        timeout = 30000L;
  10399.        waitret = DosWaitNmPipe((PSZ)pipe_name,
  10400.                             (ULONG)timeout);
  10401.        if (waitret == 0) {
  10402.           ret = DosOpen((PSZ)pipe_name,
  10403.                         (PHFILE)&open_pipe_handle,
  10404.                         (PUSHORT)&action_taken,
  10405.                         (ULONG)file_size,
  10406.                         (USHORT)file_attribute,
  10407.                         (USHORT)file_open_flag,
  10408.                         (USHORT)file_open_mode,
  10409.                         0L);
  10410.           if (ret == 0)
  10411.              printf("   DosOpen rc = %d\n", ret);
  10412.           else {
  10413.              printf("   DosOpen rc = %d,",
  10414.                 " failed to open named pipe.\n",ret);
  10415.              exit(1);
  10416.           }
  10417.        } /* endif (waitret == 0) */
  10418.        else {
  10419.           printf("   DosWaitNmPipe rc = %d,",
  10420.                 " failed to wait on named pipe.\n",
  10421.                   waitret);
  10422.           exit(1);
  10423.        }
  10424.     } /* end if */
  10425.  
  10426. /*-------------------------------------------------------*/
  10427.  
  10428.     printf("Reset buffer\n");
  10429.     ret = DosBufReset((HFILE)open_pipe_handle);
  10430.     printf("   DosBufReset rc = %d\n", ret);
  10431. /*--------------------------------------------------------*/
  10432.  
  10433.    printf("Query file handle state\n");
  10434.    ret = DosQFHandState((HFILE)open_pipe_handle,
  10435.                  (PUSHORT)&open_pipe_handle_state);
  10436.    printf("   open_pipe_handle_state = %d\n",
  10437.             open_pipe_handle_state);
  10438.    printf("   DosQFHandState rc = %d\n", ret);
  10439. /*---------------------------------------------------------*/
  10440.  
  10441.    printf("Query file handle type\n");
  10442.    ret = DosQHandType((HFILE)open_pipe_handle,
  10443.                      (PUSHORT)&hand_type,
  10444.                      (PUSHORT)&flag_word);
  10445.  
  10446.    printf("   DosQHandType rc = %d\n", ret);
  10447. /*----------------------------------------------------------*/
  10448.  
  10449.     buf = "write a string to the named pipe";
  10450.     buf_length = strlen(buf);
  10451.     printf("Write a string to named pipe\n");
  10452.     ret = DosWrite((HFILE)open_pipe_handle,
  10453.         /* handle returned from DosOpen */
  10454.                    (PVOID)buf,
  10455.                    (USHORT)buf_length,
  10456.                    (PUSHORT)&bytes_written);
  10457.     printf("   DosWrite rc = %d\n", ret);
  10458. /*----------------------------------------------------------*/
  10459.  
  10460.     printf("Duplicate pipe handle\n");
  10461.     printf("      open_pipe_handle = %d\n",
  10462.             open_pipe_handle);
  10463.     ret = DosDupHandle((HFILE)open_pipe_handle,
  10464.                        (PHFILE)&dup_open_pipe_handle);
  10465.     printf("   DosDupHandle rc = %d\n", ret);
  10466.     printf("      dup_open_pipe_handle = %d\n",
  10467.             dup_open_pipe_handle);
  10468.  
  10469.     printf("Duplicate pipe handle\n");
  10470.     printf("      open_pipe_handle = %d\n",
  10471.         open_pipe_handle);
  10472.     ret = DosDupHandle((HFILE)open_pipe_handle,
  10473.                        (PHFILE)&dup_open_pipe_handle);
  10474.     printf("   DosDupHandle rc = %d\n", ret);
  10475.     printf("      dup_open_pipe_handle = %d\n",
  10476.         dup_open_pipe_handle);
  10477. /*-----------------------------------------------------------*/
  10478.  
  10479.    printf("Set file handle state\n");
  10480.    open_pipe_handle_state = 0X4080;      /* set W=1, I=1 */
  10481.    ret = DosSetFHandState((HFILE)open_pipe_handle,
  10482.                          (USHORT)file_handle_state);
  10483.  
  10484.    printf("   DosSetFHandState rc = %d\n", ret);
  10485. /*-------------------------------------------------------------*/
  10486.  
  10487.     buf = "write another string to the named pipe";
  10488.     buf_length = strlen(buf);
  10489.     printf("Write another string to the named pipe",
  10490.         " using duplicated handle\n");
  10491.     printf("      dup_open_pipe_handle = %d\n",
  10492.         dup_open_pipe_handle);
  10493.     ret = DosWrite((HFILE)dup_open_pipe_handle,
  10494.                    (PVOID)buf,
  10495.                    (USHORT)buf_length,
  10496.                    (PUSHORT)&bytes_written);
  10497.     printf("   DosWrite rc = %d\n", ret);
  10498.  
  10499. /*-------------------------------------------------------------*/
  10500.  
  10501.     /*  RamSemaphore must be set to 0L before it is used */
  10502.  
  10503.     printf("      Set Ram Semaphore\n");
  10504.     pipe_async_ram_semaphore = 0L;
  10505.     ret = DosSemSet((HSEM)&pipe_async_ram_semaphore);
  10506.     printf("      DosSemSet rc = %d\n", ret);
  10507.  
  10508.     printf("Read Asynchronously\n");
  10509.     buf = "read a string from the named pipe";
  10510.     buf_length = strlen(buf)+1;
  10511.     ret = DosReadAsync((HFILE)dup_open_pipe_handle,  /* input    */
  10512.                        (PULONG)&pipe_async_ram_semaphore,
  10513.                        /* input    */
  10514.                        (PUSHORT)&pipe_async_return_code,
  10515.                        /* output   */
  10516.                        (PVOID)buf,
  10517.                        /* output   */
  10518.                        (USHORT)buf_length,
  10519.                        /* input    */
  10520.                        (PUSHORT)&bytes_read);
  10521.                        /* output   */
  10522.     printf("   DosReadAsync rc = %d\n", ret);
  10523.  
  10524. /*--------------------------------------------------------------*/
  10525.  
  10526.     printf("      Clear Ram Semaphore\n");
  10527.     timeout = 10000;
  10528.     ret = DosSemClear((HSEM)&pipe_async_ram_semaphore);
  10529.  
  10530.     printf("      DosSemClear rc = %d\n", ret);
  10531.  
  10532. /*-------------------------------------------------------------*/
  10533.    /* sleep so that TEST1 can write data to the named pipe */
  10534.    DosSleep(40000L);
  10535. /*-------------------------------------------------------------*/
  10536.  
  10537.     printf("Query named pipe info\n");
  10538.     ret = DosQNmPipeInfo((HFILE)pipe_handle,
  10539.                          (USHORT)1,            /* info level */
  10540.                          (PBYTE)&pipe_info,
  10541.                          (USHORT)sizeof(pipe_info));
  10542.     printf("   DosQNmPipeInfo rc = %d\n", ret);
  10543.     printf("   npi_obuflen = %d\n", pipe_info.npi_obuflen);
  10544.     printf("   npi_ibuflen = %d\n", pipe_info.npi_ibuflen);
  10545.     printf("   npi_maxicnt = %d\n", pipe_info.npi_maxicnt);
  10546.     printf("   current num icnt = %d\n", pipe_info.npi_curicnt);
  10547.     printf("   pipename len = %d\n", pipe_info.npi_namlen);
  10548.     printf("   start of name = %s\n", pipe_info.npi_name);
  10549.  
  10550. (CONTINUED) 
  10551.  
  10552.  
  10553. ΓòÉΓòÉΓòÉ 9.1.3. L12AP301.C (continued) ΓòÉΓòÉΓòÉ
  10554.  
  10555. /*------------------------------------------------------------*/
  10556.  
  10557.    /* read data sent to named pipe by TEST1 DosWrite */
  10558.    buf = "read a string from the named pipe";
  10559.    buf_length = strlen(buf)+1;
  10560.    printf("Read Data from named pipe\n");
  10561.    ret = DosRead((HFILE)open_pipe_handle,  /* input    */
  10562.                  (PVOID)buf,               /* output   */
  10563.                  (USHORT)buf_length,       /* input    */
  10564.                  (PUSHORT)&bytes_read);  /* output   */
  10565.  
  10566.    printf("   DosRead rc = %d\n");
  10567.  
  10568. /*-----------------------------------------------------------*/
  10569.  
  10570.    printf("Close Pipe Handle\n");
  10571.    ret = DosClose(open_pipe_handle);
  10572.    printf("   DosClose rc = %d\n", ret);
  10573.  
  10574. }
  10575.  
  10576.  
  10577. ΓòÉΓòÉΓòÉ 9.1.4. L12AP302.C ΓòÉΓòÉΓòÉ
  10578.  
  10579. This program accesses the named pipe on a server machine
  10580.  from a requester
  10581. machine.
  10582. /***************************************************************/
  10583. /*                                                             */
  10584. /*  FILE: L12AP302.C                                     */
  10585. /*                                                             */
  10586. /*  FUNCTION: Processes IBM OS/2                         */
  10587. /*  LAN NAMED PIPES API CALLS.                                 */
  10588. /*     This file has to be run on a server machine while       */
  10589. /*     L12AP303.C or L12AP304.C runs on a requester machine.   */
  10590. /*     Before running the program, make sure that LAN is       */
  10591. /*     started and users are logged on to the server           */
  10592. /*     and the requester.                                      */
  10593. /*                                                             */
  10594. /*  Named Pipe functions covered in this file:           */
  10595. /*      DosMakeNmPipe,                                         */
  10596. /*      DosConnectNmPipe,                                      */
  10597. /*      DosDisConnectNmPipe.                                   */
  10598. /*                                                             */
  10599. /*   Dos functions used in this file:                    */
  10600. /*      DosSleep,                                              */
  10601. /*      DosWrite,                                              */
  10602. /*      DosClose.                                              */
  10603. /*                                                             */
  10604. /*  Author: Tai C. Beal                                  */
  10605. /*  Last Edited: 6/7/89                                  */
  10606. /*                                                             */
  10607. /***************************************************************/
  10608. #define INCL_DOS#define INCL_DOSSIGNALS
  10609. #define INCL_DOSERRORS
  10610.  
  10611. #include <stdio.h>
  10612. #include <malloc.h>
  10613. #include <stdlib.h>
  10614. #include <string.h>
  10615. #include <process.h>
  10616. #include <os2.h>
  10617. #include <string.h>
  10618. #include <memory.h>
  10619.  
  10620. #define WRT_BEHIND        0x0000      /* default */
  10621. #define NO_WRT_BEHIND     0x4000
  10622.  
  10623. #define INHERITANCE       0x0000      /* default */
  10624. #define NO_INHERITANCE    0x0080
  10625.  
  10626. #define ACCESS_INBOUND    0x0000      /* default */
  10627. #define ACCESS_OUTBOUND   0x0001
  10628. #define ACCESS_DUPLEX     0x0002
  10629.  
  10630. #define BLOCK             0x0000      /* & Mask  */
  10631. #define NO_BLOCK          0x8000      /* Default */
  10632.  
  10633. #define T_BYTE_STREAM     0x0000 /* Pipe/Type is Byte Stream*/
  10634. #define T_MESSAGE_STREAM  0x0400 /* Pipe/Type is Message Stream*/
  10635.  
  10636. #define READ_AND_MASK     0x0300
  10637. #define RM_BYTE_STREAM    0x0000 /* Read Mode is Byte Stream*/
  10638. #define RM_MESSAGE_STREAM 0x0100 /* Read Mode is Message Stream*/
  10639.  
  10640. #define ICNT_AND_MASK     0x00ff
  10641. #define ICNT_INFINITE     0xffff
  10642. #define ICNT_UNIQUE       0x0001
  10643.  
  10644. main()
  10645. {
  10646.    PSZ      pipe_name;
  10647.  
  10648.    HFILE    pipe_handle;
  10649.    USHORT   pipe_open_mode;
  10650.    USHORT   pipe_mode;
  10651.    USHORT   outbuf_size;
  10652.    USHORT   inbuf_size;
  10653.    ULONG    timeout;
  10654.    USHORT   ret;
  10655.  
  10656.    PVOID    outbuf;
  10657.    USHORT   buf_len;
  10658.    USHORT   bytes_written;
  10659.  
  10660.  
  10661.  
  10662.    pipe_name = "\\pipe\\pipe2";
  10663.  
  10664.     pipe_open_mode = 0;
  10665.     pipe_mode = 0;
  10666.  
  10667.     /*  set to MESSAGE moce */
  10668.     pipe_open_mode = WRT_BEHIND | INHERITANCE | ACCESS_DUPLEX;
  10669.     pipe_mode = BLOCK | T_MESSAGE_STREAM | RM_MESSAGE_STREAM |
  10670.                 0X0020;
  10671.  
  10672.     outbuf_size = 512;
  10673.     inbuf_size  = 512;
  10674.     timeout = 50L;
  10675.  
  10676.     printf("Make a message name pipe\n");
  10677.     ret = DosMakeNmPipe((PSZ)pipe_name,
  10678.                         (PHFILE)&pipe_handle,
  10679.                         (USHORT)pipe_open_mode,
  10680.                         (USHORT)pipe_mode,
  10681.                         (USHORT)outbuf_size,
  10682.                         (USHORT)inbuf_size,
  10683.                         (ULONG)timeout);
  10684.  
  10685.     printf("   DosMakeNmPipe rc = %d\n", ret);
  10686.  
  10687. /*----------------------------------------------------------*/
  10688.  
  10689.     printf("Connect named pipe\n");
  10690.     ret = DosConnectNmPipe(pipe_handle);
  10691.     printf("  DosConnectNmPipe rc = %d\n", ret);
  10692.  
  10693. /*-----------------------------------------------------------*/
  10694.     ret=DosSleep(20000L);
  10695.  
  10696.     outbuf = "write a string to the named pipe";
  10697.     buf_len = strlen(outbuf)+1;
  10698.     printf("Write a string to the named pipe\n");
  10699.     ret = DosWrite((HFILE)pipe_handle,
  10700.                    (PVOID)outbuf,
  10701.                    (USHORT)buf_len,
  10702.                    (PUSHORT)&bytes_written);
  10703.     printf("   DosWrite rc = %d\n", ret);
  10704.  
  10705.     DosSleep(30000L);
  10706.  
  10707. /*-----------------------------------------------------------*/
  10708.     printf("Disconnect name pipe\n");
  10709.     ret = DosDisConnectNmPipe((HPIPE)pipe_handle);
  10710.     printf("   DosDisConnectNmPipe rc = %d\n", ret);
  10711. /*-----------------------------------------------------------*/
  10712.     printf("Close named pipe\n");
  10713.     ret = DosClose((HPIPE)pipe_handle);
  10714.     printf("   DosClose rc = %d\n", ret);
  10715.  
  10716. }
  10717.  
  10718.  
  10719. ΓòÉΓòÉΓòÉ 9.1.5. L12AP303.C ΓòÉΓòÉΓòÉ
  10720.  
  10721. This program accesses the named pipe on a server machine from a requester
  10722. machine.
  10723. /*************************************************************/
  10724. /*                                                           */
  10725. /*  FILE: L12AP303.C                                         */
  10726. /*                                                           */
  10727. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  10728. /*                   NAMED PIPES API CALLS.                  */
  10729. /*     This file has to be run on a requester machine while  */
  10730. /*     L12AP302.C runs on a server machine.                  */
  10731. /*     Before running the program, make sure that LAN is     */
  10732. /*     started and users are logged on to the server and the */
  10733. /*     requester.                                            */
  10734. /*                                                           */
  10735. /*  Named Pipe functions covered in this file:               */
  10736. /*      DosWaitNmpipe,                                       */
  10737. /*      DosTransactNmPipe.                                   */
  10738. /*                                                           */
  10739. /*   Dos functions used in this file:                        */
  10740. /*      DosOpen,                                             */
  10741. /*      DosClose.                                            */
  10742. /*                                                           */
  10743. /*  Author: Tai C. Beal                                      */
  10744. /*  Last Edited: 6/7/89                                      */
  10745. /*                                                           */
  10746. /*************************************************************/
  10747.  
  10748. /*-------------------------------*/
  10749. /* include files                 */
  10750. /*-------------------------------*/
  10751. #define INCL_DOS#define INCL_DOSSIGNALS
  10752. #define INCL_DOSERRORS
  10753.  
  10754. #include <stdio.h>
  10755. #include <malloc.h>
  10756. #include <stdlib.h>
  10757. #include <string.h>
  10758. #include <process.h>
  10759. #include <os2.h>
  10760. #include <string.h>
  10761. #include <memory.h>
  10762.  
  10763. main(argc,argv)
  10764.  
  10765. int      argc;
  10766. char     *argvΓòÆΓûá;
  10767.  
  10768. {
  10769.  
  10770.    char     temp1[20];
  10771.    char     *temp2, *temp3;
  10772.  
  10773.    PSZ      pipe_name;
  10774.    HFILE    pipe_handle;
  10775.    USHORT   ret, waitret;
  10776.  
  10777.    HFILE    open_pipe_handle; /*used by DosOpen to open pipe */
  10778.    USHORT   action_taken, file_size, file_attribute;
  10779.    USHORT   file_open_flag, file_open_mode;
  10780.    HFILE    dup_open_pipe_handle;
  10781.    ULONG    timeout;
  10782.  
  10783.    PVOID    inbuf, outbuf;
  10784.    USHORT   inbuf_len, outbuf_len;
  10785.    USHORT   bytesout, bytes_written;
  10786.  
  10787.  
  10788.    if (argc !=2 ) {
  10789.       printf("*** Input syntax:   PROC21",
  10790.         "  Machinename  ***\n\n");
  10791.       printf("    Machinename is the name of ",
  10792.             "the server on which the named pipe is created.\n");
  10793.       exit(1);
  10794.    }
  10795.    strcpy(temp1,"\\\\");
  10796.    temp2 = strcat(temp1,argv[1]);
  10797.    pipe_name = strcat(temp1,"\\pipe\\pipe2");
  10798.  
  10799.     /* use DosOpen to open pipe */
  10800.     file_size = 0L;
  10801.     file_attribute = 0;
  10802.     file_open_flag = 1;    /* open existing pipe (file) only */
  10803.     file_open_mode = 0xB2; /* Deny none access */
  10804.      /* sharing mode = 2, access mode = 2 */
  10805.      /* inheritance = 1, private to the current process */
  10806.  
  10807.     printf("Open named pipe\n");
  10808.     ret = DosOpen((PSZ)pipe_name,
  10809.                   (PHFILE)&open_pipe_handle,
  10810.                   (PUSHORT)&action_taken,
  10811.                   (ULONG)file_size,
  10812.                   (USHORT)file_attribute,
  10813.                   (USHORT)file_open_flag,
  10814.                   (USHORT)file_open_mode,
  10815.                   0L);
  10816.     printf("   DosOpen rc = %d\n", ret);
  10817.  
  10818.     if (ret != 0) {
  10819.        timeout = 30000L;
  10820.        waitret = DosWaitNmPipe((PSZ)pipe_name,
  10821.                             (ULONG)timeout);
  10822.        if (waitret == 0) {
  10823.           ret = DosOpen((PSZ)pipe_name,
  10824.                         (PHFILE)&open_pipe_handle,
  10825.                         (PUSHORT)&action_taken,
  10826.                         (ULONG)file_size,
  10827.                         (USHORT)file_attribute,
  10828.                         (USHORT)file_open_flag,
  10829.                         (USHORT)file_open_mode,
  10830.                         0L);
  10831.           if (ret == 0)
  10832.              printf("   DosOpen rc = %d\n", ret);
  10833.           else {
  10834.              printf("   DosOpen rc = %d, failed to open",
  10835.                 " named pipe.\n",ret);
  10836.              exit(1);
  10837.           }
  10838.        } /* endif (waitret == 0) */
  10839.        else {
  10840.           printf("   DosWaitNmPipe rc = %d, ",
  10841.                   "failed to wait on named pipe.\n",
  10842.                   waitret);
  10843.           exit(1);
  10844.        }
  10845.     } /* end if */
  10846. /*------------------------------------------------------*/
  10847.  
  10848.     inbuf = "Write a string to the named pipe";
  10849.     inbuf_len = strlen(inbuf)+1;
  10850.     outbuf = (PVOID)malloc(sizeof(inbuf)+1);
  10851.     outbuf_len = inbuf_len;
  10852.  
  10853.     printf("Performs a write/read tranaction\n");
  10854.     ret = DosTransactNmPipe((HFILE)open_pipe_handle,
  10855.                             (PVOID)inbuf,
  10856.                             (USHORT)inbuf_len,
  10857.                             (PVOID)outbuf,
  10858.                             (USHORT)outbuf_len,
  10859.                             (PUSHORT)&bytesout);
  10860.  
  10861.     printf("   DosTransactNmPipe rc = %d\n", ret);
  10862.     printf("      bytesout = %d\n", bytesout);
  10863.  
  10864. /*--------------------------------------------------------*/
  10865.  
  10866.    DosSleep(10000L);
  10867.    printf("Close Pipe Handle\n");
  10868.    ret = DosClose(open_pipe_handle);
  10869.    printf("   DosClose rc = %d\n", ret);
  10870.  
  10871. }
  10872.  
  10873.  
  10874. ΓòÉΓòÉΓòÉ 9.1.6. L12AP304.C ΓòÉΓòÉΓòÉ
  10875.  
  10876. This program accesses the named pipe on a server machine from a requester
  10877. machine.
  10878. /*************************************************************/
  10879. /*                                                           */
  10880. /*  FILE: L12AP304.C                                         */
  10881. /*                                                           */
  10882. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  10883. /*                   NAMED PIPES API CALLS.                  */
  10884. /*     This file has to be run on a requester machine while  */
  10885. /*     L12AP302.C runs on a server machine.                  */
  10886. /*     Before running the program, make sure that LAN is     */
  10887. /*     started and users are logged on to the server and the */
  10888. /*     requester.                                            */
  10889. /*                                                           */
  10890. /*  Named Pipe functions covered in this file:               */
  10891. /*      DosCallNmPipe.                                       */
  10892. /*                                                           */
  10893. /*  Author: Tai C. Beal                                      */
  10894. /*  Last Edited: 6/7/89                                      */
  10895. /*                                                           */
  10896. /*************************************************************/
  10897.  
  10898. /*-------------------------------*/
  10899. /* include files                 */
  10900. /*-------------------------------*/
  10901. #define INCL_DOS#define INCL_DOSSIGNALS
  10902. #define INCL_DOSERRORS
  10903.  
  10904. #include <stdio.h>
  10905. #include <malloc.h>
  10906. #include <stdlib.h>
  10907. #include <string.h>
  10908. #include <process.h>
  10909. #include <os2.h>
  10910. #include <string.h>
  10911. #include <memory.h>
  10912.  
  10913. main(argc,argv)
  10914.  
  10915. int      argc;
  10916. char     *argvΓòÆΓûá;
  10917. {
  10918.  
  10919.    char     temp1ΓòÆ20Γûá;
  10920.    char     *temp2, *temp3;
  10921.  
  10922.    PSZ      pipe_name;
  10923.    ULONG    time_out;
  10924.    PCH      buf, outbuf;
  10925.    USHORT   buf_length, outbuf_len, bytesout;
  10926.    USHORT   ret;
  10927.  
  10928.  /* this call is intended for use only on duplex message pipes */
  10929.  
  10930.    if (argc !=2 ) {
  10931.       printf("*** Input syntax:   PROC22",
  10932.         "  Machinename  ***\n\n");
  10933.       printf("    Machinename is the name of the ",
  10934.         "server on which the named pipe is created.\n");
  10935.       exit(1);
  10936.    }
  10937.    strcpy(temp1,"\\\\");
  10938.    temp2 = strcat(temp1,argvΓòÆ1Γûá);
  10939.    pipe_name = strcat(temp1,"\\pipe\\pipe2");
  10940. /*      pipe_name = "\\\\b-7-4\\pipe\\pipe2"; */
  10941.  
  10942.     printf("Call name pipe to open, close and transact\n");
  10943.     time_out = 30000L;
  10944.     buf =    "write buffer address                             ";
  10945.     buf_length = strlen(buf);
  10946.     outbuf = " read buffer address                             ";
  10947.     outbuf_len = strlen(outbuf);
  10948.  
  10949.     ret = DosCallNmPipe((PSZ)pipe_name,
  10950.                             /* Pipe Name             */
  10951.                         (PCH)buf,
  10952.                             /* Write Buffer Address  */
  10953.                         (USHORT)buf_length,
  10954.                             /* Write Buffer Length   */
  10955.                         (PCH)outbuf,
  10956.                             /* Read  Buffer Address  */
  10957.                         (USHORT)outbuf_len,
  10958.                             /* Read  Buffer Length   */
  10959.                         (PUSHORT)&bytesout,
  10960.                             /* Bytes Read (returned) */
  10961.                         (ULONG)time_out);
  10962.                             /* Max Wait Time         */
  10963.  
  10964.     printf("   DosCallNmPipe rc = %d\n", ret);
  10965.  
  10966. }
  10967.  
  10968.  
  10969. ΓòÉΓòÉΓòÉ 9.1.7. L12AP305.C ΓòÉΓòÉΓòÉ
  10970.  
  10971. This program accesses the named pipe on a server machine from a requester
  10972. machine.
  10973. /*************************************************************/
  10974. /*                                                           */
  10975. /*  FILE: L12AP305.C                                         */
  10976. /*                                                           */
  10977. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  10978. /*                   NAMED PIPES API CALLS.                  */
  10979. /*     This file has to be run on a requester machine while  */
  10980. /*     L12AP306.C runs on a requester machine.               */
  10981. /*     Before running the program, make sure that LAN is     */
  10982. /*     started and users are logged on to the server and the */
  10983. /*     requester.                                            */
  10984. /*                                                           */
  10985. /*  Named Pipe functions covered in this file:               */
  10986. /*      DosMakeNmPipe,                                       */
  10987. /*      DosConnectNmPipe,                                    */
  10988. /*      DosDisConnectNmPipe.                                 */
  10989. /*                                                           */
  10990. /*   Dos functions used in this file:                        */
  10991. /*      DosSleep,                                            */
  10992. /*      DosClose.                                            */
  10993. /*                                                           */
  10994. /*  Author: Tai C. Beal                                      */
  10995. /*  Last Edited: 6/7/89                                      */
  10996. /*                                                           */
  10997. /*************************************************************/
  10998. #define INCL_DOS#define INCL_DOSSIGNALS
  10999. #define INCL_DOSERRORS
  11000.  
  11001. #include <stdio.h>
  11002. #include <malloc.h>
  11003. #include <stdlib.h>
  11004. #include <string.h>
  11005. #include <process.h>
  11006. #include <os2.h>
  11007. #include <string.h>
  11008. #include <memory.h>
  11009.  
  11010. #define WRT_BEHIND        0x0000      /* default */
  11011. #define NO_WRT_BEHIND     0x4000
  11012.  
  11013. #define INHERITANCE       0x0000      /* default */
  11014. #define NO_INHERITANCE    0x0080
  11015.  
  11016. #define ACCESS_INBOUND    0x0000      /* default */
  11017. #define ACCESS_OUTBOUND   0x0001
  11018. #define ACCESS_DUPLEX     0x0002
  11019.  
  11020. #define BLOCK             0x0000      /* & Mask  */
  11021. #define NO_BLOCK          0x8000      /* Default */
  11022.  
  11023. #define T_BYTE_STREAM     0x0000
  11024.                           /* Pipe/Type is Byte Stream     */
  11025. #define T_MESSAGE_STREAM  0x0400
  11026.                           /* Pipe/Type is Message Stream  */
  11027.  
  11028. #define READ_AND_MASK     0x0300
  11029. #define RM_BYTE_STREAM    0x0000
  11030.                           /* Read Mode is Byte Stream     */
  11031. #define RM_MESSAGE_STREAM 0x0100
  11032.                           /* Read Mode is Message Stream  */
  11033.  
  11034. #define ICNT_AND_MASK     0x00ff
  11035. #define ICNT_INFINITE     0xffff
  11036. #define ICNT_UNIQUE       0x0001
  11037.  
  11038. main()
  11039. {
  11040.    PSZ      pipe_name;
  11041.  
  11042.    HFILE    pipe_handle;
  11043.    USHORT   pipe_open_mode;
  11044.    USHORT   pipe_mode;
  11045.    USHORT   outbuf_size;
  11046.    USHORT   inbuf_size;
  11047.    ULONG    timeout;
  11048.    USHORT   ret;
  11049.  
  11050.    PVOID    outbuf;
  11051.    USHORT   buf_len;
  11052.    USHORT   bytes_written;
  11053.  
  11054.  
  11055.  
  11056.    pipe_name = "\\pipe\\pipe3";
  11057.  
  11058.     pipe_open_mode = 0;
  11059.     pipe_mode = 0;
  11060.  
  11061.     /*  set to MESSAGE moce */
  11062.     pipe_open_mode = WRT_BEHIND | INHERITANCE | ACCESS_DUPLEX;
  11063.     pipe_mode = BLOCK | T_MESSAGE_STREAM | RM_MESSAGE_STREAM
  11064.         | 0X0020;
  11065.  
  11066.     outbuf_size = 512;
  11067.     inbuf_size  = 512;
  11068.     timeout = 50L;
  11069.  
  11070.     printf("Make a message name pipe\n");
  11071.     ret = DosMakeNmPipe((PSZ)pipe_name,
  11072.                         (PHFILE)&pipe_handle,
  11073.                         (USHORT)pipe_open_mode,
  11074.                         (USHORT)pipe_mode,
  11075.                         (USHORT)outbuf_size,
  11076.                         (USHORT)inbuf_size,
  11077.                         (ULONG)timeout);
  11078.  
  11079.     printf("   DosMakeNmPipe rc = %d\n", ret);
  11080.  
  11081. /*-----------------------------------------------------------*/
  11082.  
  11083.     printf("Connect named pipe\n");
  11084.     ret = DosConnectNmPipe(pipe_handle);
  11085.     printf("  DosConnectNmPipe rc = %d\n", ret);
  11086.  
  11087. /*------------------------------------------------------------*/
  11088.  
  11089.     ret = DosSleep(50000L);
  11090.  
  11091. /*------------------------------------------------------------*/
  11092.     printf("Disconnect name pipe\n");
  11093.     ret = DosDisConnectNmPipe((HPIPE)pipe_handle);
  11094.     printf("   DosDisConnectNmPipe rc = %d\n", ret);
  11095. /*------------------------------------------------------------*/
  11096.     printf("Close named pipe\n");
  11097.     ret = DosClose((HPIPE)pipe_handle);
  11098.     printf("   DosClose rc = %d\n", ret);
  11099. }
  11100.  
  11101.  
  11102. ΓòÉΓòÉΓòÉ 9.1.8. L12AP306.C ΓòÉΓòÉΓòÉ
  11103.  
  11104. This program accesses the named pipe on a server machine from a requester
  11105. machine.
  11106. /*************************************************************/
  11107. /*                                                           */
  11108. /*  FILE: L12AP306.C                                         */
  11109. /*                                                           */
  11110. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  11111. /*                   NAMED PIPES API CALLS.                  */
  11112. /*     This file has to be run on a requester machine while  */
  11113. /*     L12AP305.C runs on a server machine.                  */
  11114. /*     Before running the program, make sure that LAN is     */
  11115. /*     started and users are logged on to the server and the */
  11116. /*     requester.                                            */
  11117. /*                                                           */
  11118. /*  Dos functions covered in this file:                      */
  11119. /*      DosOpen,                                             */
  11120. /*      DosSemSet,                                           */
  11121. /*      DosWriteAsync,                                       */
  11122. /*      DosSemClear,                                         */
  11123. /*      DosClose.                                            */
  11124. /*                                                           */
  11125. /*  Author: Tai C. Beal                                      */
  11126. /*  Last Edited: 6/7/89                                      */
  11127. /*                                                           */
  11128. /*************************************************************/
  11129.  
  11130. /*-------------------------------*/
  11131. /* include files                 */
  11132. /*-------------------------------*/
  11133. #define INCL_DOS#define INCL_DOSSIGNALS
  11134. #define INCL_DOSERRORS
  11135. #define INCL_DOSSEMAPHORES
  11136.  
  11137. #include <stdio.h>
  11138. #include <malloc.h>
  11139. #include <stdlib.h>
  11140. #include <string.h>
  11141. #include <process.h>
  11142. #include <os2.h>
  11143. #include <string.h>
  11144. #include <memory.h>
  11145.  
  11146. HSEM  pipe_async_ram_semaphore;     /*RAM semaphore */
  11147. /*  taking machine names from the keyboard
  11148. causes error 4880, or 4870 */
  11149. /*
  11150. main(argc,argv)
  11151.  
  11152. int      argc;
  11153. char     *argv[];
  11154.  
  11155. {
  11156.  
  11157.    char     temp1[20];
  11158.    char     *temp2, *temp3;
  11159. */
  11160.  
  11161. main()
  11162. {
  11163.    PSZ      pipe_name;
  11164.    HFILE    pipe_handle;
  11165.    USHORT   ret, waitret;
  11166.  
  11167.    HFILE    open_pipe_handle;  /* used by DosOpen to open pipe */
  11168.    USHORT   action_taken, file_size, file_attribute;
  11169.    USHORT   file_open_flag, file_open_mode;
  11170.  
  11171.    PVOID    outbuf;
  11172.    USHORT   outbuf_len;
  11173.    USHORT   bytes_written;
  11174.  
  11175.    ULONG    timeout;
  11176.    USHORT   pipe_async_return_code;
  11177.  
  11178.    pipe_name = "\\\\b-7-4\\pipe\\pipe3";
  11179.  
  11180.     /* use DosOpen to open pipe */
  11181.     file_size = 0L;
  11182.     file_attribute = 0;
  11183.     file_open_flag = 1;  /* open existing pipe (file) only */
  11184.     file_open_mode = 0xB2;      /* Deny none access */
  11185.         /* sharing mode = 2, access mode = 2 */
  11186.         /* inheritance = 1, private to the current process */
  11187.     printf("Open named pipe\n");
  11188.     ret = DosOpen((PSZ)pipe_name,
  11189.                   (PHFILE)&open_pipe_handle,
  11190.                   (PUSHORT)&action_taken,
  11191.                   (ULONG)file_size,
  11192.                   (USHORT)file_attribute,
  11193.                   (USHORT)file_open_flag,
  11194.                   (USHORT)file_open_mode,
  11195.                   0L);
  11196.     printf("   DosOpen rc = %d\n", ret);
  11197.  
  11198.     if (ret != 0) {
  11199.        timeout = 30000L;
  11200.        waitret = DosWaitNmPipe((PSZ)pipe_name,
  11201.                             (ULONG)timeout);
  11202.        if (waitret == 0) {
  11203.           ret = DosOpen((PSZ)pipe_name,
  11204.                         (PHFILE)&open_pipe_handle,
  11205.                         (PUSHORT)&action_taken,
  11206.                         (ULONG)file_size,
  11207.                         (USHORT)file_attribute,
  11208.                         (USHORT)file_open_flag,
  11209.                         (USHORT)file_open_mode,
  11210.                         0L);
  11211.           if (ret == 0)
  11212.              printf("   DosOpen rc = %d\n", ret);
  11213.           else {
  11214.              printf("   DosOpen rc = %d, failed",
  11215.                 " to open named pipe.\n",ret);
  11216.              exit(1);
  11217.           }
  11218.        } /* endif (waitret == 0) */
  11219.        else {
  11220.           printf("   DosWaitNmPipe rc = %d,",
  11221.             "failed to wait on named pipe.\n",
  11222.                   waitret);
  11223.           exit(1);
  11224.        }
  11225.     } /* end if */
  11226. /*---------- --------------------------------------------*/
  11227.     /*  RamSemaphore must be set to 0L before it is used */
  11228.  
  11229.     printf("      Set Ram Semaphore\n");
  11230.     pipe_async_ram_semaphore = 0L;
  11231.     ret = DosSemSet((HSEM)&pipe_async_ram_semaphore);
  11232.     printf("      DosSemSet rc = %d\n", ret);
  11233.  
  11234.    outbuf = "Write a string to the named pipe\n";
  11235.    outbuf_len = strlen(outbuf)+1;
  11236.  
  11237.    printf("Write asynchronously\n");
  11238.    ret =DosWriteAsync((HFILE)open_pipe_handle,
  11239.                       (PULONG)&pipe_async_ram_semaphore,
  11240.                       (PUSHORT)&pipe_async_return_code,
  11241.                       (PVOID)outbuf,
  11242.                       (USHORT)outbuf_len,
  11243.                       (PUSHORT)&bytes_written);
  11244.  
  11245.    printf("   DosWriteAsync rc = %d\n");
  11246.  
  11247.     printf("      Clear Ram Semaphore\n");
  11248.     timeout = 10000;
  11249.     ret = DosSemClear((HSEM)&pipe_async_ram_semaphore);
  11250.     printf("      DosSemClear rc = %d\n", ret);
  11251.  
  11252. /*-----------------------------------------------------------*/
  11253.  
  11254.    printf("Close Pipe Handle\n");
  11255.    ret = DosClose(open_pipe_handle);
  11256.    printf("   DosClose rc = %d\n", ret);
  11257. }
  11258.  
  11259.  
  11260. ΓòÉΓòÉΓòÉ 9.1.9. L12AP307.C ΓòÉΓòÉΓòÉ
  11261.  
  11262. This program accesses the named pipe on a server machine from a requester
  11263. machine.
  11264. /*************************************************************/
  11265. /*   FILE: L12AP307.C                                        */
  11266. /*                                                           */
  11267. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  11268. /*                   NAMED PIPES API CALLS.                  */
  11269. /*     This file has to be run on a requester machine while  */
  11270. /*     L12AP308.C runs on a requester machine.               */
  11271. /*     Before running the program, make sure that LAN is     */
  11272. /*     started and users are logged on to the server and the */
  11273. /*     requester.                                            */
  11274. /*     Long filename is tested in this program.              */
  11275. /*                                                           */
  11276. /*   Named Pipe functions covered in this file:              */
  11277. /*      DosMakeNmPipe,                                       */
  11278. /*      DosSetNmPHandState,                                  */
  11279. /*      DosConnectNmPipe,                                    */
  11280. /*      DosPeekNmPipe,                                       */
  11281. /*      DosQNmPHandState,                                    */
  11282. /*      DosQNmPipeInfo,                                      */
  11283. /*      DosSetNmPipeSem,                                     */
  11284. /*      DosQNmPipeSemState,                                  */
  11285. /*      DosDisConnectNmPipe.                                 */
  11286. /*                                                           */
  11287. /*   Dos functions used in this file:                        */
  11288. /*      DosSleep,                                            */
  11289. /*      DosWrite,                                            */
  11290. /*      DosCreateSem,                                        */
  11291. /*      DosClose.                                            */
  11292. /*                                                           */
  11293. /*   Author: Tai C. Beal                                     */
  11294. /*   Last Edited: 6/7/89                                     */
  11295. /*                                                           */
  11296. /*************************************************************/
  11297.  
  11298. /*-------------------------------*/
  11299. /* include files                 */
  11300. /*-------------------------------*/
  11301.  
  11302. #define INCL_DOS#define INCL_DOSSIGNALS
  11303. #define INCL_DOSERRORS
  11304. #define INCL_DOSSEMAPHORES
  11305.  
  11306. #include <stdio.h>
  11307. #include <malloc.h>
  11308. #include <stdlib.h>
  11309. #include <string.h>
  11310. #include <process.h>
  11311. #include <os2.h>
  11312. #include <memory.h>
  11313.  
  11314. #define WRT_BEHIND        0x0000      /* default */
  11315. #define NO_WRT_BEHIND     0x4000
  11316.  
  11317. #define INHERITANCE       0x0000      /* default */
  11318. #define NO_INHERITANCE    0x0080
  11319.  
  11320. #define ACCESS_INBOUND    0x0000      /* default */
  11321. #define ACCESS_OUTBOUND   0x0001
  11322. #define ACCESS_DUPLEX     0x0002
  11323.  
  11324. #define BLOCK             0x0000      /* & Mask  */
  11325. #define NO_BLOCK          0x8000      /* Default */
  11326.  
  11327. #define EPO_SERVER        0x4000      /* & Mask  */
  11328. #define EPO_CLIENT        0x0000      /* Default */
  11329.  
  11330. #define TYPE_AND_MASK     0x0c00
  11331. #define T_BYTE_STREAM     0x0000
  11332.                     /* Pipe/Type is Byte Stream     */
  11333. #define T_MESSAGE_STREAM  0x0400
  11334.                     /* Pipe/Type is Message Stream  */
  11335.  
  11336. #define READ_AND_MASK     0x0300
  11337. #define RM_BYTE_STREAM    0x0000
  11338.                     /* Read Mode is Byte Stream     */
  11339. #define RM_MESSAGE_STREAM 0x0100
  11340.                      /* Read Mode is Message Stream  */
  11341.  
  11342. #define ICNT_AND_MASK     0x00ff
  11343. #define ICNT_INFINITE     0xffff
  11344. #define ICNT_UNIQUE       0x0001
  11345.  
  11346. typedef struct  _NPSS
  11347.           {        /* QNmPipeSemState information record */
  11348.           BYTE    npss_status;
  11349.                 /* type of record, 0 = EOI, 1 = read ok,
  11350.                  *   2 = write ok, 3 = pipe closed */
  11351.           BYTE    npss_flag;
  11352.                 /* additional info, 01 = waiting thread */
  11353.           USHORT  npss_key;
  11354.                 /* user's key value */
  11355.           USHORT  npss_avail;
  11356.                 /* available data/space if status = 1/2 */
  11357.           } NPSS;      /* npss */
  11358.  
  11359. main()
  11360. {
  11361.    PSZ      pipe_name;
  11362.    HFILE    pipe_handle;
  11363.    USHORT   pipe_open_mode;
  11364.    USHORT   pipe_mode;
  11365.    USHORT   outbuf_size;
  11366.    USHORT   inbuf_size;
  11367.    ULONG    timeout;
  11368.    USHORT   ret;
  11369.  
  11370.    HFILE    open_pipe_handle;
  11371.     /* used by DosOpen to open pipe */
  11372.    USHORT   action_taken, file_size, file_attribute;
  11373.    USHORT   file_open_flag, file_open_mode;
  11374.  
  11375.    ULONG    time_out;               /* used by DosWrite */
  11376.    PVOID    outbuf;
  11377.    USHORT   buf_len;
  11378.    USHORT   bytes_written;
  11379.  
  11380.    PCH      inbuf, write_buf;
  11381.    USHORT   inbuf_len, outbuf_len, max_data_size;
  11382.    USHORT   bytesout;
  11383.  
  11384.    BYTE     output_buf;        /* DosPeekNmPipe */
  11385.    USHORT   bytes_to_be_written;
  11386.    USHORT   bytes_read, bytes_avail;
  11387.    USHORT   pipe_state;
  11388.  
  11389.    typedef struct  _NPINFO_DATA1 {
  11390.           /* PipeInfo data block (returned, level 1) */
  11391.        USHORT  npi_obuflen; /* length of outgoing I/O buffer */
  11392.        USHORT  npi_ibuflen; /* length of incoming I/O buffer */
  11393.        BYTE    npi_maxicnt; /* maximum number of instances */
  11394.        BYTE    npi_curicnt; /* current number of instances */
  11395.        BYTE    npi_namlen;  /* length of pipe name */
  11396.        CHAR    npi_name[256];  /* start of name */
  11397.    } NPINFO_DATA1;      /* npi_data1 */
  11398.  
  11399.    NPINFO_DATA1 pipe_info;          /* DosQNmPipeInfo */
  11400.  
  11401.    USHORT   handle_type, flag_word;
  11402.    USHORT   pipe_hand_state;
  11403.  
  11404.    HSEM     sem_handle;
  11405.    PSZ      sem_name;
  11406.    NPSS     infobufΓòÆ3Γûá;
  11407.  
  11408.  
  11409.  
  11410.     pipe_name = "\\pipe\\a-real-long-pipe-name.pipe4.";
  11411.  
  11412.     pipe_open_mode = 0;
  11413.     pipe_mode = 0;
  11414.  
  11415.     /* set pipe mode to MESSAGE mode, and allow DUPLEX access */
  11416.     pipe_open_mode = WRT_BEHIND | INHERITANCE | ACCESS_DUPLEX;
  11417.       pipe_mode = BLOCK | T_MESSAGE_STREAM | RM_MESSAGE_STREAM
  11418.         | 0X0020;
  11419.  
  11420.     outbuf_size = 512;
  11421.     inbuf_size  = 512;
  11422.     timeout = 50L;
  11423.     printf("Make named pipe\n");
  11424.     ret = DosMakeNmPipe((PSZ)pipe_name,
  11425.                         (PHFILE)&pipe_handle,
  11426.                         (USHORT)pipe_open_mode,
  11427.                         (USHORT)pipe_mode,
  11428.                         (USHORT)outbuf_size,
  11429.                         (USHORT)inbuf_size,
  11430.                         (ULONG)timeout);
  11431.  
  11432.     printf("   DosMakeNmPipe rc = %d\n", ret);
  11433. /*-----------------------------------------------------------*/
  11434.  
  11435.     printf("Set name pipe handle state\n");
  11436.     ret = DosSetNmPHandState((HFILE)pipe_handle,
  11437.                              (USHORT)0x0100);
  11438.                              /* message stream */
  11439.     printf("   DosSetNmPHandState rc = %d\n", ret);
  11440.     ret = DosSetNmPHandState((HFILE)pipe_handle,
  11441.                              (USHORT)0x0000);
  11442.                              /* byte stream */
  11443.     printf("   DosSetNmPHandState rc = %d\n", ret);
  11444.  
  11445. /*-----------------------------------------------------------*/
  11446.  
  11447.     printf("Connect named pipe\n");
  11448.     ret = DosConnectNmPipe(pipe_handle);
  11449.     printf("  DosConnectNmPipe rc = %d\n", ret);
  11450. /*-----------------------------------------------------------*/
  11451.  
  11452. /*    outbuf = (PBYTE)malloc(512); */
  11453.     bytes_to_be_written = 512;
  11454.  
  11455.     printf("Peek named pipe\n");
  11456.     ret = DosPeekNmPipe((HFILE)pipe_handle,
  11457.                         (PBYTE)&output_buf,
  11458.                         (USHORT)bytes_to_be_written,
  11459.                         (PUSHORT)&bytes_read,
  11460.                         (PUSHORT)&bytes_avail,
  11461.                         (PUSHORT)&pipe_state);
  11462.     printf("   DosPeekNmPipe rc = %d\n", ret);
  11463. /*-----------------------------------------------------------*/
  11464.  
  11465.     printf("Query named pipe handle state\n");
  11466.     ret = DosQNmPHandState((HFILE)pipe_handle,
  11467.                            (PUSHORT)&pipe_hand_state);
  11468.     printf("   DosQNmPHandState rc = %d\n", ret);
  11469.  
  11470. /*------------------------------------------------------------*/
  11471.  
  11472.     printf("Query named pipe info\n");
  11473.     ret = DosQNmPipeInfo((HFILE)pipe_handle,
  11474.                          (USHORT)1,       /* info level */
  11475.                          (PBYTE)&pipe_info,
  11476.                          (USHORT)sizeof(pipe_info));
  11477.     printf("   DosQNmPipeInfo rc = %d\n", ret);
  11478.  
  11479. /*-----------------------------------------------------------*/
  11480.     ret = DosSleep(20000L);
  11481. /*------------------------------------------------------------*/
  11482.  
  11483.     outbuf = "write a string to the named pipe";
  11484.     buf_len = strlen(outbuf)+1;
  11485.     printf("Write a string to named pipe\n");
  11486.     ret = DosWrite((HFILE)pipe_handle,
  11487.                    (PVOID)outbuf,
  11488.                    (USHORT)buf_len,
  11489.                    (PUSHORT)&bytes_written);
  11490.     printf("   DosWrite rc = %d\n", ret);
  11491.  
  11492. /*------------------------------------------------------------*/
  11493.     ret = DosSleep(20000L);
  11494. /*----------------------------------------------------------*/
  11495.     /* DosSetNmPipeSem call works for local named pipes only */
  11496.  
  11497.     sem_name = "\\sem\\sem1";
  11498.     printf("      Create a System Semaphore\n");
  11499.     ret = DosCreateSem((USHORT) 1,
  11500.                        (PHSEM)&sem_handle,
  11501.                        (PSZ)sem_name);
  11502.     printf("      DosCreateSem rc = %d\n", ret);
  11503.  
  11504.     printf("      Initialize the System Semaphore\n");
  11505.     ret = DosSemSet((HSEM)sem_handle);
  11506.     printf("      DosSemSet rc = %d\n", ret);
  11507.  
  11508.     printf("Set named pipe semaphore\n");
  11509.     ret = DosSetNmPipeSem((HFILE)pipe_handle,
  11510.                           (HSEM)sem_handle,
  11511.                           (USHORT)10);          /* pipe number */
  11512.     printf("   DosSetNmPipeSem rc = %d\n", ret);
  11513.  
  11514. /*--------------------------------------------------------*/
  11515.     printf("Query named pipe semaphore state\n");
  11516.     ret = DosQNmPipeSemState((HSEM)sem_handle,
  11517.                             /* system semaphore  */
  11518.                              (PBYTE)&infobuf[0],
  11519.                              /* INFOBUF output    */
  11520.                              (USHORT)sizeof(NPSS)*3);
  11521.                              /* Size of INFOBUF   */
  11522.     printf("   DosQNmPipeSemState rc = %d\n", ret);
  11523. /*--------------------------------------------------------*/
  11524.  
  11525.     outbuf = "write a string to the named pipe";
  11526.     buf_len = strlen(outbuf)+1;
  11527.     printf("Write a string to named pipe\n");
  11528.     ret = DosWrite((HFILE)pipe_handle,
  11529.                    (PVOID)outbuf,
  11530.                    (USHORT)buf_len,
  11531.                    (PUSHORT)&bytes_written);
  11532.     printf("   DosWrite rc = %d\n", ret);
  11533.  
  11534. /*-------------------------------------------------------*/
  11535.  
  11536.     DosSleep(60000L);
  11537.  
  11538.     printf("Disconnect named pipe\n");
  11539.     ret = DosDisConnectNmPipe((HPIPE)pipe_handle);
  11540.     printf("   DosDisConnectNmPipe rc = %d\n", ret);
  11541. /*-------------------------------------------------------*/
  11542.     printf("Close named pipe\n");
  11543.     ret = DosClose((HPIPE)pipe_handle);
  11544.     printf("   DosClose rc = %d\n", ret);
  11545.  
  11546. }
  11547.  
  11548.  
  11549. ΓòÉΓòÉΓòÉ 9.1.10. L12AP308.C ΓòÉΓòÉΓòÉ
  11550.  
  11551. This program accesses the named pipe on a server machine from a requester
  11552. machine.
  11553. /*************************************************************/
  11554. /*                                                           */
  11555. /*  FILE: L12AP308.C                                         */
  11556. /*                                                           */
  11557. /*  FUNCTION: Processes IBM OS/2 LAN                         */
  11558. /*                   NAMED PIPES API CALLS.                  */
  11559. /*     This file has to be run on a requester machine while  */
  11560. /*     L12AP307.C runs on a server    machine.               */
  11561. /*     Before running the program, make sure that LAN is     */
  11562. /*     started and users are logged on to the server and the */
  11563. /*     requester.                                            */
  11564. /*     Long filename is tested in this program.              */
  11565. /*                                                           */
  11566. /*  Named Pipe functions covered in this file:               */
  11567. /*      DosWaitNmPipe,                                       */
  11568. /*      DosWriteNmPipe,                                      */
  11569. /*      DosQFHandState,                                      */
  11570. /*      DosQHandType,                                        */
  11571. /*      DosDupHandle,                                        */
  11572. /*      DosBufReset,                                         */
  11573. /*      DosSetFHandState,                                    */
  11574. /*      DosQNmPipeInfo,                                      */
  11575. /*      DosReadAsync.                                        */
  11576. /*                                                           */
  11577. /*   Dos functions used in this file:                        */
  11578. /*      DosOpen,                                             */
  11579. /*      DosWrite,                                            */
  11580. /*      DosRead,                                             */
  11581. /*      DosSleep,                                            */
  11582. /*      DosSemset,                                           */
  11583. /*      DosSemClear,                                         */
  11584. /*      DosClose.                                            */
  11585. /*                                                           */
  11586. /*  Author: Tai C. Beal                                      */
  11587. /*  Last Edited: 6/7/89                                      */
  11588. /*                                                           */
  11589. /*************************************************************/
  11590. #define INCL_DOS#define INCL_DOSSIGNALS
  11591. #define INCL_DOSERRORS
  11592.  
  11593. /*----------------------------*/
  11594. /*  include files             */
  11595. /*----------------------------*/
  11596. #include <stdio.h>
  11597. #include <malloc.h>
  11598. #include <stdlib.h>
  11599. #include <string.h>
  11600. #include <process.h>
  11601. #include <os2.h>
  11602. #include <string.h>
  11603. #include <memory.h>
  11604.  
  11605. HSEM  pipe_async_ram_semaphore;     /*RAM semaphore */
  11606.  
  11607.  
  11608. main(argc,argv)
  11609.  
  11610. int      argc;
  11611. char     *argvΓòÆΓûá;
  11612.  
  11613. {
  11614.    char     temp1ΓòÆ100Γûá;
  11615.    char     *temp2, *temp3;
  11616.  
  11617.    PSZ      pipe_name;
  11618.    HFILE    pipe_handle;
  11619.    USHORT   ret, waitret;
  11620.  
  11621.    HFILE    open_pipe_handle; /* used by DosOpen to open pipe */
  11622.    USHORT   action_taken, file_size, file_attribute;
  11623.    USHORT   file_open_flag, file_open_mode;
  11624.    HFILE    dup_open_pipe_handle;
  11625.  
  11626.    PVOID    buf, outbuf;
  11627.    USHORT   buf_length, outbuf_len;
  11628.    USHORT   bytes_written, bytesout, bytes_read;
  11629.  
  11630.    USHORT   open_pipe_handle_state;
  11631.    USHORT   hand_type, flag_word;
  11632.    USHORT   file_handle_state;
  11633.  
  11634.    ULONG    timeout;
  11635.    USHORT   pipe_async_return_code;
  11636.  
  11637.    typedef struct  _NPINFO_DATA1 {
  11638.           /* PipeInfo data block (returned, level 1) */
  11639.        USHORT  npi_obuflen; /* length of outgoing I/O buffer */
  11640.        USHORT  npi_ibuflen; /* length of incoming I/O buffer */
  11641.        BYTE    npi_maxicnt; /* maximum number of instances */
  11642.        BYTE    npi_curicnt; /* current number of instances */
  11643.        BYTE    npi_namlen;  /* length of pipe name */
  11644.        CHAR    npi_name[256];  /* start of name */
  11645.    } NPINFO_DATA1;      /* npi_data1 */
  11646.  
  11647.    NPINFO_DATA1 pipe_info;          /* DosQNmPipeInfo */
  11648.  
  11649.  
  11650.    if (argc !=2 ) {
  11651.       printf("*** Input syntax:   ",
  11652.         "PROC41  Machinename  ***\n\n");
  11653.       printf("    Machinename is the name of",
  11654.         " the server on which the named pipe is created.\n");
  11655.       exit(1);
  11656.    }
  11657.  
  11658.    strcpy(temp1,"\\\\");
  11659.    temp2 = strcat(temp1,argv[1]);
  11660.    pipe_name = strcat(temp1,
  11661.     "\\pipe\\a-real-long-pipe-name.pipe4.");
  11662.  
  11663.  
  11664.     /* use DosOpen to open pipe */
  11665.     file_size = 0L;
  11666.     file_attribute = 0;
  11667.     file_open_flag = 1;    /* open existing pipe (file) only */
  11668.     file_open_mode = 0xB2; /* Deny none access */
  11669.             /* sharing mode = 2, access mode = 2 */
  11670.             /* inheritance = 1, private to the current process */
  11671.  
  11672.     printf("Open named pipe\n");
  11673.     ret = DosOpen((PSZ)pipe_name,
  11674.                   (PHFILE)&open_pipe_handle,
  11675.                   (PUSHORT)&action_taken,
  11676.                   (ULONG)file_size,
  11677.                   (USHORT)file_attribute,
  11678.                   (USHORT)file_open_flag,
  11679.                   (USHORT)file_open_mode,
  11680.                   0L);
  11681.     printf("   DosOpen rc = %d\n", ret);
  11682.  
  11683.     if (ret != 0) {
  11684.        timeout = 30000L;
  11685.        waitret = DosWaitNmPipe((PSZ)pipe_name,
  11686.                             (ULONG)timeout);
  11687.        if (waitret == 0) {
  11688.           ret = DosOpen((PSZ)pipe_name,
  11689.                         (PHFILE)&open_pipe_handle,
  11690.                         (PUSHORT)&action_taken,
  11691.                         (ULONG)file_size,
  11692.                         (USHORT)file_attribute,
  11693.                         (USHORT)file_open_flag,
  11694.                         (USHORT)file_open_mode,
  11695.                         0L);
  11696.           if (ret == 0)
  11697.              printf("   DosOpen rc = %d\n", ret);
  11698.           else {
  11699.              printf("   DosOpen rc = %d, ",
  11700.                 "failed to open named pipe.\n",ret);
  11701.              exit(1);
  11702.           }
  11703.        } /* endif (waitret == 0) */
  11704.        else {
  11705.           printf("   DosWaitNmPipe rc = %d,",
  11706.                 " failed to wait on named pipe.\n",
  11707.                   waitret);
  11708.           exit(1);
  11709.        }
  11710.     } /* end if */
  11711.  
  11712. /*------------------------------------------------------*/
  11713.  
  11714.     printf("Reset buffer\n");
  11715.     ret = DosBufReset((HFILE)open_pipe_handle);
  11716.     printf("   DosBufReset rc = %d\n", ret);
  11717. /*------------------------------------------------------*/
  11718.  
  11719.    printf("Query file handle state\n");
  11720.    ret = DosQFHandState((HFILE)open_pipe_handle,
  11721.                         (PUSHORT)&open_pipe_handle_state);
  11722.    printf("   open_pipe_handle_state = %d\n",
  11723.     open_pipe_handle_state);
  11724.    printf("   DosQFHandState rc = %d\n", ret);
  11725. /*-------------------------------------------------------*/
  11726.  
  11727.    printf("Query file handle type\n");
  11728.    ret = DosQHandType((HFILE)open_pipe_handle,
  11729.                      (PUSHORT)&hand_type,
  11730.                      (PUSHORT)&flag_word);
  11731.  
  11732.    printf("   DosQHandType rc = %d\n", ret);
  11733. /*--------------------------------------------------------*/
  11734.  
  11735.     buf = "write a string to the named pipe";
  11736.     buf_length = strlen(buf);
  11737.     printf("Write a string to named pipe\n");
  11738.     ret = DosWrite((HFILE)open_pipe_handle,
  11739.                         /* handle returned from DosOpen */
  11740.                    (PVOID)buf,
  11741.                    (USHORT)buf_length,
  11742.                    (PUSHORT)&bytes_written);
  11743.     printf("   DosWrite rc = %d\n", ret);
  11744. /*----------------------------------------------------------*/
  11745.  
  11746.     printf("Duplicate pipe handle\n");
  11747.     printf("      open_pipe_handle = %d\n",
  11748.         open_pipe_handle);
  11749.     ret = DosDupHandle((HFILE)open_pipe_handle,
  11750.                        (PHFILE)&dup_open_pipe_handle);
  11751.     printf("   DosDupHandle rc = %d\n", ret);
  11752.     printf("      dup_open_pipe_handle = %d\n",
  11753.             dup_open_pipe_handle);
  11754.  
  11755.     printf("Duplicate pipe handle\n");
  11756.     printf("      open_pipe_handle = %d\n",
  11757.             open_pipe_handle);
  11758.     ret = DosDupHandle((HFILE)open_pipe_handle,
  11759.                        (PHFILE)&dup_open_pipe_handle);
  11760.     printf("   DosDupHandle rc = %d\n", ret);
  11761.     printf("      dup_open_pipe_handle = %d\n",
  11762.             dup_open_pipe_handle);
  11763. /*------------------------------------------------------------*/
  11764.  
  11765.    printf("Set file handle state\n");
  11766.    open_pipe_handle_state = 0X4080;      /* set W=1, I=1 */
  11767.    ret = DosSetFHandState((HFILE)open_pipe_handle,
  11768.                          (USHORT)file_handle_state);
  11769.  
  11770.    printf("   DosSetFHandState rc = %d\n", ret);
  11771. /*----------------------------------------------------------*/
  11772.  
  11773.     buf = "write another string to the named pipe";
  11774.     buf_length = strlen(buf);
  11775.     printf("Write another string to the",
  11776.         " named pipe using duplicated handle\n");
  11777.     printf("      dup_open_pipe_handle = %d\n",
  11778.         dup_open_pipe_handle);
  11779.     ret = DosWrite((HFILE)dup_open_pipe_handle,
  11780.                    (PVOID)buf,
  11781.                    (USHORT)buf_length,
  11782.                    (PUSHORT)&bytes_written);
  11783.     printf("   DosWrite rc = %d\n", ret);
  11784.  
  11785. /*-----------------------------------------------------------*/
  11786.  
  11787.     /*  RamSemaphore must be set to 0L before it is used */
  11788.  
  11789.     printf("      Set Ram Semaphore\n");
  11790.     pipe_async_ram_semaphore = 0L;
  11791.     ret = DosSemSet((HSEM)&pipe_async_ram_semaphore);
  11792.     printf("      DosSemSet rc = %d\n", ret);
  11793.  
  11794.     printf("Read Asynchronously\n");
  11795.     buf = "read a string from the named pipe";
  11796.     buf_length = strlen(buf)+1;
  11797.     ret = DosReadAsync((HFILE)dup_open_pipe_handle,
  11798.                         /* input    */
  11799.                        (PULONG)&pipe_async_ram_semaphore,
  11800.                        /* input    */
  11801.                        (PUSHORT)&pipe_async_return_code,
  11802.                        /* output   */
  11803.                        (PVOID)buf,
  11804.                        /* output   */
  11805.                        (USHORT)buf_length,
  11806.                        /* input    */
  11807.                        (PUSHORT)&bytes_read);
  11808.                        /* output   */
  11809.     printf("   DosReadAsync rc = %d\n", ret);
  11810.  
  11811. /*----------------------------------------------------------*/
  11812.  
  11813.     printf("      Clear Ram Semaphore\n");
  11814.     timeout = 10000;
  11815.     ret = DosSemClear((HSEM)&pipe_async_ram_semaphore);
  11816.  
  11817.     printf("      DosSemClear rc = %d\n", ret);
  11818.  
  11819. /*-----------------------------------------------------------*/
  11820.    /* sleep so that TEST1 can write data to the named pipe */
  11821.    DosSleep(40000L);
  11822. /*-----------------------------------------------------------*/
  11823.  
  11824.     printf("Query named pipe info\n");
  11825.     ret = DosQNmPipeInfo((HFILE)pipe_handle,
  11826.                          (USHORT)1,
  11827.                          /* info level */
  11828.                          (PBYTE)&pipe_info,
  11829.                          (USHORT)sizeof(pipe_info));
  11830.     printf("   DosQNmPipeInfo rc = %d\n", ret);
  11831.     printf("   npi_obuflen = %d\n", pipe_info.npi_obuflen);
  11832.     printf("   npi_ibuflen = %d\n", pipe_info.npi_ibuflen);
  11833.     printf("   npi_maxicnt = %d\n", pipe_info.npi_maxicnt);
  11834.     printf("   current num icnt = %d\n", pipe_info.npi_curicnt);
  11835.     printf("   pipename len = %d\n", pipe_info.npi_namlen);
  11836.     printf("   start of name = %s\n", pipe_info.npi_name);
  11837.  
  11838. (CONTINUED) 
  11839.  
  11840.  
  11841. ΓòÉΓòÉΓòÉ 9.1.11. L12AP308.C (continued) ΓòÉΓòÉΓòÉ
  11842.  
  11843.  
  11844. /*-----------------------------------------------------------*/
  11845.  
  11846.    /* read data sent to named pipe by TEST1 DosWrite */
  11847.    buf = "read a string from the named pipe";
  11848.    buf_length = strlen(buf)+1;
  11849.    printf("Read Data from named pipe\n");
  11850.    ret = DosRead((HFILE)open_pipe_handle,
  11851.                  /* input    */
  11852.                  (PVOID)buf,
  11853.                  /* output   */
  11854.                  (USHORT)buf_length,
  11855.                  /* input    */
  11856.                  (PUSHORT)&bytes_read);
  11857.                  /* output   */
  11858.  
  11859.    printf("   DosRead rc = %d\n");
  11860.  
  11861. /*------------------------------------------------------*/
  11862.  
  11863.    printf("Close Pipe Handle\n");
  11864.    ret = DosClose(open_pipe_handle);
  11865.    printf("   DosClose rc = %d\n", ret);
  11866.  
  11867. }
  11868.  
  11869.  
  11870. ΓòÉΓòÉΓòÉ 10. Glossary ΓòÉΓòÉΓòÉ
  11871.  
  11872.   Contains  Definitions  of  terms  frequently  used  in  this  document . 
  11873.  
  11874.  
  11875. ΓòÉΓòÉΓòÉ 10.1. API ΓòÉΓòÉΓòÉ
  11876.  
  11877. API 
  11878.  
  11879. Application  Programming  Interface . 
  11880.  
  11881.  
  11882. ΓòÉΓòÉΓòÉ 10.2. APPC ΓòÉΓòÉΓòÉ
  11883.  
  11884. APPC 
  11885.  
  11886. Advanced  Program  to  Program  Communication .   A  version  of  the  SNA 
  11887. architecture .   OS / 2  Extended  Edition  supports  the  API  defined  by 
  11888. this  architecture . 
  11889.  
  11890.  
  11891. ΓòÉΓòÉΓòÉ 10.3. Communications Manager ΓòÉΓòÉΓòÉ
  11892.  
  11893. Communications  Manager 
  11894.  
  11895. The  portion  of  OS / 2  EE  which  provides  access  to  many  of  the 
  11896. communications  attachments  provided  for  the  PC . 
  11897.  
  11898.  
  11899. ΓòÉΓòÉΓòÉ 10.4. DLL ΓòÉΓòÉΓòÉ
  11900.  
  11901. DLL 
  11902.  
  11903. Dynamic  Link  Library .   This  provides  a  way  of  linking  to  code 
  11904. routines  at  run  time ,  allowing  the  routines  to  be  contained  in 
  11905. different  executable  files . 
  11906.  
  11907.  
  11908. ΓòÉΓòÉΓòÉ 10.5. DLR ΓòÉΓòÉΓòÉ
  11909.  
  11910. DLR 
  11911.  
  11912. Dynamic  Link  Routine .   A  code  routine  which  is  contained  in  a 
  11913. dynamic  link  library . 
  11914.  
  11915.  
  11916. ΓòÉΓòÉΓòÉ 10.6. EHLLAPI ΓòÉΓòÉΓòÉ
  11917.  
  11918. EHLLAPI 
  11919.  
  11920. Emulator  High  Level  Language  API .   This  API  allows  application 
  11921. programs  running  in  an  OS / 2  protect  mode  screen  group  to  access 
  11922. the  functions  provided  by  the  3270  Emulation  portion  of  the 
  11923. Communications  Manager . 
  11924.  
  11925.  
  11926. ΓòÉΓòÉΓòÉ 10.7. Error Level ΓòÉΓòÉΓòÉ
  11927.  
  11928. Error  Level 
  11929.  
  11930. Refers  to  the  return  code  which  is  passed  to  the  Operating  System 
  11931. when  a  program  ends .   The  error  level  can  be  tested  in  a  batch  ( 
  11932. command )  file  to  decide  how  to  proceed .   Normally ,  an  error  level 
  11933. of  zero  indicates  successful  completion  of  a  program ,  and  a  non - 
  11934. zero  error  level  means  that  an  error  has  occurred . 
  11935.  
  11936.  
  11937. ΓòÉΓòÉΓòÉ 10.8. ERRORLEVEL ΓòÉΓòÉΓòÉ
  11938.  
  11939. ERRORLEVEL 
  11940.  
  11941. See  Error  Level 
  11942.  
  11943.  
  11944. ΓòÉΓòÉΓòÉ 10.9. Extended Edition ΓòÉΓòÉΓòÉ
  11945.  
  11946. Extended  Edition 
  11947.  
  11948. See  OS / 2  Extended  Edition . 
  11949.  
  11950.  
  11951. ΓòÉΓòÉΓòÉ 10.10. IEEE ΓòÉΓòÉΓòÉ
  11952.  
  11953. IEEE 
  11954.  
  11955. Institute  of  Electrical  and  Electronic  Engineers .   An  international 
  11956. standards  organization .   They  produced  the  IEEE  802 . 2  standard  which 
  11957. is  supported  by  OS / 2  EE . 
  11958.  
  11959.  
  11960. ΓòÉΓòÉΓòÉ 10.11. LAN ΓòÉΓòÉΓòÉ
  11961.  
  11962. LAN 
  11963.  
  11964. Local  Area  Network . 
  11965.  
  11966.  
  11967. ΓòÉΓòÉΓòÉ 10.12. LU ΓòÉΓòÉΓòÉ
  11968.  
  11969. LU 
  11970.  
  11971. Logical  Unit  ( in  SNA  terminology ) .   A  set  of  system  resources  and 
  11972. software  which  allows  a  user  program  to  communicate  with  another  user 
  11973. program  in  an  SNA  network . 
  11974.  
  11975.  
  11976. ΓòÉΓòÉΓòÉ 10.13. Netbios ΓòÉΓòÉΓòÉ
  11977.  
  11978. Netbios 
  11979.  
  11980. A  programming  interface  which  allows  communication  on  a  LAN .   This 
  11981. interface  was  originally  defined  and  used  for  the  PC  Network  LAN . 
  11982. It  can  currently  be  used  to  access  either  a  PC  Network  ( baseband 
  11983. or  broadband ) ,  or  the  Token  Ring  network . 
  11984.  
  11985.  
  11986. ΓòÉΓòÉΓòÉ 10.14. OS/2 ΓòÉΓòÉΓòÉ
  11987.  
  11988. OS / 2 
  11989.  
  11990. Operating  System / 2 .  An  IBM  trademark  for  a  multitasking  operating 
  11991. system .   See  OS / 2  Extended  Edition . 
  11992.  
  11993.  
  11994. ΓòÉΓòÉΓòÉ 10.15. OS/2 EE ΓòÉΓòÉΓòÉ
  11995.  
  11996. OS / 2  EE 
  11997.  
  11998. See  OS / 2  Extended  Edition . 
  11999.  
  12000.  
  12001. ΓòÉΓòÉΓòÉ 10.16. OS/2 Extended Edition ΓòÉΓòÉΓòÉ
  12002.  
  12003. OS / 2  Extended  Edition 
  12004.  
  12005. Operating  System / 2  Extended  Edition .   An  IBM  product  which  contains 
  12006. the  base  OS / 2  operating  system ,  the  Communications  Manager ,  and 
  12007. the  Database  Manager . 
  12008.  
  12009.  
  12010. ΓòÉΓòÉΓòÉ 10.17. PC ΓòÉΓòÉΓòÉ
  12011.  
  12012. PC 
  12013.  
  12014. Personal  Computer .   Generally  refers  to  the  various  models  of  the 
  12015. IBM  PC ,  PC - XT ,  PC - AT ,  and  the  PS / 2  family  of  hardware . 
  12016.  
  12017.  
  12018. ΓòÉΓòÉΓòÉ 10.18. PS/2 ΓòÉΓòÉΓòÉ
  12019.  
  12020. PS / 2 
  12021.  
  12022. Personal  System / 2 .   The  family  of  PC  hardware  which  includes  the 
  12023. various  IBM  PS / 2  models  25 ,  30 ,  50 ,  60 ,  70 ,  and  80 . 
  12024.  
  12025.  
  12026. ΓòÉΓòÉΓòÉ 10.19. SAP ΓòÉΓòÉΓòÉ
  12027.  
  12028. SAP 
  12029.  
  12030. Service  Access  Point .   This  is  a  set  of  system  resources  which 
  12031. allows  a  program  to  access  the  LAN  facilities  and  communicate  with  a 
  12032. program  on  another  LAN  station .   It  is  similar  to  a  logical  unit , 
  12033. in  SNA  terms . 
  12034.  
  12035.  
  12036. ΓòÉΓòÉΓòÉ 10.20. SNA ΓòÉΓòÉΓòÉ
  12037.  
  12038. SNA 
  12039.  
  12040. Systems  Network  Architecture .   A  set  of  rules  which  defines  how  a 
  12041. group  of  computers  can  be  connected  to  allow  communication  between 
  12042. programs  running  on  different  computers  in  the  network .  OS / 2 
  12043. Communication  Manager  supports  APPC ,  which  is  described  by  SNA . 
  12044.  
  12045.  
  12046. ΓòÉΓòÉΓòÉ 10.21. Test Case ΓòÉΓòÉΓòÉ
  12047.  
  12048. Test  Case 
  12049.  
  12050. In  COMET ,  the  processing  of  an  input  file  by  COMET  is  considered 
  12051. to  be  a  single  test  case . 
  12052.  
  12053.  
  12054. ΓòÉΓòÉΓòÉ 10.22. 802.2 ΓòÉΓòÉΓòÉ
  12055.  
  12056. 802 . 2 
  12057.  
  12058. IEEE  802 . 2  Local  Area  Network  interface  definition .   An 
  12059. international  standard  describing  a  method  of  accessing  the 
  12060. communication  functions  of  a  local  area  network . 
  12061.  
  12062.  
  12063. ΓòÉΓòÉΓòÉ 10.23. :label ΓòÉΓòÉΓòÉ
  12064.  
  12065. : label 
  12066.  
  12067. Labels  marking  lines  in  a  COMET  input  file  have  this  format , 
  12068. beginning  with  a  colon ,  followed  immediately  by  the  label ,  just  as 
  12069. in  an  OS / 2  batch  file . 
  12070.  
  12071.  
  12072. ΓòÉΓòÉΓòÉ 10.24. @ ΓòÉΓòÉΓòÉ
  12073.  
  12074.  
  12075. The  " @ "  character  is  used  as  a  prefix  for  some  COMET  commands , 
  12076. such  as  @ define  and  @ include .   These  commands  are  not  executed  in 
  12077. the  same  way  that  other  commands  in  the  COMET  input  file  are ,  but 
  12078. allow  the  writer  of  an  input  file  some  flexibility  in  writing  a 
  12079. test  case . 
  12080.  
  12081.  
  12082. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12083.  
  12084. /* ------------------------------------------------------ */
  12085. Add_Define (Statement)
  12086. char *Statement;
  12087. {
  12088.   /* ---------------------------------------------------- */
  12089.   /* Format: DEFINE const_name const_value;               */
  12090.   /*   Assigns the constant 'const_name'                  */
  12091.   /*    to the value 'const_value'.                       */
  12092.   /* ---------------------------------------------------- */
  12093.   int a, pos, size;
  12094.   char *c_name, *q, *c_value;
  12095.   err_flag=FALSE;
  12096.   ptr1=buff1;          /* set addr. for param values */
  12097.   Num_Tokens=parse_line (Statement, tokenptr);
  12098.   if (err_flag==TRUE) return (BAD);
  12099.        /* fatal parsing error...break  */
  12100.   if (Num_Tokens > 3) {
  12101.       outputf (
  12102.            "Error; Line %d: Too many parameters",
  12103.            "supplied in DEFINE statement.",
  12104.            lnum);
  12105.       return (BAD);
  12106.   }
  12107.   if ((Num_Tokens==2 && q_ptr!=NULL) || Num_Tokens==3)
  12108.       c_name=tokenptr[1];        /* get name of the constant */
  12109.   else {
  12110.       outputf (
  12111.            "Error; Line %d: Too few parameters in DEFINE statement.",
  12112.            lnum);
  12113.       return (BAD);
  12114.   }
  12115.   pos=0;
  12116.   /* ------------------------------------------------------ */
  12117.   /* Check to see if the constant has been defined already. */
  12118.   /* ------------------------------------------------------ */
  12119.   for (a=0; a<MAX_DEFINED_CONSTANTS; a++) {
  12120.       if (strcmp (c_name, defined_constant[a].const_name)==0) {
  12121.            outputf ("Redefining constant %s.", c_name);
  12122.            free (defined_constant[a].const_value);
  12123.       /* free original value */
  12124.            pos=a;
  12125.       }
  12126.   }
  12127.   if (pos==0) {
  12128.     /* if constant has not been defined. */
  12129.       num_constants++;
  12130.       if (num_constants > MAX_DEFINED_CONSTANTS) {
  12131.            outputf ("Too many constants defined.\n");
  12132.            return (BAD);
  12133.       }
  12134.       pos=num_constants;
  12135.       strcpy (defined_constant[num_constants].const_name,
  12136.            c_name);
  12137.   }
  12138.   /* ----------------------------- */
  12139.   /* Get the value of the constant */
  12140.   /* ----------------------------- */
  12141.   if (q_ptr==NULL)
  12142.   /* if there is no quoted parameter    */
  12143.       c_value=tokenptr[2];
  12144.     /*   then the value is the 3rd token. */
  12145.   else
  12146.       c_value=q_ptr;
  12147.     /* otherwise it is a quoted value. */
  12148.   /* ------------------------------------------------------*/
  12149.   /* c_value should not be NULL here,                      */
  12150.   /*           but let's check just in case.               */
  12151.   /* ------------------------------------------------------*/
  12152.   if (c_value==NULL) {
  12153.       outputf ("**UNEXPECTED COMET ERROR.. Add_Define().",
  12154.            "c_value was NULL.");
  12155.       return (BAD);
  12156.   }
  12157.   size=strlen (c_value)+1;
  12158.   /* size of value (plus 1 for the NULL) */
  12159.   if (q_ptr!=NULL) size+=2;
  12160.   /* if this is a quoted value then add 2 for the quotes */
  12161.   q=(char *) malloc (size);
  12162.   /* get some space for the value */
  12163.   if (q==NULL) {
  12164.       outputf ("Error allocating memory for",
  12165.            "storing constant %s.", c_name);
  12166.       return (BAD);
  12167.   }
  12168.   if (q_ptr!=NULL)
  12169.       sprintf (q, "\"%s\"", c_value);
  12170.   else
  12171.       strcpy (q, c_value);
  12172.     /* store it */
  12173.   defined_constant[pos].const_value=q;
  12174.   /* save pointer to it */
  12175.   ifdebug (comet_debug, "Assigning constant: %s=%s.\n",
  12176.       c_name, q);
  12177.   return (GOOD);
  12178. }
  12179.  
  12180.  
  12181. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12182.  
  12183. /* ------------------------------------------------------- */
  12184. int compare_files (p, param_name)
  12185. char *p[];           /* array holding the parameter values */
  12186. char *param_name[];  /* parameter names                    */
  12187. {
  12188.       /* ----------------------
  12189.       1 -- file 1
  12190.       2 -- file 2
  12191.       ------------------------- */
  12192.       int a;
  12193.       ushort crc_val1, crc_val2;
  12194.            /* CRC values for file 1 and 2 */
  12195.       ushort data_len;
  12196.            /* number of bytes read */
  12197.       unsigned filehandle;
  12198.            /* DOS filehandle for save file */
  12199.       if (comet_debug)
  12200.            outputf ("in compare_files..\n");
  12201.       alloc_shared_buffer ();
  12202.            /* make sure we have a data buffer */
  12203.       if (comet_debug)
  12204.       {
  12205.            outputf ("dataptr=");
  12206.            if (dataptr==NULL)
  12207.                 outputf ("NULL!\n");
  12208.            else {
  12209.                 outputf ("%p\n", dataptr);
  12210.            }
  12211.       }
  12212.       /* read file1 into buffer (dataptr) */
  12213.       if (! GET_FILE (p[1], dataptr, &data_len))
  12214.            return (BAD);
  12215.       calc_crc ((char far *)dataptr, data_len,
  12216.            &crc_val1);
  12217.       if (comet_debug)
  12218.       {
  12219.            outputf ("Calculated CRC value for file1 --->",
  12220.                 "x'%04X'\n", crc_val1);
  12221.       }
  12222.       /* read file2 into buffer (dataptr) */
  12223.       if (! GET_FILE (p[2], dataptr, &data_len))
  12224.            return (BAD);
  12225.       calc_crc ((char far *)dataptr, data_len,
  12226.            &crc_val2);
  12227.       if (comet_debug)
  12228.       {
  12229.            outputf ("Calculated CRC value for file2 --->",
  12230.                 "x'%04X'\n", crc_val2);
  12231.       }
  12232.       if (crc_val1 != crc_val2) {
  12233.            strupr (p[1]);
  12234.            strupr (p[2]);
  12235.            sprintf (tempstr,
  12236.                 "Files do not match. Crc of %s=%04X.",
  12237.                 "Crc of %s=%04X", p[1], crc_val1, p[2],
  12238.                      crc_val2);
  12239.            stamp_msg (func_name, tempstr);
  12240.            return (BAD);
  12241.       }
  12242.       return (GOOD);
  12243. }
  12244. /* --------------------------------------------------------- */
  12245. /*-----------------------------------------------------------*/
  12246. calc_crc (buffptr, bufflen, cksum)
  12247.   char far  *buffptr;
  12248.   USHORT    bufflen;
  12249.   USHORT    *cksum;
  12250. {
  12251.   /*----------------------------------------------------
  12252.    This routine calculates the CRC checksum value for
  12253.    the first "bufflen" characters in the buffer pointed
  12254.     to by "buffptr".
  12255.   ------------------------------------------------------*/
  12256.   short   i;
  12257.   USHORT  j, crc, chval;
  12258.   BYTE   hexdigits[18];
  12259.   strcpy (hexdigits,"0123456789ABCDEF\0");
  12260.   crc = 0xFFFF;
  12261.   for (i=0; i<bufflen; i++, buffptr++)
  12262.   {
  12263.       chval = (USHORT)*buffptr;
  12264.       j = (crc ^ chval) & 0x000F;
  12265.       j = j + (j << 12) + (j << 7);
  12266.       crc = j ^ ((crc >> 4) & 0x0FFF);
  12267.       j = ((chval >> 4) ^ crc) & 0x000F;
  12268.       j = j + (j << 12) + (j << 7);
  12269.       crc = j ^ ((crc >> 4) & 0x0FFF);
  12270.   }
  12271.   *cksum = crc;
  12272. }
  12273. /* ------------------------------------------------------ */
  12274.  
  12275.  
  12276. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12277.  
  12278. /*--------------------------------------------------------------------**
  12279.    The OS2_SHELL procedure.  The calling parm is the command line
  12280.    string.
  12281. **--------------------------------------------------------------------*/
  12282. int shellSpawn(char * cmdline)
  12283. {
  12284.  USHORT rtn;
  12285.  HAB hab;
  12286.  HFILE  hRd, hWrt;
  12287.  static HFILE hStdOut = STDOUT;
  12288.  static HFILE hStdErr = STDERR;
  12289.  static char *argv[20];
  12290.  char *p, *end;
  12291.  int i;
  12292.  USHORT bytesRead;
  12293.  PBYTE pBuf;
  12294.  int iChildProcess;
  12295.  int hold;
  12296.    /* if we received no parameters to give to the command interpreter
  12297.       we do nothing. */
  12298.    if (*cmdline == '\0')
  12299.      return(0);
  12300.    /* make an unmamed pipe for the child process' STDOUT and STDERR,
  12301.       and hook STDOUT and STDERR to the write side of the pipe.  We
  12302.       must close the original write end handle so that when the
  12303.       spawned process closes stdout and stderr (when it ends) our
  12304.       reads will return correctly with 0 bytes read. */
  12305.    rtn = DosMakePipe(&hRd, &hWrt, 0);
  12306.    rtn = DosDupHandle(hWrt, &hStdOut);
  12307.    rtn = DosDupHandle(hWrt, &hStdErr);
  12308.    rtn = DosClose(hWrt);
  12309.    /* fix up the argv list from the cmdline.  The first two parameters
  12310.       must be <c:\os2\cmd.exe /c> in order to invoke the command
  12311.       interpreter in the spawned process. */
  12312.    argv[0] = "C:\\OS2\\CMD.EXE";
  12313.    argv[1] = "/c";
  12314.    i = 2;
  12315.    end = cmdline + strlen(cmdline);
  12316.    for (p = cmdline; p < end; p++) {
  12317.       /* If this is a non-space, and either the previous char is a space
  12318.          or null or this is the start of the string, we mark this as the
  12319.          start of the next parameter.
  12320.          If this is a space, the last char was a non-space, and this is
  12321.          not the start of the string, it is the end of the last parameter.
  12322.          We terminate the last parameter string with a null. */
  12323.       if (*p != ' ') {
  12324.          if ((*(p-1) == ' ') || (*(p-1) == '\0') || (p == cmdline))
  12325.            argv[i++] = p;
  12326.       } else { /* *p == ' ' */
  12327.          if ((*(p-1) != ' ') && (p != cmdline))
  12328.             *p = '\0';
  12329.       } /* end if/else */
  12330.    } /* end for */
  12331.    argv[i] = NULL;
  12332.    /* spawn off the background process with given parameters and
  12333.       STDOUT and STDERR pointed to our unnamed pipe. */
  12334.    hold = 0;
  12335.    iChildProcess = spawnve(P_NOWAIT, argv[0], argv, mainEnvp);
  12336.    if (iChildProcess == -1)
  12337.      hold = errno;
  12338.    /* DosDupHandle the current stdout and stderr, currently hooked
  12339.       to the pipe write handle, back to the original stdout and
  12340.       stderr.  This has the effect of closing our last handles on
  12341.       the write end of the pipe. */
  12342.    rtn = DosDupHandle(dupStdOut, &hStdOut);
  12343.    rtn = DosDupHandle(dupStdErr, &hStdErr);
  12344.    /* if the spawn didn't work, blow this off and just return the error */
  12345.    if (hold)
  12346.      return(hold);
  12347.    /* call the double buffer read routine for the output from the spawned
  12348.       process so we can outputf it. */
  12349.    pBuf = NULL;
  12350.    while (TRUE) {
  12351.       bytesRead = nextBuf(hRd, &pBuf);
  12352.       if (bytesRead == 0)
  12353.         break;
  12354.       *(pBuf + bytesRead) = '\0';
  12355.       outputf("%s", pBuf);
  12356.    }
  12357.    /* finally close the read side of the pipe. */
  12358.    rtn = DosClose(hRd);
  12359.    /* do a cwait for the spawned process to nuke zombie process */
  12360.    cwait(NULL, iChildProcess, WAIT_CHILD);
  12361.    return(0);
  12362. }
  12363.  
  12364.  
  12365. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12366.  
  12367.   os2_rc = DosBeep (frequency, duration);
  12368.   if (os2_rc != 0) {
  12369.        os2_error = 1;   /* set error flag */
  12370.        ret_os2   = BAD;
  12371.   }
  12372.  
  12373.  
  12374. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12375.  
  12376. /*-------------------------------------------------------------*/
  12377. DOS_DATE (mon, day, year, dow)
  12378. short *mon, *day, *year, *dow;
  12379. {
  12380.     DATETIME dt;
  12381.     DosGetDateTime ((PDATETIME)&dt);
  12382.     *mon  = dt.month;
  12383.     *day  = dt.day;
  12384.     *year = dt.year;
  12385.     *dow  = dt.weekday;
  12386. }
  12387.  
  12388.  
  12389. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12390.  
  12391. /*--------------------------------------------------------------*/
  12392. DOS_TIME (hrs, mins, secs, hunds)
  12393. short *hrs, *mins, *secs, *hunds;
  12394. {
  12395.     DATETIME        dt;
  12396.     DosGetDateTime ((PDATETIME)&dt);
  12397.     *hrs = dt.hours;
  12398.     *mins = dt.minutes;
  12399.     *secs = dt.seconds;
  12400.     *hunds = dt.hundredths;
  12401. }
  12402.  
  12403.  
  12404. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12405.  
  12406. /*------------------------------------------------------------*/
  12407. DOSSLEEP ( secs, mins )
  12408. char *secs, *mins;
  12409. {
  12410.     sleep( secs, mins );
  12411. }
  12412. /*-------------------------------------------------------------*/
  12413. sleep (p1, p2)
  12414. char *p1;                /* parameter one, seconds */
  12415. char *p2;                /* parameter two, minutes */
  12416. {
  12417.     /* ------------------
  12418.     1 - Seconds
  12419.     2 - Minutes
  12420.     --------------------- */
  12421.     char prt_msg[120];
  12422.     long secs, mins;
  12423.     long millsecs;
  12424.     secs=(long)atoi (p1);
  12425.     mins=(long)atoi (p2);
  12426.     millsecs=mins*(long)60000 + secs*(long)1000;
  12427.     if (os2_debug)
  12428.     {
  12429.            outputf ("Sleeping for %ld milliseconds...",
  12430.                 millsecs);
  12431.     }
  12432.     DosSleep (millsecs);
  12433.     return (GOOD);
  12434. }
  12435.  
  12436.  
  12437. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12438.  
  12439. THIS IS A NOTHING FOOTNOTE; TO BE REPLACE WITH REAL SOURCE
  12440.  
  12441.  
  12442. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12443.  
  12444.         sqlealtd( DatabaseName, OldPassword, NewPassword,
  12445.             &sqlca );
  12446.  
  12447. where:
  12448.         CHAR *DatabaseName;
  12449.         CHAR *OldPassword;
  12450.         CHAR *NewPassword;
  12451.         struct sqlca sqlca;
  12452.  
  12453.  
  12454. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12455.  
  12456.           sqlecatd( DatabaseName, Alias, Remote, NodeName,
  12457.             Alternate, Comment, CodePage, &sqlca );
  12458. where:
  12459.         CHAR *DatabaseName;
  12460.         CHAR *Alias;
  12461.         UCHAR Remote; /* 0=local, 1=remote */
  12462.         CHAR *NodeName;
  12463.         UCHAR Alternate; /* when Remote=0, will be 1 for */
  12464.                    /* alternate adpt, 0 for primary adpt */
  12465.         CHAR *Comment;
  12466.         SHORT CodePage;
  12467.         /* codepage for Comment, 0=use default codepage*/
  12468.         struct sqlca sqlca;
  12469.  
  12470.  
  12471. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12472.  
  12473.             sqlecatn( NodeName, LocalLU, RemoteLU,
  12474.                 Mode, Comment, CodePage, &sqlca );
  12475. where:
  12476.         CHAR *NodeName;
  12477.         CHAR *LocalLU; /* Local LU name */
  12478.         CHAR *RemoteLU;/* Remote LU name */
  12479.         CHAR *Mode; /* Communications Mode */
  12480.         CHAR *Comment;
  12481.         SHORT CodePage; /* CodePage for Comment */
  12482.                     /* 0=default CodePage */
  12483.         struct sqlca sqlca;
  12484.  
  12485.  
  12486. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12487.  
  12488.             sqlecred( DatabaseName, Drive, Comment,
  12489.                 CodePage, &sqlca );
  12490. where:
  12491.         CHAR *DatabaseName;
  12492.         UCHAR Drive; /* 'C', 'D', etc. */
  12493.         CHAR *Comment;
  12494.         SHORT CodePage; /* CodePage of Comment */
  12495.         struct sqlca sqlca;
  12496.  
  12497.  
  12498. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12499.  
  12500.     sqledrpd( DatabaseName, &sqlca );
  12501. where:
  12502.         CHAR *DatabaseName;
  12503.         struct sqlca sqlca;
  12504.  
  12505.  
  12506. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12507.  
  12508.         sqluexp( DatabaseName, DataFile, &OutputCol,
  12509.             &SelectString, FileType, &FileMod,
  12510.             MsgFile, CallAction, &sqlca );
  12511. where:
  12512.         CHAR *DatabaseName;
  12513.         CHAR *DataFile;   /* Name to Export Data to */
  12514.         struct sqldcol OutputCol;
  12515.         /* Column Names for output file */
  12516.         struct sqlchar SelectString;
  12517.         /* Valid Dynamic SELECT statement */
  12518.         CHAR *FileType;
  12519.         /* "DEL", "WSF", "IXF" */
  12520.         struct sqlchar FileMod;
  12521.         /* addition info for FileType */
  12522.         CHAR *MsgFile;
  12523.         /* file to put output msgs into */
  12524.         SHORT CallAction;
  12525.         /* 0=Initial Call, 1, Continue Processning */
  12526.         /* 2=Terminate Processing */
  12527.         struct sqlca sqlca;
  12528.  
  12529.  
  12530. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12531.  
  12532.         sqluimp( DatabaseName, DataFile, &ImportColsInfo,
  12533.             &ImportCols, FileType, &FileMod,
  12534.             MsgFile, CallerAction, &sqlca );
  12535. where:
  12536.             CHAR *DatabaseName;
  12537.             CHAR *DataFile; /* Import File */
  12538.             struct sqldcol ImportColsInfo;
  12539.             /* info about cols being selected for import */
  12540.             struct sqlchar ImportCols;
  12541.             /* Cols to import data into */
  12542.             CHAR *FileType;
  12543.             /* "DEL","ASC","WSF","IXF" */
  12544.             struct sqlchar FileMod;
  12545.             /* Addtl info about FileType */
  12546.             CHAR *MsgFile;
  12547.             /* File for Import msgs */
  12548.             SHORT CallerAction;
  12549.             /* 0=Initial Call */
  12550.             /* 1=Continue Processing */
  12551.             /* 2=Terminate Processing */
  12552.             struct sqlca sqlca;
  12553.  
  12554.  
  12555. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12556.  
  12557.         sqludres(DatabaseName, Drive,
  12558.             RestoreDrive, CallerAction, &sqlca);
  12559. where:
  12560.         CHAR *DatabaseName;
  12561.         UCHAR Drive; /* 'A','B', etc */
  12562.             /* where database backup files are */
  12563.         UCHAR RestoreDrive;
  12564.             /* drive to restore files to */
  12565.         SHORT CallerAction;
  12566.             /* 0=initial call */
  12567.             /* 1=Continue processing */
  12568.             /* 2=Terminate processing */
  12569.         struct sqlca sqlca;
  12570.  
  12571.  
  12572. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12573.  
  12574.         sqlestar();
  12575.  
  12576.  
  12577. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12578.  
  12579.         sqlestrd(DatabaseName, Use, &sqlca );
  12580. where:
  12581.         CHAR *DatabaseName;
  12582.         UCHAR Use; /* 'S'=shared, 'X'=exclusive */
  12583.         struct sqlca sqlca;
  12584.  
  12585.  
  12586. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12587.  
  12588.             sqlestop(&sqlca);
  12589. where:
  12590.             struct sqlca sqlca;
  12591.  
  12592.  
  12593. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12594.  
  12595.             sqlestpd(&sqlca);
  12596.     where:
  12597.             struct sqlca sqlca;
  12598.  
  12599.  
  12600. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12601.  
  12602.             sqleuncd( DatabaseName, &sqlca );
  12603.     where:
  12604.             CHAR *DatabaseName;
  12605.             struct sqlca sqlca;
  12606.  
  12607.  
  12608. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12609.  
  12610.         sqleuncn(NodeName, &sqlca );
  12611.     where:
  12612.         CHAR *NodeName;
  12613.         struct sqlca sqlca;
  12614.  
  12615.  
  12616. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12617.  
  12618.         EXEC SQL ALTER TABLE employee
  12619.             ADD startdate DATE;
  12620.  
  12621.  
  12622. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12623.  
  12624.             EXEC SQL
  12625.                 CREATE INDEX ndxsalary
  12626.                 ON employee (salary );
  12627.  
  12628.  
  12629. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12630.  
  12631.         EXEC SQL
  12632.             CREATE TABLE employee
  12633.             (name       VARCHAR(25) NOT NULL,
  12634.              salary     INT,
  12635.              dept       CHAR(3),
  12636.              socsec     INT,
  12637.              PRIMARY KEY (socsec));
  12638.  
  12639.  
  12640. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12641.  
  12642.             EXEC SQL
  12643.                 CREATE VIEW Sales ( name, socsec )
  12644.                 AS SELECT name, socsec
  12645.                 FROM employee WHERE dept = 'SAL';
  12646.  
  12647.  
  12648. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12649.  
  12650.             EXEC SQL
  12651.                 DROP INDEX ndxsalary;
  12652.  
  12653.  
  12654. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12655.  
  12656.             EXEC SQL DROP TABLE employee;
  12657.  
  12658.  
  12659. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12660.  
  12661.             EXEC SQL DROP VIEW sales;
  12662.  
  12663.  
  12664. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12665.  
  12666.             EXEC SQL COMMIT;
  12667.  
  12668.  
  12669. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12670.  
  12671.             EXEC SQL DELETE FROM employee
  12672.                 WHERE dept='SAL';
  12673.  
  12674.  
  12675. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12676.  
  12677.             EXEC SQL
  12678.                 INSERT INTO employee ( name, socsec )
  12679.                 VALUES ('SMITH',452486749);
  12680.  
  12681.  
  12682. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12683.  
  12684.             EXEC SQL ROLLBACK;
  12685.  
  12686.  
  12687. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12688.  
  12689.             EXEC SQL
  12690.                 SELECT name, salary
  12691.                 INTO :EmployeeName, :Salary
  12692.                 FROM employee
  12693.                 WHERE dept = :DeptName ;
  12694.  
  12695.  
  12696. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12697.  
  12698.             EXEC SQL
  12699.                 UPDATE employee
  12700.                     SET startdate=DATE
  12701.                     WHERE dept='SAL';
  12702.  
  12703.  
  12704. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12705.  
  12706. #define INCL_BASE
  12707. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg       */
  12708. #include <os2.h>
  12709. #include <stdio.h>
  12710. #include <stdlib.h>
  12711. #include <dsqcommc.h>
  12712. /* structure is defined in dsqcommc.h */
  12713. /*
  12714. extern int cdecl dsqcice (
  12715.           struct dsqcomm *,       dsqcomm- communicatn area
  12716.           signed long *,          command length
  12717.           char *,                 command
  12718.           signed long *,          number of variables
  12719.           signed long *,          name lengths
  12720.           char        *,          variable names
  12721.           signed long *,          variable value lengths
  12722.           void        *,          variable values
  12723.           char        *);         type  = {FINT || CHAR}
  12724. */
  12725. /* the four commads that we'll use after START*/
  12726. static char *ListQuery  =
  12727.     "LIST QUERIES";
  12728. static char *Message  =
  12729.     "MESSAGE (TEXT='Create Query: INFO' DISPLAY=IMMED)";
  12730. static char *RunQuery  =
  12731.     "RUN QUERY INFO";
  12732. static char *Exit =
  12733.     "EXIT";
  12734.  
  12735. void DisplayError(struct dsqcomm *, CHAR *);
  12736. int main()
  12737. {
  12738.   CHAR Command[45];
  12739.   struct dsqcomm CommunicationArea;
  12740.   ULONG CommandLength;
  12741.   USHORT rc;
  12742.   SEL Selector1;
  12743.   CHAR *VariableValues, *StartPtr;
  12744.   CHAR *VariableNames;
  12745.   LONG NumberParms;
  12746.   LONG *NameLengths, *StartLong;
  12747.   LONG *ValuesLengths;
  12748.  
  12749.   rc = DosAllocSeg(100, &Selector1, SEG_NONSHARED);
  12750.   VariableValues = (CHAR *)MAKEP(Selector1, 0 );
  12751.   ValuesLengths = (LONG *)MAKEP(Selector1, 25 );
  12752.  
  12753.   /* save start of memory */
  12754.   StartLong = ValuesLengths;
  12755.   StartPtr = VariableValues;
  12756.   /* put in first variable */
  12757.   strcpy(VariableValues, "INTERACTIVE");
  12758.   /* now insert sizeof first variable */
  12759.   /* in ValueLengths array */
  12760.   *ValuesLengths = strlen(VariableValues) + 1;
  12761.   /* move ptr to end of first variable + NULL */
  12762.   StartPtr += (strlen(VariableValues) + 1);
  12763.   /* put in second variable */
  12764.   strcpy(StartPtr,   "SAMPLE     ");
  12765.   /* incrment the ValueLengths array */
  12766.   StartLong++;
  12767.   /* and put in sizeof second variable */
  12768.   *StartLong = strlen(StartPtr);
  12769.  
  12770.   /* do same as above for variable names */
  12771.   NameLengths = (LONG *)MAKEP(Selector1, 50);
  12772.   StartLong = NameLengths;
  12773.   VariableNames = (CHAR *)MAKEP(Selector1, 75 );
  12774.   StartPtr = VariableNames;
  12775.   strcpy(VariableNames, "DSQSMODE");
  12776.   *NameLengths = strlen(VariableNames) + 1;
  12777.   StartPtr += (strlen(VariableNames) + 1);
  12778.   strcpy(StartPtr, "DSQSDBNM");
  12779.   StartLong++;
  12780.   *StartLong = strlen(StartPtr);
  12781.  
  12782.   /* set up other parameters for START call*/
  12783.   strcpy(Command, "START");
  12784.   NumberParms = 2; /* MODE and DATABASE name */
  12785.   CommandLength = strlen(Command);
  12786.   dsqcice(&CommunicationArea, &CommandLength, Command,
  12787.           &NumberParms,
  12788.           NameLengths, VariableNames, ValuesLengths,
  12789.           VariableValues, DSQ_VARIABLE_CHAR);
  12790.   if (CommunicationArea.dsq_return_code)
  12791.     DisplayError(&CommunicationArea, Command );
  12792.  
  12793.   CommandLength = strlen(Message);
  12794.   dsqcic(&CommunicationArea, &CommandLength, Message);
  12795.   if (CommunicationArea.dsq_return_code)
  12796.     DisplayError(&CommunicationArea, "MESSAGE" );
  12797.  
  12798.   CommandLength = strlen(ListQuery);
  12799.   dsqcic(&CommunicationArea, &CommandLength, ListQuery);
  12800.   if (CommunicationArea.dsq_return_code)
  12801.     DisplayError(&CommunicationArea, "EDIT QUERY");
  12802.  
  12803.   CommandLength = strlen(RunQuery);
  12804.   dsqcic(&CommunicationArea, &CommandLength, RunQuery);
  12805.   if (CommunicationArea.dsq_return_code)
  12806.     DisplayError(&CommunicationArea, "RUN QUERY");
  12807.  
  12808.   CommandLength = strlen(Exit);
  12809.   dsqcic(&CommunicationArea, &CommandLength, Exit);
  12810.  
  12811.   exit(0);
  12812.   }
  12813.  
  12814. void DisplayError(CommunicationArea, FunctionName)
  12815. struct dsqcomm *CommunicationArea;
  12816. CHAR *FunctionName;
  12817. {
  12818.  
  12819.     printf("\n%s failed", FunctionName);
  12820.     printf("\nReturn Code = %d",
  12821.         CommunicationArea->dsq_return_code);
  12822.     printf("\nReason Code = %d",
  12823.         CommunicationArea->dsq_reason_code);
  12824.     printf("\nError ID = %d",
  12825.         CommunicationArea->dsq_error_id);
  12826.     if (CommunicationArea->dsq_message_id[0])
  12827.         printf("\nMessage ID = %s",
  12828.         CommunicationArea->dsq_message_id);
  12829.     if (CommunicationArea->dsq_q_message_id[0])
  12830.         printf("\nQueryMessage ID = %s",
  12831.         CommunicationArea->dsq_q_message_id);
  12832.     if (CommunicationArea->dsq_start_parm_error[0])
  12833.         printf("\nStartParameterError = %s",
  12834.         CommunicationArea->dsq_start_parm_error);
  12835. }
  12836.  
  12837.  
  12838. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12839.  
  12840. #include <ACDI_C.H>
  12841. #include <STDIO.H>
  12842. #include <STDDEF.H>
  12843. #include <STRING.H>
  12844. #include <DOS.H>
  12845. #include <DOSCALLS.H>
  12846. #include <SUBCALLS.H>
  12847. union {
  12848.    struct comopen_cb open_cb;
  12849.    struct comdefinput_cb definputbuff_cb;
  12850.    struct comdefoutputbuff_cb defoutputbuff_cb;
  12851.    struct comsetbitrate_cb setbitrate_cb;
  12852.    struct comsetlinectrl_cb setlinectrl_cb;
  12853.    struct comconnect_cb connect_cb;
  12854.    struct comsettimeouts_cb settimeouts_cb;
  12855.    struct comreadcharstring_cb readcharstring_cb;
  12856.    struct comdisconnect_cb disconnect_cb;
  12857.    struct comclose_cb close_cb;
  12858. }vcb;
  12859. void
  12860. comclose(handle)
  12861. /* This subroutine will issue com_close
  12862.     to close the communication device.  */
  12863. unsigned short handle;   /* device handle  */
  12864. {
  12865.   memset(&vcb,(int)'\0',sizeof(vcb));
  12866.     /* zero out the control block   */
  12867.   vcb.close_cb.common.com_dev_handle = handle;
  12868.   vcb.close_cb.common.function_code = COM_CLOSE;
  12869.                /* fill in control block with   */
  12870.                /* function code and parameters */
  12871.   ACDI(vcbptr);  /* issue the verb               */
  12872.   if (vcb.close_cb.common.return_code != AA_OK)
  12873.         printf("Error in ComClose Return Code = %d",
  12874.             vcb.close_cb.common.return_code);
  12875. }
  12876.  
  12877.  
  12878. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12879.  
  12880. #include <ACDI_C.H>
  12881. #include <STDIO.H>
  12882. #include <STDDEF.H>
  12883. #include <STRING.H>
  12884. #include <DOS.H>
  12885. #include <DOSCALLS.H>
  12886. #include <SUBCALLS.H>
  12887.  
  12888.  
  12889. void
  12890. comconnect(handle)
  12891. /* This subroutine will issue com_connect to establish
  12892.         connection   */
  12893. unsigned short handle;   /* device handle                */
  12894.  
  12895. {
  12896.   memset(&vcb,(int)'\0',sizeof(vcb));
  12897.     /* zero out the control block   */
  12898.  
  12899.   vcb.connect_cb.common.com_dev_handle = handle;
  12900.   /* returned from ComOpen */
  12901.   vcb.connect_cb.common.function_code = COM_CONNECT;
  12902.   vcb.connect_cb.connect_type = AA_CONNECT_TYPE_4;
  12903.   vcb.connect_cb.connect_timeout_1 = 0;
  12904.   vcb.connect_cb.connect_timeout_2 = 30;
  12905.   /* fill in control block with   */
  12906.   /* function code and parameters */
  12907.   ACDI(vcbptr);   /* issue the verb               */
  12908.  
  12909.   if (vcb.connect_cb.common.return_code != AA_OK)
  12910.     printf("Error in ComConnect return code = %d",
  12911.         vcb.connect_cb.common.return_code );
  12912.        /* any errors                   */
  12913. }
  12914.  
  12915.  
  12916. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12917.  
  12918. #include <ACDI_C.H>
  12919. #include <STDIO.H>
  12920. #include <STDDEF.H>
  12921. #include <STRING.H>
  12922. #include <DOS.H>
  12923. #include <DOSCALLS.H>
  12924. #include <SUBCALLS.H>
  12925. union {
  12926.    struct comopen_cb open_cb;
  12927.    struct comdefinput_cb definputbuff_cb;
  12928.    struct comdefoutputbuff_cb defoutputbuff_cb;
  12929.    struct comsetbitrate_cb setbitrate_cb;
  12930.    struct comsetlinectrl_cb setlinectrl_cb;
  12931.    struct comconnect_cb connect_cb;
  12932.    struct comsettimeouts_cb settimeouts_cb;
  12933.    struct comreadcharstring_cb readcharstring_cb;
  12934.    struct comdisconnect_cb disconnect_cb;
  12935.    struct comclose_cb close_cb;
  12936. }vcb;
  12937. void
  12938. comdisconnect(handle)
  12939. /* This subroutine will issue                         */
  12940. /* com_disconnect to break the connection.            */
  12941. unsigned short handle;   /* device handle             */
  12942. {
  12943.   memset(&vcb,(int)'\0',sizeof(vcb));
  12944.         /* zero out the control block   */
  12945.   vcb.disconnect_cb.common.com_dev_handle = handle;
  12946.   vcb.disconnect_cb.common.function_code = COM_DISCONNECT;
  12947.         /* fill in control block with   */
  12948.         /* function code and parameters */
  12949.         /* issue the verb               */
  12950.   ACDI(vcbptr);
  12951.   if (vcb.disconnect_cb.common.return_code != AA_OK)
  12952.         printf("Error in ComDisconnect Return Code = %d",
  12953.                 vcb.disconnect_cb.common.return_code);
  12954. }
  12955.  
  12956.  
  12957. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  12958.  
  12959. #include <ACDI_C.H>
  12960. #include <STDIO.H>
  12961. #include <STDDEF.H>
  12962. #include <STRING.H>
  12963. #include <DOS.H>
  12964. #include <DOSCALLS.H>
  12965. #include <SUBCALLS.H>
  12966. union {
  12967.    struct comopen_cb open_cb;
  12968.    struct comdefinput_cb definputbuff_cb;
  12969.    struct comdefoutputbuff_cb defoutputbuff_cb;
  12970.    struct comsetbitrate_cb setbitrate_cb;
  12971.    struct comsetlinectrl_cb setlinectrl_cb;
  12972.    struct comconnect_cb connect_cb;
  12973.    struct comsettimeouts_cb settimeouts_cb;
  12974.    struct comreadcharstring_cb readcharstring_cb;
  12975.    struct comdisconnect_cb disconnect_cb;
  12976.    struct comclose_cb close_cb;
  12977. }vcb;
  12978. void
  12979. comopen()
  12980. /* This subroutine will issue com_open verb to open the */
  12981. /* specified com. device for communication   */
  12982. {
  12983.   memset(&vcb,(int)'\0',sizeof(vcb));
  12984.         /* zero out the control block   */
  12985.   vcb.open_cb.common.function_code = COM_OPEN;
  12986.         /* verb - com_open              */
  12987.   strcpy(vcb.open_cb.com_dev_name,"COM1\0");
  12988.         /* copy communication device    */
  12989.         /* name into the control block  */
  12990.         /* issue the acdi verb          */
  12991.   ACDI(vcbptr);
  12992.   handle = vcb.open_cb.common.com_dev_handle;
  12993.         /* copy device handle returned  */
  12994.         /* by acdi to use in other verbs*/
  12995.   if (vcb.open_cb.common.return_code != AA_OK)
  12996.         /* check if return code is zero */
  12997.     printf("Error in ComOpen Return Code = %d",
  12998.         vcb.open_cb.common.return_code);
  12999. }
  13000.  
  13001.  
  13002. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13003.  
  13004. #include <ACDI_C.H>
  13005. #include <STDIO.H>
  13006. #include <STDDEF.H>
  13007. #include <STRING.H>
  13008. #include <DOS.H>
  13009. #include <DOSCALLS.H>
  13010. #include <SUBCALLS.H>
  13011. union {
  13012.    struct comopen_cb open_cb;
  13013.    struct comdefinput_cb definputbuff_cb;
  13014.    struct comdefoutputbuff_cb defoutputbuff_cb;
  13015.    struct comsetbitrate_cb setbitrate_cb;
  13016.    struct comsetlinectrl_cb setlinectrl_cb;
  13017.    struct comconnect_cb connect_cb;
  13018.    struct comsettimeouts_cb settimeouts_cb;
  13019.    struct comreadcharstring_cb readcharstring_cb;
  13020.    struct comdisconnect_cb disconnect_cb;
  13021.    struct comclose_cb close_cb;
  13022. }vcb;
  13023. void
  13024. comretbitrate(handle)
  13025. /* This subroutine will issue                    */
  13026. /* com_ret_bit_rate verb to return the line      */
  13027. /* data rates (bps).                             */
  13028. /* Uses the same structure as SetBitRate         */
  13029. unsigned short handle;
  13030.         /* device handle                */
  13031. {
  13032.   memset(&vcb,(int)'\0',sizeof(vcb));
  13033.     /* zero out the control block   */
  13034.   vcb.setbitrate_cb.common.com_dev_handle = handle;
  13035.   vcb.setbitrate_cb.common.function_code = COM_RET_BIT_RATE;
  13036.      /* fill in control block with   */
  13037.      /* function code and parameters */
  13038.      /* issue the verb               */
  13039.   ACDI(vcbptr);
  13040.   if (vcb.setbitrate_cb.common.return_code != AA_OK)
  13041.         printf("Error in ComRetBitRate Return Code = %d",
  13042.             vcb.setbitrate_cb.common.return_code);
  13043.   else {
  13044.         printf(
  13045.   "BitRateRcv = %d", vcb.setbitrate_cb.bit_rate_rcv);
  13046.         printf(
  13047.   "\nBitRateSend = %d", vcb.setbitrate_cb.bit_rate_send);
  13048.   }
  13049. }
  13050.  
  13051.  
  13052. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13053.  
  13054. #include <ACDI_C.H>
  13055. #include <STDIO.H>
  13056. #include <STDDEF.H>
  13057. #include <STRING.H>
  13058. #include <DOS.H>
  13059. #include <DOSCALLS.H>
  13060. #include <SUBCALLS.H>
  13061. union {
  13062.    struct comopen_cb open_cb;
  13063.    struct comdefinput_cb definputbuff_cb;
  13064.    struct comdefoutputbuff_cb defoutputbuff_cb;
  13065.    struct comsetbitrate_cb setbitrate_cb;
  13066.    struct comsetlinectrl_cb setlinectrl_cb;
  13067.    struct comconnect_cb connect_cb;
  13068.    struct comsettimeouts_cb settimeouts_cb;
  13069.    struct comreadcharstring_cb readcharstring_cb;
  13070.    struct comdisconnect_cb disconnect_cb;
  13071.    struct comclose_cb close_cb;
  13072. }vcb;
  13073. void
  13074. comretlinectrl(handle )
  13075. /* This subroutine will return line control parameters   */
  13076. /* Uses the same structure as SetLineControl             */
  13077. unsigned short handle;       /* device handle    */
  13078. {
  13079.   memset(&vcb,(int)'\0',sizeof(vcb));
  13080.         /* zero out the control block   */
  13081.   vcb.setlinectrl_cb.common.com_dev_handle = handle;
  13082.   vcb.setlinectrl_cb.common.function_code = COM_RET_LINE_CTRL;
  13083.     /* fill in control block with   */
  13084.     /* function code and parameters */
  13085.     /* issue the verb               */
  13086.   ACDI(vcbptr);
  13087.   if (vcb.setlinectrl_cb.common.return_code != AA_OK)
  13088.         printf("Error in ComRetLineCtrl Return Code = %d",
  13089.             vcb.setlinectrl_cb.common.return_code);
  13090.   else {
  13091.         printf("Stop Bits = %d",vcb.setlinectrl_cb.stop_bits);
  13092.         printf("\nParity = %d",vcb.setlinectrl_cb.parity);
  13093.         printf("\nData Bits = %d",vcb.setlinectrl_cb.data_bits);
  13094.   }
  13095. }
  13096.  
  13097.  
  13098. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13099.  
  13100. #include <ACDI_C.H>
  13101. #include <STDIO.H>
  13102. #include <STDDEF.H>
  13103. #include <STRING.H>
  13104. #include <DOS.H>
  13105. #include <DOSCALLS.H>
  13106. #include <SUBCALLS.H>
  13107. union {
  13108.    struct comopen_cb open_cb;
  13109.    struct comdefinput_cb definputbuff_cb;
  13110.    struct comdefoutputbuff_cb defoutputbuff_cb;
  13111.    struct comsetbitrate_cb setbitrate_cb;
  13112.    struct comsetlinectrl_cb setlinectrl_cb;
  13113.    struct comconnect_cb connect_cb;
  13114.    struct comsettimeouts_cb settimeouts_cb;
  13115.    struct comreadcharstring_cb readcharstring_cb;
  13116.    struct comdisconnect_cb disconnect_cb;
  13117.    struct comclose_cb close_cb;
  13118. }vcb;
  13119. void
  13120. comsetbitrate(handle)
  13121. /* This subroutine will issue                    */
  13122. /* com_set_bit_rate verb to set up the line      */
  13123. /* data rates (bps).                             */
  13124. unsigned short handle;
  13125.         /* device handle                */
  13126. {
  13127.   memset(&vcb,(int)'\0',sizeof(vcb));
  13128.     /* zero out the control block   */
  13129.   vcb.setbitrate_cb.common.com_dev_handle = handle;
  13130.   vcb.setbitrate_cb.common.function_code = COM_SET_BIT_RATE;
  13131.   vcb.setbitrate_cb.bit_rate_rcv = AA_300_BPS;
  13132.   vcb.setbitrate_cb.bit_rate_send = AA_300_BPS;
  13133.      /* set at 300 bps               */
  13134.      /* fill in control block with   */
  13135.      /* function code and parameters */
  13136.      /* issue the verb               */
  13137.   ACDI(vcbptr);
  13138.   if (vcb.setbitrate_cb.common.return_code != AA_OK)
  13139.         printf("Error in ComSetBitRate Return Code = %d",
  13140.             vcb.setbitrate_cb.common.return_code);
  13141. }
  13142.  
  13143.  
  13144. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13145.  
  13146. #include <ACDI_C.H>
  13147. #include <STDIO.H>
  13148. #include <STDDEF.H>
  13149. #include <STRING.H>
  13150. #include <DOS.H>
  13151. #include <DOSCALLS.H>
  13152. #include <SUBCALLS.H>
  13153. union {
  13154.    struct comopen_cb open_cb;
  13155.    struct comdefinput_cb definputbuff_cb;
  13156.    struct comdefoutputbuff_cb defoutputbuff_cb;
  13157.    struct comsetbitrate_cb setbitrate_cb;
  13158.    struct comsetlinectrl_cb setlinectrl_cb;
  13159.    struct comconnect_cb connect_cb;
  13160.    struct comsettimeouts_cb settimeouts_cb;
  13161.    struct comreadcharstring_cb readcharstring_cb;
  13162.    struct comdisconnect_cb disconnect_cb;
  13163.    struct comclose_cb close_cb;
  13164. }vcb;
  13165. void
  13166. comsetlinectrl(handle )
  13167. /* This subroutine will issue com_set_line_ctrl  */
  13168. /* to set up line control values                 */
  13169. unsigned short handle;       /* device handle    */
  13170. {
  13171.   memset(&vcb,(int)'\0',sizeof(vcb));
  13172.         /* zero out the control block   */
  13173.   vcb.setlinectrl_cb.common.com_dev_handle = handle;
  13174.   vcb.setlinectrl_cb.common.function_code = COM_SET_LINE_CTRL;
  13175.   vcb.setlinectrl_cb.stop_bits = AA_1_STOP_BIT;
  13176.   vcb.setlinectrl_cb.parity = AA_EVEN_PARITY;
  13177.   vcb.setlinectrl_cb.data_bits = AA_7_DATA_BITS;
  13178.     /* fill in control block with   */
  13179.     /* function code and parameters */
  13180.     /* issue the verb               */
  13181.   ACDI(vcbptr);
  13182.   if (vcb.setlinectrl_cb.common.return_code != AA_OK)
  13183.         printf("Error in ComSetLineCtrl Return Code = %d",
  13184.             vcb.setlinectrl_cb.common.return_code);
  13185. }
  13186.  
  13187.  
  13188. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13189.  
  13190. /**************************************************/
  13191. /* following is the start of an appc application, */
  13192. /* should be call in order:                       */
  13193. /* 1) INIT_SELF()                                 */
  13194. /* 2) DO_TP_STARTED()                             */
  13195. /* 3) DO_MC_ALLOC()                               */
  13196. /**************************************************/
  13197. #include <APPC_C.H>
  13198. #include <ACSSVCC.H>
  13199. #include <STDIO.H>
  13200. #include <STDDEF.H>
  13201. #include <STRING.H>
  13202. #include <DOS.H>
  13203. #include <DOSCALLS.H>
  13204. /* global variables */
  13205. unsigned far *vcbptr;
  13206. /* Pointer to the control block */
  13207. char tp_id[8];
  13208. /* transaction program id       */
  13209. unsigned long conv_id;
  13210. /* conversation id              */
  13211. char al_tp_name[64];
  13212. /* tp_name for MC_ALLOCATE      */
  13213. char al_tp_name[64];
  13214. /* tp_name for MC_ALLOCATE      */
  13215. char al_mode_name[8];
  13216. /* mode name for MC_ALLOCATE    */
  13217. char tps_tp_name[64];
  13218. /* tp_name for TP_STARTED       */
  13219. void
  13220. INIT_SELF()
  13221. /* Initialization routine */
  13222. {
  13223.   /* Translate ASCII to EBCDIC as required by APPC for names */
  13224.   vcbptr = (unsigned far *)&cnvt;
  13225.   memset (al_tp_name, (int)' ',sizeof(al_tp_name));
  13226.   /* all blanks                   */
  13227.   memcpy (al_tp_name,"FILEMSVR",8);
  13228.   /* Set the tp_name for allocate */
  13229.   memset(&cnvt,(int)'\0',sizeof(cnvt));
  13230.   cnvt.opcode = SV_CONVERT;
  13231.   /* Do a CONVERT general service */
  13232.   cnvt.direction = SV_ASCII_TO_EBCDIC;
  13233.   /* Cnvt ASCII to EBCDIC         */
  13234.   cnvt.char_set = SV_AE;
  13235.   /* AE conversion type           */
  13236.   cnvt.len = sizeof(al_tp_name);
  13237.   /* Convert 64 bytes             */
  13238.   cnvt.source = cnvt.target =
  13239.         (unsigned char far *)al_tp_name;
  13240.   /* Addr. (Convert in place)     */
  13241.   ACSSVC ((long) vcbptr);
  13242.   /* Go convert it to EBCDIC      */
  13243.   memcpy (al_mode_name, "MODE1   ", 8);
  13244.   /* Set the mode name allocate   */
  13245.   memset(&cnvt,(int)'\0',sizeof(cnvt));
  13246.   cnvt.opcode = SV_CONVERT;
  13247.   cnvt.direction = SV_ASCII_TO_EBCDIC;
  13248.   cnvt.char_set = SV_A;
  13249.   /* Conversion type A            */
  13250.   cnvt.len = sizeof(al_mode_name);
  13251.   cnvt.source = cnvt.target =
  13252.         (unsigned char far *)al_mode_name;
  13253.   ACSSVC ((long) vcbptr);
  13254.   memset (tps_tp_name, (int)' ',sizeof(tps_tp_name));
  13255.   /* all blanks                   */
  13256.   memcpy (tps_tp_name,"FILEMREQ",8);
  13257.   /* Set tp_name for start_tp     */
  13258.   memset(&cnvt,(int)'\0',sizeof(cnvt));
  13259.   cnvt.opcode = SV_CONVERT;
  13260.   cnvt.direction = SV_ASCII_TO_EBCDIC;
  13261.   cnvt.char_set = SV_AE;
  13262.   cnvt.len = sizeof(tps_tp_name);
  13263.   cnvt.source = vcb.cnvt.target =
  13264.         (unsigned char far *)tps_tp_name;
  13265.   ACSSVC ((long) vcbptr);
  13266. }
  13267. void
  13268. DO_TP_STARTED()
  13269. {
  13270.   struct tp_started  tpstart; /* control block       */
  13271.   vcbptr = (unsigned far *)&tpstart;
  13272.   memset(&tpstart,(int)'\0',sizeof(tpstart))
  13273.   /* Zero the control block                 */
  13274.   tpstart.opcode = AP_TP_STARTED;
  13275.   /* APPC verb - TP_STARTED       */
  13276.   memcpy (tpstart.lu_alias, "FILEREQ  ", 8);
  13277.   /* Set LU_ALIAS                 */
  13278.   memcpy (tpstart.tp_name,"FILEMREQ",8);
  13279.   /* Set TP_NAME                  */
  13280.   APPC ((long) vcbptr);
  13281.   /* Call APPC                    */
  13282.   appc_rc_p = tpstart.primary_rc;
  13283.   appc_rc_s = tpstart.secondary_rc;
  13284.   /* Save the return codes        */
  13285.   if (appc_rc_p != AP_OK)
  13286.         printf("Error in TP_STARTED, RC = %d",
  13287.             tpstart.primary_rc );
  13288.   /* Handle any error             */
  13289.   memcpy (tp_id,tpstart.tp_id,sizeof(tp_id));
  13290.   /* Save the TP_ID               */
  13291. }
  13292. void
  13293. DO_MC_ALLOCATE ()
  13294. {
  13295.   struct mc_allocate  alloc;
  13296.   vcbptr = (unsigned far *)&alloc;
  13297.   /* Get pointer to the vcb       */
  13298.   memset(&alloc,(int)'\0',sizeof(alloc));
  13299.   /* Zero out the vcb             */
  13300.   alloc.opcode = AP_M_ALLOCATE;
  13301.   /* Verb - MC_ALLOCATE           */
  13302.   alloc.opext = AP_MAPPED_CONVERSATION;
  13303.   /* Mapped Conversation type     */
  13304.   memcpy(alloc.tp_id, tp_id, sizeof(tp_id));
  13305.   /* Set the TP_ID                */
  13306.   alloc.sync_level = AP_CONFIRM_SYNC_LEVEL;
  13307.   /* Sync level-confirm           */
  13308.   alloc.rtn_ctl = AP_WHEN_SESSION_ALLOCATED;
  13309.   /* Return when ses. allocated   */
  13310.   alloc.security = AP_NONE;
  13311.   /* No security                  */
  13312.   memcpy (alloc.plu_alias, "FILESVR ", 8);
  13313.   /* Set PLU_ALIAS                */
  13314.   memcpy (alloc.tp_name,al_tp_name,sizeof(al_tp_name));
  13315.   /* Set TP_NAME                  */
  13316.   memcpy (alloc.mode_name,al_mode_name,sizeof(al_mode_name));
  13317.   /* Set MODE_NAME                */
  13318.   APPC((long) vcbptr);
  13319.   /* Call APPC                    */
  13320.   conv_id = alloc.conv_id;
  13321.   /* Save the CONVERSATION_ID     */
  13322. }
  13323.  
  13324.  
  13325. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13326.  
  13327. #include <APPC_C.H>
  13328. #include <ACSSVCC.H>
  13329. #include <STDIO.H>
  13330. #include <STDDEF.H>
  13331. #include <STRING.H>
  13332. #include <DOS.H>
  13333. #include <DOSCALLS.H>
  13334. /* from appc_c.h */
  13335. struct confirm
  13336.     {
  13337.  unsigned short  opcode;      /* Verb operation code      */
  13338.  unsigned char  opext;        /* Verb extension code      */
  13339.  unsigned char  reserv2;      /* Reserved                 */
  13340.  unsigned short  primary_rc;  /* Primary RETURN_CODE      */
  13341.  unsigned long   secondary_rc;/* Secondary RETURN_CODE    */
  13342.  unsigned char tp_id[8];      /* TP_ID                    */
  13343.  unsigned long conv_id;       /* CONV_ID                  */
  13344.  unsigned char rts_rcvd;      /* REQUEST_TO_SEND_RECEIVED */
  13345.                               /*    AP_NO                 */
  13346.                               /*    AP_YES                */
  13347.     };
  13348. void DO_CONFIRM()
  13349. {
  13350.     unsigned far *vcbptr;
  13351.     /* Pointer to the vcb           */
  13352.     struct confirm Confirm;
  13353.     /* control block */
  13354.     /* clear out control block */
  13355.     vcbptr = (unsigned far *)&Confirm;
  13356.     memset(&Confirm,(int)'\0',sizeof(Confirm));
  13357.     Confirm.opcode = AP_M_CONFIRM;
  13358.     Confirm.opext  = AP_MAPPED_CONVERSATION;
  13359.     memcpy(Confirm.tp_id, tp_id, sizeof(tp_id));
  13360.     /* use the tp_id returned from TP_STARTED */
  13361.     Confirm.conv_id = conv_id;
  13362.     /* use the conv_id returned from MC_ALLOCATE */
  13363.     /* Call APPC */
  13364.     APPC((long)vcbptr);
  13365.     /* check for errors */
  13366.     if (Confirm.primary_rc)
  13367.             printf("Error in CONFIRM, RC = %d,
  13368.             Confirm.primary_rc );
  13369. }
  13370.  
  13371.  
  13372. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13373.  
  13374. #include <APPC_C.H>
  13375. #include <ACSSVCC.H>
  13376. #include <STDIO.H>
  13377. #include <STDDEF.H>
  13378. #include <STRING.H>
  13379. #include <DOS.H>
  13380. #include <DOSCALLS.H>
  13381. unsigned far *vcbptr;                       /* Pointer to the vcb           */
  13382. void
  13383. DO_MC_CONFIRMED ()
  13384. {
  13385.   /* control block structure */
  13386.   struct mc_confirmed confirmed;
  13387.   vcbptr = (unsigned far *)&confirmed;
  13388.   memset(&confirmed,(int)'\0',sizeof(confirmed));
  13389.   /* Zero out the cb             */
  13390.   confirmed.opcode = AP_M_CONFIRMED;
  13391.   /* Verb - MC_CONFIRMED          */
  13392.   confirmed.opext = AP_MAPPED_CONVERSATION;
  13393.   /* Mapped Conversation type     */
  13394.   confirmed.conv_id = conv_id;
  13395.   /* Set conversation_id          */
  13396.   memcpy (confirmed.tp_id, tp_id, sizeof(tp_id));
  13397.   /* Set tp_id                    */
  13398.   APPC ((long) vcbptr);
  13399.   /* Do MC_CONFIRMED              */
  13400.   appc_rc_p = confirmed.primary_rc;
  13401.   appc_rc_s = confirmed.secondary_rc;
  13402.   /* Save return codes            */
  13403.   if (appc_rc_p != AP_OK)
  13404.         printf("Error in MC_CONFIRMED, rc = %d"
  13405.         confirmed.primary_rc);
  13406.   /* Handle any error             */
  13407. }
  13408.  
  13409.  
  13410. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13411.  
  13412. #include <APPC_C.H>
  13413. #include <ACSSVCC.H>
  13414. #include <STDIO.H>
  13415. #include <STDDEF.H>
  13416. #include <STRING.H>
  13417. #include <DOS.H>
  13418. #include <DOSCALLS.H>
  13419. void
  13420. DO_MC_DEALLOCATE ()
  13421. {
  13422.   /* control block */
  13423.   struct mc_deallocate dealloc;
  13424.   unsigned far *vcbptr;
  13425.   /* Pointer to the vcb           */
  13426.   memset(&dealloc,(int)'\0',sizeof(dealloc));
  13427.   dealloc.opcode = AP_M_DEALLOCATE;
  13428.   /* Verb-MC_DEALLOCATE           */
  13429.   dealloc.opext  = AP_MAPPED_CONVERSATION;
  13430.   /* Set MC ext. type             */
  13431.   dealloc.conv_id = conv_id;
  13432.   /* Set conversation_id          */
  13433.   /* Use conv_id returned from MC_ALLOCATE */
  13434.   memcpy (dealloc.tp_id, tp_id, sizeof(tp_id));
  13435.   /* Set tp_id                    */
  13436.   /* use tp_id returned from TP_STARTED */
  13437.   dealloc.dealloc_type = AP_SYNC_LEVEL;
  13438.   APPC((long) vcbptr);
  13439.   /* Call APPC                    */
  13440.   if (dealloc.primary_rc != AP_OK)
  13441.         printf("Error in MC_DEALLOCATE, RC=%d",
  13442.                 dealloc.primary_rc );
  13443. }
  13444.  
  13445.  
  13446. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13447.  
  13448. #include <APPC_C.H>
  13449. #include <ACSSVCC.H>
  13450. #include <STDIO.H>
  13451. #include <STDDEF.H>
  13452. #include <STRING.H>
  13453. #include <DOS.H>
  13454. #include <DOSCALLS.H>
  13455. unsigned far *vcbptr;
  13456. /* Pointer to the vcb           */
  13457. void
  13458. DO_MC_RECEIVE_AND_WAIT ()
  13459. {
  13460.   /* control block structure */
  13461.   struct mc_receive_and_wait   rcv_wait;
  13462.   unsigned short selector;
  13463.   /* Selector from DOSALLOCSEG    */
  13464.   unsigned short rc;
  13465.   /* return code */
  13466.   unsigned char far *BufPtr;                    /* Pointer to AlphaNumeric      */
  13467.   /* Buffer (shared)              */
  13468.   rc = DOSALLOCSEG (4096,
  13469.         (unsigned far *)&selector, 1);
  13470.   if (rc == 0) {
  13471.   /* If there is no error         */
  13472.     FP_OFF(BufPtr) = 0;
  13473.     /* set the offset to zero       */
  13474.     FP_SEG(BufPtr) = selector;
  13475.     /* address = Selector:0         */
  13476.   }
  13477.   vcbptr = (unsigned far *)&rcv_wait;
  13478.   memset(&rcv_wait,(int)'\0',sizeof(rcv_wait));
  13479.   /* Zero the vcb                 */
  13480.   rcv_wait.opcode = AP_M_RECEIVE_AND_WAIT;
  13481.   /* Verb - MC_RECEIVE_AND_WAIT   */
  13482.   rcv_wait.opext = AP_MAPPED_CONVERSATION;
  13483.   /* Mapped Conversation type     */
  13484.   /* use conv_id returned from RECEIVE_ALLOC */
  13485.   rcv_wait.conv_id = conv_id;
  13486.   /* Set conversation_id          */
  13487.   memcpy (rcv_wait.tp_id, tp_id, sizeof(tp_id));
  13488.   /* Set tp_id                    */
  13489.   rcv_wait.max_len = 4096;
  13490.   /* Receive file data in 4096    */
  13491.   /* byte blocks                  */
  13492.   rcv_wait.dptr = BufPtr;
  13493.   /* Buffer                       */
  13494.   rcv_wait.rtn_status = AP_YES;
  13495.   /* Return status with data      */
  13496.   APPC((long) vcbptr);
  13497.   /* Call APPC                    */
  13498.   /* Get length we actually rcvd  */
  13499.   if (rcv_wait.primary_rc)
  13500.         printf("Error in MC_RECEIVE_AND_WAIT, RC = %d",
  13501.             rcv_wait.primary_rc );
  13502. }
  13503.  
  13504.  
  13505. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13506.  
  13507. #include <APPC_C.H>
  13508. #include <ACSSVCC.H>
  13509. #include <STDIO.H>
  13510. #include <STDDEF.H>
  13511. #include <STRING.H>
  13512. #include <DOS.H>
  13513. #include <DOSCALLS.H>
  13514. unsigned far *vcbptr;                       /* Pointer to the vcb           */
  13515. void
  13516. SEND_YOUR_NAME ()
  13517. {
  13518.   /* control block */
  13519.   struct mc_send_data send;
  13520.   unsigned short selector;
  13521.   /* Selector from DOSALLOCSEG    */
  13522.   unsigned short rc;
  13523.   /* return code */
  13524.   unsigned char far *NamePtr;                    /* Pointer to shared buffer     */
  13525.   memset(&send,(int)'\0',sizeof(send));
  13526.   rc = DOSALLOCSEG (100,
  13527.         (unsigned far *)&selector, 1);
  13528.   if (rc == 0) {
  13529.   /* If there is no error         */
  13530.     FP_OFF(NamePtr) = 0;
  13531.     /* set the offset to zero       */
  13532.     FP_SEG(NamePtr) = selector;
  13533.     /* address = Selector:0         */
  13534.   }
  13535.   /* clear out control block */
  13536.   send.opcode = AP_M_SEND_DATA;
  13537.   /* APPC Verb - MC_SEND_DATA     */
  13538.   send.opext = AP_MAPPED_CONVERSATION;
  13539.   /* Mapped Conservation type     */
  13540.   send.conv_id = conv_id;
  13541.   /* Set conversation_id          */
  13542.   /* use conv_id returned from MC_ALLOCATE */
  13543.   memcpy (send.tp_id, tp_id, sizeof(tp_id));
  13544.   /* Set TP_id                    */
  13545.   /* use tp_id returned from TP_STARTED */
  13546.   send.dlen = 100;
  13547.   /* namelength - 100 bytes max.  */
  13548.   /* insert data into buffer      */
  13549.   strcpy(NamePtr, "Your Name Here ");
  13550.   send.dptr = NamePtr;
  13551.   /* Set data pointer to buffer   */
  13552.   send.type = AP_NONE;
  13553.   /* Use SEND_DATA verb alone     */
  13554.   APPC((long) vcbptr);
  13555.   /* Call APPC to send name   */
  13556.   if (send.primary_rc != AP_OK)
  13557.         printf("Error in MC_SEND_DATA, RC = %d",
  13558.             send.primary_rc );
  13559. }
  13560.  
  13561.  
  13562. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13563.  
  13564. #include <APPC_C.H>
  13565. #include <ACSSVCC.H>
  13566. #include <STDIO.H>
  13567. #include <STDDEF.H>
  13568. #include <STRING.H>
  13569. #include <DOS.H>
  13570. #include <DOSCALLS.H>
  13571. void
  13572. DO_RECEIVE_ALLOCATE()
  13573. {
  13574.   unsigned far *vcbptr;
  13575.   /* Pointer to the vcb           */
  13576.   struct receive_allocate rcv_a;
  13577.   /* control block */
  13578.   memset(&rcv_a,(int)'\0',sizeof(rcv_a))
  13579.   rcv_a.opcode = AP_RECEIVE_ALLOCATE;
  13580.   /* Set the APPC opcode          */
  13581.   memcpy (rcv_a.tp_name, ra_tp_name, sizeof(ra_tp_name));
  13582.   /* This has to have already     */
  13583.   /* been converted to EBCDIC     */
  13584.   APPC((long) vcbptr);
  13585.   /* Call APPC                    */
  13586.   if (rcv_a.primary_rc != AP_OK)
  13587.         printf("Error in RECEIVE_ALLOCATE, RC = %d",
  13588.             rcv_a.primary_rc);
  13589.   conv_id = rcv_a.conv_id;
  13590.   /* Save the conversation_id     */
  13591.   /* this is used in many places later */
  13592. }
  13593.  
  13594.  
  13595. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13596.  
  13597. #include <APPC_C.H>
  13598. #include <ACSSVCC.H>
  13599. #include <STDIO.H>
  13600. #include <STDDEF.H>
  13601. #include <STRING.H>
  13602. #include <DOS.H>
  13603. #include <DOSCALLS.H>
  13604. unsigned far *vcbptr;
  13605. /* Pointer to the vcb           */
  13606. void
  13607. DO_TP_ENDED ()
  13608. {
  13609.   /* control block */
  13610.   struct tp_ended tpend;
  13611.   vcbptr = (unsigned far *)&tpend;
  13612.   /* clear out control block */
  13613.   memset(&vcb,(int)'\0',sizeof(vcb))
  13614.   tpend.opcode = AP_TP_ENDED;
  13615.   /* Verb - TP_ENDED              */
  13616.   /* use tp_id returned from TP_STARTED */
  13617.   memcpy (tpend.tp_id, tp_id, sizeof(tp_id));
  13618.   /* Set tp_id                    */
  13619.   tpend.type = AP_SOFT;
  13620.   /* Select SOFT stop             */
  13621.   APPC((long) vcbptr);
  13622.   /* Do the TP_ENDED              */
  13623.   if (tpend.primary_rc != AP_OK)
  13624.         printf("Error in TP_ENDED, RC = %d",
  13625.             tpend.primary_rc );
  13626. }
  13627.  
  13628.  
  13629. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13630.  
  13631. /* -----------------------  Include files  ------------------------------*/
  13632. #include <mt\STDIO.H>
  13633. #include <mt\STDDEF.H>
  13634. #include <mt\STRING.H>
  13635. #include <mt\DOS.H>
  13636. #include <mt\STDLIB.H>
  13637. #include <mt\TIME.H>
  13638. #include <mt\ERRNO.H>
  13639. #include <mt\IO.H>
  13640. #define INCL_DOSQUEUES
  13641. #define INCL_DOSMISC
  13642. #define INCL_DOSMEMMGR
  13643. #include <os2.h>
  13644. #include "uuccprb.h"
  13645. /* --------- External variables ---------------------- */
  13646. /* Segment selectors for request and reply parameters
  13647.    and data.  These are only allocated once.  After
  13648.    they have been allocated they are used for subsequent
  13649.    SRPI call. */
  13650. SEL selQParm = 0,
  13651.     selQData = 0,
  13652.     selRParm = 0,
  13653.     selRData = 0;
  13654. // Current version value (uerversion)
  13655. #define UERVERSNUM      0x0200
  13656. // Send_Request verb type (uerverbtyp)
  13657. #define UERSENDREQ      0x1
  13658. // 3270 screen update notify (uer3270ind)
  13659. #define UER3270DISABL   0x255
  13660. // Disable notification of 3270 update
  13661. #define UER3270NOTIFY   0x0
  13662. // Notify user of 3270 screen update
  13663. // Sizes of allocated data segments for SRPI call
  13664. #define MAXQPARML          32763
  13665. #define MAXQDATAL          65535
  13666. #define MAXRPARML          32763
  13667. #define MAXRDATAL          65535
  13668. void main ()
  13669. {
  13670.    short       result;
  13671.         /* temp variable for Dos calls        */
  13672.    static char data[] = "0987654321";
  13673.         /* what we'll use for data */
  13674.    static char parm[] = "12345678";
  13675.         /* what we'll use for parmeters */
  13676.    char far *ptrData;
  13677.         /* need to use pointers */
  13678.    char far *ptrParm;
  13679.    UERCPRB cprb;
  13680.         /* control block structure */
  13681.    ptrData = (char far *)&data;
  13682.    ptrParm = (char far *)&parm;
  13683.    // initalize control block
  13684.    init_send_req_parms(&cprb);
  13685.    // Get data segments.  Non-zero return indicates error
  13686.    // allocating
  13687.    // a data segment.  This triggers a BAD return to caller.
  13688.    if (DosAllocSeg (MAXQPARML+1, &selQParm, 1)
  13689.         return BAD;
  13690.    if (DosAllocSeg (MAXQDATAL+1, &selQData, 1)
  13691.         return BAD;
  13692.    if(DosAllocSeg (MAXRPARML+1, &selRParm, 1)
  13693.         return BAD;
  13694.    if(DosAllocSeg (MAXRDATAL+1, &selRData, 1)
  13695.         return BAD;
  13696.    // INITIALIZE UUMCPRB
  13697.    cprb.uerrbsiz   = sizeof(UERCPRB);
  13698.    cprb.uerversion = UERVERSNUM;
  13699.    cprb.uerverbtyp = UERSENDREQ;
  13700.    cprb.uerfunct   = 0x00;
  13701.    FP_OFF(cprb.uerqparmad) = 0;
  13702.    FP_SEG(cprb.uerqparmad) = selQParm;
  13703.    FP_OFF(cprb.uerqdataad) = 0;
  13704.    FP_SEG(cprb.uerqdataad) = selQData;
  13705.    cprb.uerrparml          = MAXRPARML;
  13706.    FP_OFF(cprb.uerrparmad) = 0;
  13707.    FP_SEG(cprb.uerrparmad) = selRParm;
  13708.    cprb.uerrdatal          = MAXRDATAL;
  13709.    FP_OFF(cprb.uerrdataad) = 0;
  13710.    FP_SEG(cprb.uerrdataad) = selRData;
  13711.    // Initialize Request Parameter fields
  13712.    cprb.uerqparml = 20;
  13713.    movedata (FP_SEG(ptrParm), FP_OFF(ptrParm),
  13714.         FP_SEG(cprb.uerqparmad), FP_OFF(cprb.uerqparmad),
  13715.         sizeof numbers);
  13716.    // Initialize Request Data fields
  13717.    cprb.uerqdatal = 20;
  13718.    movedata (FP_SEG(ptrData), FP_OFF(ptrData),
  13719.         FP_SEG(cprb.uerqdataad), FP_OFF(cprb.uerqdataad),
  13720.          cprb.uerqdatal);
  13721.    cprb.uer3270ind = 0;
  13722.    // Now initialize Server Name and length of name
  13723.    cprb.uersrvnml  = 8;
  13724.    strcpy(cprb.uerserver, "IBMABASE");
  13725.    send_request(&cprb);
  13726. }
  13727.  
  13728.  
  13729. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13730.  
  13731. #define INCL_BASE
  13732. typedef unsigned char byte;
  13733. typedef unsigned short int word;
  13734. typedef unsigned long int dword;
  13735. typedef unsigned char far * address;
  13736. #include <os2.h>
  13737. #include <stdio.h>
  13738. #include <string.h>
  13739. #include <stdlib.h>
  13740. #include <dos.h>
  13741. #include <lan_1_c.h>
  13742. #include <lan_2_c.h>
  13743. #include <lan_3_c.h>
  13744. #include <lan_4_c.h>
  13745. #include <lan_5_c.h>
  13746. #include <lan_6_c.h>
  13747. struct ccb2_form {
  13748.     byte ccb_adapter;
  13749.     byte ccb_command;
  13750.     byte ccb_retcode;
  13751.     byte ccb_work;
  13752.     address ccb_pointer;
  13753.     dword ccb_cmpl_flag;
  13754.     word ccb_parm_offset;
  13755.     word ccb_parameter_1;
  13756.     dword ccb_semaphore;
  13757.     byte ccb_appl_id;
  13758.     byte ccb_read_flag;
  13759.     word ccb_appl_key;
  13760.     word ccb_parameter_2;
  13761. };
  13762. struct dir_open_form {
  13763.     word    adapter_parms_off;
  13764.     word    reserve1;
  13765.     dword   reserve2;
  13766.     word    dlc_parms_offset;
  13767.     word    reserve3;
  13768.     word    reserve4;
  13769. };
  13770. struct dir_open_dlc_form {
  13771.     byte    dlc_max_sap;
  13772.     byte    dlc_max_stations;
  13773.     byte    dlc_max_gsap;
  13774.     byte    dlc_max_gmem;
  13775.     byte    dlc_t1_tick_one;
  13776.     byte    dlc_t2_tick_one;
  13777.     byte    dlc_ti_tick_one;
  13778.     byte    dlc_t1_tick_two;
  13779.     byte    dlc_t2_tick_two;
  13780.     byte    dlc_ti_tick_two;
  13781. };
  13782. struct dir_open_adap_form {
  13783.     word    open_error_code;
  13784.     word    open_options;
  13785.     char    node_address[6];
  13786.     dword   group_address;
  13787.     dword   functional_adrr;
  13788.     word    number_rcv_buffers;
  13789.     word    rcv_buffers_length;
  13790.     word    dhb_buffer_length;
  13791.     byte    data_hold_buffers;
  13792.     char    reserve_ccb2[3];
  13793.     word    product_id_offset;
  13794.     word    reserve_2_ccb2;
  13795.     word    bring_ups;
  13796.     word    init_warnings;
  13797.     word    semaphore_count;
  13798.     dword   sys_semaphore_table;
  13799. };
  13800. struct prod_id_form {
  13801.     byte    prod_id[18];
  13802. };
  13803. void main(void);
  13804. void DoStatus(BYTE);
  13805. word DoOpenSAP(BYTE);
  13806. void DoCloseSAP(BYTE, word);
  13807. void DoOpenStation(BYTE, word);
  13808. void main()
  13809. {
  13810.     struct ccb2_form ControlBlock;
  13811.     struct dir_open_form OpenParm;
  13812.     struct dir_open_adap_form OpenAdapterParm;
  13813.     struct dir_open_dlc_form OpenDLCParm;
  13814.     struct prod_id_form ProdID;
  13815.     BYTE ApplicationID;
  13816.     char far *Ptr;
  13817.     USHORT ReturnCode;
  13818.     address BadPtr;
  13819.     word StationID;
  13820.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  13821.         struct ccb2_form));
  13822.     memset((CHAR FAR *)&OpenParm, 0, sizeof(
  13823.         struct dir_open_form));
  13824.     memset((CHAR FAR *)&OpenAdapterParm, 0,
  13825.         sizeof( struct dir_open_adap_form));
  13826.     memset((CHAR FAR *)&OpenDLCParm, 0,
  13827.         sizeof( struct dir_open_dlc_form));
  13828.     memset((CHAR FAR *)&ProdID, 0,
  13829.         sizeof( struct prod_id_form ));
  13830.     ControlBlock.ccb_adapter = 0x00;
  13831.     ControlBlock.ccb_command = LLC_DIR_OPEN_ADAPTER;
  13832.     ControlBlock.ccb_cmpl_flag = 0x0001;
  13833.     ControlBlock.ccb_semaphore = 0x00;
  13834.     Ptr = (CHAR FAR *)&OpenParm;
  13835.     ControlBlock.ccb_parm_offset = FP_OFF (Ptr );
  13836.     Ptr = (CHAR FAR *)&OpenAdapterParm;
  13837.     OpenParm.adapter_parms_off = FP_OFF (Ptr );
  13838.     Ptr = (CHAR FAR *)&OpenDLCParm;
  13839.     OpenParm.dlc_parms_offset = FP_OFF (Ptr );
  13840.     Ptr = (CHAR FAR *)&ProdID;
  13841.     OpenAdapterParm.product_id_offset = FP_OFF (Ptr);
  13842.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  13843.         (CHAR FAR *)&BadPtr);
  13844.     printf("Dir_Open_Adapter = %d", ReturnCode );
  13845.     ApplicationID = ControlBlock.ccb_appl_id;
  13846.     printf("\nProduct ID = %c",ApplicationID );
  13847.     StationID = DoOpenSAP(ApplicationID);
  13848.     getch();
  13849.     DoOpenStation(ApplicationID, StationID);
  13850.     DoStatus(ApplicationID);
  13851.     getch();
  13852.     DoCloseSAP(ApplicationID, StationID);
  13853.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  13854.         struct ccb2_form));
  13855.     ControlBlock.ccb_adapter = 0x00;
  13856.     ControlBlock.ccb_command = LLC_DIR_CLOSE_ADAPTER;
  13857.     ControlBlock.ccb_cmpl_flag = 0x0001;
  13858.     ControlBlock.ccb_semaphore = 0x00;
  13859.     ControlBlock.ccb_parm_offset = 0x0000;
  13860.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  13861.         (CHAR FAR *)&BadPtr);
  13862.     printf("\nDir_Close_Adapter = %d", ReturnCode );
  13863. }
  13864.  
  13865.  
  13866. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13867.  
  13868. #define INCL_BASE
  13869. typedef unsigned char byte;
  13870. typedef unsigned short int word;
  13871. typedef unsigned long int dword;
  13872. typedef unsigned char far * address;
  13873. #include <os2.h>
  13874. #include <stdio.h>
  13875. #include <string.h>
  13876. #include <stdlib.h>
  13877. #include <dos.h>
  13878. #include <lan_1_c.h>
  13879. #include <lan_2_c.h>
  13880. #include <lan_3_c.h>
  13881. #include <lan_4_c.h>
  13882. #include <lan_5_c.h>
  13883. #include <lan_6_c.h>
  13884. struct ccb2_form {
  13885.     byte ccb_adapter;
  13886.     byte ccb_command;
  13887.     byte ccb_retcode;
  13888.     byte ccb_work;
  13889.     address ccb_pointer;
  13890.     dword ccb_cmpl_flag;
  13891.     word ccb_parm_offset;
  13892.     word ccb_parameter_1;
  13893.     dword ccb_semaphore;
  13894.     byte ccb_appl_id;
  13895.     byte ccb_read_flag;
  13896.     word ccb_appl_key;
  13897.     word ccb_parameter_2;
  13898. };
  13899. void DoCloseSAP(BYTE ApplicationID, word StationID)
  13900. {
  13901.     struct ccb2_form ControlBlock;
  13902.     USHORT ReturnCode;
  13903.     address BadPtr;
  13904.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  13905.         struct ccb2_form));
  13906.     ControlBlock.ccb_command = LLC_DLC_CLOSE_SAP;
  13907.     ControlBlock.ccb_retcode = 0xff;
  13908.     ControlBlock.ccb_cmpl_flag = 0x0001;
  13909.     ControlBlock.ccb_appl_id = ApplicationID;
  13910.     ControlBlock.ccb_parm_offset = StationID;
  13911.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  13912.         (CHAR FAR *)&BadPtr );
  13913.     printf("\nCloseSAP, rc = %d", ReturnCode );
  13914. }
  13915.  
  13916.  
  13917. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13918.  
  13919. #define INCL_BASE
  13920. typedef unsigned char byte;
  13921. typedef unsigned short int word;
  13922. typedef unsigned long int dword;
  13923. typedef unsigned char far * address;
  13924. #include <os2.h>
  13925. #include <stdio.h>
  13926. #include <string.h>
  13927. #include <stdlib.h>
  13928. #include <dos.h>
  13929. #include <lan_1_c.h>
  13930. #include <lan_2_c.h>
  13931. #include <lan_3_c.h>
  13932. #include <lan_4_c.h>
  13933. #include <lan_5_c.h>
  13934. #include <lan_6_c.h>
  13935. struct ccb2_form {
  13936.     byte ccb_adapter;
  13937.     byte ccb_command;
  13938.     byte ccb_retcode;
  13939.     byte ccb_work;
  13940.     address ccb_pointer;
  13941.     dword ccb_cmpl_flag;
  13942.     word ccb_parm_offset;
  13943.     word ccb_parameter_1;
  13944.     dword ccb_semaphore;
  13945.     byte ccb_appl_id;
  13946.     byte ccb_read_flag;
  13947.     word ccb_appl_key;
  13948.     word ccb_parameter_2;
  13949. };
  13950. void DoCloseStation(BYTE ApplicationID, word StationID)
  13951. {
  13952.     struct ccb2_form ControlBlock;
  13953.     USHORT ReturnCode;
  13954.     address BadPtr;
  13955.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  13956.         struct ccb2_form));
  13957.     ControlBlock.ccb_command = LLC_DLC_CLOSE_STATION;
  13958.     ControlBlock.ccb_retcode = 0xff;
  13959.     ControlBlock.ccb_cmpl_flag = 0x0001;
  13960.     ControlBlock.ccb_appl_id = ApplicationID;
  13961.     ControlBlock.ccb_parm_offset = StationID;
  13962.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  13963.         (CHAR FAR *)&BadPtr );
  13964.     printf("\nCloseStation, rc = %d", ReturnCode );
  13965. }
  13966.  
  13967.  
  13968. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  13969.  
  13970. #define INCL_BASE
  13971. typedef unsigned char byte;
  13972. typedef unsigned short int word;
  13973. typedef unsigned long int dword;
  13974. typedef unsigned char far * address;
  13975. #include <os2.h>
  13976. #include <stdio.h>
  13977. #include <string.h>
  13978. #include <stdlib.h>
  13979. #include <dos.h>
  13980. #include <lan_1_c.h>
  13981. #include <lan_2_c.h>
  13982. #include <lan_3_c.h>
  13983. #include <lan_4_c.h>
  13984. #include <lan_5_c.h>
  13985. #include <lan_6_c.h>
  13986. struct ccb2_form {
  13987.     byte ccb_adapter;
  13988.     byte ccb_command;
  13989.     byte ccb_retcode;
  13990.     byte ccb_work;
  13991.     address ccb_pointer;
  13992.     dword ccb_cmpl_flag;
  13993.     word ccb_parm_offset;
  13994.     word ccb_parameter_1;
  13995.     dword ccb_semaphore;
  13996.     byte ccb_appl_id;
  13997.     byte ccb_read_flag;
  13998.     word ccb_appl_key;
  13999.     word ccb_parameter_2;
  14000. };
  14001. struct     dlc_connect_station
  14002.    {
  14003.       word       link_station_id;
  14004.       byte       reserve1[2];
  14005.       word       routing_offset;
  14006.       word       reserve2;
  14007.    };
  14008. struct     route_info {
  14009.     byte items[18];
  14010. };
  14011. void dlc_connect_station(BYTE ApplicationID, word LinkID )
  14012.    {
  14013.       USHORT ReturnCode;
  14014.       struct ccb2_form ControlBlock;
  14015.       struct dlc_connect_station ConnectStation;
  14016.       address BadPtr;
  14017.       CHAR *Ptr;
  14018.       struct route_info RouteInfo;
  14019.    /* reset control_block ControlBlock and dlc_status_read_parm  */
  14020.       memset((char far *) &ControlBlock, 0,
  14021.         sizeof (struct ccb2_form));
  14022.       memset((char far *) &ConnectStation, 0,
  14023.         sizeof (struct dlc_connect_station));
  14024.       memset((char far *) &RouteInfo,0,18);
  14025.    /* set pointer to command specific parameter table   */
  14026.       Ptr = (char far *) &ConnectStation;
  14027.       ControlBlock.ccb_parm_offset = FP_OFF (Ptr);
  14028.       ControlBlock.ccb_adapter = 0x00;
  14029.       ControlBlock.ccb_command = LLC_DLC_CONNECT_STATION;
  14030.       ControlBlock.ccb_cmpl_flag = 0x0001;
  14031.       ControlBlock.ccb_appl_id = ApplicationID;
  14032.       ConnectStation.link_station_id = LinkID;
  14033.       Ptr = (char far *) &RouteInfo;
  14034.       ConnectStation.routing_offset = FP_OFF (Ptr);
  14035.       ReturnCode = ACSLAN((CHAR FAR *) &ControlBlock,
  14036.         (CHAR FAR *)&BadPtr);
  14037.    }
  14038.  
  14039.  
  14040. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14041.  
  14042. #define INCL_BASE
  14043. typedef unsigned char byte;
  14044. typedef unsigned short int word;
  14045. typedef unsigned long int dword;
  14046. typedef unsigned char far * address;
  14047. #include <os2.h>
  14048. #include <stdio.h>
  14049. #include <string.h>
  14050. #include <stdlib.h>
  14051. #include <dos.h>
  14052. #include <lan_1_c.h>
  14053. #include <lan_2_c.h>
  14054. #include <lan_3_c.h>
  14055. #include <lan_4_c.h>
  14056. #include <lan_5_c.h>
  14057. #include <lan_6_c.h>
  14058. struct ccb2_form {
  14059.     byte ccb_adapter;
  14060.     byte ccb_command;
  14061.     byte ccb_retcode;
  14062.     byte ccb_work;
  14063.     address ccb_pointer;
  14064.     dword ccb_cmpl_flag;
  14065.     word ccb_parm_offset;
  14066.     byte ccb_parameter_1[2];
  14067.     dword ccb_semaphore;
  14068.     byte ccb_appl_id;
  14069.     byte ccb_read_flag;
  14070.     word ccb_appl_key;
  14071.     word ccb_parameter_2;
  14072. };
  14073. #define  RESETBUSYSTATE 0x80
  14074. #define  LOCALBUSYSTATE 0x40
  14075. void FlowControl( word StationID )
  14076.    {
  14077.       USHORT ReturnCode;
  14078.       struct ccb2_form ControlBlock;
  14079.       address BadPtr;
  14080.    /* reset control_block ControlBlock */
  14081.       memset((char far *) &ControlBlock, 0,
  14082.         sizeof (struct ccb2_form));
  14083.    /* use StationID or SAPID */
  14084.       ControlBlock.ccb_parm_offset = StationID;
  14085.       ControlBlock.ccb_adapter = 0x00;
  14086.       ControlBlock.ccb_command = LLC_DLC_FLOW_CONTROL;
  14087.       ControlBlock.ccb_cmpl_flag = 0x0001;
  14088.       ControlBlock.ccb_parameter_1[0] = 0;
  14089.       ControlBlock.ccb_parameter_1[1] = 0;
  14090.       ControlBlock.ccb_parameter_1[0] =
  14091.         RESETBUSYSTATE|LOCALBUSYSTATE;
  14092.       ReturnCode = ACSLAN((CHAR FAR *) &ControlBlock,
  14093.         (CHAR FAR *)&BadPtr);
  14094.    }
  14095.  
  14096.  
  14097. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14098.  
  14099. #define INCL_BASE
  14100. typedef unsigned char byte;
  14101. typedef unsigned short int word;
  14102. typedef unsigned long int dword;
  14103. typedef unsigned char far * address;
  14104. #include <os2.h>
  14105. #include <stdio.h>
  14106. #include <string.h>
  14107. #include <stdlib.h>
  14108. #include <dos.h>
  14109. #include <lan_1_c.h>
  14110. #include <lan_2_c.h>
  14111. #include <lan_3_c.h>
  14112. #include <lan_4_c.h>
  14113. #include <lan_5_c.h>
  14114. #include <lan_6_c.h>
  14115. struct ccb2_form {
  14116.     byte ccb_adapter;
  14117.     byte ccb_command;
  14118.     byte ccb_retcode;
  14119.     byte ccb_work;
  14120.     address ccb_pointer;
  14121.     dword ccb_cmpl_flag;
  14122.     word ccb_parm_offset;
  14123.     word ccb_parameter_1;
  14124.     dword ccb_semaphore;
  14125.     byte ccb_appl_id;
  14126.     byte ccb_read_flag;
  14127.     word ccb_appl_key;
  14128.     word ccb_parameter_2;
  14129. };
  14130. struct dlc_open_sap {
  14131.     word    station_id;
  14132.     word    user_stat_value;
  14133.     byte    timer_t1;
  14134.     byte    timer_t2;
  14135.     byte    timer_ti;
  14136.     byte    maxout;
  14137.     byte    maxin;
  14138.     byte    maxout_incr;
  14139.     byte    max_retry_cnt;
  14140.     byte    max_members;
  14141.     word    max_i_field;
  14142.     byte    sap_value;
  14143.     byte    option_priority;
  14144.     byte    station_count;
  14145.     word    reserve1;
  14146.     byte    group_count;
  14147.     word    group_list_offset;
  14148.     word    reserve2;
  14149.     address dlc_status_flag;
  14150.     word    dlc_buf_size;
  14151.     word    dlc_pool_len;
  14152.     address dlc_pool_addr;
  14153.     byte    adpt_stns_avail;
  14154. };
  14155. word DoOpenSAP(BYTE ApplicationID)
  14156. {
  14157.     struct ccb2_form ControlBlock;
  14158.     struct dlc_open_sap OpenSAP;
  14159.     USHORT ReturnCode;
  14160.     CHAR *Ptr;
  14161.     BYTE SAP_pool[4096];
  14162.     address BadPtr;
  14163.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  14164.         struct ccb2_form));
  14165.     memset((CHAR FAR *)&OpenSAP, 0,
  14166.         sizeof( struct dlc_open_sap));
  14167.     ControlBlock.ccb_adapter = 0;
  14168.     ControlBlock.ccb_command = LLC_DLC_OPEN_SAP;
  14169.     ControlBlock.ccb_retcode = 0xff;
  14170.     ControlBlock.ccb_cmpl_flag = 0x0001;
  14171.     ControlBlock.ccb_semaphore = 0x00;
  14172.     ControlBlock.ccb_appl_id = ApplicationID;
  14173.     Ptr = (CHAR FAR *)&OpenSAP;
  14174.     ControlBlock.ccb_parm_offset = FP_OFF(Ptr);
  14175.     OpenSAP.timer_t1 = 10;
  14176.     OpenSAP.timer_t2 = 9;
  14177.     OpenSAP.timer_ti = 10;
  14178.     OpenSAP.maxout   = 0;
  14179.     OpenSAP.maxin    = 0;
  14180.     OpenSAP.maxout_incr = 0;
  14181.     OpenSAP.max_retry_cnt = 0;
  14182.     OpenSAP.max_members = 0;
  14183.     OpenSAP.max_i_field = 0;
  14184.     OpenSAP.sap_value = 0x0A4;
  14185.     OpenSAP.option_priority = 0x04;
  14186.     OpenSAP.station_count = 2;
  14187.     OpenSAP.group_count = 0;
  14188.     OpenSAP.dlc_status_flag = (address)(0x0001);
  14189.     OpenSAP.dlc_buf_size = 0;
  14190.     OpenSAP.dlc_pool_len = 256;
  14191.     OpenSAP.dlc_pool_addr = (address) SAP_pool;
  14192.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  14193.         (CHAR FAR *)&BadPtr );
  14194.     printf("\nOpenSAP, rc = %d", ReturnCode );
  14195.     printf("\nccbRc = %d", ControlBlock.ccb_retcode);
  14196.     return(OpenSAP.station_id);
  14197. }
  14198.  
  14199.  
  14200. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14201.  
  14202. #define INCL_BASE typedef unsigned char byte; typedef unsigned short int word; 
  14203. typedef unsigned long int dword; typedef unsigned char far * address; #include 
  14204. <os2.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include 
  14205. <dos.h> #include <lan_1_c.h> #include <lan_2_c.h> #include <lan_3_c.h> #include 
  14206. <lan_4_c.h> #include <lan_5_c.h> #include <lan_6_c.h> struct ccb2_form {   byte 
  14207. ccb_adapter;   byte ccb_command;   byte ccb_retcode;   byte ccb_work;   address 
  14208. ccb_pointer;   dword ccb_cmpl_flag;   word ccb_parm_offset;   word 
  14209. ccb_parameter_1;   dword ccb_semaphore;   byte ccb_appl_id;   byte 
  14210. ccb_read_flag;   word ccb_appl_key;   word ccb_parameter_2; }; struct 
  14211. dlc_open_station  {  word    station_id;         /* SAP station ID       */ 
  14212. word    link_station_id;       /* Link station ID assigned  */  byte 
  14213. timer_t1;          /* Ti timer value       */  byte    timer_t2;          /* T2 
  14214. timer value       */  byte    timer_ti;          /* Ti timer value       */ 
  14215. byte    maxout;           /* Max transmits without ACK */  byte    maxin; 
  14216. /* Max receives without ACK  */  byte    maxout_incr;         /* Dynamic window 
  14217. increment  */  byte    max_retry_cnt;        /* Maximum retry count    */  byte 
  14218. rsap_value;         /* Remote SAP value      */  word    max_i_field; 
  14219. /* Max rcv data for I frames */  byte    access_priority;       /* Ring access 
  14220. priority    */  byte    reserved1;          /* RESERVED          */  word 
  14221. destination_offset;     /* Offset to remote dest add */  word    reserved2; 
  14222. /* Reserved for application  */  }; struct remote_address_form {   byte 
  14223. adapter_address[6]; }; void DoOpenStation(BYTE ApplicationID, word StationID) { 
  14224. struct ccb2_form ControlBlock;   struct dlc_open_station OpenStation;   USHORT 
  14225. ReturnCode;   CHAR *Ptr;   address BadPtr;   struct remote_address_form 
  14226. RemoteAddress;   memset((CHAR FAR *)&ControlBlock,0, sizeof(     struct 
  14227. ccb2_form));   memset((CHAR FAR *)&OpenStation, 0,     sizeof( struct 
  14228. dlc_open_station));   memset((CHAR FAR *)&RemoteAddress, 0,     6 ); 
  14229. ControlBlock.ccb_adapter = 0;   ControlBlock.ccb_command = 
  14230. LLC_DLC_OPEN_STATION;   ControlBlock.ccb_retcode = 0xff; 
  14231. ControlBlock.ccb_cmpl_flag = 0x0001;   ControlBlock.ccb_semaphore = 0x00; 
  14232. ControlBlock.ccb_appl_id = ApplicationID;   RemoteAddress.adapter_address[0] = 
  14233. 0xA7;   RemoteAddress.adapter_address[1] = 0x0A; 
  14234. RemoteAddress.adapter_address[2] = 0x15;   RemoteAddress.adapter_address[3] = 
  14235. 0x00;   RemoteAddress.adapter_address[4] = 0x00; 
  14236. RemoteAddress.adapter_address[5] = 0x40;   Ptr = (CHAR FAR *)&OpenStation; 
  14237. ControlBlock.ccb_parm_offset = FP_OFF(Ptr);   OpenStation.station_id = 
  14238. StationID;   OpenStation.rsap_value = 0x0A4;   Ptr = (address)&RemoteAddress; 
  14239. OpenStation.destination_offset = FP_OFF(Ptr);   ReturnCode = ACSLAN((CHAR FAR 
  14240. *)&ControlBlock,     (CHAR FAR *)&BadPtr );   printf("\nOpenStation, rc = %d", 
  14241. ReturnCode );   printf("\nccbRc = %x", ControlBlock.ccb_retcode); } 
  14242.  
  14243.  
  14244. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14245.  
  14246. #define INCL_BASE
  14247. typedef unsigned char byte;
  14248. typedef unsigned short int word;
  14249. typedef unsigned long int dword;
  14250. typedef unsigned char far * address;
  14251. #include <os2.h>
  14252. #include <stdio.h>
  14253. #include <string.h>
  14254. #include <stdlib.h>
  14255. #include <dos.h>
  14256. #include <lan_1_c.h>
  14257. #include <lan_2_c.h>
  14258. #include <lan_3_c.h>
  14259. #include <lan_4_c.h>
  14260. #include <lan_5_c.h>
  14261. #include <lan_6_c.h>
  14262. struct ccb2_form {
  14263.     byte ccb_adapter;
  14264.     byte ccb_command;
  14265.     byte ccb_retcode;
  14266.     byte ccb_work;
  14267.     address ccb_pointer;
  14268.     dword ccb_cmpl_flag;
  14269.     word ccb_parm_offset;
  14270.     word ccb_parameter_1;
  14271.     dword ccb_semaphore;
  14272.     byte ccb_appl_id;
  14273.     byte ccb_read_flag;
  14274.     word ccb_appl_key;
  14275.     word ccb_parameter_2;
  14276. };
  14277. struct     dlc_status_read_form
  14278.    {
  14279.       word       sap_station_id;
  14280.       byte       option_indicator;
  14281.       byte       event_set;
  14282.       byte       event;
  14283.       byte       critical_subset;
  14284.       dword      notification_flag;
  14285.       word       station_id;
  14286.       word       dlc_status_code;
  14287.       byte       frmr_data[5];
  14288.       byte       access_priority;
  14289.       byte       remote_node[6];
  14290.       byte       remote_sap;
  14291.       byte       reserve1;
  14292.       word       user_stat_value;
  14293.       byte       extr_byte[6];
  14294.    };
  14295. void Read(ApplicationID, SapID)
  14296. byte ApplicationID;
  14297. word SapID;
  14298.    {
  14299.       struct ccb2_form ControlBlock;
  14300.       CHAR *Ptr;
  14301.       USHORT ReturnCode;
  14302.       address BadPtr;
  14303.       struct dlc_status_read_form Read;
  14304.       memset((char far *) &ControlBlock, 0,
  14305.         sizeof (struct ccb2_form));
  14306.       memset((char far *) &Read ,
  14307.         0, sizeof (struct dlc_status_read_form));
  14308.       Ptr = (char far *) &Read ;
  14309.       ControlBlock.ccb_parm_offset = FP_OFF (Ptr);
  14310.       ControlBlock.ccb_adapter = 0x00;
  14311.       ControlBlock.ccb_command = LLC_READ;
  14312.       ControlBlock.ccb_retcode = 0xff;
  14313.       ControlBlock.ccb_pointer = (unsigned char *)0L;
  14314.       ControlBlock.ccb_cmpl_flag = 0x0001;
  14315.       ControlBlock.ccb_appl_id = ApplicationID;
  14316.       Read.sap_station_id = SapID;
  14317.       Read.option_indicator = 0x01;
  14318.       Read.event_set = 0x08;
  14319.       ReturnCode = ACSLAN((char far *) &ControlBlock,
  14320.         (CHAR FAR *)&BadPtr);
  14321.    }
  14322.  
  14323.  
  14324. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14325.  
  14326. #define INCL_BASE
  14327. typedef unsigned char byte;
  14328. typedef unsigned short int word;
  14329. typedef unsigned long int dword;
  14330. typedef unsigned char far * address;
  14331. #include <os2.h>
  14332. #include <stdio.h>
  14333. #include <string.h>
  14334. #include <stdlib.h>
  14335. #include <dos.h>
  14336. #include <lan_1_c.h>
  14337. #include <lan_2_c.h>
  14338. #include <lan_3_c.h>
  14339. #include <lan_4_c.h>
  14340. #include <lan_5_c.h>
  14341. #include <lan_6_c.h>
  14342. struct ccb2_form {
  14343.     byte ccb_adapter;
  14344.     byte ccb_command;
  14345.     byte ccb_retcode;
  14346.     byte ccb_work;
  14347.     address ccb_pointer;
  14348.     dword ccb_cmpl_flag;
  14349.     word ccb_parm_offset;
  14350.     word ccb_parameter_1;
  14351.     dword ccb_semaphore;
  14352.     byte ccb_appl_id;
  14353.     byte ccb_read_flag;
  14354.     word ccb_appl_key;
  14355.     word ccb_parameter_2;
  14356. };
  14357. struct     dlc_rcv_form
  14358.    {
  14359.       word       station_id;
  14360.       word       user_length;
  14361.       dword      receive_flag;
  14362.       address    first_buffer;
  14363.       byte       options;
  14364.       byte       reseve1[3];
  14365.       byte       rcv_read_option;
  14366.    };
  14367. void Receive(ApplicationID, SapID)
  14368. byte ApplicationID;
  14369. word SapID;
  14370.    {
  14371.       struct ccb2_form ControlBlock;
  14372.       CHAR *Ptr;
  14373.       USHORT ReturnCode;
  14374.       address BadPtr;
  14375.       struct dlc_rcv_form Receive;
  14376.       memset((char far *) &ControlBlock, 0,
  14377.         sizeof (struct ccb2_form));
  14378.       memset((char far *) &Receive, 0,
  14379.         sizeof (struct dlc_rcv_form));
  14380.       Ptr = (char far *) &Receive;
  14381.       ControlBlock.ccb_parm_offset = FP_OFF (Ptr);
  14382.       ControlBlock.ccb_command = LLC_RECEIVE;
  14383.       ControlBlock.ccb_retcode = 0xff;
  14384.       ControlBlock.ccb_pointer = (unsigned char *)0L;
  14385.       ControlBlock.ccb_cmpl_flag = 0x0001;
  14386.       ControlBlock.ccb_appl_id = ApplicationID;
  14387.       Receive.station_id = SapID;
  14388.       ReturnCode = ACSLAN((char far *) &ControlBlock,
  14389.         (CHAR FAR *)&BadPtr);
  14390.    }
  14391.  
  14392.  
  14393. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14394.  
  14395. #define INCL_BASE
  14396. typedef unsigned char byte;
  14397. typedef unsigned short int word;
  14398. typedef unsigned long int dword;
  14399. typedef unsigned char far * address;
  14400. #include <os2.h>
  14401. #include <stdio.h>
  14402. #include <string.h>
  14403. #include <stdlib.h>
  14404. #include <dos.h>
  14405. #include <lan_1_c.h>
  14406. #include <lan_2_c.h>
  14407. #include <lan_3_c.h>
  14408. #include <lan_4_c.h>
  14409. #include <lan_5_c.h>
  14410. #include <lan_6_c.h>
  14411. struct ccb2_form {
  14412.     byte ccb_adapter;
  14413.     byte ccb_command;
  14414.     byte ccb_retcode;
  14415.     byte ccb_work;
  14416.     address ccb_pointer;
  14417.     dword ccb_cmpl_flag;
  14418.     word ccb_parm_offset;
  14419.     word ccb_parameter_1;
  14420.     dword ccb_semaphore;
  14421.     byte ccb_appl_id;
  14422.     byte ccb_read_flag;
  14423.     word ccb_appl_key;
  14424.     word ccb_parameter_2;
  14425. };
  14426. void ReceiveCancel(StationID)
  14427. word StationID;
  14428. {
  14429.     struct ccb2_form ControlBlock;
  14430.     USHORT ReturnCode;
  14431.     address BadPtr;
  14432.     memset((CHAR FAR *)&ControlBlock,0, sizeof(
  14433.         struct ccb2_form));
  14434.     ControlBlock.ccb_adapter = 0x00;
  14435.     ControlBlock.ccb_command = LLC_RECEIVE_CANCEL;
  14436.     ControlBlock.ccb_cmpl_flag = 0x0001;
  14437.     ControlBlock.ccb_semaphore = 0x00;
  14438.     ControlBlock.ccb_parm_offset = StationID;
  14439.     ReturnCode = ACSLAN((CHAR FAR *)&ControlBlock,
  14440.         (CHAR FAR *)&BadPtr);
  14441.     printf("LLC_RECEIVE_CANCEL = %d", ReturnCode );
  14442. }
  14443.  
  14444.  
  14445. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14446.  
  14447. #define INCL_BASE
  14448. typedef unsigned char byte;
  14449. typedef unsigned short int word;
  14450. typedef unsigned long int dword;
  14451. typedef unsigned char far * address;
  14452. #include <os2.h>
  14453. #include <stdio.h>
  14454. #include <string.h>
  14455. #include <stdlib.h>
  14456. #include <dos.h>
  14457. #include <lan_1_c.h>
  14458. #include <lan_2_c.h>
  14459. #include <lan_3_c.h>
  14460. #include <lan_4_c.h>
  14461. #include <lan_5_c.h>
  14462. #include <lan_6_c.h>
  14463. struct ccb2_form {
  14464.     byte ccb_adapter;
  14465.     byte ccb_command;
  14466.     byte ccb_retcode;
  14467.     byte ccb_work;
  14468.     address ccb_pointer;
  14469.     dword ccb_cmpl_flag;
  14470.     word ccb_parm_offset;
  14471.     word ccb_parameter_1;
  14472.     dword ccb_semaphore;
  14473.     byte ccb_appl_id;
  14474.     byte ccb_read_flag;
  14475.     word ccb_appl_key;
  14476.     word ccb_parameter_2;
  14477. };
  14478. struct     dlc_transmit_form
  14479.    {
  14480.       word       station_id;
  14481.       byte       transmit_fs;
  14482.       byte       rsap;
  14483.       address    xmit_queu_one;
  14484.       address    xmit_queu_two;
  14485.       word       buffer_len_one;
  14486.       word       buffer_len_two;
  14487.       address    buffer_one;
  14488.       address    buffer_two;
  14489.       byte       xmit_read_option;
  14490.    };
  14491. void TransmitFrame(ApplicationID, LinkID, message)
  14492. byte ApplicationID;
  14493. word LinkID;
  14494. CHAR *message;
  14495.    {
  14496.       CHAR *Ptr;
  14497.       USHORT ReturnCode;
  14498.       address BadPtr;
  14499.       struct ccb2_form ControlBlock;
  14500.       struct dlc_transmit_form TransmitFrame;
  14501.    /* reset structures */
  14502.       memset((char far *) &ControlBlock, 0,
  14503.         sizeof (struct ccb2_form));
  14504.       memset((char far *) &TransmitFrame, 0,
  14505.         sizeof (struct dlc_transmit_form));
  14506.    /* set pointer to command specific parameter table */
  14507.       Ptr = (char far *) &TransmitFrame;
  14508.       ControlBlock.ccb_parm_offset = FP_OFF (Ptr);
  14509.    /* set adapter and command code                     */
  14510.       ControlBlock.ccb_adapter = 0x00;
  14511.       ControlBlock.ccb_command = LLC_TRANSMIT_I_FRAME;
  14512.       ControlBlock.ccb_retcode = 0xFF;
  14513.       ControlBlock.ccb_cmpl_flag = 0x0001;
  14514.       ControlBlock.ccb_appl_id = ApplicationID;
  14515.       TransmitFrame.station_id = LinkID;
  14516.       TransmitFrame.rsap = 0xA4;
  14517.       TransmitFrame.buffer_len_one = strlen(message);
  14518.       TransmitFrame.buffer_one = (address) message;
  14519.       TransmitFrame.buffer_len_two = 0x0000;
  14520.       TransmitFrame.buffer_two = (unsigned char *)0L;
  14521.       ReturnCode = ACSLAN((CHAR FAR *) &ControlBlock,
  14522.         (CHAR FAR *)&BadPtr);
  14523.    }
  14524.  
  14525.  
  14526. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14527.  
  14528. /*********************************************************************/
  14529. /*  Include all OS/2 1.x definitions                                 */
  14530. /*********************************************************************/
  14531. #include <lan_7_c.h>
  14532. #include <stdio.h>
  14533. #include <netb_1_c.h>
  14534. #include <netb_2_c.h>
  14535. extern unsigned pascal far NETBIOS (char far *);
  14536. struct network_control_block ncb1;
  14537. unsigned NETB_RETC;
  14538. void add_group_name(loc_name)
  14539. char *loc_name;
  14540.    {
  14541.       /* clear out control block */
  14542.       memset((char far *) &ncb1,0,
  14543.             sizeof(struct network_control_block));
  14544.       /* insert name to be added */
  14545.       strcpy(ncb1.ncb_name, loc_name);
  14546.       ncb1.ncb_command = NB_ADD_GROUP_NAME_WAIT;
  14547.       ncb1.ncb_lana_num = 0;  /* use your adapter num here */
  14548.       /* call NETBIOS */
  14549.       NETB_RETC = NETBIOS((char far *) &ncb1);
  14550.    }
  14551.  
  14552.  
  14553. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14554.  
  14555. /*******************************************************/
  14556. /*  Include all OS/2 1.x definitions                   */
  14557. /*******************************************************/
  14558. #include <lan_7_c.h>
  14559. #include <stdio.h>
  14560. #include <netb_1_c.h>
  14561. #include <netb_2_c.h>
  14562. extern unsigned pascal far NETBIOS (char far *);
  14563. struct network_control_block ncb1;
  14564. unsigned NETB_RETC;
  14565. void add__name(loc_name)
  14566. char *loc_name;
  14567.    {
  14568.       /* clear out control block */
  14569.       memset((char far *) &ncb1,0,
  14570.             sizeof(struct network_control_block));
  14571.       /* insert name to be added */
  14572.       strcpy(ncb1.ncb_name, loc_name);
  14573.       ncb1.ncb_command = NB_ADD_NAME_WAIT;
  14574.       ncb1.ncb_lana_num = 0;  /* use your adapter num here */
  14575.       NETB_RETC = NETBIOS((char far *) &ncb1);
  14576.    }
  14577.  
  14578.  
  14579. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14580.  
  14581. /*********************************************************************/
  14582. /*  Include all OS/2 1.x definitions                                 */
  14583. /*********************************************************************/
  14584. #include <lan_7_c.h>
  14585. #include <stdio.h>
  14586. #include <netb_1_c.h>
  14587. #include <netb_2_c.h>
  14588. /* definitions and externals */
  14589. extern unsigned pascal far NETBIOS (char far *);
  14590. struct network_control_block ncb1;
  14591. unsigned far NETB_RETC;
  14592. char call_ncb(loc_name, remote_name)
  14593. char *loc_name,*remote_name;
  14594.    {
  14595.        /* first clear out structure */
  14596.        memset((char far *) &ncb1,0,
  14597.             sizeof(struct network_control_block));
  14598.        /* insert the local name */
  14599.        strcpy(ncb1.ncb_name, loc_name);
  14600.        /* insert the remote name */
  14601.        strcpy(ncb1.ncb_callname, remote_name);
  14602.        /* insert adapter number */
  14603.        ncb1.ncb_lana_num = 0x0000;
  14604.        ncb1.ncb_command  = NB_CALL_WAIT;
  14605.        /* these are the timeout values */
  14606.        ncb1.ncb_rto = 0x0000;
  14607.        ncb1.ncb_sto = 0x0000;
  14608.        /* call NETBIOS */
  14609.        NETB_RETC = NETBIOS((char far*) &ncb1);
  14610.        return(ncb1.ncb_lsn);
  14611.    }
  14612.  
  14613.  
  14614. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14615.  
  14616. /*******************************************************/
  14617. /*  Include all OS/2 1.x definitions                   */
  14618. /*******************************************************/
  14619. #include <lan_7_c.h>
  14620. #include <stdio.h>
  14621. #include <netb_1_c.h>
  14622. #include <netb_2_c.h>
  14623. extern unsigned pascal far NETBIOS (char far *);
  14624. struct network_control_block ncb1;
  14625. unsigned NETB_RETC;
  14626. void delete__name(loc_name)
  14627. char *loc_name;
  14628.    {
  14629.       /* clear out control block */
  14630.       memset((char far *) &ncb1,0,
  14631.             sizeof(struct network_control_block));
  14632.       /* insert name to be added */
  14633.       strcpy(ncb1.ncb_name, loc_name);
  14634.       ncb1.ncb_command = NB_DELETE_NAME_WAIT;
  14635.       ncb1.ncb_lana_num = 0;  /* use your adapter num here */
  14636.       NETB_RETC = NETBIOS((char far *) &ncb1);
  14637.    }
  14638.  
  14639.  
  14640. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14641.  
  14642.   struct name_info
  14643.    {
  14644.     struct ncb_find_name_info common;
  14645.     BYTE       header_len;
  14646.     struct  ncb_lan_header_entry LanInfo[10];
  14647.              /* reserved space to hold 10 LAN headers */
  14648.    } info;
  14649. struct     ncb_lan_header_entry
  14650.  {
  14651.   byte  lan_entry_length;        /* Length of entry          */
  14652.   byte  lan_pcf0;                /* Physical control field 0 */
  14653.   byte  lan_pcf1;                /* Physical control field 1 */
  14654.   byte  lan_destination_addr[6]; /* Destination address      */
  14655.   byte  lan_source_addr[6];      /* Source address           */
  14656.   byte  lan_routing_info[18];    /* Routing information      */
  14657.  };
  14658. /*******************************************************/
  14659. /*  Include all OS/2 1.x definitions                   */
  14660. /*******************************************************/
  14661. #include <lan_7_c.h>
  14662. #include <stdio.h>
  14663. #include <netb_1_c.h>
  14664. #include <netb_2_c.h>
  14665. extern unsigned pascal far NETBIOS (char far *);
  14666. struct network_control_block ncb1;
  14667. unsigned NETB_RETC;
  14668. void find__name(loc_name)
  14669. char *loc_name;
  14670.    {
  14671.       /* clear out control block */
  14672.       memset((char far *) &ncb1,0,
  14673.             sizeof(struct network_control_block));
  14674.       /* insert name to be found */
  14675.       strcpy(ncb1.ncb_callname, loc_name );
  14676.       ncb1.ncb_length = sizeof( info );
  14677.       ncb1.ncb_buffer_address = (address)&info;
  14678.       ncb1.ncb_command = NB_FIND_NAMEWAIT;
  14679.       ncb1.ncb_lana_num = 0;  /* use your adapter num here */
  14680.       NETB_RETC = NETBIOS((char far *) &ncb1);
  14681.    }
  14682.  
  14683.  
  14684. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14685.  
  14686. /*****************************************************/
  14687. /*  Include all OS/2 1.x definitions                 */
  14688. /*****************************************************/
  14689. #include <lan_7_c.h>
  14690. #include <stdio.h>
  14691. #include <netb_1_c.h>
  14692. #include <netb_2_c.h>
  14693. extern unsigned pascal far NETBIOS (char far *);
  14694. struct network_control_block ncb1;
  14695. unsigned far NETB_RETC;
  14696. void ncb_hang_up(lsn)
  14697. byte lsn; /* local session number */
  14698.         {
  14699.            /* clear out control block */
  14700.            memset((char far *) &ncb1,0,
  14701.                 sizeof(struct network_control_block));
  14702.            ncb1.ncb_command = NB_HANG_UP_WAIT;
  14703.            /* insert your adapter num here */
  14704.            ncb1.ncb_lana_num = 0;
  14705.            /* this is the local session num */
  14706.            ncb1.ncb_lsn = lsn;
  14707.            /* call NETBIOS */
  14708.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14709.         }
  14710.  
  14711.  
  14712. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14713.  
  14714. /*****************************************************/
  14715. /*  Include all OS/2 1.x definitions                 */
  14716. /*****************************************************/
  14717. #include <lan_7_c.h>
  14718. #include <stdio.h>
  14719. #include <netb_1_c.h>
  14720. #include <netb_2_c.h>
  14721. extern unsigned pascal far NETBIOS (char far *);
  14722. struct network_control_block ncb1;
  14723. unsigned far retval,NETB_RETC;
  14724. /***********************************************************/
  14725. /*         MSG.LISTEN                                      */
  14726. /*                                                         */
  14727. /*   This module enables a session to be opened with the   */
  14728. /*   name specified in the ncb_callname field, using the   */
  14729. /*   name specified by the ncb_name field                  */
  14730. /***********************************************************/
  14731. byte listen(cal_name,locc_name)
  14732. /* calling name */
  14733. char far * cal_name;
  14734. /* local name   */
  14735. char far * locc_name;
  14736.      {
  14737.         /* clear out control block */
  14738.         memset((char far *) &ncb1,0,
  14739.                 sizeof(struct network_control_block));
  14740.         ncb1.ncb_command = NB_LISTEN_WAIT;
  14741.         /* insert your adapter num here */
  14742.         ncb1.ncb_lana_num = 0X0000;
  14743.         strcpy(ncb1.ncb_name,locc_name);
  14744.         strcpy(ncb1.ncb_callname,cal_name);
  14745.         /* time out values , 0 and no timeout will occur*/
  14746.         ncb1.ncb_rto = 0x00;
  14747.         ncb1.ncb_sto = 0x00;
  14748.         /* call NETBIOS */
  14749.         NETB_RETC = NETBIOS((char far *)&ncb1);
  14750.         return(ncb1.ncb_lsn);
  14751.       }
  14752.  
  14753.  
  14754. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14755.  
  14756. /*****************************************************/
  14757. /*  Include all OS/2 1.x definitions                 */
  14758. /*****************************************************/
  14759. #include <lan_7_c.h>
  14760. #include <stdio.h>
  14761. #include <netb_1_c.h>
  14762. #include <netb_2_c.h>
  14763. extern unsigned pascal far NETBIOS (char far *);
  14764. struct network_control_block ncb1;
  14765. unsigned far retval,NETB_RETC;
  14766. char rec_buff[10];  /* receiving buffer */
  14767. /****************************************************/
  14768. /*      MSG.RECEIVE                                 */
  14769. /*                                                  */
  14770. /*    This module receives data from the session    */
  14771. /*    partner that sends data to you.               */
  14772. /****************************************************/
  14773. void msg_receive(lsn)
  14774. byte lsn; /* local session number */
  14775.         {
  14776.            /* clear out control block */
  14777.            memset((char far *) &ncb1,0,
  14778.                 sizeof(struct network_control_block));
  14779.            ncb1.ncb_command = NB_RECEIVE_WAIT;
  14780.            /* insert your adapter num here */
  14781.            ncb1.ncb_lana_num = 0;
  14782.            ncb1.ncb_lsn = lsn;
  14783.            ncb1.ncb_buffer_address = (address) rec_buff;
  14784.            /* length of rx buffer */
  14785.            ncb1.ncb_length = 10;
  14786.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14787.          }
  14788.  
  14789.  
  14790. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14791.  
  14792. /*****************************************************/
  14793. /*  Include all OS/2 1.x definitions                 */
  14794. /*****************************************************/
  14795. #include <lan_7_c.h>
  14796. #include <stdio.h>
  14797. #include <netb_1_c.h>
  14798. #include <netb_2_c.h>
  14799. extern unsigned pascal far NETBIOS (char far *);
  14800. struct network_control_block ncb1;
  14801. unsigned far retval,NETB_RETC;
  14802. char rec_buff[10];  /* receiving buffer */
  14803. /****************************************************/
  14804. /*      MSG.RECEIVEANY                              */
  14805. /*                                                  */
  14806. /*    This module receives data from any session    */
  14807. /*    partner that sends data to you.               */
  14808. /****************************************************/
  14809. void msg_receive_any()
  14810.         {
  14811.            /* clear out control block */
  14812.            memset((char far *) &ncb1,0,
  14813.                 sizeof(struct network_control_block));
  14814.            ncb1.ncb_command = NB_RECEIVE_ANY_WAIT;
  14815.            /* insert your adapter num here */
  14816.            ncb1.ncb_lana_num = 0;
  14817.            /* set so will rx from ANY session we are
  14818.            connected to */
  14819.            ncb1.ncb_lsn = 0xFF;
  14820.            ncb1.ncb_buffer_address = (address) rec_buff;
  14821.            /* length of rx buffer */
  14822.            ncb1.ncb_length = 10;
  14823.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14824.          }
  14825.  
  14826.  
  14827. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14828.  
  14829. /*****************************************************/
  14830. /*  Include all OS/2 1.x definitions                 */
  14831. /*****************************************************/
  14832. #include <lan_7_c.h>
  14833. #include <stdio.h>
  14834. #include <netb_1_c.h>
  14835. #include <netb_2_c.h>
  14836. extern unsigned pascal far NETBIOS (char far *);
  14837. struct network_control_block ncb1;
  14838. unsigned far retval,NETB_RETC;
  14839. char rec_buff[10];  /* receiving buffer */
  14840. /****************************************************/
  14841. /*      MSG.RECEIVEBROADCASTDATAGRAM                */
  14842. /*                                                  */
  14843. /*    This module receives a datagram message       */
  14844. /*    from any name on the network that issues      */
  14845. /*    an NCB.SEND.BROADCAST.DATAGRAM                */
  14846. /****************************************************/
  14847. void msg_receive_broadcast_datagram(num)
  14848. byte num; /* returned from ADD_NAME */
  14849.         {
  14850.            /* clear out control block */
  14851.            memset((char far *) &ncb1,0,
  14852.                 sizeof(struct network_control_block));
  14853.            ncb1.ncb_command = NB_RECEIVE_BROADCAST_DATAGRAM_W;
  14854.            /* insert your adapter num here */
  14855.            ncb1.ncb_lana_num = 0;
  14856.            /* number of application program name */
  14857.            ncb1.ncb_num = num;
  14858.            ncb1.ncb_buffer_address = (address) rec_buff;
  14859.            /* length of rx buffer */
  14860.            ncb1.ncb_length = 10;
  14861.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14862.          }
  14863.  
  14864.  
  14865. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14866.  
  14867. /*****************************************************/
  14868. /*  Include all OS/2 1.x definitions                 */
  14869. /*****************************************************/
  14870. #include <lan_7_c.h>
  14871. #include <stdio.h>
  14872. #include <netb_1_c.h>
  14873. #include <netb_2_c.h>
  14874. extern unsigned pascal far NETBIOS (char far *);
  14875. struct network_control_block ncb1;
  14876. unsigned far retval,NETB_RETC;
  14877. char rec_buff[10];  /* receiving buffer */
  14878. /****************************************************/
  14879. /*      MSG.RECEIVE.DATAGRAM                        */
  14880. /*                                                  */
  14881. /*    This module receives a datagram message       */
  14882. /*    from any name on the network that issues      */
  14883. /*    an NCB.SEND.DATAGRAM                          */
  14884. /****************************************************/
  14885. void msg_receive_datagram()
  14886.         {
  14887.            /* clear out control block */
  14888.            memset((char far *) &ncb1,0,
  14889.                 sizeof(struct network_control_block));
  14890.            ncb1.ncb_command = NB_RECEIVE_DATAGRAM_WAIT;
  14891.            /* insert your adapter num here */
  14892.            ncb1.ncb_lana_num = 0;
  14893.            /* want to rx from anybody on the network
  14894.            so use FF */
  14895.            ncb1.ncb_num = 0xFF;
  14896.            ncb1.ncb_buffer_address = (address) rec_buff;
  14897.            /* length of rx buffer */
  14898.            ncb1.ncb_length = 10;
  14899.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14900.          }
  14901.  
  14902.  
  14903. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14904.  
  14905. /**************************************************/
  14906. /*  Include all OS/2 1.x definitions              */
  14907. /**************************************************/
  14908. #include <lan_7_c.h>
  14909. #include <stdio.h>
  14910. #include <netb_1_c.h>
  14911. #include <netb_2_c.h>
  14912. extern unsigned pascal far NETBIOS (char far *);
  14913. struct network_control_block ncb1;
  14914. unsigned far NETB_RETC;
  14915. /***************************************************/
  14916. /*   This function resets the local settings       */
  14917. /***************************************************/
  14918. void reset_netbios()
  14919.    {
  14920.       /* clear out control block */
  14921.       memset((char far *) &ncb1,0,
  14922.             sizeof(struct network_control_block));
  14923.       ncb1.ncb_command  = NB_RESET_WAIT;
  14924.       /* insert your lan adapter number here */
  14925.       ncb1.ncb_lana_num = 0X0000;
  14926.       /* lsn = 0, means requesting resources */
  14927.       ncb1.ncb_lsn      = 0X00FF;
  14928.       /* call NETBIOS */
  14929.       NETB_RETC = NETBIOS((char far *) &ncb1);
  14930.    }
  14931.  
  14932.  
  14933. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14934.  
  14935. /*****************************************************/
  14936. /*  Include all OS/2 1.x definitions                 */
  14937. /*****************************************************/
  14938. #include <lan_7_c.h>
  14939. #include <stdio.h>
  14940. #include <netb_1_c.h>
  14941. #include <netb_2_c.h>
  14942. extern unsigned pascal far NETBIOS (char far *);
  14943. struct network_control_block ncb1;
  14944. unsigned far retval,NETB_RETC;
  14945. char tx_buff[10];  /* receiving buffer */
  14946. /****************************************************/
  14947. /*      MSG.SEND                                    */
  14948. /*                                                  */
  14949. /*    This module sends data to the session         */
  14950. /*    partner                                       */
  14951. /****************************************************/
  14952. void msg_send(lsn)
  14953. byte lsn; /* local session number */
  14954.         {
  14955.            /* clear out control block */
  14956.            memset((char far *) &ncb1,0,
  14957.                 sizeof(struct network_control_block));
  14958.            ncb1.ncb_command = NB_SEND_WAIT;
  14959.            strcpy(tx_buff, "Message");
  14960.            /* insert your adapter num here */
  14961.            ncb1.ncb_lana_num = 0;
  14962.            ncb1.ncb_lsn = lsn;
  14963.            ncb1.ncb_buffer_address = (address) tx_buff;
  14964.            /* length of rx buffer */
  14965.            ncb1.ncb_length = strlen(tx_buff);
  14966.            NETB_RETC = NETBIOS((char far *) &ncb1);
  14967.          }
  14968.  
  14969.  
  14970. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  14971.  
  14972. /*****************************************************/
  14973. /*  Include all OS/2 1.x definitions                 */
  14974. /*****************************************************/
  14975. #include <lan_7_c.h>
  14976. #include <stdio.h>
  14977. #include <netb_1_c.h>
  14978. #include <netb_2_c.h>
  14979. extern unsigned pascal far NETBIOS (char far *);
  14980. struct network_control_block ncb1;
  14981. unsigned far retval,NETB_RETC;
  14982. char tx_buff[10];  /* receiving buffer */
  14983. /****************************************************/
  14984. /*      MSG.SEND.BROADCAST.DATAGRAM                 */
  14985. /*                                                  */
  14986. /*    This module sends data to every station that  */
  14987. /*    has an NCB.RECEIVE.BROADCAST.DATAGRAM command */
  14988. /*    outstanding.                                  */
  14989. /****************************************************/
  14990. void msg_send_broadcast_datagram( num)
  14991. byte num; /* number returned from ADD_NAME */
  14992.         {
  14993.            /* clear out control block */
  14994.            memset((char far *) &ncb1,0,
  14995.                 sizeof(struct network_control_block));
  14996.            ncb1.ncb_command = NB_SEND_BROADCAST_DATAGRAM_WAIT;
  14997.            strcpy(tx_buff, "Message");
  14998.            /* insert your adapter num here */
  14999.            ncb1.ncb_lana_num = 0;
  15000.            ncb1.ncb_num = num;
  15001.            ncb1.ncb_buffer_address = (address) tx_buff;
  15002.            /* length of rx buffer */
  15003.            ncb1.ncb_length = strlen(tx_buff);
  15004.            NETB_RETC = NETBIOS((char far *) &ncb1);
  15005.          }
  15006.  
  15007.  
  15008. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15009.  
  15010. /*****************************************************/
  15011. /*  Include all OS/2 1.x definitions                 */
  15012. /*****************************************************/
  15013. #include <lan_7_c.h>
  15014. #include <stdio.h>
  15015. #include <netb_1_c.h>
  15016. #include <netb_2_c.h>
  15017. extern unsigned pascal far NETBIOS (char far *);
  15018. struct network_control_block ncb1;
  15019. unsigned far retval,NETB_RETC;
  15020. char tx_buff[10];  /* receiving buffer */
  15021. /****************************************************/
  15022. /*      MSG.SEND.DATAGRAM                           */
  15023. /*                                                  */
  15024. /*    This module sends data to the session         */
  15025. /*    partner                                       */
  15026. /****************************************************/
  15027. void msg_send_datagram(lsn, callingname, num)
  15028. byte lsn; /* local session number */
  15029. char *callingname;   /* name to send message to */
  15030. byte num; /* number of session to send message to */
  15031.         {
  15032.            /* clear out control block */
  15033.            memset((char far *) &ncb1,0,
  15034.                 sizeof(struct network_control_block));
  15035.            ncb1.ncb_command = NB_SEND_DATAGRAM_WAIT;
  15036.            strcpy(tx_buff, "Message");
  15037.            /* insert your adapter num here */
  15038.            ncb1.ncb_lana_num = 0;
  15039.            ncb1.ncb_lsn = lsn;
  15040.            /* insert name */
  15041.            strcpy(ncb1.ncb_callname, callingname );
  15042.            ncb1.ncb_num = num;
  15043.            ncb1.ncb_buffer_address = (address) tx_buff;
  15044.            /* length of rx buffer */
  15045.            ncb1.ncb_length = strlen(tx_buff);
  15046.            NETB_RETC = NETBIOS((char far *) &ncb1);
  15047.          }
  15048.  
  15049.  
  15050. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15051.  
  15052. /*****************************************************/
  15053. /*  Include all OS/2 1.x definitions                 */
  15054. /*****************************************************/
  15055. #include <lan_7_c.h>
  15056. #include <stdio.h>
  15057. #include <netb_1_c.h>
  15058. #include <netb_2_c.h>
  15059. struct stat2 {
  15060.     BYTE  local_session_number; /* Local session number      */
  15061.     BYTE  session_state;        /* State of session          */
  15062.     BYTE  local_name[16];       /* Local name                */
  15063.     BYTE  remote_name[16];      /* Remote name               */
  15064.     BYTE  active_receives;      /* # of RECEIVE cmnds out    */
  15065.     BYTE  active_sends;         /* # of SEND, CHAIN.SEND out */
  15066. };
  15067. struct s_status {
  15068.    BYTE name_number_of_sessions; /* Name number for sessions  */
  15069.    BYTE sessions_using_name;     /* # of sessions using name  */
  15070.    BYTE active_rcv_datagrams;    /* # of receive datagrams out*/
  15071.    BYTE active_receive_anys;     /* # of RECEIVE.ANY cmnds out*/
  15072.     struct stat2 info[100];     /* can hold up to 100 sessions*/
  15073. } sess_stat;
  15074. extern unsigned pascal far NETBIOS (char far *);
  15075. struct network_control_block ncb1;
  15076. unsigned far retval,NETB_RETC;
  15077. call_session_status ()
  15078. {
  15079.     int i;
  15080.     int a,max;
  15081.     /* clear out control block */
  15082.     memset((char far *) &ncb1,0,
  15083.          sizeof(struct network_control_block));
  15084.     ncb1.ncb_command =  NB_SESSION_STATUS_WAIT;
  15085.     /* insert your adapter num here */
  15086.     ncb1.ncb_lana_num = 0;
  15087.     strcpy (ncb1.ncb_name, "*");
  15088.     /* status of all names will be returned
  15089.     if an asterisk (*) is specified. */
  15090.     ncb1.ncb_length=sizeof (struct s_status);
  15091.     ncb1.ncb_buffer_address=(char far *)&sess_stat;
  15092.     NETB_RETC = NETBIOS((char far *) &ncb1);
  15093.     printf ( "-----------SESSION STATUS INFO -------------\n");
  15094.     printf ( "Name number for sessions:%d.\n",
  15095.                  sess_stat.name_number_of_sessions);
  15096.     printf ( "# of sessions using name:%d.\n",
  15097.                  sess_stat.sessions_using_name);
  15098.     printf ( "# of receive datagrams out:%d.\n",
  15099.                  sess_stat.active_rcv_datagrams);
  15100.     printf ( "# of RECEIVE.ANY cmnds out:%d.\n",
  15101.                  sess_stat.active_receive_anys);
  15102.     a=0;
  15103.     max=(ncb1.ncb_length-4) / 36;
  15104.     while (a < max) {
  15105.         printf ( "-------------------------------------\n");
  15106.         printf ( "  Local session number:%d.\n",
  15107.                    sess_stat.info[a].local_session_number);
  15108.         printf ( "  State of session:");
  15109.         switch (sess_stat.info[a].session_state) {
  15110.              case 1: printf ( "Listen outstanding.\n");
  15111.                 break;
  15112.              case 2: printf ( "CALL pending.\n");
  15113.                 break;
  15114.              case 3: printf ( "Session established.\n");
  15115.                 break;
  15116.              case 4: printf ( "HANG UP pending.\n");
  15117.                 break;
  15118.              case 5: printf ( "HANG UP complete.\n");
  15119.                 break;
  15120.              case 6: printf ( "Session aborted.\n");
  15121.                 break;
  15122.         }
  15123.         printf ( "  Local name:%s.\n",
  15124.            sess_stat.info[a].local_name);
  15125.         printf ( "  Remote name:%s.\n",
  15126.            sess_stat.info[a].remote_name);
  15127.         printf ( "  # of RECEIVE cmnds out:%d.\n",
  15128.            sess_stat.info[a].active_receives);
  15129.         printf ( "  # of SEND, CHAIN.SEND out:%d.\n",
  15130.            sess_stat.info[a].active_sends);
  15131.         a++;
  15132.     }
  15133. }
  15134.  
  15135.  
  15136. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15137.  
  15138. /*****************************************************/
  15139. /*  Include all OS/2 1.x definitions                 */
  15140. /*****************************************************/
  15141. #include <lan_7_c.h>
  15142. #include <stdio.h>
  15143. #include <netb_1_c.h>
  15144. #include <netb_2_c.h>
  15145. extern unsigned pascal far NETBIOS (char far *);
  15146. struct network_control_block ncb1;
  15147. unsigned far NETB_RETC;
  15148. /* include file from netb_2_c.h */
  15149. struct     ncb_status_information
  15150.  {
  15151.   byte  burned_in_addr[6];       /* Adapter's burned in addr  */
  15152.   byte  reserved1[2];            /* RESERVED always X'0000'   */
  15153.   word  software_level_number;   /* X'FFnn' - nn is level num */
  15154.   word  reporting_period;        /* reporting period (minutes)*/
  15155.   word  frmr_frames_received;    /* Number of FRMR received   */
  15156.   word  frmr_frames_sent;        /* Number of FRMR sent       */
  15157.   word  bad_iframes_received;    /* # bad Iframes received    */
  15158.   word  aborted_transmissions;   /* # aborted transmits       */
  15159.   dword packets_transmitted;     /* # Successfully transmitted*/
  15160.   dword packets_received;        /* # Successfully received   */
  15161.   word  bad_iframes_transmitted; /* # bad Iframes transmitted */
  15162.   word  lost_data_count;         /* Lost SAP buffer data cnt  */
  15163.   word  t1_expiration_count;     /* Number of T1 expirations  */
  15164.   word  ti_expiration_count;     /* Number of Ti expirations  */
  15165.   byte  reserved2[4];            /* RESERVED always X'00...00'*/
  15166.   word  number_of_free_ncbs;     /* Number of NCBs available  */
  15167.   word  max_configured_ncbs;     /* Configured NCB maximum    */
  15168.   word  max_allowed_ncbs;        /* Maximum NCBs (always 255) */
  15169.   word  busy_condition_count;    /* Local station busy count  */
  15170.   word  max_datagram_size;       /* Maximum datagram packet   */
  15171.   word  pending_sessions;        /* Number of pending sessions*/
  15172.   word  max_configured_sessions; /* Configured session maximum*/
  15173.   word  max_allowed_sessions;    /* Maximum sessions (254)    */
  15174.   word  max_data_packet_size;    /* Maximum session packet    */
  15175.   word  number_of_names_present; /* Number of names in table  */
  15176.  };
  15177. call_status (callingname)
  15178. char *callingname;
  15179. {
  15180.     /* structure to put return into */
  15181.     struct ncb_status_information stat_info;
  15182.     int i;
  15183.     /* clear out control block */
  15184.     memset((char far *) &ncb1,0,
  15185.          sizeof(struct network_control_block));
  15186.     ncb1.ncb_command =  NB_STATUS_WAIT;
  15187.     /* insert your adapter num here */
  15188.     ncb1.ncb_lana_num= 0;
  15189.     strcpy (ncb1.ncb_callname, callingname);    /* call name */
  15190.     ncb1.ncb_buffer_address=(char far *)&stat_info;
  15191.     ncb1.ncb_length=sizeof(struct ncb_status_information);
  15192.     NETB_RETC = NETBIOS((char far *) &ncb1);
  15193.     printf ( "------------------ STATUS INFO ------------\n");
  15194.     printf ( "Burned-in Name..................");
  15195.     for (i = 0; i < 6; i++)
  15196.        printf ( "%02X", stat_info.burned_in_addr[i]);
  15197.     printf ( "\n");
  15198.     printf ( "Software level number:..........%d.\n",
  15199.                stat_info.software_level_number);
  15200.     printf ( "reporting period (minutes):.....%d.\n",
  15201.                stat_info.reporting_period);
  15202.     printf ( "Number of FRMR received:........%d.\n",
  15203.                stat_info.frmr_frames_received);
  15204.     printf ( "Number of FRMR sent:............%d.\n",
  15205.                stat_info.frmr_frames_sent);
  15206.     printf ( "# bad Iframes received:.........%d.\n",
  15207.                stat_info.bad_iframes_received);
  15208.     printf ( "# aborted transmits:............%d.\n",
  15209.                stat_info.aborted_transmissions);
  15210.     printf ( "# Successfully transmitted:.....%ld\n",
  15211.                stat_info.packets_transmitted);
  15212.     printf ( "# Successfully received:........%ld\n",
  15213.                stat_info.packets_received);
  15214.     printf ( "# bad Iframes transmitted:......%d.\n",
  15215.                stat_info.bad_iframes_transmitted);
  15216.     printf ( "Lost SAP buffer data cnt:.......%d.\n",
  15217.                stat_info.lost_data_count);
  15218.     printf ( "Number of T1 expirations:.......%d.\n",
  15219.                stat_info.t1_expiration_count);
  15220.     printf ( "Number of Ti expirations:.......%d.\n",
  15221.                stat_info.ti_expiration_count);
  15222.     printf ( "Reserved2[4] (old extended_stat_addr)..%p.\n",
  15223.                stat_info.reserved2);
  15224.     printf ( "Number of NCBs available:.......%d.\n",
  15225.                stat_info.number_of_free_ncbs);
  15226.     printf ( "Configured NCB maximum:.........%d.\n",
  15227.                stat_info.max_configured_ncbs);
  15228.     printf ( "Maximum NCBs (always 255):......%d.\n",
  15229.                stat_info.max_allowed_ncbs);
  15230.     printf ( "Local station busy count:.......%d.\n",
  15231.                stat_info.busy_condition_count);
  15232.     printf ( "Maximum datagram packet:........%d.\n",
  15233.                stat_info.max_datagram_size);
  15234.     printf ( "Number of pending sessions:.....%d.\n",
  15235.                stat_info.pending_sessions);
  15236.     printf ( "Configured session maximum:.....%d.\n",
  15237.                stat_info.max_configured_sessions);
  15238.     printf ( "Maximum sessions (254):.........%d.\n",
  15239.                stat_info.max_allowed_sessions);
  15240.     printf ( "Maximum session packet:.........%d.\n",
  15241.                stat_info.max_data_packet_size);
  15242.     printf ( "Number of names in table:.......%d.\n",
  15243.                stat_info.number_of_names_present);
  15244. }
  15245.  
  15246.  
  15247. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15248.  
  15249. #define OS2_BASE
  15250. #include <os2.h>
  15251. #include "stdio.h"
  15252. #include "stdlib.h"
  15253. #include "string.h"
  15254. #include "subcalls.h"
  15255. #include "hapi_c.h"
  15256. USHORT DisplayEhllapiInfo(void);
  15257. USHORT DisplaySessionInfo(void);
  15258. USHORT ConnectPresentationSpace(void);
  15259. #define MAX_DATA_SIZE 3840
  15260. /* global variables */
  15261. UCHAR press_ent_msg[] =
  15262. "\n\nPress ENTER to continue...";
  15263. UCHAR dft_sess = NULL;
  15264. USHORT hfunc_num;
  15265. UCHAR hdata_str[MAX_DATA_SIZE];
  15266. USHORT  hds_len;
  15267. USHORT  hrc;
  15268. void cdecl main()
  15269. {
  15270.     USHORT  rc;
  15271.     rc = DisplayEhllapiInfo();
  15272.     /* wait for user key hit */
  15273.     printf(press_ent_msg);
  15274.     fgetchar();
  15275.     rc = DisplaySessionInfo();
  15276.     rc = ConnectPresentationSpace();
  15277. }
  15278. /* This functions calls QuerySystem and displays  */
  15279. /* EHLLAPI version and date                       */
  15280. USHORT DisplayEhllapiInfo()
  15281. {
  15282.     /* Set pointer to the qsys_struct */
  15283.     /* defined in hapi_c.h            */
  15284.     struct qsys_struct * data_ptr =
  15285.         (struct qsys_struct *)hdata_str;
  15286.     USHORT i;
  15287.     USHORT rc = 0;
  15288.     hfunc_num = HA_QUERY_SYSTEM;
  15289.     /* call EHLLAPI                          */
  15290.     hllc(&hfunc_num, data_ptr, &hds_len, &hrc);
  15291.     if (hrc == HARC_SUCCESS){
  15292.         printf("\n  EHLLAPI version: ");
  15293.         fputchar(data_ptr->qsys_hllapi_ver);
  15294.         printf("\n EHLLAPI realease date: ");
  15295.         for (i=0;i <6;i++)
  15296.             fputchar(data_ptr->qsys_hllapi_date[i]);
  15297.     } /* end if */
  15298. }
  15299. /*  This functions calls QuerySessions to find the status of */
  15300. /*  all running sessions.  Note the first session listed is  */
  15301. /*  actually this program                                    */
  15302. USHORT DisplaySessionInfo()
  15303. {
  15304.     /* set the pointer to the qses_struct */
  15305.     /* defined in hapi_c.h                */
  15306.     struct qses_struct * data_ptr =
  15307.         (struct qses_struct *)hdata_str;
  15308.     struct qsst_struct sess_stuc;
  15309.     USHORT i, j;
  15310.     USHORT num_sess;
  15311.     USHORT rc=0;
  15312.     CHAR sesstype[9];
  15313.     printf("\n         Session Info\n\n");
  15314.     hfunc_num = HA_QUERY_SESSIONS;
  15315.     hds_len = MAX_DATA_SIZE / 12 * 12;
  15316.     hllc(&hfunc_num, data_ptr, &hds_len, &hrc );
  15317.     if (hrc == HARC_SUCCESS){
  15318.         num_sess = hds_len;
  15319.         printf("Number of started sessions = %d\n\n",
  15320.             num_sess );
  15321.         for (i=0;((i < num_sess) && (rc==0));i++){
  15322.             printf("Session Number = %d", i+1 );
  15323.             printf("\nSession Long name :");
  15324.             for(j=0;j<8;j++){
  15325.                 if (data_ptr[i].qses_longname[j])
  15326.                     fputchar(data_ptr[i].qses_longname[j]);
  15327.             }
  15328.             printf("\nSession Short name:");
  15329.             printf("%c",data_ptr[i].qses_shortname);
  15330.             printf("\nSession Type:");
  15331.             switch(data_ptr[i].qses_sestype){
  15332.                 case 'H':strcpy(sesstype, "HOST");
  15333.                          break;
  15334.                 case 'P':strcpy(sesstype, "PC");
  15335.                          break;
  15336.                 default:strcpy(sesstype, "UNKNOWN");
  15337.                          break;
  15338.             }
  15339.             printf(sesstype);
  15340.             printf("\nSession PS size : %d",
  15341.                 data_ptr[i].qses_pssize );
  15342.             hfunc_num = HA_QUERY_SESSION_STATUS;
  15343.             hds_len = 18;
  15344.             /* set sess_stuc shortname =           */
  15345.             /* to the shortname in the qses struct */
  15346.             sess_stuc.qsst_shortname =
  15347.                 data_ptr[i].qses_shortname;
  15348.             /* Call EHLLAPI */
  15349.             hllc(&hfunc_num, &sess_stuc, &hds_len, &hrc );
  15350.             if (hrc == HARC_SUCCESS){
  15351.                     printf("\nSession PS rows: %d",
  15352.                         sess_stuc.qsst_ps_rows);
  15353.                     printf("\nSession PS cols: %d",
  15354.                         sess_stuc.qsst_ps_cols);
  15355.             } /* end if */
  15356.         } /* end for */
  15357.     } /* end if */
  15358.     return (rc);
  15359. } /* end fn */
  15360. /* This functions connects a Presentation to Session A  */
  15361. /* and then prints out what is currently visible        */
  15362. /* Note: Change hdata_str[0] to the short session id    */
  15363. /* of any currently running session                     */
  15364. USHORT ConnectPresentationSpace()
  15365. {
  15366.     CHAR *strPresentation;
  15367.     USHORT i, j;
  15368.     strPresentation = (CHAR *)calloc(1, MAX_DATA_SIZE );
  15369.     hfunc_num = HA_CONNECT_PS;
  15370.     hdata_str[0] = 'A';
  15371.     printf("\n");
  15372.     hllc(&hfunc_num, hdata_str, &hds_len, &hrc );
  15373.     if (hrc==HARC_SUCCESS){
  15374.         hfunc_num = HA_COPY_PS_TO_STR;
  15375.         hds_len = MAX_DATA_SIZE;
  15376.         hrc = 1;
  15377.         j=0;
  15378.         hllc(&hfunc_num, strPresentation, &hds_len, &hrc);
  15379.         if (hrc==HARC_SUCCESS){
  15380.             while(j++ < hds_len && strPresentation)
  15381.                     fputchar(*strPresentation++);
  15382.         }
  15383.     }
  15384.     /* clean up */
  15385.     free(strPresentation);
  15386.     hfunc_num = HA_DISCONNECT_PS;
  15387.     hllc(&hfunc_num, hdata_str, &hds_len, &hrc );
  15388. }
  15389.  
  15390.  
  15391. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15392.  
  15393. #define INCL_BASE
  15394. #define INCL_DOSMEMMGR
  15395. #include <os2.h>
  15396. #include <mt\stdio.h>
  15397. #include <mt\string.h>
  15398. #include <mt\stdlib.h>
  15399. #include <mt\process.h>
  15400. #include <netcons.h>
  15401. #include <neterr.h>
  15402. #include <config.h>
  15403. #define NULLSTRING (CHAR *)0;
  15404. /* ****************************************************/
  15405. /* The following prints out all values of parameters  */
  15406. /* from IBMLAN.INI.  Uses NetConfigGet2() and         */
  15407. /* NetConfigGetAll2().  Prints out values             */
  15408. /* The parameters used came from a IBMLAN.INI out of  */
  15409. /* a requester                                        */
  15410. /******************************************************
  15411. /* possible components */
  15412. char *components[] = {
  15413.             "networks",
  15414.             "requester",
  15415.             "messenger",
  15416.             "replicator",
  15417.             "services"
  15418.         };
  15419. /* parameters for networks component */
  15420. char *networkparm[] = {
  15421.             "net1"
  15422.         };
  15423. /* parameters for requester component */
  15424. char *requesterparm[] = {
  15425.             "computername",
  15426.             "domain",
  15427.             "charcount",
  15428.             "chartime",
  15429.             "charwait",
  15430.             "keepconn",
  15431.             "keepsearch",
  15432.             "maxcmds",
  15433.             "maxerrorlog",
  15434.             "maxthreads",
  15435.             "maxwrkcache",
  15436.             "numalerts",
  15437.             "numcharbuf",
  15438.             "numservices",
  15439.             "numworkbuf",
  15440.             "numdgrambuf",
  15441.             "printbuftime",
  15442.             "sesstimeout",
  15443.             "sizcharbuf",
  15444.             "sizerror",
  15445.             "sizworkbuf",
  15446.             "wrkheuristics",
  15447.             "wrknets",
  15448.             "wrkservices"
  15449.         };
  15450. /* parameters for messenger component */
  15451. char *messangerparm[] = {
  15452.             "logfile",
  15453.             "sizmessbuf"
  15454.         };
  15455. /* parameters for replicator component */
  15456. char *replicatorparm[] = {
  15457.             "replicate",
  15458.             "importpath",
  15459.             "tryuser",
  15460.             "password"
  15461.         };
  15462. /* parameters for services component */
  15463. char *servicesparm[] = {
  15464.             "requester",
  15465.             "messenger",
  15466.             "netpopup",
  15467.             "replicator"
  15468.         };
  15469. int cdecl main(void); /* definition*/
  15470. int cdecl main()
  15471. {
  15472.         USHORT i, NumComponents=5, NumParameters, j, rc, k;
  15473.         USHORT DataSizeAvailable; /* Buffer size */
  15474.         USHORT DataSizeReturned;  /* how much fn used */
  15475.         CHAR *Buffer;
  15476.         SEL Selector;
  15477.         /* array containing num parms for each component */
  15478.         static USHORT IntParmArray[] = {1,24,2,4,4 };
  15479.         CHAR parameterarray[24][20]; /* generic char array */
  15480.         /* allocate memory for data buffer */
  15481.         DosAllocSeg(1024, &Selector, SEG_NONSHARED );
  15482.         Buffer = MAKEP(Selector, 0 );
  15483.         /* copy necessary parmeters into the generically */
  15484.         /* used array                                    */
  15485.         for (i = 0; i < NumComponents; i++){
  15486.             NumParameters = IntParmArray[i];
  15487.             switch(i){
  15488.                 case 0:
  15489.                 for (k=0;k<NumParameters;k++)
  15490.                 strcpy(parameterarray[k], networkparm[k]);
  15491.                 break;
  15492.                 case 1:
  15493.                 for (k=0;k<NumParameters;k++)
  15494.                 strcpy(parameterarray[k], requesterparm[k]);
  15495.                 break;
  15496.                 case 2:
  15497.                 for (k=0;k<NumParameters;k++)
  15498.                 strcpy(parameterarray[k], messangerparm[k]);
  15499.                 break;
  15500.                 case 3:
  15501.                 for (k=0;k<NumParameters;k++)
  15502.                 strcpy(parameterarray[k], replicatorparm[k]);
  15503.                 break;
  15504.                 case 4:
  15505.                 for (k=0;k<NumParameters;k++)
  15506.                 strcpy(parameterarray[k], servicesparm[k]);
  15507.                 break;
  15508.             }
  15509.             for (j = 0; j < NumParameters; j++){
  15510.                 /* clear out the buffer */
  15511.                 memset(Buffer, 0, 1024);
  15512.                 rc = NetConfigGet2((CHAR *)0, (CHAR *)0,
  15513.                     components[i], parameterarray[j], Buffer,
  15514.                         1024, &DataSizeReturned);
  15515.                 if (rc)
  15516.                     printf("\nError in 1, RC = %d", rc );
  15517.                 else
  15518.                     printf(
  15519. "\n1.Comp: %s Parm: %s Value: %s",
  15520.   components[i], parameterarray[j], Buffer );
  15521.                 memset(Buffer, 0, 1024);
  15522.             } /* end for */
  15523.                 /* now do the GetAll Parameters call */
  15524.                 rc = NetConfigGetAll2((CHAR *)0, (CHAR *)0,
  15525.                     components[i], Buffer,
  15526.                         1024, &DataSizeReturned,
  15527.                         &DataSizeAvailable);
  15528.                 if (rc)
  15529.                     printf("\nError in 1, RC = %d", rc );
  15530.                 else {
  15531.                     printf("\nAll:Comp: %s  Value: ",
  15532.                         components[i]);
  15533.                     for(k=0;k<DataSizeReturned;k++)
  15534.                         putchar(Buffer[k]);
  15535.                 } /* end else */
  15536.         } /* end for i */
  15537. } /* end main */
  15538.  
  15539.  
  15540. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15541.  
  15542. #define INCL_BASE
  15543. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  15544. #include <os2.h>          /* OS/2 API definitions          */
  15545. #include <mt\stdio.h>
  15546. #include <mt\string.h>
  15547. #include <mt\stdlib.h>
  15548. #include <mt\process.h>
  15549. #include <netcons.h>      /* definition of NetAPI constants*/
  15550. #include <neterr.h>       /* NetAPI error codes            */
  15551. #include <shares.h>       /* Used for NetConnectionEnum()  */
  15552. /* structure found in shares.h */
  15553. /*
  15554. struct connection_info_1 {
  15555.     unsigned short      coni1_id;
  15556.     unsigned short      coni1_type;
  15557.     unsigned short      coni1_num_opens;
  15558.     unsigned short      coni1_num_users;
  15559.     unsigned long       coni1_time;
  15560.     char far *          coni1_username;
  15561.     MAX User = UNLEN;
  15562.     char far *          coni1_netname;
  15563.     MAX Netname = CNLEN;
  15564. };*/  /* connection_info_1 */
  15565. #define MAXENTRIES 40
  15566. void cdecl main(void);
  15567. void cdecl main()
  15568. {
  15569.     SEL Selector1, Selector2;
  15570.     struct connection_info_1 *Buffer[MAXENTRIES];
  15571.     USHORT rc, BufLen, EntriesRead, TotalEntries;
  15572.     USHORT TotalAvailable;
  15573.     CHAR ServerName[32], Qualifier[32];
  15574.     USHORT i;
  15575.     /* allocate space for structure   */
  15576.     /* structure + space for pointers */
  15577.     /* see Appendix H in LS 1.3 Program Ref */
  15578.     BufLen = sizeof( struct connection_info_1 ) + CNLEN + 1 +
  15579.         UNLEN + 1;
  15580.     rc = DosAllocSeg( BufLen*MAXENTRIES, &Selector1,
  15581.         SEG_NONSHARED );
  15582.     for (i=0; i < MAXENTRIES; i++)
  15583.         Buffer[i] = (struct connection_info_1 *)
  15584.             MAKEP( Selector1,
  15585.                 i*sizeof( struct connection_info_1));
  15586.     /* enter your server name here, notice 4 backslashes */
  15587.     strcpy(ServerName, "\\\\TECHSUPP");
  15588.     /* insert netname here, notice no backslashes */
  15589.     /* aliases allowed */
  15590.     strcpy(Qualifier, "DEPT_644");
  15591.     rc = NetConnectionEnum( (CHAR FAR *)ServerName,
  15592.         Qualifier,
  15593.         1, (CHAR FAR *)Buffer[0], BufLen*MAXENTRIES,
  15594.         &EntriesRead, &TotalEntries );
  15595.     if (!rc){
  15596.         printf("\nConnections to %s", Qualifier);
  15597.         for (i = 0; i < EntriesRead; i++)
  15598.             printf("\nUser: %s",Buffer[i]->coni1_username );
  15599.     }
  15600.     else
  15601.         printf("\nError in NetConnectionEnum(), rc = %d",
  15602.             rc );
  15603.     DosFreeSeg(Selector1);
  15604. }
  15605.  
  15606.  
  15607. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15608.  
  15609. /* Small example of server and requester designed to run on */
  15610. /* same machine.                                            */
  15611. #define INCL_BASE
  15612. #define INCL_DOSMEMMGR
  15613. #include <os2.h>
  15614. #include <mt\stdio.h>
  15615. #include <mt\string.h>
  15616. #include <mt\stdlib.h>
  15617. #include <mt\process.h>
  15618. #include <netcons.h>
  15619. #include <neterr.h>
  15620. #include <config.h>
  15621. #include <mailslot.h>
  15622. #include <neterr.h>
  15623. int cdecl main(void);
  15624. int cdecl main()
  15625. {
  15626.     unsigned hdlMailSlot;
  15627.     /* mail slot handle */
  15628.     CHAR FAR *Name;
  15629.     /* name of other mailstation */
  15630.     USHORT SlotSize=140;
  15631.     USHORT MessageSize=140;
  15632.     SEL Selector1, Selector2, Selector3;
  15633.     /* selectors for memory */
  15634.     USHORT rc;
  15635.     /* return code */
  15636.     CHAR FAR *Message, *RxMessage;
  15637.     /* msg to be sent, and received, respectively */
  15638.     USHORT NextSize, NextPriority, MsgCount, BytesRead;
  15639.     /* assorted information from Read() */
  15640.     /* allocate memory for name */
  15641.     DosAllocSeg(40, &Selector1, SEG_NONSHARED );
  15642.     Name = MAKEP(Selector1, 0 );
  15643.     DosAllocSeg(120, &Selector2, SEG_NONSHARED );
  15644.     Message = MAKEP(Selector2, 0 );
  15645.     DosAllocSeg(120, &Selector3, SEG_NONSHARED );
  15646.     RxMessage = MAKEP(Selector3, 0 );
  15647.     /* this mailstation will be MailStation1 */
  15648.     /* other session will be MailStation2 */
  15649.     strcpy(Name, "\\mailslot\\MailStation1");
  15650.     rc = DosMakeMailslot(Name, MessageSize, SlotSize,
  15651.         &hdlMailSlot );
  15652.     if (rc){
  15653.         printf("Error in MakeMailslot, rc = %d", rc );
  15654.         return (0);
  15655.     }
  15656.     /* for remote device need to change name to  */
  15657.     /* \\computername\mailslot\name              */
  15658.     strcpy(Name, "\\mailslot\\MailStation2");
  15659.     strcpy(Message, "Message Sent from MailStation1");
  15660.     do {
  15661.         rc = DosWriteMailslot(Name, Message,
  15662.             (USHORT)strlen(Message),
  15663.             1, 1, 1000L );
  15664.         printf("\nWriting Message, rc = %d", rc );
  15665.         rc = DosReadMailslot(hdlMailSlot, RxMessage,
  15666.             &BytesRead, &NextSize, &NextPriority,
  15667.             -1 );
  15668.         printf("\nReading Message, rc = %d ", rc  );
  15669.         if (BytesRead)
  15670.             printf("\nMessage: %s", RxMessage );
  15671.         DosSleep(500L);
  15672.     }
  15673.     while (strcmp(RxMessage, "Message Sent from MailStation2"));
  15674.     /* keep going until we get the msg from Mailstation2 */
  15675.     /* this last write is just in case we stopped writing too
  15676.     soon */
  15677.     DosSleep(2000L);
  15678.     rc = DosWriteMailslot(Name, Message,
  15679.         (USHORT)strlen(Message),
  15680.         1, 1, -1 );
  15681.     printf("\nWriting message, rc = %d", rc );
  15682. }
  15683. #define INCL_BASE
  15684. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg       */
  15685. #include <os2.h>          /* OS/2 API definitions           */
  15686. #include <mt\stdio.h>     /* Since the application starts a */
  15687. #include <mt\string.h>    /* thread, we must use the        */
  15688. #include <mt\stdlib.h>    /* multithreaded include file.    */
  15689. #include <mt\process.h>   /*                                */
  15690. #include <netcons.h>      /* definition of NetAPI constants */
  15691. #include <neterr.h>       /* NetAPI error codes             */
  15692. #include <config.h>
  15693. #include <mailslot.h>
  15694. #include <neterr.h>
  15695. int cdecl main(void);
  15696. int cdecl main()
  15697. {
  15698.     unsigned hdlMailSlot;
  15699.     CHAR FAR *Name;
  15700.     USHORT SlotSize=140;
  15701.     USHORT MessageSize=140;
  15702.     SEL Selector1, Selector2, Selector3;
  15703.     USHORT rc;
  15704.     CHAR FAR *Message, *RxMessage;
  15705.     USHORT NextSize, NextPriority, MsgCount, BytesRead;
  15706.     /* allocate memory for name */
  15707.     DosAllocSeg(40, &Selector1, SEG_NONSHARED );
  15708.     Name = MAKEP(Selector1, 0 );
  15709.     DosAllocSeg(120, &Selector2, SEG_NONSHARED );
  15710.     Message = MAKEP(Selector2, 0 );
  15711.     DosAllocSeg(120, &Selector3, SEG_NONSHARED );
  15712.     RxMessage = MAKEP(Selector3, 0 );
  15713.     /* name of this mailstation */
  15714.     strcpy(Name, "\\mailslot\\MailStation2");
  15715.     rc = DosMakeMailslot(Name, MessageSize, SlotSize,
  15716.         &hdlMailSlot );
  15717.     if (rc){
  15718.         printf("Error in MakeMailslot, rc = %d", rc );
  15719.         return (0);
  15720.     }
  15721.     /* Willbe writing to MailStation1 */
  15722.     strcpy(Name, "\\mailslot\\MailStation1");
  15723.     /* this is msg to be sent to mailstation1 */
  15724.     strcpy(Message, "Message Sent from MailStation2");
  15725.     do {
  15726.         rc = DosWriteMailslot(Name, Message,
  15727.             (USHORT)strlen(Message),
  15728.             1, 1, -1 );
  15729.         printf("\nWriting message, rc = %d", rc );
  15730.         DosSleep(500L);
  15731.         do {
  15732.         rc = DosPeekMailslot(hdlMailSlot,
  15733.             RxMessage, &BytesRead, &NextSize,
  15734.             &NextPriority );
  15735.             printf("\nPeeking...");
  15736.         } while (!BytesRead);
  15737.         printf("BytesRead = %d", BytesRead );
  15738.         printf("\nMessage is %s", RxMessage );
  15739.         printf("\nNextSize = %d NextPriority = %d",
  15740.             NextSize, NextPriority );
  15741.         /* clear out buffer */
  15742.         memset(RxMessage, 0, 100 );
  15743.         rc = DosReadMailslot(hdlMailSlot, RxMessage,
  15744.             &BytesRead, &NextSize, &NextPriority,
  15745.             -1 );
  15746.         printf("\nReading message, rc = %d", rc );
  15747.         if (BytesRead)
  15748.             printf("\nMessage: %s", RxMessage );
  15749.         else
  15750.             printf("\nNo message");
  15751.         DosSleep(500L);
  15752.     }
  15753.     while (strcmp(RxMessage, "Message Sent from MailStation1"));
  15754.     /* keep going until we hear from the other mailstation */
  15755.     /* last write, in case we stopped before the other side */
  15756.     /* got the message */
  15757.     DosSleep(2000L);
  15758.     rc = DosWriteMailslot(Name, Message,
  15759.         (USHORT)strlen(Message),
  15760.         1, 1, -1 );
  15761.     printf("\nWriting message, rc = %d", rc );
  15762.     /* now get rid of mailslot */
  15763.     rc = DosDeleteMailslot(hdlMailSlot);
  15764. }
  15765.  
  15766.  
  15767. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15768.  
  15769. #define INCL_BASE
  15770. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg       */
  15771. #include <os2.h>          /* OS/2 API definitions           */
  15772. #include <mt\stdio.h>     /* Since the application starts a */
  15773. #include <mt\string.h>    /* thread, we must use the        */
  15774. #include <mt\stdlib.h>    /* multithreaded include file.    */
  15775. #include <mt\process.h>   /*                                */
  15776. #include <netcons.h>      /* definition of NetAPI constants */
  15777. #include <neterr.h>       /* NetAPI error codes             */
  15778. #include <config.h>
  15779. #include <message.h>
  15780. #define NULLSTRING (CHAR *)0;
  15781. /*
  15782. struct msg_info_0 {
  15783.     char msgi0_name[CNLEN+1];
  15784. };
  15785. struct msg_info_1 {
  15786.     char msgi1_name[CNLEN+1];
  15787.     char msgi1_forward_flag;
  15788.     unsigned char msgi1_pad1;
  15789.     char msgi1_forward[CNLEN+1];
  15790. };
  15791. */
  15792. struct nametable_0 {
  15793.     struct msg_info_0 MsgInfo[20];
  15794. } NameTable;
  15795. int cdecl main(void);
  15796. int cdecl main()
  15797. {
  15798.     SEL Selector1, Selector2, Selector3, Selector4, Selector5;
  15799.     CHAR FAR *Server;
  15800.     CHAR FAR *Filename;
  15801.     CHAR FAR *Name;
  15802.     CHAR FAR *Buffer;
  15803.     CHAR FAR *ForwardName;
  15804.     USHORT rc, i;
  15805.     USHORT EntriesRead, TotalEntries;
  15806.     USHORT LoggingOn;
  15807.     struct msg_info_1 Info;
  15808.     USHORT InfoAvailable;
  15809.     DosAllocSeg( 20, &Selector1, SEG_NONSHARED );
  15810.     DosAllocSeg( 20, &Selector2, SEG_NONSHARED );
  15811.     DosAllocSeg( 64, &Selector3, SEG_NONSHARED );
  15812.     DosAllocSeg( 64, &Selector4, SEG_NONSHARED );
  15813.     DosAllocSeg( 64, &Selector4, SEG_NONSHARED );
  15814.     Server   = MAKEP(Selector1, 0 );
  15815.     Name     = MAKEP(Selector2, 0 );
  15816.     Filename = MAKEP(Selector3, 0 );
  15817.     Buffer   = MAKEP(Selector4, 0 );
  15818.     ForwardName = MAKEP(Selector4, 0 );
  15819.     /* fill in the server to query */
  15820.     /* note: use 4 \\ characters   */
  15821.     strcpy(Server, "\\\\TECHSUPP");
  15822.     strcpy(Name, "TESTNAME");
  15823.     rc = NetMessageNameAdd(Server, Name, 0 );
  15824.     printf("Adding name TESTNAME, rc = %d", rc );
  15825.     rc = NetMessageNameEnum(Server, 0, &NameTable,
  15826.         sizeof(NameTable), &EntriesRead, &TotalEntries );
  15827.     for (i = 0; i < EntriesRead; i++)
  15828.         printf("\nEntry #%d: %s", i,
  15829.         NameTable.MsgInfo[i].msgi0_name);
  15830.     strcpy(Buffer, "Hello, World!");
  15831.     /* fill in your requester name here   */
  15832.     strcpy(ForwardName, "KOREQ");
  15833.     strcpy(Name, "TESTNAME");
  15834.     /* now forward mail from newname to yourself */
  15835.     rc = NetMessageNameFwd( Server, Name, ForwardName,
  15836.         0 );
  15837.     /* get a little info on the new name */
  15838.     rc = NetMessageNameGetInfo( Server, Name,
  15839.         1, &Info, sizeof(Info), &InfoAvailable );
  15840.     printf("\nName: %s", Info.msgi1_name );
  15841.     printf("\nFowarding is %s",
  15842.         Info.msgi1_forward_flag?"ON":"OFF");
  15843.     if (Info.msgi1_forward_flag)
  15844.         printf("\nMail forwarded to: %s", Info.msgi1_forward );
  15845.     /* now send a message to TESTNAME */
  15846.     rc = NetMessageBufferSend( Server, Name, Buffer,
  15847.         strlen(Buffer));
  15848.     printf("\nSending Buffer, rc = %d", rc );
  15849.     strcpy(Filename, "c:\\startup.cmd");
  15850.     /* now take off forwarding */
  15851.     rc = NetMessageNameUnFwd( Server, Name );
  15852.     printf("\nUnforwarding, rc = %d", rc );
  15853.     /* now disable logging */
  15854.     rc = NetMessageLogFileSet( Server, (CHAR *)0, 0 );
  15855.     printf("\nDisablng Logging, rc = %d", rc );
  15856.     rc = NetMessageFileSend( Server, ForwardName, Filename );
  15857.     printf("\nSending File, rc = %d", rc );
  15858.     strcpy(Buffer, "c:\\ibmlan\\logs\\messages.log");
  15859.     /* now get some info on the logging facility */
  15860.     rc = NetMessageLogFileGet( Server, Buffer, 64,
  15861.         &LoggingOn);
  15862.     printf("\nGetting LogFile, rc = %d", rc );
  15863.     printf("\nLog File is: %s ,Logging is %s", Buffer,
  15864.         LoggingOn?"ON":"OFF");
  15865.     /* now delete the name we added */
  15866.     strcpy(Name, "TESTNAME");
  15867.     rc = NetMessageNameDel( Server, Name, 1 );
  15868.     printf("\nDeleting Name TESTNAME, rc = %d", rc );
  15869.     /* and turn on logging */
  15870.     rc = NetMessageLogFileSet( Server, (CHAR *)0, 1 );
  15871.     printf("\nTurning on logging, rc = %d", rc );
  15872. } /* end main */
  15873.  
  15874.  
  15875. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  15876.  
  15877. #define INCL_BASE
  15878. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  15879. #include <os2.h>          /* OS/2 API definitions          */
  15880. #include <mt\stdio.h>
  15881. #include <mt\string.h>
  15882. #include <mt\stdlib.h>
  15883. #include <mt\process.h>
  15884. #include <netcons.h>      /* definition of NetAPI constants*/
  15885. #include <neterr.h>       /* NetAPI error codes            */
  15886. #include <server.h>       /* header for NetServer..()      */
  15887. /*
  15888. struct server_info_1 {
  15889.     char            sv1_name[CNLEN + 1];
  15890.     unsigned char   sv1_version_major;
  15891.     unsigned char   sv1_version_minor;
  15892.     unsigned long   sv1_type;
  15893.     char far *      sv1_comment;
  15894. };
  15895. */
  15896. #define NUMSERVERS 20
  15897. void cdecl main(void);
  15898. void cdecl main()
  15899. {
  15900.     CHAR ServerName[32], Buffer[32], *p;
  15901.     CHAR Domain[32], *Comment, *Return;
  15902.     SEL Selector1, Selector2, Selector3, Selector4;
  15903.     struct server_info_1  *ServerInfo, *Server[NUMSERVERS];
  15904.     struct server_info_2 *Info;
  15905.     USHORT  rc, TotalAvailable, ServerInfoLen;
  15906.     USHORT  BufLen, EntriesRead,TotalEntries;
  15907.     USHORT BytesRead, RemoteRC, BigBufSize;
  15908.     CHAR *TempPtr;
  15909.     USHORT i;
  15910.     USHORT Value;
  15911.     BigBufSize = 3000;
  15912.     /* insert name of your server here */
  15913.     /* notice 4 backslases             */
  15914.     strcpy(ServerName, "\\\\KOSER");
  15915.     /* insert name of your domain here */
  15916.     strcpy(Domain, "ADTSUPP");
  15917.     /* memory allocation part */
  15918.     BufLen = sizeof (struct server_info_1) +
  15919.         MAXCOMMENTSZ + 1;
  15920.     ServerInfoLen = sizeof( struct server_info_2) +
  15921.         MAXCOMMENTSZ + 1 + PATHLEN + 1 + PATHLEN + 1
  15922.         + PATHLEN + 1;
  15923.     rc = DosAllocSeg(ServerInfoLen, &Selector3,
  15924.         SEG_NONSHARED );
  15925.     rc = DosAllocSeg( BigBufSize, &Selector4,
  15926.         SEG_NONSHARED);
  15927.     Return = (CHAR *)MAKEP(Selector4, 0 );
  15928.     Info = (struct server_info_2 *)MAKEP(Selector3, 0 );
  15929.     /* Constants used here are                          */
  15930.     /* found in Appendix H of Lan Server API Reference  */
  15931.     /* now allocate space for various structures needed */
  15932.     rc = DosAllocSeg( BufLen, &Selector1, SEG_NONSHARED );
  15933.     ServerInfo = (struct server_info_1 *)MAKEP(Selector1,0);
  15934.     rc = DosAllocSeg(BufLen * NUMSERVERS, &Selector2,
  15935.         SEG_NONSHARED );
  15936.     for (i = 0; i < NUMSERVERS; i++)
  15937.         Server[i] = (struct server_info_1 *)MAKEP(Selector2,
  15938.             i * sizeof( struct server_info_1 ));
  15939.     /* Because are only changing one value, use address */
  15940.     /* for that one value               */
  15941.     /* instead of struct server_info  * */
  15942.     Value = SV_HIDDEN;
  15943.     rc = NetServerSetInfo( ServerName, 2,
  15944.         (CHAR FAR *)&Value, sizeof(Value),
  15945.         SV_HIDDEN_PARMNUM);
  15946.     if (!rc)
  15947.         printf("\nServer is now Hidden");
  15948.     else
  15949.         printf("\nError in SetInfo, rc = %d", rc );
  15950.     /* delay for change in Server */
  15951.     memset(ServerInfo, 0, BufLen );
  15952.     rc = NetServerGetInfo( ServerName, 2,
  15953.         (CHAR FAR *)Info, ServerInfoLen, &TotalAvailable );
  15954.     if (!rc ){
  15955.         printf("\n Server Name: %s", Info->sv2_name );
  15956.         printf("\n Server Version: %d.%d",
  15957.             Info->sv2_version_major,
  15958.             Info->sv2_version_minor);
  15959.         printf("\n Server Type: ");
  15960.         if (Info->sv2_type & SV_TYPE_WORKSTATION)
  15961.             printf("Workstation, ");
  15962.         if (Info->sv2_type & SV_TYPE_SERVER)
  15963.             printf("Server, ");
  15964.         if (Info->sv2_type & SV_TYPE_DOMAIN_CTRL)
  15965.             printf("Domain Controller, ");
  15966.         if (Info->sv2_type & SV_TYPE_DOMAIN_BAKCTRL)
  15967.             printf("Backup Domain Controller, ");
  15968.         if (Info->sv2_type & SV_TYPE_TIME_SOURCE)
  15969.             printf("Time Server, ");
  15970.         if (Info->sv2_type & SV_TYPE_NOVELL)
  15971.             printf("Novell, ");
  15972.         printf("\nServer is: %s", Info->sv2_hidden?
  15973.             "Hidden":"Visible");
  15974.     }
  15975.     else
  15976.         printf("\nError in GetInfo, rc = %d", rc );
  15977.     rc = NetServerDiskEnum( ServerName, 0,
  15978.         Buffer, 32, &EntriesRead, &TotalEntries );
  15979.     if (!rc){
  15980.         printf("\nDrives on Server: ");
  15981.         for (p = Buffer, i=0; i < EntriesRead; i++, p+=3)
  15982.             printf("%s,", p );
  15983.     }
  15984.     else
  15985.         printf("Error in DiskEnum, rc = %d", rc );
  15986.     rc = NetServerEnum2( ServerName, 1, (CHAR FAR *)Server[0],
  15987.         BufLen * NUMSERVERS, &EntriesRead, &TotalEntries,
  15988.         SV_TYPE_ALL, Domain );
  15989.     if (!rc){
  15990.         printf("\n Servers on Domain %s", Domain );
  15991.         for (i = 0; i < EntriesRead; i++){
  15992.             printf("\n\n Server Name: %s",
  15993.                 Server[i]->sv1_name );
  15994.             printf("\n Server Version: %d.%d",
  15995.                 Server[i]->sv1_version_major,
  15996.                 Server[i]->sv1_version_minor);
  15997.             printf("\n Server Type: ");
  15998.             if (Server[i]->sv1_type & SV_TYPE_WORKSTATION)
  15999.                 printf("Workstation, ");
  16000.             if (Server[i]->sv1_type & SV_TYPE_SERVER)
  16001.                 printf("Server, ");
  16002.             if (Server[i]->sv1_type & SV_TYPE_DOMAIN_CTRL)
  16003.                 printf("Domain Controller, ");
  16004.             if (Server[i]->sv1_type & SV_TYPE_DOMAIN_BAKCTRL)
  16005.                 printf("Backup Domain Controller, ");
  16006.             if (Server[i]->sv1_type & SV_TYPE_TIME_SOURCE)
  16007.                 printf("Time Server, ");
  16008.             if (Server[i]->sv1_type & SV_TYPE_NOVELL)
  16009.                 printf("Novell, ");
  16010.         }
  16011.     }
  16012.     else
  16013.         printf("\nError in ServerEnum, rc = %d", rc );
  16014.     /* now do the admin command */
  16015.     rc = NetServerAdminCommand( ServerName, "DIR C:\\",
  16016.         &RemoteRC, Return, BigBufSize, &BytesRead,
  16017.             &TotalAvailable );
  16018.     if (!rc){
  16019.         printf("\nReturned: \n");
  16020.         for ( i = 0; i < BytesRead; i++)
  16021.             printf("%c",*Return++);
  16022.     }
  16023.     else
  16024.         printf("Error in ServerAdmin, rc = %d", rc );
  16025.     Value = SV_VISIBLE;
  16026.     rc = NetServerSetInfo( ServerName, 2,
  16027.         (CHAR FAR *)&Value, sizeof(Value),
  16028.         SV_HIDDEN_PARMNUM);
  16029.     if (!rc)
  16030.         printf("\nServer is now Visible");
  16031.     else
  16032.         printf("\nError in SetInfo, rc = %d", rc );
  16033.     DosFreeSeg(Selector1);
  16034.     DosFreeSeg(Selector2);
  16035.     DosFreeSeg(Selector3);
  16036.     DosFreeSeg(Selector4);
  16037.     free(Comment);
  16038. }
  16039.  
  16040.  
  16041. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16042.  
  16043. #define INCL_BASE
  16044. #define INCL_DOSMEMMGR     /* prototype of DosAllocSeg       */
  16045. #include <os2.h>           /* OS/2 API definitions           */
  16046. #include <mt\stdio.h>      /* Since the application starts a */
  16047. #include <mt\string.h>     /* thread, we must use the        */
  16048. #include <mt\stdlib.h>     /* multithreaded include file.    */
  16049. #include <mt\process.h>    /*                                */
  16050. #include <netcons.h>       /* definition of NetAPI constants */
  16051. #include <neterr.h>        /* NetAPI error codes             */
  16052. #include <service.h>
  16053. #define NULLSTRING (CHAR *)0;
  16054. int PrintStatus (USHORT );
  16055. int PrintInfo( struct service_info_2 *, USHORT );
  16056. /*
  16057. struct service_status {
  16058.     unsigned short svcs_status;
  16059.     unsigned long  svcs_code;
  16060.     unsigned short svcs_pid;
  16061.     char svcs_text[STXTLEN+1];
  16062. };
  16063. struct service_info_2 {
  16064.     char    svci2_name[SNLEN+1];
  16065.     unsigned short svci2_status;
  16066.     unsigned long svci2_code;
  16067.     unsigned short svci2_pid;
  16068.     char    svci2_text[STXTLEN+1];
  16069. };
  16070. */
  16071. void cdecl main(void);
  16072. void cdecl main()
  16073. {
  16074.     USHORT rc, i;
  16075.     SEL Selector1;
  16076.     struct service_info_2 *ServiceInfo[10];
  16077.     CHAR Server[32], Service[32];
  16078.     USHORT EntriesRead, TotalAvailable, Length;
  16079.     CHAR *Ptr;
  16080.     struct service_status Status;
  16081.     Length = sizeof( struct service_info_2 );
  16082.     rc = DosAllocSeg( Length * 10,
  16083.         &Selector1, SEG_NONSHARED );
  16084.     ServiceInfo[0] = MAKEP( Selector1, 0 );
  16085.     for (i = 1; i < 10; i++)
  16086.         ServiceInfo[i] = ServiceInfo[0] + i;
  16087.     /* insert the name of your server here, NULL for local */
  16088.     /* machine */
  16089.     strcpy( Server, "\\\\TECHSUPP");
  16090.     rc = NetServiceEnum ( Server, 2,
  16091.         (CHAR FAR *)ServiceInfo[0],
  16092.         sizeof (struct service_info_2) * 10,
  16093.         &EntriesRead, &TotalAvailable );
  16094.     if (rc ){
  16095.         printf("rc = %d", rc );
  16096.         exit(0);
  16097.     }
  16098.     for (i=0; i < EntriesRead; i++)
  16099.         PrintInfo( ServiceInfo[i], i );
  16100.     /* clear out memory */
  16101.     Ptr = (CHAR *)ServiceInfo[0];
  16102.     for (i=0; i< Length; i++)
  16103.         *Ptr++ = 0;
  16104.     /* will use requester */
  16105.     strcpy(Service, "requester");
  16106.     /* pause the requester */
  16107.     rc = NetServiceControl( Server, Service,
  16108.             SERVICE_CTRL_PAUSE,
  16109.             SERVICE_CTRL_REDIR_COMM,
  16110.             (CHAR FAR *)ServiceInfo[0],
  16111.             Length );
  16112.     /* interrogate the requester */
  16113.     rc = NetServiceControl( Server, Service,
  16114.             SERVICE_CTRL_INTERROGATE,
  16115.             0, (CHAR FAR *)ServiceInfo[0],
  16116.             Length );
  16117.     /* print out info */
  16118.     printf("\n\nResults from NetServiceControl ");
  16119.     printf("after Pausing Requester ");
  16120.     PrintInfo( ServiceInfo[0], 0 );
  16121.     /* start the requester again*/
  16122.     rc = NetServiceControl( Server, Service,
  16123.             SERVICE_CTRL_CONTINUE, SERVICE_CTRL_REDIR_COMM,
  16124.             (CHAR FAR *)ServiceInfo[0],
  16125.             Length );
  16126.     if (rc){
  16127.         printf("\nError, Rc = %d", rc );
  16128.         exit(0);
  16129.     }
  16130.     /* clear out memory */
  16131.     Ptr = (CHAR *)ServiceInfo[0];
  16132.     for (i=0; i< Length; i++)
  16133.         *Ptr++ = 0;
  16134.     rc = NetServiceGetInfo( Server, Service,2,
  16135.         ServiceInfo[0], Length, &TotalAvailable );
  16136.     printf("\nResults from NetServiceGetInfo ");
  16137.     printf("after Unpausing Requester ");
  16138.     PrintInfo( ServiceInfo[0], 0 );
  16139. } /* end main */
  16140. int PrintInfo( struct service_info_2 *Info , USHORT i)
  16141. {
  16142.        printf("\n %d Name: %10s ",
  16143.             i, Info->svci2_name);
  16144.        PrintStatus( Info->svci2_status );
  16145.        printf("\n Code: %ld(0x%lx)",Info->svci2_code,
  16146.             Info->svci2_code );
  16147.        printf("\n Primary Code: %d(0x%lx)",
  16148.             Info->svci2_code & 0xFFFF0000 ,
  16149.             Info->svci2_code & 0xFFFF0000 );
  16150.        printf("  Secondary Code: %d(0x%lx)",
  16151.             Info->svci2_code & 0x0000FFFF ,
  16152.             Info->svci2_code & 0x0000FFFF );
  16153.        printf("\n %d  PID: %d Text: %s",i,
  16154.             Info->svci2_pid,
  16155.             strlen(Info->svci2_text)?
  16156.             Info->svci2_text:"NULL");
  16157.         return (0);
  16158. }
  16159. int PrintStatus( USHORT status )
  16160. {
  16161.     USHORT Value; /* Value after mask */
  16162.     /* 0000 0XXX 0000 0000 */
  16163.     Value = status & 0x700;
  16164.     if (Value==0x700)
  16165.         printf("\nStatus: SERVICE_REDIR_PAUSED");
  16166.     else {
  16167.         if (Value == 0x400)
  16168.             printf("\nStatus: SERVICE_REDIR_COMM_PAUSED");
  16169.         if (Value == 0x200)
  16170.             printf("\nStatus: SERVICE_REDIR_PRINT_PAUSED" );
  16171.         if (Value == 0x100)
  16172.             printf("\nStatus: SERVICE_REDIR_DISK_PAUSED ");
  16173.     }
  16174.     /* 0000 0000 00X0 0000 */
  16175.     Value = status & 0x20;
  16176.     if (Value)
  16177.         printf("\nStatus: SERVICE_PAUSABLE");
  16178.     else
  16179.         printf("\nStatus: SERVICE_NOT_PAUSABLE");
  16180.     /* 0000 0000 000X 0000 */
  16181.     Value = status & 0x10;
  16182.     if (Value)
  16183.         printf("    Status: SERVICE_UNINSTALLABLE");
  16184.     else
  16185.         printf("    Status: SERVICE_NOT_UNINSTALLABLE");
  16186.     /* 0000 0000 0000 XX00 */
  16187.     Value = status & 0x0C;
  16188.     if (Value == 0x0C)
  16189.         printf("\nStatus: SERVICE_PAUSED");
  16190.     else {
  16191.         if (Value == 0x08)
  16192.             printf("\nStatus: SERVICE_PAUSE_PENDING");
  16193.         if (Value == 0x04)
  16194.             printf("\nStatus: SERVICE_CONTINUE_PENDING");
  16195.         if (Value == 0x00)
  16196.             printf("\nStatus: SERVICE_ACTIVE");
  16197.     }
  16198.     /* 0000 0000 0000 00XX */
  16199.     Value = status & 0x03;
  16200.     if (Value == 0x03)
  16201.         printf("    Status: SERVICE_INSTALLED ");
  16202.     else {
  16203.         if (Value == 0x02)
  16204.             printf("    Status: SERVICE_UNINSTALL_PENDING");
  16205.         if (Value == 0x01)
  16206.             printf("    Status: SERVICE_INSTALL_PENDING");
  16207.         if (Value == 0x00)
  16208.             printf("    Status: SERVICE_UNINSTALLED");
  16209.     }
  16210.     return (0);
  16211. }
  16212.  
  16213.  
  16214. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16215.  
  16216. #define INCL_BASE
  16217. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16218. #include <os2.h>          /* OS/2 API definitions          */
  16219. #include <mt\stdio.h>
  16220. #include <mt\string.h>
  16221. #include <mt\stdlib.h>
  16222. #include <mt\process.h>
  16223. #include <netcons.h>      /* definition of NetAPI constants*/
  16224. #include <neterr.h>       /* NetAPI error codes            */
  16225. #include <shares.h>       /* header for NetSession..()     */
  16226.  
  16227. /*
  16228. struct session_info_2 {
  16229.     char far * sesi2_cname; MAX: CNLEN+1
  16230.     char far * sesi2_username; MAX: UNLEN+1
  16231.     unsigned short sesi2_num_conns;
  16232.     unsigned short sesi2_num_opens;
  16233.     unsigned short sesi2_num_users;
  16234.     Note: Documentation does not agree with .h files
  16235.     for sesi2_time (DOC VS: sesi2_sess_time );
  16236.     unsigned long sesi2_time;
  16237.     unsigned long sesi2_idle_time;
  16238.     unsigned long sesi2_user_flags;
  16239.     char far * sesi2_cltype_name;
  16240. }
  16241. */
  16242. #define NUMENTRIES 30
  16243. void cdecl main(void);
  16244. void cdecl main()
  16245. {
  16246.     CHAR ServerName[32], Workstation[32];
  16247.     SEL Selector1, Selector2;
  16248.     struct session_info_2 *Buffer, *Entries[NUMENTRIES];
  16249.     USHORT i, rc, TotalEntries, EntriesRead;
  16250.     USHORT TotalAvailable, BufLen;
  16251.  
  16252.     /* insert name of your server here */
  16253.     /* note use of 4 backslashes in C  */
  16254.     strcpy(ServerName, "\\\\TECHSUPP");
  16255.     BufLen = sizeof (struct session_info_2) +
  16256.         CNLEN + 1 + UNLEN + 1 + 14;
  16257.     /* now add space for strings */
  16258.     /* found in Appendix H of Lan Server API Reference */
  16259.     rc = DosAllocSeg( BufLen*NUMENTRIES, &Selector1,
  16260.         SEG_NONSHARED );
  16261.     for (i = 0; i < NUMENTRIES ; i++)
  16262.         Entries[i] = (struct session_info_2 *)MAKEP(Selector1,
  16263.             i*sizeof( struct session_info_2) );
  16264.  
  16265.     rc = NetSessionEnum(ServerName, 2, Entries[0],
  16266.         BufLen*NUMENTRIES, &EntriesRead, &TotalEntries );
  16267.     if (!rc){
  16268.         for (i = 0; i< EntriesRead; i++){
  16269.             printf("\n\nNumber %d Computer: %s",
  16270.                 i, Entries[i]->sesi2_cname );
  16271.             printf("\nUser: %s ",
  16272.                 Entries[i]->sesi2_username );
  16273.         }
  16274.     }
  16275.     else
  16276.         printf("rc = %d", rc );
  16277.  
  16278.     printf("\nEnter number of computer to get info on: ");
  16279.     scanf("%d", &i );
  16280.     /* allocate memory */
  16281.     rc = DosAllocSeg(BufLen, &Selector2, SEG_NONSHARED );
  16282.     Buffer = (struct session_info_2 *)MAKEP(Selector2, 0 );
  16283.     /* add the necessary backslashes (4 in a C program ) */
  16284.     sprintf(Workstation,"\\\\%s",Entries[i]->sesi2_cname);
  16285.  
  16286.     rc = NetSessionGetInfo((CHAR FAR *)ServerName, Workstation,
  16287.         2, (CHAR FAR *)Buffer, BufLen, &TotalAvailable );
  16288.     if (!rc){
  16289.         printf("\n\nInformation for Computer %s",
  16290.             Buffer->sesi2_cname );
  16291.         printf("\nUser: %s", Buffer->sesi2_username );
  16292.         printf("\nNumber of Connections: %d",
  16293.             Buffer->sesi2_num_conns );
  16294.         printf("\nNumber of Opens: %d",
  16295.             Buffer->sesi2_num_opens );
  16296.         printf("\nNumber of Sessions: %d",
  16297.             Buffer->sesi2_num_users );
  16298.         printf("\nTime Active: %ld",
  16299.             Buffer->sesi2_time );
  16300.         printf("\nTime Idle: %ld",
  16301.             Buffer->sesi2_idle_time );
  16302.         if (Buffer->sesi2_user_flags & SESS_GUEST)
  16303.             printf("\nUser is GUEST");
  16304.         if (Buffer->sesi2_user_flags & SESS_NOENCRYPTION)
  16305.             printf("\nUser has not used password encryption");
  16306.     }
  16307.     else
  16308.         printf("\nError in GetInfo, rc = %d", rc );
  16309.     /* clean up */
  16310.     DosFreeSeg(Selector1);
  16311.     DosFreeSeg(Selector2);
  16312. }
  16313.  
  16314.  
  16315. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16316.  
  16317. #define INCL_BASE
  16318. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg       */
  16319. #include <os2.h>          /* OS/2 API definitions           */
  16320. #include <mt\stdio.h>
  16321. #include <mt\string.h>
  16322. #include <mt\stdlib.h>
  16323. #include <mt\process.h>
  16324. #include <netcons.h>      /* definition of NetAPI constants */
  16325. #include <neterr.h>       /* NetAPI error codes             */
  16326. #include <access.h>
  16327. #include <wksta.h>        /* header for NetWksta..()        */
  16328.  
  16329. /* structure defined in wksta.h */
  16330. /* and access.h                 */
  16331. /*
  16332. struct user_logon_info_1 {
  16333.         unsigned short  usrlog1_code;
  16334.         char            usrlog1_eff_name[UNLEN+1];
  16335.         char            usrlog1_pad_1;
  16336.         unsigned short  usrlog1_priv;
  16337.         unsigned long   usrlog1_auth_flags;
  16338.         unsigned short  usrlog1_num_logons;
  16339.         unsigned short  usrlog1_bad_pw_count;
  16340.         unsigned long   usrlog1_last_logon;
  16341.         unsigned long   usrlog1_last_logoff;
  16342.         unsigned long   usrlog1_logoff_time;
  16343.         unsigned long   usrlog1_kickoff_time;
  16344.         long            usrlog1_password_age;
  16345.         unsigned long   usrlog1_pw_can_change;
  16346.         unsigned long   usrlog1_pw_must_change;
  16347.         char far *      usrlog1_computer;
  16348.         char far *      usrlog1_domain;
  16349.         char far *      usrlog1_script_path;
  16350.         unsigned long   usrlog1_reserved1;
  16351. };
  16352. */
  16353. int PrintValues( struct wksta_info_0 *);
  16354. void cdecl main(void);
  16355. void cdecl main()
  16356. {
  16357.     SEL Selector1,  Selector2;
  16358.     CHAR Server[32];
  16359.     USHORT rc, TotalAvailable, BufLen;
  16360.     struct wksta_info_0 *Info;
  16361.     USHORT CharWait;
  16362.     USHORT LogOffLen;
  16363.     struct user_logoff_info_1 *LogOffInfo;
  16364.  
  16365.     /* call uses space behind structure for data  */
  16366.     /* need to allocate size of structure + room  */
  16367.     /* for data                                   */
  16368.     LogOffLen = sizeof (struct user_logoff_info_1 ) + 256;
  16369.     BufLen = sizeof( struct wksta_info_0);
  16370.     rc = DosAllocSeg(BufLen + 256,
  16371.         &Selector1, SEG_NONSHARED);
  16372.     rc = DosAllocSeg(LogOffLen, &Selector2, SEG_NONSHARED);
  16373.     /* make pointers                              */
  16374.     Info   = (struct wksta_info_0 *)MAKEP(Selector1, 0 );
  16375.     LogOffInfo = (struct user_logoff_info_1 *)
  16376.         MAKEP(Selector2, 0 );
  16377.  
  16378.     /* enter name of your server here */
  16379.     strcpy(Server, "\\\\TECHSUPP");
  16380.     /* now find out some info about wksta */
  16381.     rc = NetWkstaGetInfo( Server, 0, (CHAR FAR *)Info,
  16382.         sizeof (struct wksta_info_0) + 256 ,
  16383.         &TotalAvailable);
  16384.     /* print out return values */
  16385.     if (rc )
  16386.         printf("Error in GetInfo, rc = %d", rc );
  16387.     else
  16388.         PrintValues ( Info );
  16389.  
  16390.     /* now we're going to up the charwait */
  16391.     /* variable by 256 */
  16392.     CharWait = Info->wki0_charwait ;
  16393.     Info->wki0_charwait = CharWait + 256;
  16394.     rc = NetWkstaSetInfo( Server, 0, (CHAR FAR *)Info,
  16395.         sizeof (Info),
  16396.         WKSTA_CHARWAIT_PARMNUM );
  16397.     if (rc)
  16398.         printf("Error in SetInfo, rc = %d", rc );
  16399.     else
  16400.         PrintValues ( Info );
  16401.     /* set it back the way it was */
  16402.     rc = NetWkstaSetInfo( Server, 0, (CHAR FAR *)Info,
  16403.         sizeof (Info),
  16404.         WKSTA_CHARWAIT_PARMNUM );
  16405.     if (rc)
  16406.         printf("Error in SetInfo, rc = %d", rc );
  16407.     else
  16408.         PrintValues ( Info );
  16409.  
  16410.     /* WARNING:  THIS WILL LOG YOU OFF */
  16411.     /* now we're going to log off */
  16412.     rc = NetWkstaSetUID2( NULL, NULL,
  16413.         NULL, NULL, "",
  16414.         WKSTA_LOTS_OF_FORCE, 1, LogOffInfo, LogOffLen,
  16415.         &TotalAvailable );
  16416.     if (rc)
  16417.         printf("\n LoggOff Failed, rc = %d", rc );
  16418.     else {
  16419.         printf("\n\n USER Logged OFF");
  16420.         printf("\nTime On: %ul",
  16421.             LogOffInfo->usrlogf1_duration);
  16422.         printf("  Number of Logongs:   %d",
  16423.             LogOffInfo->usrlogf1_num_logons);
  16424.     }
  16425. } /* end main */
  16426.  
  16427. int PrintValues ( struct wksta_info_0 *Info )
  16428. {
  16429.     /* print out return values */
  16430.     if (Info->wki0_computername )
  16431.         printf("\n\nComputername: %s",
  16432.             Info->wki0_computername );
  16433.     if (Info->wki0_username)
  16434.         printf("\nUserName    : %s", Info->wki0_username );
  16435.     if (Info->wki0_langroup)
  16436.         printf("\nGroup       : %s", Info->wki0_langroup );
  16437.     printf("\nVersion     : %d.%d", Info->wki0_ver_major,
  16438.         Info->wki0_ver_minor);
  16439.     printf("\nCharwait    : %d", Info->wki0_charwait);
  16440.     return (0);
  16441. }
  16442.  
  16443.  
  16444. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16445.  
  16446. /* NOTE: AUDITING must be turned on in IBMLAN.INI          */
  16447. #define INCL_BASE
  16448. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16449. #include <os2.h>          /* OS/2 API definitions          */
  16450. #include <mt\stdio.h>     /* Since the application starts a*/
  16451. #include <mt\string.h>    /* thread, we must use the       */
  16452. #include <mt\stdlib.h>    /* multithreaded include file.   */
  16453. #include <mt\process.h>   /*                               */
  16454. #include <time.h>
  16455. #include <netcons.h>      /* definition of NetAPI constants*/
  16456. #include <neterr.h>       /* NetAPI error codes            */
  16457. #include <audit.h>        /* header for NetAudit..()       */
  16458.  
  16459. void cdecl main(void);
  16460. void cdecl main()
  16461. {
  16462.     CHAR ServerName[32], BackUpFile[32];
  16463.     CHAR TypeStr[40], ComputerName[15];
  16464.     CHAR UserName[15];
  16465.     SEL Selector1;
  16466.     struct audit_entry *AuditLog;
  16467.     struct ae_sesslogoff *SessionEnded;
  16468.     USHORT  rc, TotalAvailable;
  16469.     USHORT  BytesRead;
  16470.     USHORT NameOffset;
  16471.     USHORT UserOffset;
  16472.     USHORT BufLen;
  16473.     USHORT Type;
  16474.     HLOG    LogHandle;
  16475.     CHAR *Buffer;
  16476.     USHORT LineCounter=0;
  16477.  
  16478.     /* insert name of your server here */
  16479.     strcpy(ServerName, "\\\\KOSER");
  16480.     strcpy(BackUpFile, "AUDLOG.BAK");
  16481.     BufLen =  1500 ;
  16482.     rc = DosAllocSeg( BufLen , &Selector1, SEG_NONSHARED );
  16483.     Buffer = (CHAR FAR *)MAKEP(Selector1, 0 );
  16484.     /* put our dummy error info at end of Read Buffer */
  16485.     SessionEnded = (struct ae_sesslogoff *)MAKEP(Selector1,
  16486.         1000);
  16487.  
  16488.     /* clear out audit file */
  16489.     rc = NetAuditClear( ServerName,
  16490.         BackUpFile, NULL);
  16491.     if(!rc)
  16492.         printf("\nError Log has been cleared");
  16493.     else
  16494.         printf("\nLogClear failed, rc = %d", rc );
  16495.  
  16496.     /* now we're going to enter a fake error */
  16497.     /* start name right at end of fixed data */
  16498.     /* structure                             */
  16499.     NameOffset = sizeof(struct ae_sesslogoff);
  16500.     Type = AE_SESSLOGOFF;
  16501.     /* UserOffset = NameOffset + strlen(name) */
  16502.     /* + NULL                                 */
  16503.     UserOffset = NameOffset + 6;
  16504.     /* put in computername */
  16505.     strcpy((CHAR *)SessionEnded+NameOffset, "KOSER");
  16506.     /* put in username */
  16507.     strcpy((CHAR *)SessionEnded+UserOffset, "OREILLY");
  16508.     SessionEnded->ae_sf_compname = NameOffset;
  16509.     SessionEnded->ae_sf_username = UserOffset;
  16510.  
  16511.     /* size of write buffer = 500 bytes */
  16512.     rc = NetAuditWrite( Type, (CHAR FAR *)SessionEnded, 500,
  16513.         NULL, NULL);
  16514.     if (!rc)
  16515.         printf("\nWrote to Log File");
  16516.     else
  16517.         printf("\nLogWrite failed, rc = %d", rc );
  16518.  
  16519.     /* set up log handle for read from beginning*/
  16520.     LogHandle.time = 0L;
  16521.     LogHandle.last_flags = 0L;
  16522.     LogHandle.offset = 0xFFFFFFFF;
  16523.     LogHandle.last_flags = 0xFFFFFFFF;
  16524.     do {
  16525.         /* read in a thousand bytes */
  16526.         rc = NetAuditRead( ServerName, NULL, &LogHandle,
  16527.             0L, NULL, 0L, 0L, Buffer, 1000, &BytesRead,
  16528.             &TotalAvailable );
  16529.         if (rc){
  16530.             printf("LogRead failed, rc = %d", rc );
  16531.             exit(0);
  16532.         }
  16533.         for (AuditLog = Buffer;
  16534.             /* cast to struct * after ptr addition */
  16535.             AuditLog < (struct audit_entry *)
  16536.             (Buffer + BytesRead); ){
  16537.                 if (LineCounter == 23){
  16538.                     printf("Press any key for next page");
  16539.                     getch();
  16540.                     LineCounter = 0;
  16541.                 }
  16542.                 LineCounter++;
  16543.                 switch(AuditLog->ae_type){
  16544.                     case AE_SRVSTATUS:
  16545.                        strcpy(TypeStr,"Server Status Changed");
  16546.                        break;
  16547.                     case AE_SESSLOGON:
  16548.                        strcpy(TypeStr,"Session was logged on");
  16549.                        break;
  16550.                     case AE_SESSLOGOFF:
  16551.                        /* case to struct * after ptr addition*/
  16552.                        SessionEnded =
  16553.                            (struct ae_sesslogoff *)
  16554.                            ((char *)AuditLog+
  16555.                        AuditLog->ae_data_offset);
  16556.                        strcpy(TypeStr,"Session was logged off");
  16557.                        strcpy(ComputerName,(char *)SessionEnded
  16558.                            + SessionEnded->ae_sf_compname);
  16559.                        strcpy(UserName,(char *)SessionEnded +
  16560.                            SessionEnded->ae_sf_username);
  16561.                        break;
  16562.                     default:
  16563.                        strcpy(TypeStr, "OTHER Type of Audit");
  16564.                        break;
  16565.                 }
  16566.                 printf("\nType: %-30s Time: %-40s",
  16567.                     TypeStr,
  16568.                     /* convert the time to a string */
  16569.                     ctime(&(AuditLog->ae_time)));
  16570.                 printf("\nComputer: %s", ComputerName);
  16571.                 printf("  User: %s", UserName);
  16572.                 AuditLog = (struct audit_entry *)
  16573.                     ((char *)AuditLog +
  16574.                     AuditLog->ae_len);
  16575.         }
  16576.     } while ((rc == 0) && (BytesRead != 0));
  16577.  
  16578.     DosFreeSeg(Selector1);
  16579. }
  16580.  
  16581.  
  16582. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16583.  
  16584. #define INCL_BASE
  16585. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16586. #include <os2.h>          /* OS/2 API definitions          */
  16587. #include <mt\stdio.h>     /* Since the application starts a*/
  16588. #include <mt\string.h>    /* thread, we must use the       */
  16589. #include <mt\stdlib.h>    /* multithreaded include file.   */
  16590. #include <mt\process.h>   /*                               */
  16591. #include <time.h>
  16592. #include <netcons.h>      /* definition of NetAPI constants*/
  16593. #include <neterr.h>       /* NetAPI error codes            */
  16594. #include <errlog.h>       /* header for NetError..()       */
  16595.  
  16596. void cdecl main(void);
  16597. void cdecl main()
  16598. {
  16599.     CHAR ServerName[32], BackUpFile[32];
  16600.     SEL Selector1;
  16601.     struct error_log *ErrorLog;
  16602.     USHORT  rc, TotalAvailable;
  16603.     USHORT  BytesRead;
  16604.     USHORT BufLen;
  16605.     HLOG    LogHandle;
  16606.     CHAR *Buffer;
  16607.     USHORT LineCounter=0;
  16608.  
  16609.     /* insert name of your server here */
  16610.     strcpy(ServerName, "\\\\KOSER");
  16611.     strcpy(BackUpFile, "ERRLOG.BAK");
  16612.     BufLen =  1000;
  16613.     rc = DosAllocSeg( BufLen , &Selector1, SEG_NONSHARED );
  16614.     Buffer = (CHAR FAR *)MAKEP(Selector1, 0 );
  16615.  
  16616.     /* this is for the LogRead() */
  16617.     LogHandle.time = 0L;
  16618.     LogHandle.last_flags = 0L;
  16619.     LogHandle.offset = 0xFFFFFFFF;
  16620.     LogHandle.last_flags = 0xFFFFFFFF;
  16621.  
  16622.     /* clear out log file, back up saved */
  16623.     rc = NetErrorLogClear( ServerName,
  16624.         BackUpFile, NULL);
  16625.     if(!rc)
  16626.         printf("\nError Log has been cleared");
  16627.     else
  16628.         printf("\nLogClear failed, rc = %d", rc );
  16629.  
  16630.     /* now we're going to enter a fake error */
  16631.     rc = NetErrorLogWrite( NULL, NERR_InternalError,
  16632.         "NET", NULL, 0, NULL, 0, NULL);
  16633.     if (!rc)
  16634.         printf("\nWrote to Log File");
  16635.     else
  16636.         printf("\nLogWrite failed, rc = %d", rc );
  16637.  
  16638.     do {
  16639.         /* now read the errors in file */
  16640.         rc = NetErrorLogRead( ServerName, NULL, &LogHandle,
  16641.             0L, NULL, 0L, 0L, Buffer, 1000, &BytesRead,
  16642.             &TotalAvailable );
  16643.         if (rc){
  16644.             printf("LogRead failed, rc = %d", rc );
  16645.             exit(0);
  16646.         }
  16647.         for (ErrorLog = Buffer;
  16648.             ErrorLog < (struct error_log *)
  16649.             (Buffer + BytesRead); ){
  16650.                 if (LineCounter == 23){
  16651.                     printf("Press any key for next page");
  16652.                     getch();
  16653.                     LineCounter = 0;
  16654.                 }
  16655.                 LineCounter++;
  16656.                 printf("\nError: %u Service: %s Time: %s",
  16657.                     ErrorLog->el_error, ErrorLog->el_name ,
  16658.                     ctime(&(ErrorLog->el_time)));
  16659.                 /* ptr arithmetic here, add the length of */
  16660.                 /* log rec (el_len) to ErrorLog to get   */
  16661.                 /*  address of                           */
  16662.                 /* new record (notice char * casting to  */
  16663.                 /* use addition of 1 char increments     */
  16664.                 /* rather than sizeof (struct error_log  */
  16665.                 /* increments                            */
  16666.                 ErrorLog = (struct error_log *)((char *)ErrorLog
  16667.                     + ErrorLog->el_len);
  16668.         }
  16669.     } while ((rc == 0) && (BytesRead != 0));
  16670.     DosFreeSeg(Selector1);
  16671. }
  16672.  
  16673.  
  16674. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16675.  
  16676. #define INCL_BASE
  16677. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16678. #include <os2.h>          /* OS/2 API definitions          */
  16679. #include <mt\stdio.h>     /* Since the application starts a*/
  16680. #include <mt\string.h>    /* thread, we must use the       */
  16681. #include <mt\stdlib.h>    /* multithreaded include file.   */
  16682. #include <mt\process.h>   /*                               */
  16683. #include <netcons.h>      /* definition of NetAPI constants*/
  16684. #include <neterr.h>       /* NetAPI error codes            */
  16685. #include <shares.h>
  16686. #define FILERIGHTS_READ    0x1
  16687. #define FILERIGHTS_WRITE   0x2
  16688. #define FILERIGHTS_CREATE  0x4
  16689. void cdecl main(void);
  16690. void cdecl main()
  16691. {
  16692.         CHAR Server[32];
  16693.         CHAR FAR *Start;
  16694.         USHORT rc, i;
  16695.         USHORT EntriesRead, TotalEntries, TotalAvailable;
  16696.         SEL Selector1, Selector2;
  16697.         USHORT BufLen;
  16698.         struct file_info_3 *Info[30], *Buffer;
  16699.         FRK Resume;
  16700.         /* Set up for Resume Key */
  16701.         FRK_INIT(Resume);
  16702.         /* allocate space for 30 entry,
  16703.             structure + dynamic data */
  16704.         BufLen = sizeof( struct file_info_3) +
  16705.             UNLEN + 1L + PATHLEN;
  16706.         rc = DosAllocSeg(BufLen * 30, &Selector1,
  16707.             SEG_NONSHARED);
  16708.         /* now allocate space for GetInfo call */
  16709.         rc = DosAllocSeg(BufLen , &Selector2, SEG_NONSHARED);
  16710.         /* set up data buffer */
  16711.         for ( i = 0; i < 30; i++)
  16712.             Info[i] = (struct file_info_3 *)MAKEP(Selector1,
  16713.                  i * sizeof( struct file_info_3) );
  16714.         Start = (CHAR FAR *)&Info[0];
  16715.         /* make pointer for GetInfo call */
  16716.         Buffer = (struct file_info_3  *)MAKEP(Selector2,
  16717.             0 );
  16718.         /* insert the name of your favorite server here */
  16719.         strcpy(Server, "\\\\TECHSUPP");
  16720.         rc = NetFileEnum2(Server, (CHAR FAR *)0,
  16721.             (CHAR FAR *)0, 3, (CHAR FAR *)Info[0],
  16722.             BufLen*30 , &EntriesRead, &TotalEntries,
  16723.             &Resume );
  16724.         printf("EntriesRead = %d", EntriesRead );
  16725.         for (i = 0 ; i < EntriesRead; i++){
  16726.             printf("\n Entry #%d", i );
  16727.             printf("  Name = %-40s",
  16728.                 Info[i]->fi3_pathname[0]?Info[i]->fi3_pathname:
  16729.                 "NULL");
  16730.             printf(" Id= %ld", Info[i]->fi3_id );
  16731.         }
  16732.         printf("\n Enter number of Entry to display");
  16733.         printf(" information on: ");
  16734.         scanf("%d", &i );
  16735.         rc = NetFileGetInfo2( Server, Info[i]->fi3_id,
  16736.             3, (CHAR FAR *)Buffer, BufLen, &TotalAvailable );
  16737.         printf("\n ID = %ld", Buffer->fi3_id );
  16738.         printf("\n Permissions = ");
  16739.         if (Buffer->fi3_permissions & FILERIGHTS_READ )
  16740.             printf("FILE_READ " );
  16741.         if (Buffer->fi3_permissions & FILERIGHTS_WRITE )
  16742.             printf("FILE_WRITE " );
  16743.         if (Buffer->fi3_permissions & FILERIGHTS_CREATE )
  16744.             printf("FILE_CREATE " );
  16745.         printf("\n NumLocks = %d", Buffer->fi3_num_locks );
  16746.         printf("\n PathName = %s", Buffer->fi3_pathname );
  16747.         printf("\n UserName = %s", Buffer->fi3_username );
  16748.         printf("\nEnter number of Entry to close, ");
  16749.         printf("10 to exit: ");
  16750.         scanf("%d", &i );
  16751.         if (i != 10 ){
  16752.             rc = NetFileClose2(Server, Info[i]->fi3_id );
  16753.             if (!rc)
  16754.                 printf("\nFile %s closed",
  16755.                     Info[i]->fi3_pathname );
  16756.             else
  16757.                 printf("\nError in closing file, rc = %d",
  16758.                      rc );
  16759.         }
  16760.         DosFreeSeg(Selector1);
  16761.         DosFreeSeg(Selector2);
  16762. }
  16763.  
  16764.  
  16765. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16766.  
  16767. #define INCL_BASE
  16768. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16769. #include <os2.h>          /* OS/2 API definitions          */
  16770. #include <mt\stdio.h>     /* Since the application starts a*/
  16771. #include <mt\string.h>    /* thread, we must use the       */
  16772. #include <mt\stdlib.h>    /* multithreaded include file.   */
  16773. #include <mt\process.h>   /*                               */
  16774. #include <netcons.h>      /* definition of NetAPI constants*/
  16775. #include <neterr.h>       /* NetAPI error codes            */
  16776. #include <shares.h>
  16777. #define NULLSTRING (CHAR *)0;
  16778. /*
  16779. struct file_info_3 {
  16780.     unsigned long fi3_id;
  16781.     unsigned short fi3_permissiolns;
  16782.     unsigned short fi3_num_locks;
  16783.     char far * fi3_pathname;
  16784.     char far * fi3_username;
  16785. };
  16786. */
  16787. void cdecl main(void);
  16788. void cdecl main()
  16789. {
  16790.         CHAR Server[32];
  16791.         USHORT rc, i;
  16792.         USHORT EntriesRead, TotalEntries;
  16793.         SEL Selector1;
  16794.         USHORT BufLen;
  16795.         struct file_info_3 *Info[30];
  16796.         FRK Resume;
  16797.         CHAR FAR *Start;
  16798.         /* Set up for Resume Key */
  16799.         FRK_INIT(Resume);
  16800.         /* allocate space for 30 entries,
  16801.             arrays + dynamic data */
  16802.         BufLen = sizeof( struct file_info_3) +
  16803.             UNLEN + 1L + PATHLEN;
  16804.         rc = DosAllocSeg(BufLen*30, &Selector1, SEG_NONSHARED);
  16805.         /* set up array of structure */
  16806.         for (i= 0; i < 30; i++)
  16807.             Info[i] = MAKEP(Selector1,
  16808.                 i*sizeof( struct file_info_3) );
  16809.         /* insert the name of your favorite server here */
  16810.         strcpy(Server, "\\\\TECHSUPP");
  16811.         Start = (CHAR FAR *)&Info[0];
  16812.         rc = NetFileEnum2(Server, (CHAR FAR *)0,
  16813.             (CHAR FAR *)0, 3, (CHAR FAR *)Info[0],
  16814.             BufLen * 30, &EntriesRead, &TotalEntries,
  16815.             &Resume );
  16816.         if (rc)
  16817.             printf("\nError in NetFileEnum2, RC = %d", rc );
  16818.         else {
  16819.             /* if no errors, see what is open */
  16820.             printf("\nEntries read = %d", EntriesRead );
  16821.             printf("\nTotal Entries = %d", TotalEntries );
  16822.             for (i=0; i < EntriesRead; i++){
  16823.                 printf(
  16824.                "\nEntry #: %d Id: %ld Permissions: %d ",
  16825.                     i, Info[i]->fi3_id,
  16826.                         Info[i]->fi3_permissions);
  16827.                 printf(
  16828.                 "\nName: %s User: %s",
  16829.                     Info[i]->fi3_pathname[0]?
  16830.                     Info[i]->fi3_pathname:"NULL",
  16831.                     Info[i]->fi3_username[0]?
  16832.                     Info[i]->fi3_username:"NULL");
  16833.             }
  16834.         }
  16835. } /* end main */
  16836.  
  16837.  
  16838. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16839.  
  16840. #define INCL_BASE
  16841. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16842. #include <os2.h>          /* OS/2 API definitions          */
  16843. #include <mt\stdio.h>
  16844. #include <mt\string.h>
  16845. #include <mt\stdlib.h>
  16846. #include <mt\process.h>
  16847. #include <mt\conio.h>
  16848. #include <netcons.h>      /* definition of NetAPI constants*/
  16849. #include <neterr.h>       /* NetAPI error codes            */
  16850. #include <chardev.h>      /* header for NetHandle()...     */
  16851. /*
  16852.     Structure found in chardev.h
  16853. struct handle_info_2 {
  16854.     char far *hdli2_username;
  16855. };
  16856. struct handle_info_1 {
  16857.         unsigned long   hdli1_chartime;
  16858.         unsigned short  hdli1_charcount;
  16859. };
  16860. */
  16861. #define MAXENTRIES      300
  16862. void cdecl main(void);
  16863. void cdecl main()
  16864. {
  16865.     USHORT rc, BufLen;
  16866.     struct handle_info_2 *HandleInfo;
  16867.     struct handle_info_1 HandleSet;
  16868.     USHORT Handle;
  16869.     USHORT TotalAvailable;
  16870.     USHORT Value;
  16871.     SEL Selector1;
  16872.  
  16873.     /* insert number of handle to get info on */
  16874.     Handle = 10;
  16875.     BufLen = sizeof (struct handle_info_21 *) + 60;
  16876.     rc = DosAllocSeg(BufLen, &Selector1, SEG_NONSHARED);
  16877.     HandleInfo = (struct handle_info_2 *)MAKEP(Selector1,0);
  16878.     rc = NetHandleGetInfo(Handle, 2,
  16879.         (CHAR FAR *)HandleInfo,
  16880.         BufLen,
  16881.         &TotalAvailable );
  16882.     if (!rc){
  16883.         printf("\nHANDLE INFO:");
  16884.         printf("\nUserName = %s", HandleInfo->hdli2_username );
  16885.     }
  16886.     else
  16887.         printf("\nGetInfo() failed, rc = %d", rc );
  16888.     /* NOTE: if handle specified is not open, rc will be 87 */
  16889.     /* ERROR_INVALID_PARAMETER   */
  16890.  
  16891.     /* set the character count before sending to be 20 */
  16892.     Value = 20;
  16893.     rc = NetHandleSetInfo( Handle, 1, &Value, sizeof(Value),
  16894.         HANDLE_SET_CHAR_COUNT);
  16895.     if (!rc)
  16896.         printf("\nHandleInfo successfully set");
  16897.     else
  16898.         printf("\nSetInfo() failed, rc = %d", rc );
  16899.     DosFreeSeg(Selector1);
  16900. }
  16901.  
  16902.  
  16903. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  16904.  
  16905. #define INCL_BASE
  16906. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  16907. #include <os2.h>          /* OS/2 API definitions          */
  16908. #include <mt\stdio.h>
  16909. #include <mt\string.h>
  16910. #include <mt\stdlib.h>
  16911. #include <mt\process.h>
  16912. #include <netcons.h>      /* definition of NetAPI constants*/
  16913. #include <neterr.h>       /* NetAPI error codes            */
  16914. #include <remutil.h>      /* header for NetRemote..()      */
  16915. #include <use.h>          /* header for redirections       */
  16916. void cdecl main(void);
  16917. void cdecl main()
  16918. {
  16919.     CHAR ServerName[32], SourcePath[32], RemoteName[32];
  16920.     CHAR FailedObject[64], ReturnCodes[64];
  16921.     CHAR EnvStrings[2], ArgsStrings[13];
  16922.     SEL Selector1;
  16923.     struct use_info_1 *Buffer;
  16924.     USHORT  rc;
  16925.     USHORT BufLen, OpenFlags, CopyFlags;
  16926.     struct copy_info CopyInfo;
  16927.     struct move_info MoveInfo;
  16928.     struct time_of_day_info TimeInfo;
  16929.  
  16930.     /* insert name of your server here */
  16931.     strcpy(ServerName, "\\\\KOSER");
  16932.     /* allocate space for each entry  */
  16933.     /* structure + space for pointers */
  16934.     BufLen = sizeof( struct use_info_1 ) + DEVLEN + 1 + PWLEN
  16935.         + 1 + RMLEN + 1;
  16936.     rc = DosAllocSeg( BufLen, &Selector1, SEG_NONSHARED );
  16937.     Buffer = (struct use_info_1 *)MAKEP(Selector1, 0 );
  16938.     /* we're going to make it our T drive */
  16939.     strcpy(Buffer->ui1_local, "T:");
  16940.     /* specify server and directory */
  16941.     /* take note of backslashes     */
  16942.     /* use a RemoteName available on your network */
  16943.     strcpy(RemoteName, "\\\\TECHSUPP\\DEPT_644");
  16944.     Buffer->ui1_remote = RemoteName;
  16945.     Buffer->ui1_password = (CHAR FAR *)0;
  16946.     Buffer->ui1_asg_type = USE_DISKDEV;
  16947.     rc = NetUseAdd((CHAR FAR *)0, 1, (CHAR FAR *)Buffer,
  16948.         BufLen );
  16949.     printf("\n NetUseAdd, Added U: ,rc = %d", rc );
  16950.     /* now copy a file to another place */
  16951.     OpenFlags = 0x0012;
  16952.     CopyFlags = MUST_BE_FILE;
  16953.     rc = NetRemoteCopy("T:\\KO\\TIPS.INF",
  16954.         "T:\\KO\\TIPSINF.TST",
  16955.         NULL,
  16956.         NULL,
  16957.         OpenFlags,
  16958.         CopyFlags,
  16959.         &CopyInfo,
  16960.         sizeof(struct copy_info));
  16961.     printf("\nNetRemoteCopy returned %d", rc );
  16962.  
  16963.     rc = NetRemoteTOD( ServerName, &TimeInfo,
  16964.         sizeof( struct time_of_day_info ));
  16965.     if (!rc){
  16966.         printf("\nDate on Server %s", ServerName );
  16967.         printf(":  %d/%d/%d", TimeInfo.tod_month,
  16968.             TimeInfo.tod_day, TimeInfo.tod_year );
  16969.         printf(" Time: %d:%d:%d", TimeInfo.tod_hours,
  16970.             TimeInfo.tod_mins, TimeInfo.tod_secs);
  16971.     }
  16972.     else
  16973.         printf("Error in RemoteTOD, rc = %d", rc );
  16974.  
  16975.     /* notice the way args are set up */
  16976.     /* one null after program name    */
  16977.     /* two nulls at end of string     */
  16978.     ArgsStrings[0] = 'E';
  16979.     ArgsStrings[1] = '\0';
  16980.     ArgsStrings[2] = 'T';
  16981.     ArgsStrings[3] = 'E';
  16982.     ArgsStrings[4] = 'S';
  16983.     ArgsStrings[5] = 'T';
  16984.     ArgsStrings[6] = '.';
  16985.     ArgsStrings[7] = 'D';
  16986.     ArgsStrings[8] = 'O';
  16987.     ArgsStrings[9] = 'C';
  16988.     ArgsStrings[10] = ArgsStrings[11] = '\0';
  16989.     EnvStrings[0] = EnvStrings[1] = '\0';
  16990.     rc = NetRemoteExec( -1L, FailedObject,
  16991.         64, EXEC_SYNC, ArgsStrings,
  16992.         EnvStrings, ReturnCodes, "E.EXE",
  16993.         NULL, 0 );
  16994.     if (!rc)
  16995.         printf("\nExecuting Editor");
  16996.     else
  16997.         printf("\nRemoteExec failed, rc = %d", rc );
  16998.  
  16999.     rc = NetRemoteMove( "T:\\KO\\TIPSINF.TST",
  17000.         "T:\\KO\\TIPSINF2.TST",
  17001.         NULL, NULL, OpenFlags, MUST_BE_FILE,
  17002.         &MoveInfo, sizeof( struct move_info));
  17003.     if (!rc)
  17004.         printf("\nTIPSINF.TST moved to TIPSINF2.TST");
  17005.     else
  17006.         printf("\nRemoteMove failed, rc = %d", rc );
  17007. }
  17008.  
  17009.  
  17010. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17011.  
  17012. #define INCL_BASE
  17013. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg       */
  17014. #include <os2.h>          /* OS/2 API definitions           */
  17015. #include <mt\stdio.h>     /* Since the application starts a */
  17016. #include <mt\string.h>    /* thread, we must use the        */
  17017. #include <mt\stdlib.h>    /* multithreaded include file.    */
  17018. #include <mt\process.h>   /*                                */
  17019. #include <netcons.h>      /* definition of NetAPI constants */
  17020. #include <neterr.h>       /* NetAPI error codes             */
  17021. #include <netstats.h>
  17022. #define NULLSTRING (CHAR *)0;
  17023. /*
  17024. struct stat_workstation_0 {
  17025.     unsigned long stw0_start;
  17026.     unsigned long stw0_numNCB_r;
  17027.     unsigned long stw0_numNCB_s;
  17028.     unsigned long stw0_numNCB_a;
  17029.     unsigned long stw0_fiNCB_r;
  17030.     unsigned long stw0_fiNCB_s;
  17031.     unsigned long stw0_fiNCB_a;
  17032.     unsigned long stw0_fcNCB_r;
  17033.     unsigned long stw0_fcNCB_s;
  17034.     unsigned long stw0_fcNCB_a;
  17035.     unsigned long stw0_sesstart;
  17036.     unsigned long stw0_sessfailcon;
  17037.     unsigned long stw0_sessbroke;
  17038.     unsigned long stw0_uses;
  17039.     unsigned long stw0_usefail;
  17040.     unsigned long stw0_autorec;
  17041.     unsigned long stw0_bytessent_r_high;
  17042.     unsigned long stw0_bytessent_r_low;
  17043.     unsigned long stw0_bytesrcvd_r_high;
  17044.     unsigned long stw0_bytesrcvd_r_low;
  17045.     unsigned long stw0_bytessent_s_high;
  17046.     unsigned long stw0_bytessent_s_low;
  17047.     unsigned long stw0_bytesrcvd_s_high;
  17048.     unsigned long stw0_bytesrcvd_s_low;
  17049.     unsigned long stw0_bytessent_a_high;
  17050.     unsigned long stw0_bytessent_a_low;
  17051.     unsigned long stw0_bytesrcvd_a_high;
  17052.     unsigned long stw0_bytesrcvd_a_low;
  17053.     unsigned long stw0_reqbufneed;
  17054.     unsigned long stw0_bigbufneed;
  17055. };
  17056. */
  17057. int cdecl main(void);
  17058. int cdecl main()
  17059. {
  17060.     CHAR Server[32], Service[32];
  17061.     struct stat_workstation_0 Info;
  17062.     USHORT Buflen, TotalAvailable;
  17063.     USHORT rc;
  17064.     ULONG Options;
  17065.     Server[0] = 0;
  17066.     strcpy(Service, "REQUESTER");
  17067.     Buflen = sizeof ( struct stat_workstation_0);
  17068.     Options = STATSOPT_CLR;
  17069.     rc = NetStatisticsGet2 ( Server, Service, 0L,
  17070.         0, Options, (CHAR FAR *)&Info, Buflen,
  17071.         &TotalAvailable );
  17072.     if (rc){
  17073.         printf("rc = %d", rc );
  17074.         exit(0);
  17075.     }
  17076.  printf("\nStartTime: %lu", Info.stw0_start );
  17077.  printf("\nTotal NCB's Issued - Redirector: %lu",
  17078.      Info.stw0_numNCB_r );
  17079.  printf("\nTotal NCB's Issued - Server     : %lu",
  17080.      Info.stw0_numNCB_s );
  17081.  printf("\nTotal NCB's Issued - Application: %lu",
  17082.      Info.stw0_numNCB_a );
  17083.  printf("\nTotal NCB's Failed Issue - Redirector: %lu",
  17084.      Info.stw0_fiNCB_r );
  17085.  printf("\nTotal NCB's Failed Issue - Server     : %lu",
  17086.      Info.stw0_fiNCB_s );
  17087.  printf("\nTotal NCB's Failed Issue - Application: %lu",
  17088.      Info.stw0_fiNCB_a );
  17089.  printf("\nTotal NCB's Failed Completion - Redirector: %lu",
  17090.      Info.stw0_fcNCB_r );
  17091.  printf("\nTotal NCB's Failed Completion - Server    : %lu",
  17092.      Info.stw0_fcNCB_s );
  17093.  printf("\nTotal NCB's Failed Completion - Application: %lu",
  17094.      Info.stw0_fcNCB_a );
  17095.  printf("\nNumber of requester sessions started : %lu",
  17096.      Info.stw0_sesstart );
  17097.  printf("\nNumber of requester sessions failing connection: %lu",
  17098.      Info.stw0_sessfailcon );
  17099.  printf("\nNumber of requester sessions broken: %lu",
  17100.      Info.stw0_sessbroke );
  17101.  printf("\nNumber of requester uses: %lu",
  17102.      Info.stw0_uses );
  17103.  printf("\nNumber of requester use failure: %lu",
  17104.      Info.stw0_usefail );
  17105.  printf("\nNumber of requester auto-connects: %lu",
  17106.      Info.stw0_autorec );
  17107.  printf("\nNumber of requester bytes sent to network(high): %lu",
  17108.      Info.stw0_bytessent_r_hi);
  17109.  printf("\nNumber of requester bytes sent to network(low): %lu",
  17110.      Info.stw0_bytessent_r_lo);
  17111.  printf("\nNumber of requester bytes rcvd to network(high): %lu",
  17112.      Info.stw0_bytesrcvd_r_hi);
  17113.  printf("\nNumber of requester bytes rcvd to network(low): %lu",
  17114.      Info.stw0_bytesrcvd_r_lo);
  17115.  printf("\nNumber of server bytes sent to network(high): %lu",
  17116.      Info.stw0_bytessent_s_hi);
  17117.  printf("\nNumber of server bytes sent to network(low): %lu",
  17118.      Info.stw0_bytessent_s_lo);
  17119.  printf("\nNumber of server bytes rcvd to network(high): %lu",
  17120.      Info.stw0_bytesrcvd_s_hi);
  17121.  printf("\nNumber of server bytes rcvd to network(low): %lu",
  17122.      Info.stw0_bytesrcvd_s_lo);
  17123.  printf("\nNumber of application bytes sent to network(high): %lu",
  17124.      Info.stw0_bytessent_a_hi);
  17125.  printf("\nNumber of application bytes sent to network(low): %lu",
  17126.      Info.stw0_bytessent_a_lo);
  17127.  printf("\nNumber of application bytes rcvd to network(high): %lu",
  17128.      Info.stw0_bytesrcvd_a_hi);
  17129.  printf("\nNumber of application bytes rcvd to network(low): %lu",
  17130.      Info.stw0_bytesrcvd_a_lo);
  17131.  printf("\nNumber of times req needed reqbuf but alloc failed: %lu",
  17132.      Info.stw0_reqbufneed );
  17133.  printf("\nNumber of times req needed bigbuf but alloc failed: %lu",
  17134.      Info.stw0_bigbufneed );
  17135. } /* end main */
  17136.  
  17137.  
  17138. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17139.  
  17140. #define INCL_BASE
  17141. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17142. #include <os2.h>          /* OS/2 API definitions          */
  17143. #include <mt\stdio.h>     /* Since the application starts a*/
  17144. #include <mt\string.h>    /* thread, we must use the       */
  17145. #include <mt\stdlib.h>    /* multithreaded include file.   */
  17146. #include <mt\process.h>   /*                               */
  17147. #include <netcons.h>      /* definition of NetAPI constants*/
  17148. #include <neterr.h>       /* NetAPI error codes            */
  17149. #include <use.h>
  17150. /*
  17151.     struct use_info_1 {
  17152.         char ui1_local[DEVLEN+1];
  17153.         char ui1_pad_1;
  17154.         char far * ui1_remote;
  17155.         char far * ui1_password;
  17156.         unsigned char ui1_status;
  17157.         unsigned char ui1_asg_type;
  17158.         unsigned char ui1_refcount;
  17159.         unsigned char ui1_usecount;
  17160.     }
  17161. */
  17162. void cdecl main(void);
  17163. void cdecl main()
  17164. {
  17165.     SEL Selector1, Selector2;
  17166.     struct use_info_1 *Buffer, *Info[30];
  17167.     USHORT rc, BufLen, EntriesRead, TotalEntries;
  17168.     USHORT TotalAvailable;
  17169.     CHAR RemoteName[32], Status[45],Type[45];
  17170.     USHORT i;
  17171.     /* allocate space for each entry  */
  17172.     /* structure + space for pointers */
  17173.     BufLen = sizeof( struct use_info_1 ) + DEVLEN + 1 + PWLEN
  17174.         + 1 + RMLEN + 1;
  17175.     rc = DosAllocSeg( BufLen, &Selector1, SEG_NONSHARED );
  17176.     Buffer = (struct use_info_1 *)MAKEP(Selector1, 0 );
  17177.     /* we're going to make it our U drive */
  17178.     strcpy(Buffer->ui1_local, "U:");
  17179.     /* specify server and directory */
  17180.     /* take note of backslashes     */
  17181.     strcpy(RemoteName, "\\\\JLWSRVR\\GRAPHICS");
  17182.     /* use a RemoteName available on your network */
  17183.     Buffer->ui1_remote = RemoteName;
  17184.     Buffer->ui1_password = (CHAR FAR *)0;
  17185.     rc = NetUseAdd((CHAR FAR *)0, 1, (CHAR FAR *)Buffer,
  17186.         BufLen );
  17187.     printf("\n NetUseAdd, Added U: ,rc = %d", rc );
  17188.     /* now allocate space for 30 entries */
  17189.     rc = DosAllocSeg( BufLen*30, &Selector2, SEG_NONSHARED );
  17190.     for (i=0;i < 30; i++)
  17191.         Info[i] = MAKEP(Selector2,
  17192.             i*sizeof( struct use_info_1));
  17193.     /* if Server is specified, will tell you redirections on */
  17194.     /* Server, if NULL, will tell you local redirections     */
  17195.     rc = NetUseEnum( (CHAR FAR *)0, 1, (CHAR FAR *)Info[0],
  17196.         BufLen*30, &EntriesRead, &TotalEntries );
  17197.     printf("\n NetUseEnum: rc = %d Entries = %d",
  17198.         rc, EntriesRead );
  17199.     for (i=0; i < EntriesRead; i++)
  17200.         printf("\nEntry #%d Name: %-40s", i,
  17201.             Info[i]->ui1_remote );
  17202.     /* for GetInfo specify local device name (U:) */
  17203.     rc = NetUseGetInfo((CHAR FAR *)0, "U:", 1,
  17204.         (CHAR FAR *)Buffer, BufLen, &TotalAvailable);
  17205.     if (!rc){
  17206.         printf("\n\n NetUseGetInfo Returned:");
  17207.         printf("\nRemoteName: %s", Buffer->ui1_remote );
  17208.         printf("\nLocalName : %s", Buffer->ui1_local  );
  17209.         switch(Buffer->ui1_status){
  17210.             case 0:
  17211.                 strcpy(Status, "Connection valid");
  17212.                 break;
  17213.             case 1:
  17214.                 strcpy(Status, "Paused by Local Requester");
  17215.                 break;
  17216.             /* 2 can either be session removed */
  17217.             /* OR Connection Disconnected      */
  17218.             case 2:
  17219.                 strcpy(Status, "Session Removed, Disconnected");
  17220.                 break;
  17221.             case 3:
  17222.                 strcpy(Status, "Network Error");
  17223.                 break;
  17224.             case 4:
  17225.                 strcpy(Status, "Connection being Made");
  17226.                 break;
  17227.             case 5:
  17228.                 strcpy(Status, "Reconnecting");
  17229.                 break;
  17230.         }
  17231.         printf("\nStatus    : %s", Status );
  17232.         switch(Buffer->ui1_asg_type){
  17233.             case -1:
  17234.                 strcpy(Type, "NULL Local Device");
  17235.                 break;
  17236.             case 0:
  17237.                 strcpy(Type,"Disk Device");
  17238.                 break;
  17239.             case 1:
  17240.                 strcpy(Type,"Spooled Printer");
  17241.                 break;
  17242.             case 2:
  17243.                 strcpy(Type,"Serial Device");
  17244.                 break;
  17245.             case 3:
  17246.                 strcpy(Type,"IPC");
  17247.                 break;
  17248.         }
  17249.         printf("\nType: %s", Type );
  17250.         printf("\nResources Open: %d", Buffer->ui1_refcount );
  17251.         printf("\nExplicit Connections: %d",
  17252.             Buffer->ui1_usecount);
  17253.     }/* if rc == 0 */
  17254.     else
  17255.         printf("\nNet UseGetInfo RC = %d", rc );
  17256.     /* Now delete the U: drive */
  17257.     rc = NetUseDel( (CHAR FAR *)0, "U:", USE_FORCE );
  17258.     printf("\nDeleted U:, rc = %d", rc );
  17259. }
  17260.  
  17261.  
  17262. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17263.  
  17264. #define INCL_BASE
  17265. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17266. #include <os2.h>          /* OS/2 API definitions          */
  17267. #include <mt\stdio.h>
  17268. #include <mt\string.h>
  17269. #include <mt\stdlib.h>
  17270. #include <mt\process.h>
  17271. #include <mt\conio.h>
  17272. #include <netcons.h>      /* definition of NetAPI constants*/
  17273. #include <neterr.h>       /* NetAPI error codes            */
  17274. #include <alert.h>        /* header for NetAlert()...      */
  17275. /*
  17276. struct std_alert
  17277. {
  17278.         long    alrt_timestamp;
  17279.         char    alrt_eventname[EVLEN+1];
  17280.         char    alrt_pad1;
  17281.         char    alrt_servicename[SNLEN+1];
  17282. };
  17283. */
  17284. void cdecl main(void);
  17285. void cdecl main()
  17286. {
  17287.     USHORT rc, BufLen;
  17288.     USHORT BufUsed;
  17289.     struct std_alert *Alert;
  17290.     SEL Selector1;
  17291.     CHAR *MsgText;
  17292.     /* allocate a big buffer */
  17293.     BufLen = 1000;
  17294.     rc = DosAllocSeg(BufLen, &Selector1, SEG_NONSHARED);
  17295.     Alert = (struct std_alert *)MAKEP(Selector1, 0 );
  17296.  
  17297.     strcpy(Alert->alrt_eventname, ALERT_MESSAGE_EVENT);
  17298.     strcpy(Alert->alrt_servicename, "TESTSVC");
  17299.     /* macro to put MsgText at end of Alert structure */
  17300.     /* see header alert.h */
  17301.     MsgText = ALERT_OTHER_INFO(Alert);
  17302.     strcpy(MsgText,"TRIAL RUN");
  17303.     BufUsed = sizeof( struct std_alert) + strlen(MsgText) +1;
  17304.  
  17305.     /* defines are found in alert.h */
  17306.     rc = NetAlertRaise( ALERT_MESSAGE_EVENT, (CHAR FAR *)Alert,
  17307.         BufUsed, ALERT_MED_WAIT);
  17308.     if (!rc)
  17309.         printf("\nAlert was raised");
  17310.     else
  17311.         printf("\nError in AlertRaise(), rc = %d", rc );
  17312.  
  17313.     DosFreeSeg(Selector1);
  17314. }
  17315.  
  17316.  
  17317. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17318.  
  17319. #define INCL_BASE
  17320. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17321. #include <os2.h>          /* OS/2 API definitions          */
  17322. #include <mt\stdio.h>
  17323. #include <mt\string.h>
  17324. #include <mt\stdlib.h>
  17325. #include <mt\process.h>
  17326. #include <mt\conio.h>
  17327. #include <netcons.h>      /* definition of NetAPI constants*/
  17328. #include <neterr.h>       /* NetAPI error codes            */
  17329. #include <access.h>
  17330. #include <shares.h>       /* header for NetShare..()       */
  17331. /*
  17332.  structure found in shares.h
  17333. struct share_info_1 {
  17334.     char                shi1_netname[NNLEN+1];
  17335.     char                shi1_pad1;
  17336.     unsigned short      shi1_type;
  17337.     char far *          shi1_remark;
  17338. };
  17339. struct share_info_2 {
  17340.     char                shi2_netname[NNLEN+1];
  17341.     char                shi2_pad1;
  17342.     unsigned short      shi2_type;
  17343.     char far *          shi2_remark;
  17344.     unsigned short      shi2_permissions;
  17345.     unsigned short      shi2_max_uses;
  17346.     unsigned short      shi2_current_uses;
  17347.     char far *          shi2_path;
  17348.     char                shi2_passwd[SHPWLEN+1];
  17349.     char                shi2_pad2;
  17350. };
  17351. */
  17352. #define MAXENTRIES      300
  17353. static char *Types[] = {"Disk Drive", "Spooler Queue",
  17354.     "Serial Device", "IPC"};
  17355. void cdecl main(void);
  17356. void cdecl main()
  17357. {
  17358.     CHAR ServerName[32];
  17359.     CHAR BasePath[25], NetName[25];
  17360.     CHAR Comment[40];
  17361.     USHORT DeviceType;
  17362.     USHORT rc, BufLen, i, AddLen;
  17363.     struct share_info_2 *ShareAdd;
  17364.     SEL Selector1, Selector2;
  17365.     USHORT EntriesRead, TotalAvailable;
  17366.  
  17367.     /* use double backslashes with servername */
  17368.     /* insert name of your server here */
  17369.     strcpy(ServerName, "\\\\KOSER");
  17370.     /* defines are found in Appendix H */
  17371.     /* of LS Prog Ref 1.3 */
  17372.     BufLen = sizeof( struct share_info_1 ) +
  17373.         MAXCOMMENTSZ + 1;
  17374.     /* Allocate one big buffer */
  17375.     rc = DosAllocSeg(BufLen * MAXENTRIES, &Selector1,
  17376.         SEG_NONSHARED );
  17377.     ShareInfo = (struct share_info_1 *)
  17378.             MAKEP( Selector1, 0);
  17379.     rc = DosAllocSeg(1000, &Selector2, SEG_NONSHARED);
  17380.     ShareAdd = (struct share_info_2 *)
  17381.         MAKEP(Selector2, 0 );
  17382.  
  17383.     /* clear our memory */
  17384.     memset(ShareAdd,0, sizeof(struct share_info_2));
  17385.     strcpy(NetName, "OHNO");
  17386.     strcpy(ShareAdd->shi2_netname, NetName);
  17387.     ShareAdd->shi2_type = STYPE_DISKTREE;
  17388.     strcpy(BasePath, "C:\\IBMLAN");
  17389.     ShareAdd->shi2_path = BasePath;
  17390.     /* no password */
  17391.     ShareAdd->shi2_passwd[0] = '\0';
  17392.     /* unlimited uses */
  17393.     ShareAdd->shi2_max_uses = -1;
  17394.     /* give read, write, and exec permissions */
  17395.     ShareAdd->shi2_permissions = ACCESS_READ & ACCESS_WRITE
  17396.         & ACCESS_EXEC;
  17397.  
  17398.     /* defines found in Appendix H referenced above */
  17399.     AddLen = sizeof(struct share_info_2) + PATHLEN + 1
  17400.         + MAXCOMMENTSZ + 1;
  17401.     rc = NetShareAdd( ServerName, 2,
  17402.         (CHAR FAR *)ShareAdd, AddLen);
  17403.     if (!rc)
  17404.         printf("Resource successfully added");
  17405.     else
  17406.         printf("ShareAdd() failed, rc = %d", rc );
  17407.  
  17408.     rc = NetShareEnum( ServerName, 1,
  17409.         (CHAR FAR *)ShareInfo,
  17410.         BufLen * MAXENTRIES, &EntriesRead,
  17411.         &TotalAvailable );
  17412.     if (!rc){
  17413.         for (i = 0; i < EntriesRead; i++){
  17414.             printf("\nName: %-15s Type: %s",
  17415.                 ShareInfo->shi1_netname,
  17416.                 Types[ShareInfo->shi1_type] );
  17417.             /* increment ptr to next structure */
  17418.             ShareInfo++;
  17419.         }
  17420.     }
  17421.     else
  17422.         printf("\nShareEnum failed, rc = %d", rc );
  17423.  
  17424.     rc = NetShareCheck( ServerName, NetName,
  17425.         &DeviceType);
  17426.     if (!rc)
  17427.         printf("\nServer is sharing device %s of type %s",
  17428.             NetName, Types[DeviceType]);
  17429.     else
  17430.         if (rc == NERR_DeviceNotShared)
  17431.             printf("\nDevice %s is NOT being shared",
  17432.                 NetName);
  17433.         else
  17434.             printf("\nShareCheck() failed, rc = %d", rc );
  17435.  
  17436.     /* since only changing one item, pass Comment */
  17437.     /* instead of whole structure */
  17438.     strcpy(Comment,"COMMENTCOMMENTCOMMENTETC");
  17439.     rc = NetShareSetInfo( ServerName, NetName,
  17440.         2, Comment, strlen(Comment) + 1,
  17441.         SHI_REMARK_PARMNUM);
  17442.     if (!rc)
  17443.         printf("\nComment successfully added");
  17444.     else
  17445.         printf("\nSetInfo() failed, rc = %d", rc );
  17446.  
  17447.     /* clear out for re-use */
  17448.     memset(ShareAdd, 0, AddLen );
  17449.     rc = NetShareGetInfo( ServerName, NetName, 2,
  17450.         (CHAR FAR *)ShareAdd, AddLen, &TotalAvailable );
  17451.     if (!rc){
  17452.         printf("\nInfo on Resource: %s", NetName );
  17453.         printf("\nPath: %s", ShareAdd->shi2_path );
  17454.         printf("\nType: %s", Types[ShareAdd->shi2_type]);
  17455.         printf("\nNumber of Current Connections: %d",
  17456.             ShareAdd->shi2_current_uses );
  17457.         printf("\nRemark: %s", ShareAdd->shi2_remark);
  17458.     }
  17459.     else
  17460.         printf("\nGetInfo() failed, rc = %d", rc );
  17461.  
  17462.     /* now delete the resource we created */
  17463.     rc = NetShareDel(ServerName, NetName, 0 );
  17464.     if (!rc)
  17465.         printf("\nResource deleted");
  17466.     else
  17467.         printf("\nShareDel() failed, rc = %d", rc );
  17468.     /*clean up */
  17469.     DosFreeSeg(Selector1);
  17470.     DosFreeSeg(Selector2);
  17471. }
  17472.  
  17473.  
  17474. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17475.  
  17476. #define INCL_BASE
  17477. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17478. #include <os2.h>          /* OS/2 API definitions          */
  17479. #include <mt\stdio.h>
  17480. #include <mt\string.h>
  17481. #include <mt\stdlib.h>
  17482. #include <mt\process.h>
  17483. #include <mt\conio.h>
  17484. #include <netcons.h>      /* definition of NetAPI constants*/
  17485. #include <neterr.h>       /* NetAPI error codes            */
  17486. #include <access.h>       /* header for NetGroup..()       */
  17487. /*
  17488.     struct access_info_1 {
  17489.         char far * acc1_resource_name;
  17490.         short      acc1_attr;
  17491.         short      acc1_count;
  17492.     };
  17493.     struct access_list {
  17494.         char acl_ugname[UGLEN+1];
  17495.         char acl_ugname_pad_1;
  17496.         short acl_access;
  17497.     };
  17498.     Structures are arranged in buffer as follows:
  17499.         AccessInfo  | first resource
  17500.         AccessList  |  followed by acc1_count number
  17501.         AccessList  |  of AccessList structures
  17502.         ...
  17503.         AccessInfo  |second resource
  17504.         AccessList  |   etc..
  17505.         AccessList  |   etc..
  17506.         ...
  17507. */
  17508. #define MAXENTRIES      300
  17509. void cdecl main(void);
  17510. void cdecl main()
  17511. {
  17512.     CHAR ServerName[32];
  17513.     CHAR BasePath[32];
  17514.     USHORT rc, BufLen, i;
  17515.     USHORT j, LineCtr=0;
  17516.     struct access_list *AccessList;
  17517.     SEL Selector1;
  17518.     USHORT EntriesRead, TotalAvailable, NumEntries;
  17519.  
  17520.     strcpy(ServerName, "\\\\TECHSUPP");
  17521.     strcpy(BasePath, "C:\\");
  17522.     /* BufLen should be sizeof struct + (sizeof*/
  17523.     /* struct access_list * number of access   */
  17524.     /* permissions )                           */
  17525.     BufLen = sizeof( struct access_info_1 ) +
  17526.         60 + 1;
  17527.     NumEntries = MAXENTRIES;
  17528.     /* Allocate one big buffer */
  17529.     rc = DosAllocSeg(BufLen * NumEntries, &Selector1,
  17530.         SEG_NONSHARED );
  17531.     AccessInfo = (struct access_info_1 *)
  17532.             MAKEP( Selector1, 0);
  17533.  
  17534.     rc = NetAccessEnum( ServerName, BasePath,
  17535.         1, 1, (CHAR FAR *)AccessInfo,
  17536.         BufLen * NumEntries, &EntriesRead,
  17537.         &TotalAvailable );
  17538.     if (!rc){
  17539.         printf("\nAccess Permission Records are:");
  17540.         for (i=0; i < EntriesRead; i++){
  17541.             if (LineCtr == 23){
  17542.                 printf("\n                Press any key");
  17543.                 getch();
  17544.                 LineCtr = 0;
  17545.             }
  17546.             printf("\n\nName:  %s",
  17547.                 AccessInfo->acc1_resource_name );
  17548.             LineCtr++;
  17549.             /* put the first access list struct after */
  17550.             /* one AccessInfo struct                  */
  17551.             AccessList = (struct access_list *)
  17552.                 (AccessInfo + 1);
  17553.             for (j = 0; j < AccessInfo->acc1_count; j++){
  17554.                 if (LineCtr == 23){
  17555.                     printf("\n                Press any key");
  17556.                     getch();
  17557.                     LineCtr = 0;
  17558.                 }
  17559.                 printf("\nUsers: %s", AccessList->acl_ugname);
  17560.                 LineCtr++;
  17561.                 /* need to increment AccessList struct */
  17562.                 /* by one AccessList structure         */
  17563.                 AccessList++;
  17564.             }
  17565.             /* Put the next AccessInfo struct at the   */
  17566.             /* end of all the access_list structures   */
  17567.             AccessInfo = (struct access_info_1 *)AccessList;
  17568.         }
  17569.     }
  17570.     else
  17571.         printf("\nAccessEnum failed, rc = %d", rc );
  17572.  
  17573.     DosFreeSeg(Selector1);
  17574. }
  17575.  
  17576.  
  17577. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17578.  
  17579. #define INCL_BASE
  17580. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17581. #include <os2.h>          /* OS/2 API definitions          */
  17582. #include <mt\stdio.h>
  17583. #include <mt\string.h>
  17584. #include <mt\stdlib.h>
  17585. #include <mt\process.h>
  17586. #include <netcons.h>      /* definition of NetAPI constants*/
  17587. #include <neterr.h>       /* NetAPI error codes            */
  17588. #include <access.h>       /* header for NetGroup..()       */
  17589. /*
  17590.     struct access_info_1 {
  17591.         char far * acc1_resource_name;
  17592.         short      acc1_attr;
  17593.         short      acc1_count;
  17594.     };
  17595.     struct access_list {
  17596.         char acl_ugname[UGLEN+1];
  17597.         char acl_ugname_pad_1;
  17598.         short acl_access;
  17599.     };
  17600.     Structures are arranged in buffer as follows:
  17601.         AccessInfo  | first resource
  17602.         AccessList  |  followed by acc1_count number
  17603.         AccessList  |  of AccessList structures
  17604.         ...
  17605.         AccessInfo  |second resource
  17606.         AccessList  |   etc..
  17607.         AccessList  |   etc..
  17608.         ...
  17609. */
  17610. #define MAXENTRIES      300
  17611. void cdecl main(void);
  17612. void cdecl main()
  17613. {
  17614.     CHAR ServerName[32];
  17615.     CHAR BasePath[32], UserName[15];
  17616.     USHORT rc, BufLen, i;
  17617.     struct access_list *AccessList;
  17618.     SEL Selector1;
  17619.     USHORT ReturnCode, TotalAvailable;
  17620.     /* insert name of your server here */
  17621.     strcpy(ServerName, "\\\\KOSER");
  17622.     /* insert name of some resource here */
  17623.     strcpy(BasePath, "C:\\IBMLAN");
  17624.     /* inert name of some user  here */
  17625.     strcpy(UserName, "OREILLY");
  17626.     /* Memory Allocation stuff */
  17627.     /* BufLen should be sizeof struct + (sizeof*/
  17628.     /* struct access_list * number of access   */
  17629.     /* permissions )                           */
  17630.     BufLen = sizeof( struct access_info_1 ) + PATHLEN + 1+
  17631.         sizeof( struct access_list) * 5;
  17632.     rc = DosAllocSeg(BufLen, &Selector1, SEG_NONSHARED);
  17633.     AccessInfo = (struct access_info_1 *)
  17634.         MAKEP(Selector1, 0 );
  17635.     /* set up info for AccessAdd() */
  17636.     AccessInfo->acc1_resource_name = BasePath;
  17637.     /* want auditing */
  17638.     AccessInfo->acc1_attr = 1;
  17639.     /* going to add 1 set users */
  17640.     AccessInfo->acc1_count = 1;
  17641.     /* put AccessList struct at end of AccessInfo struct */
  17642.     AccessList = (struct access_list *)(AccessInfo + 1);
  17643.     strcpy(AccessList->acl_ugname, UserName);
  17644.     AccessList->acl_access = ACCESS_READ | ACCESS_WRITE;
  17645.     rc = NetAccessAdd( ServerName, 1, (CHAR FAR *)AccessInfo,
  17646.         BufLen );
  17647.     if (!rc)
  17648.         printf("\nAccess successfully added");
  17649.     else
  17650.         printf("\nAccessAdd() failed, rc = %d", rc );
  17651.     rc = NetAccessCheck( NULL, UserName, BasePath,
  17652.         ACCESS_READ, &ReturnCode);
  17653.     if (!rc)
  17654.         printf("\nUser %s has %s rights in %s",
  17655.             UserName, ReturnCode?"NO READ":"READ",
  17656.             BasePath);
  17657.     else
  17658.         printf("\nAccessCheck() failed, rc = %d", rc );
  17659.     rc = NetAccessGetInfo( ServerName, BasePath,
  17660.         1, (CHAR FAR *)AccessInfo, BufLen, &TotalAvailable );
  17661.     if (!rc){
  17662.         /* AccessList is at end of structure AccessInfo */
  17663.         printf("\nInfo on %s", BasePath);
  17664.         AccessList = (struct access_list *)(AccessInfo+1);
  17665.         for (i = 0; i < AccessInfo->acc1_count; i++){
  17666.             printf("\nUser: %s", AccessList->acl_ugname );
  17667.             printf("    Access: 0x%x",
  17668.                 AccessList->acl_access);
  17669.             /* now go on to next AccessList struct */
  17670.             AccessList++;
  17671.         }
  17672.     }
  17673.     else
  17674.         printf("\nGetInfo() failed, rc = %d", rc );
  17675.     rc = NetAccessGetUserPerms( ServerName,UserName,
  17676.         BasePath, &ReturnCode);
  17677.     if (!rc){
  17678.         printf("\nPermissions for User %s: ", UserName);
  17679.         if (ReturnCode & ACCESS_READ)
  17680.             printf("  READ");
  17681.         if (ReturnCode & ACCESS_WRITE)
  17682.             printf("  WRITE");
  17683.     }
  17684.     else
  17685.         printf("GetUserPerms() failed, rc = %d", rc );
  17686.     /* now delete the access permissions */
  17687.     rc = NetAccessDel(ServerName, BasePath);
  17688.     if (!rc)
  17689.         printf("\n%s Access Deleted", BasePath);
  17690.     else
  17691.         printf("AccessDel failed, rc = %d", rc );
  17692.     DosFreeSeg(Selector1);
  17693. }
  17694.  
  17695.  
  17696. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17697.  
  17698. #define INCL_BASE
  17699. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17700. #include <os2.h>          /* OS/2 API definitions          */
  17701. #include <mt\stdio.h>
  17702. #include <mt\string.h>
  17703. #include <mt\stdlib.h>
  17704. #include <mt\process.h>
  17705. #include <netcons.h>      /* definition of NetAPI constants*/
  17706. #include <neterr.h>       /* NetAPI error codes            */
  17707. #include <access.h>       /* header for NetGroup..()       */
  17708.  
  17709. /*
  17710.     these structures are in access.h, here for
  17711.     reference only.
  17712.     struct group_info_1 {
  17713.         char grpi1_name[GNLEN + 1];
  17714.         char grpi1_pad_1;
  17715.         char far *grpi1_comment;
  17716.     };
  17717.     struct group_users_info_0 {
  17718.         char grui0_name[UNLEN + 1];
  17719.     };
  17720. */
  17721.  
  17722. #define MAXGROUPS 20
  17723. void cdecl main(void);
  17724.  
  17725. void cdecl main()
  17726. {
  17727.     CHAR ServerName[32], GroupName[15];
  17728.     CHAR *Comment;
  17729.     struct group_info_1 *GroupInfo;
  17730.     struct group_info_1 *GroupEnum[MAXGROUPS];
  17731.     struct group_users_ino_0 *GroupUsers;
  17732.     SEL Selector1, Selector2;
  17733.     USHORT rc, i;
  17734.     USHORT BufLen, TotalAvailable;
  17735.     USHORT EntriesRead;
  17736.  
  17737.     /* insert name of server here */
  17738.     /* this is our primary server */
  17739.     strcpy(ServerName, "\\\\TECHSUPP");
  17740.     /* name of some dummy group to add */
  17741.     strcpy(GroupName, "DGROUP");
  17742.     /* do memory allocation for fns */
  17743.     BufLen = sizeof (struct group_info_1) + MAXCOMMENTSZ + 1;
  17744.     rc = DosAllocSeg( BufLen, &Selector1, SEG_NONSHARED );
  17745.     rc = DosAllocSeg( BufLen * MAXGROUPS, &Selector2,
  17746.         SEG_NONSHARED );
  17747.     GroupInfo = (struct group_info_1 *)MAKEP(Selector1, 0 );
  17748.     for (i=0; i < MAXGROUPS; i++)
  17749.         GroupEnum[i] = (struct group_info_1 *)MAKEP(Selector2,
  17750.             i*sizeof( struct group_info_1));
  17751.  
  17752.     strcpy(GroupInfo->grpi1_name, GroupName);
  17753.     /* Now add the Group */
  17754.     rc = NetGroupAdd(ServerName, 1, (CHAR FAR *)
  17755.         GroupInfo, BufLen );
  17756.     if (!rc)
  17757.         printf("Group Successfully Added");
  17758.     else
  17759.         printf("Error in GroupAdd, rc = %d", rc );
  17760.  
  17761.     /* now see if our group shows up */
  17762.     rc = NetGroupEnum( ServerName, 1, (CHAR FAR *)GroupEnum[0],
  17763.         BufLen*MAXGROUPS, &EntriesRead, &TotalAvailable);
  17764.     if (!rc){
  17765.         printf("\nGroups  on Server:");
  17766.         for (i = 0; i < EntriesRead; i++)
  17767.             printf("\nGroup: %s", GroupEnum[i]->grpi1_name );
  17768.     }
  17769.     else
  17770.         printf("\nGroupEnum Failed, rc = %d", rc );
  17771.  
  17772.     /* now we're going to add some dummy comment */
  17773.     Comment = (CHAR *)calloc(1, 40 );
  17774.     strcpy(Comment, "GROUPCOMMENT");
  17775.     GroupInfo->grpi1_comment = Comment;
  17776.     /* note: 2 is the magic number of change */
  17777.     /* comment field */
  17778.     rc = NetGroupSetInfo( ServerName,
  17779.         GroupName, 1, (CHAR FAR *)Comment,
  17780.         40 , 2);
  17781.     if (!rc)
  17782.         printf("\nComment added ");
  17783.     else
  17784.         printf("\nError in SetInfo, rc = %d", rc );
  17785.  
  17786.     /* Now Get Info to see if Comment shows up */
  17787.     rc = NetGroupGetInfo( ServerName,
  17788.         GroupName, 1, (CHAR FAR *)GroupInfo,
  17789.         BufLen, &TotalAvailable );
  17790.     if (!rc){
  17791.         printf("\nGroup: %s", GroupInfo->grpi1_name );
  17792.         printf("\nComment: %s", GroupInfo->grpi1_comment );
  17793.     }
  17794.     else
  17795.         printf("\nError in GetInfo, rc = %d", rc );
  17796.     /* now delete group */
  17797.     rc = NetGroupDel(ServerName, GroupName );
  17798.     if (!rc)
  17799.         printf("\nGroup Successfully Deleted");
  17800.     else
  17801.         printf("\nError in GroupDel, rc = %d", rc );
  17802.     /* clean up */
  17803.     DosFreeSeg(Selector1 );
  17804.     DosFreeSeg(Selector2 );
  17805. }
  17806.  
  17807.  
  17808. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17809.  
  17810. #define INCL_BASE
  17811. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17812. #include <os2.h>          /* OS/2 API definitions          */
  17813. #include <mt\stdio.h>
  17814. #include <mt\string.h>
  17815. #include <mt\stdlib.h>
  17816. #include <mt\process.h>
  17817. #include <netcons.h>      /* definition of NetAPI constants*/
  17818. #include <neterr.h>       /* NetAPI error codes            */
  17819. #include <access.h>       /* header for NetGroup..()       */
  17820.  
  17821. /*
  17822.     struct group_info_1 {
  17823.         char grpi1_name[GNLEN + 1];
  17824.         char grpi1_pad_1;
  17825.         char far *grpi1_comment;
  17826.     };
  17827.     struct group_users_info_0 {
  17828.         char grui0_name[UNLEN + 1];
  17829.     };
  17830. */
  17831.  
  17832. #define MAXUSERS 70
  17833. void cdecl main(void);
  17834. void cdecl main()
  17835. {
  17836.     CHAR ServerName[32], GroupName[15];
  17837.     USHORT rc, BufLen, i, GroupBufLen;
  17838.     CHAR UserName[15];
  17839.     struct group_users_info_0 *Users[MAXUSERS];
  17840.     struct group_info_1 *GroupInfo;
  17841.     SEL Selector1, Selector2;
  17842.     USHORT EntriesRead, TotalAvailable;
  17843.  
  17844.     /* insert name of your server here */
  17845.     strcpy(ServerName, "\\\\TECHSUPP");
  17846.     /* use some dummy group name */
  17847.     strcpy(GroupName, "XXGROUP");
  17848.     strcpy(UserName, "OREILLY");
  17849.  
  17850.     /* memory allocation stuff */
  17851.     BufLen = sizeof( struct group_users_info_0 );
  17852.     /* defines for maximum size found in Appendix H in */
  17853.     /* Lan Server 1.3 Prog Ref                         */
  17854.     GroupBufLen = sizeof (struct group_info_1) + MAXCOMMENTSZ
  17855.         + 1;
  17856.     rc = DosAllocSeg( GroupBufLen, &Selector2, SEG_NONSHARED );
  17857.     GroupInfo = (struct group_info_1 *)MAKEP(Selector2, 0 );
  17858.     rc = DosAllocSeg(BufLen * MAXUSERS, &Selector1,
  17859.         SEG_NONSHARED );
  17860.     for (i = 0; i < MAXUSERS; i++)
  17861.         Users[i] = (struct group_users_info_0 *)MAKEP(Selector1,
  17862.             i * BufLen );
  17863.  
  17864.     /* add group */
  17865.     strcpy(GroupInfo->grpi1_name, GroupName);
  17866.     rc = NetGroupAdd(ServerName, 1, (CHAR FAR *)
  17867.         GroupInfo, GroupBufLen );
  17868.     if (!rc)
  17869.         printf("Added group %s", GroupName );
  17870.     else
  17871.         printf("Failed in GroupAdd, rc = %d", rc );
  17872.  
  17873.     /* now add one user */
  17874.     rc = NetGroupAddUser(ServerName, GroupName, UserName );
  17875.     if (!rc)
  17876.         printf("\nUser Successfully Added");
  17877.     else
  17878.         printf("\nAddUser failed, rc = %d", rc );
  17879.  
  17880.     /* get whole set of users from admins*/
  17881.     rc = NetGroupGetUsers( ServerName, "ADMINS",
  17882.         0, (CHAR FAR *)Users[0], BufLen * MAXUSERS,
  17883.         &EntriesRead, &TotalAvailable );
  17884.     if (!rc){
  17885.         printf("\nUsers in Group ADMIN");
  17886.         for (i = 0; i < EntriesRead; i++)
  17887.             printf("\nName: %s", Users[i]->grui0_name );
  17888.     }
  17889.     else
  17890.         printf("\nGetUsers failed, rc = %d", rc );
  17891.  
  17892.     /* and add these users to your dummy group */
  17893.     rc = NetGroupSetUsers(ServerName, GroupName,
  17894.         0, (CHAR FAR *)Users[0], BufLen * MAXUSERS,
  17895.         EntriesRead );
  17896.     if (!rc){
  17897.         printf("\nUsers in Groups %s", GroupName );
  17898.         for (i = 0; i < EntriesRead; i++)
  17899.             printf("\nName: %s", Users[i]->grui0_name );
  17900.     }
  17901.  
  17902.     /* Delete the single user */
  17903.     rc = NetGroupDelUser( ServerName, GroupName, UserName );
  17904.     if (!rc)
  17905.         printf("\nUser successfully deleted");
  17906.     else
  17907.         printf("\nDelUser failed, rc = %d", rc );
  17908.  
  17909.     /* and now delete the dummy group */
  17910.     rc = NetGroupDel(ServerName, GroupName );
  17911.     if (!rc)
  17912.         printf("\nGroup Successfully Deleted");
  17913.     else
  17914.         printf("\nError in GroupDel, rc = %d", rc );
  17915.     /* clean up */
  17916.     DosFreeSeg(Selector1);
  17917.     DosFreeSeg(Selector2);
  17918. }
  17919.  
  17920.  
  17921. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  17922.  
  17923. #define INCL_BASE
  17924. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  17925. #include <os2.h>          /* OS/2 API definitions          */
  17926. #include <mt\stdio.h>
  17927. #include <mt\string.h>
  17928. #include <mt\stdlib.h>
  17929. #include <mt\process.h>
  17930. #include <netcons.h>      /* definition of NetAPI constants*/
  17931. #include <neterr.h>       /* NetAPI error codes            */
  17932. #include <access.h>       /* header for NetUser..()        */
  17933. /* Structures defined in access.h
  17934. struct user_logon_info_1 {
  17935.         unsigned short  usrlog1_code;
  17936.         char            usrlog1_eff_name[UNLEN+1];
  17937.         char            usrlog1_pad_1;
  17938.         unsigned short  usrlog1_priv;
  17939.         unsigned long   usrlog1_auth_flags;
  17940.         unsigned short  usrlog1_num_logons;
  17941.         unsigned short  usrlog1_bad_pw_count;
  17942.         unsigned long   usrlog1_last_logon;
  17943.         unsigned long   usrlog1_last_logoff;
  17944.         unsigned long   usrlog1_logoff_time;
  17945.         unsigned long   usrlog1_kickoff_time;
  17946.         long            usrlog1_password_age;
  17947.         unsigned long   usrlog1_pw_can_change;
  17948.         unsigned long   usrlog1_pw_must_change;
  17949.         char far *      usrlog1_computer;
  17950.         char far *      usrlog1_domain;
  17951.         char far *      usrlog1_script_path;
  17952.         unsigned long   usrlog1_reserved1;
  17953. };
  17954. struct user_logon_req_1 {
  17955.         char            usrreq1_name[UNLEN+1];
  17956.         char            usrreq1_pad_1;
  17957.         char            usrreq1_password[SESSION_PWLEN];
  17958.         char far *      usrreq1_workstation;
  17959. };
  17960. struct user_info_2 {
  17961.         char            usri2_name[UNLEN+1];
  17962.         char            usri2_pad_1;
  17963.         char            usri2_password[ENCRYPTED_PWLEN];
  17964.         long            usri2_password_age;
  17965.         unsigned short  usri2_priv;
  17966.         char far *      usri2_home_dir;
  17967.         char far *      usri2_comment;
  17968.         unsigned short  usri2_flags;
  17969.         char far *      usri2_script_path;
  17970.         unsigned long   usri2_auth_flags;
  17971.         char far *      usri2_full_name;
  17972.         char far *      usri2_usr_comment;
  17973.         char far *      usri2_parms;
  17974.         char far *      usri2_workstations;
  17975.         long            usri2_last_logon;
  17976.         long            usri2_last_logoff;
  17977.         long            usri2_acct_expires;
  17978.         unsigned long   usri2_max_storage;
  17979.         unsigned short  usri2_units_per_week;
  17980.         unsigned char far *     usri2_logon_hours;
  17981.         unsigned short  usri2_bad_pw_count;
  17982.         unsigned short  usri2_num_logons;
  17983.         char far *      usri2_logon_server;
  17984.         unsigned short  usri2_country_code;
  17985.         unsigned short  usri2_code_page;
  17986. };
  17987. */
  17988. void cdecl main(void);
  17989. void cdecl main()
  17990. {
  17991.     CHAR ServerName[32],
  17992.          Remark[MAXCOMMENTSZ],
  17993.          UserName[UNLEN+1],
  17994.          Password[32];
  17995.     SEL Selector1, Selector2;
  17996.     struct user_info_2  *UserInfo;
  17997.     struct group_info_0 GroupInfo;
  17998.     struct user_logon_req_1 *LogonReq;
  17999.     struct user_logon_info_1 *LogonInfo;
  18000.     USHORT  rc, TotalAvailable;
  18001.     USHORT  BufLen, LogonLen;
  18002.     CHAR *TempPtr;
  18003.     USHORT Flags;
  18004.  
  18005.     /* insert name of your server here */
  18006.     strcpy(ServerName, "\\\\TECHSUPP");
  18007.     BufLen = sizeof (struct user_info_2) ;
  18008.     /* found in Appendix H of Lan Server API Reference  */
  18009.     /* now allocate space for various structures needed */
  18010.     LogonLen = sizeof (struct user_logon_info_1) +
  18011.         CNLEN + 1 + DNLEN + 1 + PATHLEN + 1;
  18012.  
  18013.     rc = DosAllocSeg( BufLen, &Selector1, SEG_NONSHARED );
  18014.     UserInfo = (struct user_info_2 *)MAKEP(Selector1,0);
  18015.     rc = DosAllocSeg( LogonLen, &Selector2, SEG_NONSHARED );
  18016.     LogonReq = (struct user_logon_req_1 *)MAKEP(Selector2, 0 );
  18017.     /* clear out memory */
  18018.     memset(UserInfo, 0, BufLen );
  18019.  
  18020.     /* set info about user to be added */
  18021.     Flags = UF_SCRIPT;
  18022.     UserInfo->usri2_units_per_week=UNITS_PER_WEEK;
  18023.     UserInfo->usri2_num_logons=-1;
  18024.     UserInfo->usri2_max_storage=-1;
  18025.     UserInfo->usri2_acct_expires=-1;
  18026.     strcpy(UserName ,  "BBBBB");
  18027.     strcpy(UserInfo->usri2_name, UserName);
  18028.     strcpy(Password, "Secret");
  18029.     strcpy(UserInfo->usri2_password, Password);
  18030.     UserInfo->usri2_priv = USER_PRIV_USER;
  18031.     UserInfo->usri2_comment=TempPtr=malloc(1);
  18032.     *TempPtr='\0';
  18033.     UserInfo->usri2_full_name=TempPtr=malloc(sizeof(UserName)+1);
  18034.     strcpy(UserInfo->usri2_full_name, UserName);
  18035.     UserInfo->usri2_parms=TempPtr=malloc(1);
  18036.     *TempPtr='\0';
  18037.     UserInfo->usri2_usr_comment=TempPtr=malloc(sizeof(Remark)+1);
  18038.     strcpy(UserInfo->usri2_usr_comment, Remark);
  18039.     UserInfo->usri2_script_path=TempPtr=malloc(1);
  18040.     *TempPtr='\0';
  18041.     UserInfo->usri2_workstations=TempPtr=malloc(8);
  18042.     strcpy(TempPtr, "KOREQ");
  18043.     /* insert name, pw, and other info */
  18044.     UserInfo->usri2_flags = Flags;
  18045.  
  18046.     rc = NetUserAdd((CHAR FAR *)ServerName, 2,
  18047.         (CHAR FAR *)UserInfo,
  18048.         BufLen);
  18049.     if (!rc)
  18050.         printf("\nTest User successfully added !");
  18051.     else
  18052.         printf("\nError in AddUser, rc = %d", rc );
  18053.     /* now change the PW */
  18054.     rc = NetUserPasswordSet(ServerName, UserName,
  18055.         Password, "NEWPW");
  18056.     if (!rc)
  18057.         printf("\nPW has been changed to *****");
  18058.     else
  18059.         printf("\nError in PWSet, rc = %d", rc );
  18060.     /* specify some group in your environment       */
  18061.     /* note that ADMIN and USERS are considered     */
  18062.     /* "special groups" and user priority is a factor*/
  18063.  
  18064.     strcpy(GroupInfo.grpi0_name, "DBUSERS");
  18065.     rc = NetUserSetGroups( ServerName, UserName,
  18066.         0, (CHAR FAR *)&GroupInfo, sizeof( struct group_info_0),
  18067.         1 );
  18068.     if (!rc)
  18069.         printf("\nNew User added to Group: USERS");
  18070.     else
  18071.         printf("\nError in SetGroups, rc = %d", rc );
  18072.     /* now add a comment to the User */
  18073.     strcpy(UserInfo->usri2_comment, "THIS IS A COMMENT");
  18074.     strcpy(Remark, "THIS IS A COMMENT");
  18075.     rc = NetUserSetInfo( ServerName, UserName,
  18076.         2, (CHAR FAR *)UserInfo, BufLen,
  18077.         PARMNUM_COMMENT );
  18078.     if (!rc)
  18079.         printf("\nNew User Comment Added");
  18080.     else
  18081.         printf("\nError in SetInfo, rc = %d", rc );
  18082.  
  18083.     /* now set up info for validation */
  18084.     /* Note: NetUserValidate2() has an input  */
  18085.     /* of struct user_logon_req_1 and outputs */
  18086.     /* a struct user_logon_info_1 to the same */
  18087.     /* space                                  */
  18088.     strcpy(LogonReq->usrreq1_name, UserName );
  18089.     strcpy(LogonReq->usrreq1_password, Password );
  18090.     LogonReq->usrreq1_workstation = TempPtr = malloc( 10 );
  18091.     /* enter machine ID here */
  18092.     strcpy(TempPtr, "KOSER");
  18093.  
  18094.     /* will return an rc of 5 when running on a requester */
  18095.     /* this was run on an addtl server                    */
  18096.  
  18097.     rc = NetUserValidate2( NULL, 1, (CHAR FAR *)LogonReq,
  18098.         LogonLen, 0, &TotalAvailable );
  18099.  
  18100.     LogonInfo = (struct user_logon_info_1 *)LogonReq;
  18101.  
  18102.     if (!rc){
  18103.         printf("\nUser: %s", LogonInfo->usrlog1_eff_name );
  18104.         printf("\nComputer: %s", LogonInfo->usrlog1_computer );
  18105.         printf("\nNum Logons: %d", LogonInfo->usrlog1_num_logons );
  18106.         printf("\nUser Validated");
  18107.     }
  18108.     else
  18109.         printf("\nError in UserValidate2(), rc = %d", rc );
  18110.  
  18111.     /* now delete the user                            */
  18112.     rc = NetUserDel((CHAR FAR *)ServerName, UserName );
  18113.  
  18114.     if (!rc)
  18115.         printf("\nTest User successfully Deleted !");
  18116.     else
  18117.         printf("\nError in DelUser, rc = %d", rc );
  18118.     /* clean up */
  18119.     DosFreeSeg(Selector1);
  18120.     DosFreeSeg(Selector2);
  18121. }
  18122.  
  18123.  
  18124. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  18125.  
  18126. #define INCL_BASE
  18127. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  18128. #include <os2.h>          /* OS/2 API definitions          */
  18129. #include <mt\stdio.h>
  18130. #include <mt\string.h>
  18131. #include <mt\stdlib.h>
  18132. #include <mt\process.h>
  18133. #include <netcons.h>      /* definition of NetAPI constants*/
  18134. #include <neterr.h>       /* NetAPI error codes            */
  18135. #include <access.h>       /* header for NetUser..()        */
  18136. /* structures defined in access.h
  18137. struct user_info_2 {
  18138.         char            usri2_name[UNLEN+1];
  18139.         char            usri2_pad_1;
  18140.         char            usri2_password[ENCRYPTED_PWLEN];
  18141.         long            usri2_password_age;
  18142.         unsigned short  usri2_priv;
  18143.         char far *      usri2_home_dir;  MAX:PATHLEN
  18144.         char far *      usri2_comment;  MAX:MAXCOMMENTSZ
  18145.         unsigned short  usri2_flags;
  18146.         char far *      usri2_script_path;  MAX:PATHLEN
  18147.         unsigned long   usri2_auth_flags;
  18148.         char far *      usri2_full_name;    MAX:MAXCOMMENTSZ
  18149.         char far *      usri2_usr_comment;  MAX:MAXCOMMENTSZ
  18150.         char far *      usri2_parms;        MAX:PATHLEN
  18151.         char far *      usri2_workstations;
  18152.             MAX:MAXWORKSTATIONS *(CNLEN)
  18153.         long            usri2_last_logon;
  18154.         long            usri2_last_logoff;
  18155.         long            usri2_acct_expires;
  18156.         unsigned long   usri2_max_storage;
  18157.         unsigned short  usri2_units_per_week;
  18158.         unsigned char far *     usri2_logon_hours; MAX:21 BYTES
  18159.         unsigned short  usri2_bad_pw_count;
  18160.         unsigned short  usri2_num_logons;
  18161.         char far *      usri2_logon_server; MAX:CNLEN
  18162.         unsigned short  usri2_country_code;
  18163.         unsigned short  usri2_code_page;
  18164. };
  18165. struct  user_modals_info_0 {
  18166.         unsigned short  usrmod0_min_passwd_len;
  18167.         unsigned long   usrmod0_max_passwd_age;
  18168.         unsigned long   usrmod0_min_passwd_age;
  18169.         unsigned long   usrmod0_force_logoff;
  18170.         unsigned short  usrmod0_password_hist_len;
  18171.         unsigned short  usrmod0_reserved1;
  18172. };
  18173. */
  18174. #define NUMENTRIES 80
  18175. #define MAXGROUPS  10
  18176. void cdecl main(void);
  18177. void cdecl main()
  18178. {
  18179.     CHAR ServerName[32];
  18180.     SEL Selector1, Selector2, Selector3, Selector4;
  18181.     struct user_info_2  *Entries[NUMENTRIES], *Info;
  18182.     struct group_info_0 *Buffer[MAXGROUPS];
  18183.     struct user_modals_info_0 *Modals;
  18184.     USHORT i, rc, TotalEntries, EntriesRead, GroupsRead;
  18185.     USHORT GroupsAvailable,j;
  18186.     USHORT TotalAvailable, BufLen;
  18187.  
  18188.     /* insert name of your server here */
  18189.     strcpy(ServerName, "\\\\TECHSUPP");
  18190.     BufLen = sizeof (struct user_info_2) +
  18191.        ( 3 * (PATHLEN + 1 )) + ( 3 * (MAXCOMMENTSZ + 1)) +
  18192.        CNLEN + 1 + (MAXWORKSTATIONS * (CNLEN + 1)) + 21;
  18193.     /* now add space for strings */
  18194.     /* found in Appendix H of Lan Server API Reference  */
  18195.     /* now allocate space for various structures needed */
  18196.     rc = DosAllocSeg( BufLen*NUMENTRIES, &Selector1,
  18197.         SEG_NONSHARED );
  18198.     for (i = 0; i < NUMENTRIES ; i++)
  18199.         Entries[i] = (struct user_info_2 *)MAKEP(Selector1,
  18200.             i*sizeof( struct user_info_2) );
  18201.     rc = DosAllocSeg((GNLEN+1)*MAXGROUPS, &Selector2,
  18202.         SEG_NONSHARED );
  18203.     for (i=0; i < MAXGROUPS; i++)
  18204.         Buffer[i] = (struct group_info_0 *)MAKEP(Selector2,
  18205.             i*sizeof( struct group_info_0 ));
  18206.     rc = DosAllocSeg( BufLen, &Selector3, SEG_NONSHARED );
  18207.     Info = (struct user_info_2 *)MAKEP(Selector3, 0 );
  18208.     rc = DosAllocSeg( sizeof( struct user_modals_info_0 ),
  18209.         &Selector4, SEG_NONSHARED );
  18210.     Modals = (struct user_modals_info_0 *)MAKEP(Selector4, 0 );
  18211.  
  18212.     rc = NetUserEnum(ServerName, 2, (CHAR FAR *)Entries[0],
  18213.         BufLen*NUMENTRIES, &EntriesRead, &TotalEntries );
  18214.     if (!rc){
  18215.         /* list all users */
  18216.         for (i = 0; i< EntriesRead; i++){
  18217.             printf("\nNumber %02d Name: %-10s",
  18218.                 i, Entries[i]->usri2_name );
  18219.             printf("     Priviledge: %d ",
  18220.                 Entries[i]->usri2_priv );
  18221.  
  18222.             /* get groups for each user */
  18223.             rc = NetUserGetGroups(ServerName,
  18224.                 Entries[i]->usri2_name,
  18225.                 0,
  18226.                 (CHAR FAR *)Buffer[0],
  18227.                 MAXGROUPS *(GNLEN+1),
  18228.                 &GroupsRead, &GroupsAvailable );
  18229.             printf("   Groups:");
  18230.             for (j=0; j < GroupsRead; j++)
  18231.                 printf("%s,",Buffer[j]->grpi0_name );
  18232.             /* if too many to fit on one page, wait for key*/
  18233.             if ((!(i%25))&&i){
  18234.                 printf("\nPress any key to see next page");
  18235.                 getchar();
  18236.             } /* end if */
  18237.         } /* end for i */
  18238.     } /* end if !rc */
  18239.     else
  18240.         printf("rc = %d", rc );
  18241.  
  18242.     /* now pick a user, any user */
  18243.     printf("\nEnter number of user to get info on: ");
  18244.     scanf("%d", &i );
  18245.  
  18246.     rc = NetUserGetInfo( ServerName, Entries[i]->usri2_name,
  18247.         2, (CHAR FAR *)Info, BufLen, &TotalAvailable );
  18248.     if (!rc){
  18249.         /* print out various info about user */
  18250.         printf("\nUser: %s", Info->usri2_name);
  18251.         printf("\nHome Directory: %s", Info->usri2_home_dir);
  18252.         printf("\nComment: %s", Info->usri2_comment);
  18253.         printf("\nFull Name: %s", Info->usri2_full_name );
  18254.         printf("\nNumber of Logons: %d",Info->usri2_num_logons );
  18255.         printf("\nLogon Server: %s", Info->usri2_logon_server );
  18256.         printf("\nLast Logon: %ld", Info->usri2_last_logon );
  18257.         printf("\nLast Logoff: %ld", Info->usri2_last_logoff );
  18258.     }
  18259.     else
  18260.         printf("\nError in NetUserGetInfo, rc = %d", rc );
  18261.  
  18262.     /* get modals info */
  18263.     rc = NetUserModalsGet( ServerName, 0, Modals,
  18264.         sizeof( struct user_modals_info_0), &TotalAvailable);
  18265.     if (!rc ){
  18266.         printf("\n\nGlobal Modals Information");
  18267.         printf("\nMin Password Length: %d",
  18268.             Modals->usrmod0_min_passwd_len );
  18269.         if (Modals->usrmod0_max_passwd_age == TIMEQ_FOREVER)
  18270.             printf("\nMax Password Age: VALID FOREVER ");
  18271.         else
  18272.             printf("\nMax Password Age:    %ld",
  18273.                 Modals->usrmod0_max_passwd_age );
  18274.         printf("\nMin Password Age:    %ld",
  18275.             Modals->usrmod0_min_passwd_age );
  18276.         if (Modals->usrmod0_force_logoff == TIMEQ_FOREVER)
  18277.             printf("\nTime Before Forced Logoff: NEVER");
  18278.         else
  18279.             printf("\nTime Before Forced Logoff: %ld",
  18280.                 Modals->usrmod0_force_logoff);
  18281.     }
  18282.     else
  18283.         printf("\nError in NetUseModalsGet(), rc = %d", rc );
  18284.     /* clean up */
  18285.     DosFreeSeg(Selector1);
  18286.     DosFreeSeg(Selector2);
  18287.     DosFreeSeg(Selector4);
  18288.     DosFreeSeg(Selector3);
  18289. }
  18290.  
  18291.  
  18292. ΓòÉΓòÉΓòÉ <hidden>  ΓòÉΓòÉΓòÉ
  18293.  
  18294. #define INCL_BASE
  18295. #define INCL_DOSMEMMGR    /* prototype of DosAllocSeg      */
  18296. #include <os2.h>          /* OS/2 API definitions          */
  18297. #include <mt\stdio.h>     /* Since the application starts a*/
  18298. #include <mt\string.h>    /* thread, we must use the       */
  18299. #include <mt\stdlib.h>    /* multithreaded include file.   */
  18300. #include <mt\process.h>   /*                               */
  18301. #include <netcons.h>      /* definition of NetAPI constants*/
  18302. #include <neterr.h>       /* NetAPI error codes            */
  18303. #include <access.h>       /* header for NetUser..()        */
  18304. /* in header file access.h */
  18305. /*
  18306. struct user_logon_info_0 {
  18307.         char            usrlog0_eff_name[UNLEN+1];
  18308.         char            usrlog0_pad_1;
  18309. }; */     /* user_logon_info_0 */
  18310. /* not system limit, just for this program */
  18311. #define MAXUSERS 40
  18312. void cdecl main(void);
  18313. void cdecl main()
  18314. {
  18315.     CHAR ServerName[32], DomainController[32];
  18316.     SEL Selector1;
  18317.     struct user_logon_info_0 *Users[MAXUSERS];
  18318.     USHORT i, rc, TotalEntries, EntriesRead;
  18319.     USHORT BufLen;
  18320.  
  18321.     /* insert name of your server here */
  18322.     strcpy(ServerName, "\\\\TECHSUPP");
  18323.     /* now do memory allocation for the LogonEnum call */
  18324.     BufLen = sizeof (struct user_logon_info_0);
  18325.     rc = DosAllocSeg(BufLen * MAXUSERS,&Selector1,
  18326.         SEG_NONSHARED );
  18327.     for (i=0;i < MAXUSERS; i++)
  18328.         Users[i] = (struct user_logon_info_0 *)MAKEP(Selector1,
  18329.             i*BufLen );
  18330.  
  18331.     /* use NULL to obtain DC for primary domain */
  18332.     rc = NetGetDCName(ServerName, (CHAR FAR *)0,
  18333.         DomainController, 32 );
  18334.     if (!rc){
  18335.         printf("\nDomain Controller: %s", DomainController );
  18336.     }
  18337.     else
  18338.         printf("rc = %d", rc );
  18339.  
  18340.     /* Now list all logged-on users */
  18341.     rc = NetLogonEnum( ServerName, 0, (CHAR FAR *)Users[0],
  18342.             BufLen*MAXUSERS, &EntriesRead, &TotalEntries );
  18343.     if (!rc){
  18344.         for (i=0; i < EntriesRead;i++)
  18345.             printf("\nUser: %s", Users[i]->usrlog0_eff_name );
  18346.     }
  18347.     else
  18348.         printf("\nError in NetLogonEnum(), rc=%d", rc );
  18349. }
  18350.