PROCEDURE rap$define_tftps (
  protocol, p: key
      (cdna_session, cs)
      (datagram_socket, ds)
    keyend = datagram_socket
  status)

*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'

"    This request defines the TFTP server.
"
*IFEND

  VAR
    command_file: file = $unique($local)
    ignore_status: status
    local_status: status
  VAREND

  IF protocol = cdna_session THEN
    put_line 'WARNING - TCP/IP Gateway support terminated at release level 1.7.1' o=$response
    COLLECT_TEXT command_file until='    COLLECT_END'
      $system.osf$command_library.MANAGE_NETWORK_APPLICATIONS
        define_client client=osa$tftp_server protocol=cdna_session
          change_maximum_connections maximum_connections=40
          change_client_validation system_privilege=true
        QUIT
        activate_client client=osa$tftp_server
      QUIT
    COLLECT_END
  ELSE
    COLLECT_TEXT command_file until='    COLLECT_END'
      $system.osf$command_library.MANAGE_NETWORK_APPLICATIONS
        define_tcpip_application application=osa$tftp_server protocol=datagram_socket
          change_maximum_sockets maximum_sockets=40
          change_tcpip_validation system_privilege=true
        QUIT
        activate_tcpip_application application=osa$tftp_server
      QUIT
    COLLECT_END
  IFEND

  include_file command_file status=local_status
  delete_file command_file status=ignore_status

  IF local_status.normal THEN
    put_line ' TFTP server is defined' o=$response
  ELSE
    EXIT_PROC WITH local_status
  IFEND

PROCEND rap$define_tftps
