LU name assignment user exit

Most LU assignment requirements can be satisfied using the Telnet LU group and LU mapping statements. However, there are cases when the LU assignment requirements are so specific that Telnet cannot satisfy them. In these cases, the LU name assignment user exit might be the solution. The LU name exit is defined like an LUGROUP and is mapped the same way LUGROUPs are mapped. The LUGROUP is defined as an exit by specifying ,EXIT immediately after the LUGROUP name. For LUGROUPs, Telnet selects an LU from the group, verifies its availability, and assigns the LU to the connection. For LU name exits, Telnet calls the user-written assembler program passing a parameter list that contains client and other information. The program creates the LU name, places it in the parameter list, and returns control to Telnet. Telnet will then verify the LU name's availability and assign the LU to the connection. An LU name exit cannot be dynamically updated. After it is loaded, it remains unchanged until Telnet is recycled. To make a change without recycling Telnet, the exit name must be changed. The new name can then be added on a mapping statement. For a detailed description of the parameter list and coding requirements for the Telnet LU exit, see z/OS Communications Server: IP Configuration Reference.

Version 2 of the LU exit allows the exit to override Telnet profile assigned USS (3270 or SCS format) and interpret tables. The values assigned by the Telnet profile or blanks are passed into the exit. The exit can override any of the three values and Telnet will use the new values. For details on Telnet LU exit setup, see z/OS Communications Server: IP Configuration Reference.

In addition to client information, the parameter list includes any LU names or ranges that were coded in the LUGROUP, and the requested application name if known. Telnet does not use the LU list. The LUs specified can be used as seed values if the LU name exit wants to use them. The LUGROUP can be defined without any LUs specified. However, if the exit is used with multilevel security, at least one LU must be specified so the LUGROUP can be assigned a security label. For details, see LU mapping with multilevel security active.

The LU name exit is called when the LU is assigned, when the LU is released, when the LU is deactivated, and when the LU is activated. A different function code is used for each type of call. If you do not need a certain function, like tracking deactivated LUs, the LU name exit can be written to ignore the function code. Telnet allows only one connection at a time to use the LU name exit, which serializes its use in case any local tables are maintained in the exit.

As an example, assume LU names are to be assigned based on client port number and application requested. The SIMCLIENTLU parameter is used to postpone TN3270E LU assignment until the application name is known. The parameter list includes the client port number and the requested application name. In this case, no seed LU names are needed. The LU name exit will create LU names based on the port number and application name in the parameter list.

LUGROUP  LUEXIT1,EXIT
ENDLUGROUP           

In another example, assume that the clients specify LUGROUP names that match the default applications on the LUMAP statement. The LU names are to be created based on the last two numbers of the IP address and a prefix that identifies the application. For example, TSO, IMS™, and CICS® are three current applications, and the prefix for each is TS, IM, and CI, respectively. The connection from IP address 9.1.240.111 specifies LUGROUP LUGTSO and is assigned the name TS240111. The connection from IP address 9.1.240.212 specifies LUGROUP LUGIMS and is assigned the name IM240212. The connection from IP address 9.1.89.7 specifies LUGROUP LUGTSO and is assigned the name TS089007. Three LU name exits are required (LUGTSO, LUGIMS, LUGCICS), but they are all functionally equivalent. The LU name specified in the LUGROUP statement is passed to the LU name exit as part of the parameter list, and that name is used by the exit as the prefix. The client IP address is also in the parameter list. To force Telnet to call each exit, the LU name exit must return a nonzero return code when the LU name sent by the client does not match the LUGROUP name. The LU name exit combines the prefix with the last portions of the IP address to create an LU name. The following statements can be used to support this scenario.

IPGROUP  IPGRP1  0.0.0.0:0.0.0.0  ENDIPGROUP  ; Matches all connections
                                                                      
                                                                      
LUGROUP  LUGTSO,EXIT    TS       ENDLUGROUP                           
LUGROUP  LUGIMS,EXIT    IM       ENDLUGROUP                           
LUGROUP  LUGCICS,EXIT   CI       ENDLUGROUP                           
                                                                      
LUMAP  LUGTSO  IPGRP1  DEFAPPL  TSO                                   
LUMAP  LUGIMS  IPGRP1  DEFAPPL  IMS                                   
LUMAP  LUGCICS IPGRP1  DEFAPPL  CICS                                  

Capacity checks cannot be performed because Telnet has no way of knowing how many total LUs are available in the LU name exit.