Chapter 2. Programming with the SNA SERVER Verbs

This chapter contains information to help you write transaction programs using the verb library functions and to help diagnose application errors should they arise. The material in this chapter provides an introduction and overview of the verbs. Appendix A lists the major and minor codes returned by the verb functions. Appendix C describes messages displayed during normal system activity or when errors are detected. Appendix G, “API Verb Catalog,” lists all of the API verbs in alphabetical order, giving their full names and verb types.

Some of the verbs presented in this chapter are relevant to users of IRIS SNA LU 6.2. See the IRIS SNA LU 6.2 Programming Guide for information about these verbs.

API Overview

The Application Program Interface (API) is a library of verb functions and header files that define the structures and variables needed by applications that call the verb functions. In the Silicon Graphics implementation, these verbs take the form of C-language function calls. The API supplied by the IRIS SNA SERVER also contains the verbs needed by other related Silicon Graphics SNA products such as IRIS SNA LU 6.2, IRIS SNA 3770, and IRIS SNA 3270. The API library for the IRIS SNA SERVER is installed as /usr/lib/libsna.a and /usr/lib/liblu03.a.

Verb Categories

The IRIS SNA SERVER verbs are divided into three categories according to their function:

  • Implementation-specific verbs

  • Configuration verbs

  • Node Operator verbs

Implementation-specific Verbs

Implementation-specific verbs are not specified in the IBM SNA Transaction Programmer's Reference Manual for LU Type 6.2 (referred to subsequently in this guide as TPRM) but are defined and implemented in Silicon Graphics SNA products. These verbs are divided into two groups:

  • Transaction program connection verbs

  • Transaction program utility functions

The connection verbs establish or break the connection between a transaction program and the IRIS SNA Scheduler. The utility functions, while not true verbs, provide routines that APPC transaction programs commonly need, such as ASCII-to-EBCDIC translation.

Configuration Verbs

Configuration verbs define and display the resources of the node and logical unit. They are divided into two groups:

  • Define verbs

  • Display verbs

The first group contains both LU define and node define verbs. The LU define verbs configure information about LUs, modes, and transaction programs. The node define verbs configure PU 2.1 components. The second group, the display verbs, provide information about the configured LUs and PU 2.1 components.

Node Operator Verbs

Node operator verbs activate and deactivate PU 2.1 components. These verbs are not specified in IBM's TPRM, but are Silicon Graphics-defined.

Verb Library

Verb functions, and functions called by the verb, are archived in
/usr/lib/libsna.a. Programs that use verb functions must be linked against this library. Under most compilers, this is accomplished by using the -l option; for example:

cc sample.c -L/usr/lib/sna -lsna.a 

Note the case-specific use of the letter l in the example. See your compiler documentation for instructions on linking against product libraries.

Header Files

The structures and variables used in the SNA verbs are defined in header files located in /usr/include/sna. Here are some of the header files you can include in your application:

global.h 

Contains the definitions of the global variables used by all of the verb types.

imp.h 

Contains the definitions of the verb parameter structures for the implementation-specific verbs.

ludef.h 

Contains the definitions of the verb parameter structures for the LU define verbs.

msgdef.h 

Contains the definitions of the structures used to retrieve and parse node messages.

noop.h 

Contains the definitions of the verb parameter structures for the node operator verbs.

uadef.h 

Contains the definitions of the verb parameter structures for the node define verbs.

In addition to these header files, /usr/include/sna contains several files that contain the type definitions and constant values used by the SNA verbs. They do not need to be explicitly included; examine them for their contents.

ddhvtyp.h 

Contains the type definitions for the SNA verbs.

ddhverr.h 

Contains constants for the major and minor return codes.

ddhvicn.h 

Contains the constants used for the verb parameter values.

ddhviex.h 

Contains external variable declarations.

Data Type Definitions

The verb parameter structures use data types defined in the header file ddhvtyp.h. Several of these data types may not be familiar to you:

  • typedef unsigned char hex

    Used for strings or bytes where all bits are significant

  • typedef unsigned short shex

    Used for values that must be two bytes long

  • typedef unsigned long lhex

    Used for values that must be four bytes long

