[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smaug::snagwy

Title:SNA GATEWAY NOTEFILE
Notice:Note 1.* -> kits and doc, 288.* -> obtaining product support
Moderator:EDSCLU::GARROD
Created:Fri Feb 07 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:7116
Total number of notes:28576

7114.0. "LU6.2 V3.0: Dependent LU Configuration & example" by DELNI::BARBER_MINGO (Let me DANCE for you) Wed Jun 04 1997 12:55

    Hi,
    	I was asked if I had a dependent lu configuration for LU6.2 V
    3.1 with an example program that showed it working.  I do.
    I'm trying to figure out the best place to put it.  For now,
    Although it is VERY ugly and the example only does an allocate
    with an echoed receive against the mainframe through an ST,
    I will post it here.
    
    Cindi
T.RTitleUserPersonal
Name
DateLines
7114.1Server.lu62_hosts file.DELNI::BARBER_MINGOLet me DANCE for youWed Jun 04 1997 13:0014
    They have added security for the management of your servers.
    In your /lib/sna directory, you should now have a file called:
    
    SERVERNAME.lu62hosts - Where you define the hosts that will be
    able to manage your lu6.2 server.
    
    ====================================================================
    
    TOBLU.lu62hosts
    ******************
    cscibm.lkg.dec.com
    appc1.lkg.dec.com
    APPC1.lkg.dec.com
    
7114.2Easy attach manager daemon.DELNI::BARBER_MINGOLet me DANCE for youWed Jun 04 1997 13:0623
    They have gotten rid of the EVIL rsh and daemon account setup they
    had in 3.1.  They replaced it with an attach manager daemon:
    
    LU62_AMD 
    
    That you must make sure is running and defined on your system:
    
    linkb# grep LU62_AMD /etc/services                                           
    LU62_AMD        8101/tcp     # LU6.2 Attach Manager Daemon for tcp users
    
    linkb# ps -e | grep amd
      628 ??       IW       0:00.26 /usr/sbin/lu62_amd
     3974 ttyp4    S  +     0:00.01 grep amd
    
    
    They have made access to this Daemon dependent on a cute little
    configuration file:
    
    linkb# pg /lib/sna/lu62_amd.access
    linkb.lkg.dec.com::TCPIP::TOBLU::root,cpicuser
    linkb.lkg.dec.com::TCPIP::LU62_SRV::root
    
           
7114.3TOBLU.cfgDELNI::BARBER_MINGOLet me DANCE for youWed Jun 04 1997 13:1184
    They FINALLY have a text based configuration file, that if you
    save in the correct directory under your configuration, will be
    autoloaded when you start the server.  I saved the following file
    from a running connect to a dependent LU on my ST this morning:
    
    # SNALU62_MANAGER - Save Configuration -  4-Jun-1997 11:25:54 DST
    SELECT_SERVER{
            server_name=TOBLU,
            server_node=linkb,
            server_transport=TCPIP
            }
    DEFINE_LOCAL_LU{
            fq_local_lu_name=USDEC101.T126C002,
            local_lu_alias=T126C002,
            lu_session_limit=100,
            session_activation=false,
            max_sync_level=none,
            gateway_node_name=TOBLUE,
            gateway_transport=DECNET,
            lu_capability=secondary,
            access_name=XSNADS,
            lu_name=sna-0.1
            }
    DEFINE_TP{
            fq_local_lu_name=USDEC101.T126C002,
            tp_name=XXXX,
            status=enable,
            conversation_type=basic,
            sync_level=none,
            security_required=none,
            pip_type=no,
            pip_number=0,
            instance_limit=1,
            a_mgr_started=true,
            a_nodename=linkb,
            a_user_id=root,
            a_command_string="/trc/lib/sna/examples/cindi/exa4"
            }
    DEFINE_REMOTE_LU{
            fq_local_lu_name=USDEC101.T126C002,
            fq_remote_lu_name=USDEC101.CICS41B,
            partner_lu_alias=CICS41B,
            initiate_type=initiate_only,
            parallel_support=false,
            cnos_support=false,
            security_acceptance=none
            }
    INITIALIZE_SESSION_LIMIT{
            fq_local_lu_name=USDEC101.T126C002,
            fq_remote_lu_name=USDEC101.CICS41B,
            mode_name=        ,
            lu_mode_session_limit=1,
            min_conwinners_source=1,
            min_conwinners_target=0
            }
    DEFINE_MODE{
            fq_local_lu_name=USDEC101.T126C002,
            fq_remote_lu_name=USDEC101.CICS41B,
            mode_name=XL620256,
            send_max_ru_size_lower_bound=256,
            send_max_ru_size_upper_bound=256,
            recv_max_ru_size_lower_bound=256,
            recv_max_ru_size_upper_bound=256,
            single_session_reinitiation=secondary_lu,
            conwinner_auto_activate_limit=0,
            preferred_recv_ru_size=256,
            preferred_send_ru_size=256,
            local_max_session_limit=1
            }
    INITIALIZE_SESSION_LIMIT{
            fq_local_lu_name=USDEC101.T126C002,
            fq_remote_lu_name=USDEC101.CICS41B,
            mode_name=XL620256,
            lu_mode_session_limit=1,
            min_conwinners_source=1,
            min_conwinners_target=0
            }
    ACTIVATE_SESSION{
            fq_local_lu_name=USDEC101.T126C002,
            fq_remote_lu_name=USDEC101.CICS41B,
            mode_name=XL620256
            }
    # End of Saved Server Configuration File
    
7114.4Program- the same as ever.DELNI::BARBER_MINGOLet me DANCE for youWed Jun 04 1997 13:18216
    You no longer have to program your configuration options.
    The example programs for allocates and the rest are identical.
    The following kludge sent and received data over the dependent
    lu you saw configured in the last file.  It is IDENTICAL to
    the initial code that Echardt used to use to illustrate painful
    lu6.2 behavior in 3.0.  The names and order of calls has been
    changed because the gateway and the partner program being used,
    in this case, is different :
    
    
    This should be enough to either clarify everything COMPLETELY or
    make it REALLY confusing.   Let me know which one it does.
    
    Regards,
    Cindi
    ==================
    #include <math.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <sna/snatprmdf.h>
    
    main( int argc, char** argv )
    {
        STATUS_RTN status;
        STATUS_VEC status_vec;
        SRV_INFO server;
        char *local_lu = "T126C002";
        char *remote_lu = "CICS41B";
        char *mode_name = "XL620256";
        char data[32000];
        UINT32 length;
        UINT32 data_recv, status_recv;
        RES_ID resource;
        TP_NAME tpn;
        UINT32 conversation_state;
        UINT32 dealloc_type;
        unsigned int ii, jj,sndl=100,rcvl=200;
    
    
        server.identifier = "TOBLU";
        server.transport = SNALU62_C_TRANSPORT_TCPIP;
        server.nodename = "0";      /* this is the same as localhost       
    */
    
        tpn.translate = SNALU62_C_TRANSLATE;
        tpn.tpn.length = 4;
        tpn.tpn.pointer = (UINT8 *) "GA02";
     
        status= putenv("SNALOG_MASK=0xFFFFFFF");
        status= putenv("SNALOG_FILE=/tmp/immallc.logmask");
        status= system("export SNALOG_MASK SNALOG_FILE");
     
     
        status = snalu62_allocate(
                            &resource,
                            NULL,
                            status_vec,
                            local_lu,
                            remote_lu,
                            mode_name,
                           &tpn,
                            SNALU62_C_MAPPED,
                            SNALU62_C_WHEN_SESSION_ALLOC,
                            0,      /* conversation_group_id               
    */
                            SNALU62_C_SL_NONE,
                            NULL,   /* security                            
    */
                            NULL,   /* pip_data                            
    */
                            NULL,   /* wait_object                         
    */
                            NULL,   /* luwid                               
    */
                            NULL,   /* conversation_correlator             
    */
                            &server
                            );
    
        if( status == SNALU62_S_OK ) {
            sprintf( data, "CONNCPIC1   004USERID      PASSWD  D
    ACPICT4XACPICT4    
                       ");
            length = strlen( data );
            snalu62_as2eb( data, data, length );
            status = snalu62_send_data(
                            resource,
                            status_vec,
                            (unsigned char*)data,
                            length,
                            NULL, 0, 0, 0, 0, 0, NULL
                            );
        }
        if( status != SNALU62_S_OK ) {
            printf( " slogon: status= %d\n", status );
        }
        if( status == SNALU62_S_OK ) {
            length = sizeof(data);
            status = snalu62_receive_and_wait(
                            resource,
                            status_vec,
                            SNALU62_C_LL,
                            &length,
                            0, 0,
                            (unsigned char*)data,
                            &data_recv,
                            &status_recv,
                            NULL, NULL
                            );
        }
       }
        if( status != SNALU62_S_OK  ||  data_recv !=
    SNALU62_C_DATA_COMPLETE ) {
            printf( "rwlogon: status= %d, stat= %d, data= %d, length=
    %d\n",
                status, status_recv, data_recv, length );
        }
        if( status == SNALU62_S_OK  &&  data_recv ==
    SNALU62_C_DATA_COMPLETE ) {
            snalu62_eb2as( data, data, length );
            for( ii = 0; ii < length; ii++ )  putchar( data[ii] );
            putchar( '\n' );
            length = 0;
            status = snalu62_receive_immediate(
                            resource,
                            status_vec,
                            SNALU62_C_LL,
                            &length,
                            0, 0,
                            NULL,
                            &data_recv,
                            &status_recv,
                            NULL
                            );
        }
        if( status != SNALU62_S_OK  ||  status_recv != SNALU62_C_SEND_RECV
    ) {
            printf( "rilogon: status= %d, stat= %d, data= %d, length=
    %d\n",
                status, status_recv, data_recv, length );
        }
        if( status == SNALU62_S_OK  &&  status_recv == SNALU62_C_SEND_RECV
    ) {
            sprintf( data, "%010d%010d", rcvl, sndl );
            length = strlen( data );
            snalu62_as2eb( data, data, length );
            status = snalu62_send_data(
                            resource,
                            status_vec,
                            (unsigned char*)data,
                            length,
                            NULL, 0, 0, 0, 0, 0, NULL
                            );
        }
        if( status != SNALU62_S_OK ) {
            printf( " sprolo: status= %d\n", status );
        }
        if( status == SNALU62_S_OK ) {
            length = sizeof(data);
            status = snalu62_receive_and_wait(
                           resource,
                            status_vec,
                            SNALU62_C_LL,
                            &length,
                            0, 0,
                            (unsigned char*)data,
                            &data_recv,
                            &status_recv,
                            NULL, NULL
                            );
        }
        if( status != SNALU62_S_OK  ||  data_recv !=
    SNALU62_C_DATA_COMPLETE ) {
            printf( "rwprolo: status= %d, stat= %d, data= %d, length=
    %d\n",
                status, status_recv, data_recv, length );
        }
        if( status == SNALU62_S_OK  &&  data_recv ==
    SNALU62_C_DATA_COMPLETE ) {
            snalu62_eb2as( data, data, length );
            for( ii = 0; ii < length; ii++ )  putchar( data[ii] );
            putchar( '\n' );
            length = 0;
            status = snalu62_receive_immediate(
                            resource,
                            status_vec,
                            SNALU62_C_LL,
                            &length,
                            0, 0,
                            NULL,
                            &data_recv,
                            &status_recv,
                            NULL
                            );
        }
        if( status != SNALU62_S_OK  ||  status_recv != SNALU62_C_SEND_RECV
    ) {
            printf( "riprolo: status= %d, stat= %d, data= %d, length=
    %d\n",
                status, status_recv, data_recv, length );
        }
                status = snalu62_deallocate(
                                    resource,
                                    status_vec,
                                    dealloc_type,
                                    NULL,   /* log_data                    
    */
                                    NULL,   /* exp_data_recv               
    */
                                    NULL    /* wait_object                 
    */
                                    );
        return status;
    }
    
7114.5Where do you want it?DELNI::BARBER_MINGOLet me DANCE for youWed Jun 04 1997 13:205
    
    If these, and other examples were to be on a web site, would it
    be of use to you?
    
    Cindi