home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / NETBIO.ZIP / NETBIOS / NETBIOS.DOC next >
Text File  |  1991-12-10  |  8KB  |  237 lines

  1.  
  2.  
  3.                  IBM EXTENDED SERVICES FOR OS/2
  4.         COMMUNICATIONS MANAGER API SAMPLE PROGRAMS SUPPORT
  5.  
  6.    (c) Copyright International Business Machines Corp., 1989, 1990,
  7.    1991
  8.  
  9.  
  10.  
  11.  
  12.    NETBIOS SAMPLE PROGRAM
  13.  
  14.  
  15.    The NETBIOS sample program is an example of an application
  16.    program written to the dynamic link interface of NETBIOS.
  17.    The function of the sample program is to communicate on a
  18.    Local Area Network using NETBIOS protocol.  In the sample
  19.    scenario communication is set up between two NETBIOS session
  20.    partners on the Local Area Network; one session sends data
  21.    while the other receives the data.  The session partners
  22.    can be on one machine or separate machines.
  23.  
  24.    The sample program is designed to run only in protected
  25.    mode of IBM Extended Services for OS/2.  The sample program
  26.    source code and supporting files are provided for C.  The
  27.    sample program can be compiled as a 16 bit application or
  28.    a 32 bit application.  The 16 bit program is compiled with
  29.    the Microsoft C Compiler Version 6.0 and runs on OS/2 SE Version
  30.    1.30.1 or higher.  The 32 bit program is compiled with the
  31.    the IBM C Set/2 Compiler and runs on OS/2 Standard Edition
  32.    Version 2.0.
  33.  
  34.  
  35.    PREREQUISITES
  36.  
  37.    To run the sample program, a user must obtain and be familiar
  38.    with the following:
  39.  
  40.    1.  OS/2 installation and program execution
  41.  
  42.    2.  TOOLKIT installation
  43.  
  44.    3.  IBM Extended Services for OS/2 including Communications
  45.        Manager Installation and Configuration
  46.  
  47.    5.  Microsoft C Compiler Version 6.0 (for 16-bit programs) or
  48.        IBM C Set/2 Compiler (for 32-bit programs)
  49.  
  50.  
  51.    HARDWARE REQUIREMENTS
  52.  
  53.    One or two PS/2 or AT machines which are connected to the same
  54.    Local Area Network.  The network adapter must be one supported by
  55.    IBM Extended Services for OS/2.  The adapter should be configured
  56.    as adapter 0 or adapter 1.
  57.  
  58.  
  59.    INSTALLATION
  60.  
  61.    The installation for running NETBIOS sample programs consists of the
  62.    following:
  63.  
  64.    1. Installing IBM Extended Services for OS/2 including
  65.       Communications Manager.
  66.  
  67.    2. Creating the LAN Adapter and Protocol Support configuration file
  68.       for the network adapter installed and IBM OS/2 NETBIOS protocol
  69.       for the sample program
  70.  
  71.    3. Installing TOOLKIT
  72.  
  73.    4. Installing the compiler selected
  74.  
  75.  
  76.    ASSUMPTIONS
  77.  
  78.    The INSTALLATION DETAIL section explains the installation procedure.
  79.    It is assumed that Extended Services, TOOLKIT and the compiler
  80.    are installed on the same drive. For ease of discussion the C drive
  81.    is used as the default.
  82.  
  83.    INSTALLATION DETAIL
  84.  
  85.    1. INSTALLING IBM EXTENDED SERVICES FOR OS/2
  86.  
  87.    Install IBM Extended Services for OS/2 according to the
  88.    installation documentation provided with the product.
  89.    When you install make sure you install LAN Adapter
  90.    and Protocol Support.
  91.  
  92.    To build the NETBIOS sample program, the Communications
  93.    Manager API data structures must be installed on the build
  94.    machine.  The API data structures are high level language
  95.    include files.  To install the API data structures select them
  96.    from the "Install Additional Features" panel.
  97.  
  98.    2. CREATING NETBIOS SAMPLE PROGRAM CONFIGURATION FILE
  99.  
  100.    Use Communications Manager Advanced Configuration and
  101.    select LAN Adapter and Protocol Support to configure
  102.    the workstation.  Configure the network adapter
  103.    driver for the network adapter installed and configure
  104.    the NETBIOS protocol driver for adapter 0 or 1.  The
  105.    default configuration parameters for both the network
  106.    adapter driver and the NETBIOS protocol driver are
  107.    sufficient to run the sample program.
  108.  
  109.  
  110.    4. INSTALLING TOOLKIT
  111.  
  112.    Install TOOLKIT using its installation procedure.
  113.  
  114.  
  115.    5. INSTALLING THE COMPILER
  116.  
  117.    For the 16-bit application install Microsoft C Compiler
  118.    Version 6.0 using the installation procedure for the compiler.
  119.    For the 32-bit application install IBM C Set/2 Compiler
  120.    using the installation procedure for the compiler.
  121.  
  122.  
  123.  
  124.  
  125.    C SAMPLE PROGRAM 16 BIT APPLICATION
  126.  
  127.    The C sample program and the following instructions are
  128.    for Microsoft C version 6.0.
  129.  
  130.    Set up the environment for the Microsoft C Compiler according
  131.    to the compiler documentation. Create a subdirectory for the
  132.    sample program.
  133.  
  134.    Copy the following into the sample program subdirectory from
  135.    the sample program diskette:
  136.  
  137.         NETSAMPO.C    - sample program source code
  138.         NETERROR.H    - sample program header file
  139.         NETGBLV.H     - sample program header file
  140.         NETSAM16      - 16 bit sample program make file
  141.         NETSAMPO.DEF  - sample program module definition file
  142.  
  143.    Copy the following Extended Services LAN Adapter and Protocol
  144.    Support header files into the sample program subdirectory:
  145.  
  146.         NETB_1_C.H
  147.         NETB_2_C.H
  148.         NETB_4_C.H
  149.         LAN_7_C.H
  150.  
  151.    These header files are installed during Extended Services
  152.    installation.  To install the API header files select them
  153.    from the "Install  Additional Features" panel.
  154.  
  155.    To compile and link make sure the current directory is the sample
  156.    program subdirectory.  Rename the file NETSAM16 as NETSAM16.MAK.
  157.    Type the following at the OS/2 command prompt:
  158.            nmake netsam16.mak
  159.    The file netsampo.exe will be created.
  160.  
  161.  
  162.    C SAMPLE PROGRAM 32 BIT APPLICATION
  163.  
  164.    The C sample program and the following instructions are
  165.    for the IBM C Set/2 Compiler.
  166.  
  167.    Set up the environment for the IBM C Set/2 Compiler according
  168.    to the compiler documentation. Create a subdirectory for the
  169.    sample program.  The nmake utiltity used to compile and link
  170.    the sample program is in the toolkit.  Be sure to include
  171.    the path to nmake in the path statement when setting up the
  172.    work environment.
  173.  
  174.    Copy the following into the sample program subdirectory from
  175.    the sample program diskette:
  176.  
  177.         NETSAMPO.C    - sample program source code
  178.         NETERROR.H    - sample program header file
  179.         NETGBLV.H     - sample program header file
  180.         NETSAMPO      - 32 bit sample program make file
  181.         NETSAMPO.DEF  - sample program module definition file
  182.  
  183.    Copy the following Extended Services LAN Adapter and Protocol
  184.    Support header files into the sample program subdirectory:
  185.  
  186.         NETB_1_C.H
  187.         NETB_2_C.H
  188.         NETB_4_C.H
  189.         LAN_7_C.H
  190.  
  191.    These header files are installed during Extended Services
  192.    installation.  To install the API header files select them
  193.    from the "Install  Additional Features" panel.
  194.  
  195.    Add the following to the source program NETSAMPO.C
  196.  
  197.         #define E32TO16
  198.  
  199.    This will cause the 32-bit versions of the .H files to be expanded
  200.    when compiling.
  201.  
  202.    To compile and link make sure the current directory is the sample
  203.    program subdirectory.  Rename the file NETSAMPO as NETSAMPO.MAK.
  204.    Type the following at the OS/2 command prompt:
  205.            nmake netsampo.mak
  206.    The file netsampo.exe will be created.
  207.  
  208.  
  209.    RUNNING THE SAMPLE PROGRAM
  210.  
  211.  
  212.    If you are running the sample program on one machine set up two
  213.    OS/2 sessions.  If you are running the sample program on two
  214.    machines set up one OS/2 session per machine.  Change the
  215.    current directory to the directory containing NETSAMPO.EXE.
  216.  
  217.    The sample program has a sender and receiver.  Start the
  218.    receiver first.  At the command prompt enter:
  219.  
  220.        netsampo recv adapter=adapter_num lclname=rcvname netname=sendname
  221.  
  222.    In the OS/2 session (either on the same machine or the partner
  223.    machine) at the command prompt enter:
  224.  
  225.        netsampo send adapter=adapter_num lclname=sendname netname=rcvname
  226.  
  227.    The parameter adapter= defaults to 0.  The sender's local name defaults
  228.    to netsamplesend and the receiver's local name defaults to netsamplerecv.
  229.    The netname for each is the partner's local name.
  230.  
  231.    To simply use the defaults the respective inputs for the receiver
  232.    and sender are:
  233.  
  234.        netsampo recv
  235.  
  236.        netsampo send
  237.