Data Structures

Each member (referred to as both parameter and field) of the data structure is described as being Supplied, Returned, or Supplied/Returned.

  • Supplied parameters are set by the application program.

  • Returned parameters are set automatically by the successful operation of the verb.

  • Supplied/Returned parameters are set by the application program when the verb is issued, but their value can change after the successful operation of the verb.

Initialization of every member of the structure is the responsibility of the application. This is especially true of pointers, which must be set to null if not set to a specific address.


Note: For the character-string parameters in the display and get attribute verbs, Returned and Supplied have a slightly different meaning. These verbs require the application program to allocate space for names and other strings that are to be returned. If the pointer is nulled, the name is not returned.

Even though the value in a name field is returned by the verb, the pointer must still be supplied by the application program. A display verb with a name parameter listed as Supplied/Returned can return a different name in that space after the successful completion of the verb.

Supplied parameters are further specified as Required, Conditional, or Optional.

  • Required parameters must be set by the application program.

  • Conditional parameters can have a value required, depending on the setting of another parameter.

  • Optional parameters need not be set.

Global Variables

Information on the state of the conversation and feedback on the execution of verb calls are returned in three global variables. These variables are defined in the header file global.h. This file must be included in each program that uses functions described in the IRIS SNA SERVER API. Routines that query the values of these variables can refer to them as external variables.

After a verb function is executed, return information is placed in global variables snamaj and snamin. The values carried here correspond to the verb return-code parameters defined in the TPRM. If the function completed normally (return code of “OK”), the function returns 0 and the major and minor codes are also 0. If a return code was set in the major or minor fields, the verb function returns -1. In general, the major code is sufficient for controlling program logic.

Table 2-1 describes the major codes used. (For a complete list of the major and minor return codes, see Appendix A.)

Table 2-1. Major Return Codes

Major Code

Description

S2_OK (0)

Function completed successfully.

S2_USAGE (1)

Function aborted, usage error.

 

The function was not performed because a parameter was in error or requested a function that was not supported. Most of the minor codes provide specific information on usage errors.

S2_UNSUC (2)

Function completed unsuccessfully.

 

Set when a function, such as “Receive Immediate” or “Test,” completes normally but does not return data.

 

S2_STATE (3)

Function aborted, state error.

 

The function was not performed because it is not allowed in the current conversation state.

S2_ALCER (5)

Allocation error.

 

The program could not allocate a conversation for the reason specified in the minor code. The conversation is in deallocated state when an allocation error occurs.

S2_PGMER (7)

Program error.

 

The partner program has issued an error indication. If the conversation was in send state, it is now in receive state.

 

S2_DEALC (9)

Deallocation indication.

 

The conversation has been deallocated, normally or abnormally, for the reason specified in the minor code. The conversation is in deallocated state.

S2_COERR (10)

Control operator function error.

 

A control operator function has ended abnormally. Since the control operator verb may not have been using a conversation, the conversation state does not apply.

 

S2_NPERR (11)

Node-operator function error.

 

A node-operator function was not accepted. Since node operator verbs do not use conversations, the conversation state does not apply.

 


Implementation-specific Verbs

Although the implementation-specific verbs are not part of the IBM SNA, they are required for the IRIS SNA SERVER. These verbs perform specific functions, such as opening and closing the connection between the transaction program and the IRIS SNA Scheduler.

The implementation-specific verbs are divided into two groups: transaction program connection verbs and transaction program utility functions. Each of these groups is described on the following pages. The verb structures and variables are in /usr/include/sna/imp.h.

Transaction Program Connection Verbs

Before a program can issue any conversation, control-operator, or node-operator functions, it establishes a connection with the IRIS SNA Scheduler. Establishing this connection is called attaching. Conversation verbs and control operator verbs attach by specifying the name of the configuration and the local LU that the transaction program wants to use. Node operator verbs require only the configuration. The names specified in the attach request are called the context of the attach. Since a program can issue verbs to more than one configuration or LU, the program can issue multiple attach requests. Each of these attaches creates a new logical instance of the program. The setctx verb switches from one instance to the other before issuing verbs to the different LUs.

