The Telnet device initialization process (which takes place before the signon screen is displayed) provides an exit point to a user program which has the opportunity to validate the terminal session. SECTCP provides an exit point program (named TGTINIT10) which establishes whether to allow the session depending on the IP address of the client device.

Your local TELNET exit program
In turn, program TGTINIT0 provides a second level exit point to a local user program which has the opportunity to change the TGTINIT0 final validation.

This local user exit program receives the following parameter group:

1char 15IP address of the client workstation
2char 14Client workstation type
3char 100IP address description
4char 1A flag telling whether to enable the Auto-signon process ('1'=yes, '0'=no)
5char 10The user profile for the Auto-signon
6char 10The current library for the Auto-signon
7char 10The initial program for the Auto-signon
8char 10The initial menu for the Auto-signon
9char 1A flag telling whether to device session can be accepted ('1'=yes, '0'=no)
   

The local user exit program, after checking the client IP address and/or the workstation type, decides
  • whether to update the IP address description by changing parameter number 3
  • whether to accept the terminal session requested by the client IP address in parameter number 9
    • to accept the terminal session, set parameter number 9 to '1'
    • to reject the terminal session, set parameter number 9 to '0'
  • whether to force an Auto-signon
    • Not to force an Auto-signon and provide the regular signon screen, set parameter number 4 to '0'.
    • To force an Auto-signon
      • set parameter number 4 to '1'
      • in parameter number 5 set an user profile name
      • in parameter number 7 set the name of the initial program AND/OR
        in parameter number 8 set the name of the initial menu
      • in parameter number 6 set the library name of the initial program and the of initial menu (whathever is available)
      • set parameter number 9 to '1'.
      Notes:
      1. The Auto-signon process automatically retrieves the correct password for the specified user profile and uses it for going through the signon process. This is why there is no need to specify a password.
        On the other side, this explain why user profiles with no password cannot be used in the Auto-signon process.
      2. While the user profile name is mandatory for the Auto-signon process, the other three inputs (current library, initial program and initial menu) are optional. If missing, they will be taken from the user profile definition.
    Program examples:

    Enabling/disabling your local TELNET exit program

    Use SECTCP command WRKTLNEPGM to:
    • enable the local user exit program
    • disable the local user exit program
    • check if the local user exit program is enabled.

    Testing your local TELNET exit program

    We strongly recommend that you use the EDBG (Enhanced Debug) command to debug your exit program. Command EDBG is available from the following Easy400.net utilities:
    • CGIDEV2
    • EPOLICE
    • MMAIL
    Debug your program as follow:
    1. From an active interactive session run command
      SECTCP/WRKTLNEPGM ACTION(*ON) PGM(your_library/your_exit_pgm)
      to enable your exit program.
      Keep this session active until you are over with your debugging.
    2. Run command
      WRKACTJOB SBS(QSYSWORK) JOB(QTV*)
      to display a list of the jobs in charge for initiating TELNET sessions.
      Use option 3 to hold all those jobs.
    3. Start a new TELNET session: it will not proceed, as the initiating job was held.
      Release one initiator job at a time, until the new TELNET session goes through.
      Now you know which is the job that will initiate the next session.
      End the TELNET session that you just started.
    4. Select with option 5 the initiator job you just detected, in order to display its job number nnnn.
    5. From the command line run command:
      library:name/EDBG PGM(your_library/your_exit_pgm) JOBNBR(NNN)
    6. Add at least one breakpoint to the program source
    7. Start another TELNET session: process will stop at that break point and you can start your debugging.
      Note - The TELNET initation process gives you only a few seconds (about 30) to do your test, then it times out and resumes process. In such a case, end the session you just initiated, and start a new one.