NSEXIT exit routine

The NSEXIT exit routine is entered whenever certain network services RUs arrive for an application program. Network services RUs are sent to the application program on the SSCP-to-application program LU session. (If the program is a communication network management program, any network services RUs having a management-services category are sent to the application program as data. For more information, refer to Coding for the communication network management interface. In this case, the application program must issue a RECEIVE macroinstruction; the NSEXIT exit routine is not scheduled for management services requests.) The action taken by the exit routine depends on the type of network services request unit received by the program.

An application program can receive any of three types of network services request units:
  • The program receives a Clean Up Session (CLEANUP) request unit (RU) when a session of which the application program is a part is terminated.
  • The program receives a Notify request unit (containing control vector hex 3) if, after the program has issued a session-initiation request (other than through OPNDST OPTCD=ACQUIRE) with a nonzero NIB USERFLD and the request has been responded to positively by the SSCP, something happens that makes it impossible to ensure that the session is set up successfully. The program also receives a Notify RU (containing control vector hex 3) after the session initiated by CLSDST OPTCD=PASS is established if PARMS=(THRDPTY=NOTIFY) is specified.
  • The program receives a Network Services Procedure Error (NSPE) request unit if, after the program has issued a session-initiation request with a zero NIB USERFLD and the request has been responded to positively by the SSCP, something happens that makes it impossible to ensure that the session is set up successfully. (See Network services procedure error or Notify for more information.)
When the exit routine is entered, VTAM® provides it with the address of a read-only RPL in the fifth word of the parameter list. The fields of this RPL that are filled in by VTAM are shown in Figure 4. The AREA field of the RPL contains the address of the RU that is received, and the RECLEN field (as well as the AREALEN field) of the RPL specifies the number of bytes in the RU. The exit routine examines the RU to determine which type of network services RU is received; this determines what action it should take. The following are also true for this RPL:
  • The application program uses SHOWCB, TESTCB, or IFGRPL DSECT to examine the RPL fields (see Figure 2).
  • The 3-byte user RH field is set (see Operation for inbound RUs for more information).
  • CHECK must not be issued for the RPL.
  • RPL and RU pointed to by AREA are freed when control returns to VTAM.
In the event that other types of network services request units are passed to the NSEXIT exit routine in the future, the exit routine must test the 3-byte network services header to determine the particular type of request received and take action for each type. The exit routine must also take particular action when it receives a request unit other than one of the types it expects to receive. If the exit routine receives an RU other than an NSPE, Notify, or CLEANUP RU, the exit routine should set register 0 to 0 and register 15 to 4 and then return control to VTAM. Otherwise, it must set register 0 to 0 and register 15 to 0 before returning. This allows VTAM to determine whether the application program understands the network services request and to take appropriate action for that RU if the application program does not understand it. (VTAM does not take any special action if values other than 0 are returned in registers 0 and 15.) Similarly, certain other fields within the network services request units must be checked; if the values of these fields are not understood, register 0 must be set to 0 and register 15 must be set to 4. See Figure 1, Table 1 to Table 5, and Figure 1 for the fields that must be checked.