Because transaction program connection verbs establish or break the connection between the transaction program and the IRIS SNA Scheduler, they are the first and last verbs the program issues.

Table 2-2 shows the supported transaction program connection verbs.

Table 2-2. Transaction Program Connection Verbs

Verb

Function

attach

Initiates communication between the local program and the IRIS SNA Scheduler.

detach

Detaches the current context from the IRIS SNA Scheduler.

rattach

Initiates communication between a remotely invoked transaction program and the IRIS SNA Scheduler.

setctx

Sets the current context under which subsequent verbs are issued.


Transaction Program Utility Functions

The transaction program utility functions shown in Table 2-3 are not considered verbs because they do not set snastat, snamaj, or snamin. Rather, they provide useful routines for writing APPC applications.

Table 2-3. Transaction Program Utility Functions

Utility

Function

atoe

Translates an ASCII string into EBCDIC for partner programs running on IBM computers so they may receive application-specific information.

etoa

Translates an EBCDIC string into ASCII so partner programs running on IBM machines can send application-specific information.

dspmaj

Formats major return code messages.

dspmin

Formats minor return code messages.

prtnmsg

Prints a formatted message from the message structure returned by the rtvnmsg verb.


Configuration Verbs

Configuration verbs are divided into two categories: define verbs and display verbs. The define verbs include LU define verbs, which configure local and remote LUs, modes, and transaction programs; and node define verbs, which define the components of the PU 2.1 node. (Display verbs display information about LUs, modes, transaction programs, and PU 2.1 node components.)

The verb functions, and functions called by the verb, are archived in
/usr/lib/libsna.a. Programs that use verb functions are linked against this library. LU define verb data structures are in /usr/include/sna/ludef.h. Data structures for the node define verbs are in /usr/include/sna/noop.h. The global variables are defined in header file /usr/include/sna/global.h.

Each verb has an associated data structure that contains the verb's parameters. These data structures are more complex than those for the conversation verbs. To simplify their use, two special verbs are provided—initcbu for the node and initcbl for the LU—to initialize the values in the structure members. Each pointer within the structure is nulled. All other fields are set to the constant value, indicating that the parameter is not being specified.

As stated earlier, each member of the data structure is described as being Supplied, Returned, or Supplied/Returned. For more information on these parameter qualifiers, see Section , “Data Structures.” For the character-string parameters in the display verbs, Returned and Supplied have a slightly different meaning. These verbs require the application program to allocate space for names and other strings that are to be returned. If the pointer is nulled, the name is not returned. Even though the value in a name field is returned by the verb, the pointer must still be supplied by the application program. A name parameter listed as Supplied/Returned in a display verb means a different name can be returned in the same space after the successful completion of the verb.

Define Verbs

Define verbs define the configuration elements of the LU (the local LU, remote LU, modes, and transaction programs) and the PU 2.1 node (the lines, stations, control points, and the node itself). Table 2-4 lists the define verbs that are provided.

Table 2-4. Define Verbs

Verb

Function

dfncp

Defines the addressing information for the control point at the remote node.

dfnline

Defines line name, line type, and line characteristics.

dfnllu

Initializes or modifies parameter values that control the operation of the local LU.

dfnmode

Initializes or modifies parameter values that control the operation of the local LU in conjunction with a group of sessions (identified by a mode name) with a remote LU.

dfnnode

Defines the system-wide operating parameters for an instance of the SNA node.

dfnrlu

Initializes or modifies parameter values that control the operation of the local LU in conjunction with a remote LU.

dfnslu

Defines a secondary LU.

dfnsta

Defines the station name and other parameters that pertain to the adjacent link station.

dfntp

Initializes or modifies parameter values that control the operation of the local LU in conjunction with a local transaction program.

dltcbl

Deletes the operating parameters for the local LU that were set by the define verbs.

dltcbu

Deletes control blocks defined by the node define verbs.

initcbl

Initializes a define verb structure.

initcbu

Initializes a define verb structure of the type specified in the

stype parameter.

 

The node define verbs use the parameter constants listed in Table 2-5.

Table 2-5. Parameter Constants for Node Define Verbs

Constant

Description

IGN_VAR

