Source code of HPW routine I25560

Server program that runs on Host

 

*********************************************************************
*
*                                I25560
*
*                        TCP/IP Password Server
*
*             Written by William van den Heuvel, 1998
*
*             Update: 1998-11-10
*
*********************************************************************
*
* This program is a TCP/IP server that listens on port x.
*
* It provides Password services submitted by the client program.
* The client is a program that may run on any platform that
* supports TCP/IP.
* The client program submits the request by sending a TCP/IP message
* to port x. The server listens on this port and returns a reply.
*
***********************************************************************
*
* on entry,
* register 1 points to a fullword that contains the address
* of the PARM string.
*
* The PARM string is made by the Operating System when the PARM=
* keyword was found on the EXEC statement.
* The PARM string is a character string with a 2-byte length prefix
* that shows the number of bytes that follow.
* If there was no PARM string on the EXEC statement then the System
* makes a dummy PARM string: in this case the 2-byte length prefix
* contains 0.
*
*......................................................................
*
* This is the main entry point of the program.
* It's purpose is to accept and parse input parameters from the PARM
* string and then call I255601 passing the parsed parameters.
*
* Currently, the PARM string is not used and is therefore ignored.
*
*......................................................................
*
* on completion,
* register 15 will contain a return code (RC):
*
* RC=0 - normal completion (always)
*
***********************************************************************




**********************************************************************
*
I25560   CSECT
I25560   AMODE ANY
I25560   RMODE ANY
*
R0       EQU   0
R1       EQU   1
R2       EQU   2
R3       EQU   3
R4       EQU   4
R5       EQU   5
R6       EQU   6
R7       EQU   7
R8       EQU   8
R9       EQU   9
R10      EQU   10   PARM - address of pointer to PARM-string)
R11      EQU   11   BASE - base register of this program
R12      EQU   12   CAA  - reserved for LE
R13      EQU   13   DSA  - Dynamic Storage Area
R14      EQU   14   return address
R15      EQU   15   entry point address
*
DSA      EQU   R13
CAA      EQU   R12
BASE     EQU   R11
PARM     EQU   R10
API      EQU   R9         API parameters
*
         USING PARM_DSECT,PARM
         USING DSA_DSECT,DSA
         USING API_DSECT,API
*
*********************************************************************



*********************************************************************
*
         LEMENTRY BASE=BASE,LENGTH=DSA_DSECT_LENGTH,PARAM=PARM TRACE=0
*
* note:
*        PARM -> PARM_DSECT
*        DSA  -> DSA_DSECT
*
***********************************************************************
*
         LEMTRACE 0,'I25560: entry'
*
***********************************************************************
*
*        make API parameters
*
         XC    DSA_API,DSA_API              clear API
         LA    API,DSA_API                  address API
*
*        set parameters passed by user (parsed from PARM)
         MVC   API_BIND_IP,USER_IP        IP-address
         MVC   API_BIND_PORT,USER_PORT    port number
         MVC   API_MAXSOC,USER_MAXSOC     maximum number of sockets
         MVC   API_BACKLOG,USER_BACKLOG   backlog queued connects
*
***********************************************************************
*
*        call I255601 passing API
*
         LR    R1,API
         L     R15,=V(I255601)
         BASR  R14,R15
*
***********************************************************************
*
         LEMTRACE 0,'I25560: exit'
*
***********************************************************************
*
*        return to caller
*
         LEMEXIT
*
*********************************************************************





***********************************************************************
*
* The following is the information that can be passed by the user
* via the PARM string.
*
* The parsing of the PARM string is not yet implemented
* hence the "user" information is temporarily specified as constants.
*
USER_IP      DC AL1(0,0,0,0)    IP-address (0,0,0,0 means accept any)
USER_PORT    DC H'11111'        port number to listen on
USER_MAXSOC  DC H'100'          max sockets
USER_BACKLOG DC H'100'          backlog (queue for incoming conects)
*
*********************************************************************





***********************************************************************
*
* DSA - Dynamic Storage Area (pointed to by register 13)
*
DSA_DSECT  LEMDSA
*
*......................................................................
*
           DS   0D   D-align what follows
DSA_API    DS   XL256   API to be passed to I25561
*
*......................................................................
*
           DS   0D   D-align what follows
DSA_DSECT_LENGTH EQU  *-DSA_DSECT
*
***********************************************************************
*
* PARM - parameters passed by caller via register 1
* this dsect is address via register PARM
*
PARM_DSECT   DSECT
PARM_STRING  DS  A  pointer to LL-string
*
***********************************************************************
*
* API - parameters passed between modules
* this dsect is address via register API
*
API_DSECT      DSECT
*
* following fields are set by I25560:
API_BIND_IP    DS  XL4  IP-address                             for BIND
API_BIND_PORT  DS  H    port number to listen on               for BIND
API_MAXSOC     DS  H    maximum number of sockets           for INITAPI
API_BACKLOG    DS  F    backlog queued incoming connections  for LISTEN
*
***********************************************************************
        END