Ignore this parameter.

 

Specifies that an optional parameter is to be ignored. Use the current or default value for this parameter.

 

SUPPORT

Function is supported.

 

Indicates the specific function is supported.

 

NOT_SUP

Function is not supported.

 

Indicates the specific function is not supported.

 

These parameter constants and the data structures are defined in the header file uadef.h.


Note: Some of the node define verb parameter constants listed in Table 2-5 and Table 2-6 have the same underlying values. Specifically, NOT_SUP, ADD_VAR, and RPL_VAR have a value of 0. DEL_VAR and SUPPORT have a value of 1. IGN_VAR has a value of -1. Use only the documented constants for any parameter value since these equivalencies can change in later releases.

The LU define verbs use the parameter constants listed in Table 2-6.

Table 2-6. Parameter Constants for LU Define Verbs

Constant

Description

IGN_VAR

Ignore this parameter.

 

Specifies that an optional parameter is to be ignored. The current or default value for this parameter is to be used.

SUPPORT

Function is supported.

 

Indicates the specific function is supported.

 

NOT_SUP

Function is not supported.

 

Indicates the specific function is not supported.

 

RPL_VAR

Replace parameter.

 

Specifies that a related field (such as a network name) is to replace the existing value on the control block.

DEL_VAR

Delete parameter.

 

Specifies that a related field (such as a network name) is to be deleted from a control block.

ADD_VAR

Add parameter.

 

Specifies that a related field (such as an user ID) is to be added to a control block.

These parameter constants and the data structures are defined in the header file ludef.h.


Note: Before issuing a define or display verb, the transaction program uses the attach verb to establish a connection to s2_schd, the IRIS SNA SERVER.

The verbs return 0 if the control block was successfully defined or displayed and -1 if an error occurred. For errors, the global variables snamaj and snamin are set to the major code and minor code of the error. Use the verbs dspmaj and dspmin to translate these codes into printed error messages. (For a list of the major and minor codes, see Appendix A.)

Display Verbs

Display verbs return information about configuration elements for 6.2 LUs (the local LU, remote LU, modes, and transaction programs), secondary LUs, and the PU 2.0/PU 2.1 node (the lines, stations, control points, and the node itself). Table 2-7 lists the display verbs.

Table 2-7. Display Verbs

Verb

Function

dspcp

Returns addressing information for a control point defined with the dfncp verb.

dspcph

Returns data describing the current status of sessions with a host-type control point.

dspline

Returns information about a line defined with the

dfnline verb.

dspllu

Returns parameter values that control Local LU operation.

dspmode

Returns parameter values that control the operation of the local LU in conjunction with a group of sessions (identified by a mode name) with a remote LU.

dspnode

Returns information stored in the Node Control Block.

dsprlu

Returns parameter values that control the operation of the local LU in conjunction with the remote LU.

dspses

Returns information about sessions between local and remote LUs.

dspslu

Returns information about a secondary LU.

dspsta

Returns information about a station defined with the

dfnsta verb.

dsptp

Returns parameter values that control the operation of the local LU in conjunction with a local transaction program.

Display verbs for the node use the parameter constants listed in Table 2-8.

Table 2-8. Display Verb Parameter Constants for the Node

Constant

Description

IGN_VAR

Ignore this parameter.

 

Specifies that an optional parameter is to be ignored. The current or default value for this parameter is to be used.

SUPPORT

Function is supported.

 

Indicates the specific function is supported.

 

NOT_SUP

Function is not supported.

 

Indicates the specific function is not supported.

 

NEXT

Display information on the next control block.

 

The Display Verbs can return information on a specific block or the next block so that you can step through all of the blocks of a specific type. If a block is named and the next parameter is set to IGN_VAR, the information for that block is returned. If next is set to NEXT, information for the next block is returned.

These parameter constants and the data structures are defined in the header file uadef.h.


Note: Some of these widely used constants have the same underlying values. Specifically, NOT_SUP and NEXT have a value of 0. SUPPORT has a value of 1. IGN_VAR has a value of -1. Use only the documented constants for any parameter value since these equivalencies can change in later releases.

Display verbs for the LU use the parameter constants listed in Table 2-9.

Table 2-9. Display Verb Parameter Constants for the LU

Constant

Description

IGN_VAR

Ignore this parameter.

 

Specifies that an optional parameter is to be ignored. The current or default value for this parameter is to be used.

 

SUPPORT

Function is supported.

 

Indicates the specific function is supported.

NOT_SUP

Function is not supported.

 

Indicates the specific function is not supported.

NEXT

Display information on the next control block.

These parameter constants and data structures are defined in the header file ludef.h.


Note: Some of these widely used constants have the same underlying values. Specifically, NOT_SUP, ADD_VAR, RPL_VAR, and NEXT all have a value of 0. DEL_VAR and SUPPORT have a value of 1. IGN_VAR has a value of -1. Use only the documented constants for any parameter value since these equivalencies can change in later releases.

The verbs return 0 if the control block was successfully defined or displayed and -1 if an error occurred. If there was an error, the global variables snamaj and snamin are set to the major code and minor code of the error. Use the verbs dspmaj and dspmin, described in “Transaction Program Utility Functions,” to translate these codes into printed error messages. (For a list of the major and minor codes, see Appendix A.)


Note: Before issuing a define or display verb, the transaction program uses the attach verb to establish a connection to the IRIS SNA SERVER, s2_schd.


Node Operator Verbs

Node operator verbs activate lines, stations, LUs, and the local PU and control the node logging and message facilities. While their format is not determined by IBM, their function is implied.

The Node Operator verb function is archived in /usr/lib/libsna.a. Programs that use verb functions must be linked against this library. The data structures used in these verbs are in /usr/include/sna/noop.h. The global variables are defined in the header file /usr/include/sna/global.h.

Table 2-10 lists the node operator verbs provided.

Table 2-10. Node Operator Verbs

Verb

Function

actline

Activates the line.

actlu

Activates the LU locally.

actpu

Activates the node's physical unit locally.

actsta

Instructs the node to enable the link connection to a particular remote node.

chgmsgq

Instructs the node to change the status parameters of a message queue.

dctline

Deactivates the named line from use.

dctlu

Terminates the use of the named LU.

dctpu

Terminates the use of the PU.

dctsta

Instructs the node to issue the proper commands to disable the link connection to a particular remote node.

dspmsgq

Instructs the node to display the status parameters of a message queue.

rtvnmsg

Retrieves a message from the named message queue.

The activation and deactivation requests issue a message to the Node Operator message queue indicating whether the activation or deactivation was successful. Each of these requests returns a correlation number used to retrieve the completion message from the queue.

Operation Diagnostics

Table 2-11 provides information to help you locate and solve a problem if you encounter trouble using the IRIS SNA SERVER.

Table 2-11. Operation Diagnostics

Problem

Solution

The line is active but the station is pending-active, even after the partner activates its side.

Check that the SDLC address in the station definition block matches your partner's. If it does not and the problem persists, check for a defective cable between the system and the modem.

“Link Inoperative” message received.

Deactivate the line, then reactivate it. Consult Appendix C in the IRIS SNA Administration Guide for specific information about the condition that caused the line to drop.

“Link Inoperative” message received (“too many aborts”)

The duplex, NRZI, and line speed settings received must match. If they do not, reconfigure and try again. Also, check the modem's duplex setting.

Primary is polling; secondary is responding.

The duplex, NRZI and line speed settings must match. If they do not, reconfigure and try again. Also, check your modem's duplex setting.

Line drops immediately after activation.

Check the log. It is likely that the exchange IDs were not recognized. Contact your partner and exchange IDs. Update the local node or remote node block, regenerate the configuration, and retry.

The message ends with “CNOS allocation error.”

Partner needs to initialize session limits.

The message states that the LU was not recognized.

Your configuration does not match your partner's mode. Modify the resource definition blocks, regenerate the configuration, and try again.

No sessions are activated.

If you specified 0 auto-initiated sessions in the mode definitiion block, sessions are not activated until needed by an application. If you did specify auto-initiated sessions, check the log for session-failure messages. Usually this problem is a mismatch of the mode parameters for CNOS support and re-initialization.