PROCEDURE rap$define_5744_interface (
  gateway, g: boolean = false
  maximum_connections, mc: integer = 100
  status)

  "$FORMAT=OFF"
  VAR
    command_file     : file =$unique($local)
    ignore_status    : status
    local_status     : status
  VAREND
  "$FORMAT=ON"

  IF NOT gateway THEN
    collect_text command_file until='    collect_end'
      $system.osf$command_library.manage_network_applications
        define_tcpip_application application=osa$5744_interface_dgram ..
              protocol=datagram_socket
          change_maximum_sockets ms=maximum_connections
        quit
        activate_tcpip_application application=osa$5744_interface_dgram
      quit
    collect_end
  ELSE
    put_line 'WARNING - TCP/IP Gateway support terminated at release level 1.7.1'
    collect_text command_file until='    collect_end'
      $system.osf$command_library.manage_network_applications
        define_client client=osa$5744_interface_gateway protocol=cdna_session
          change_maximum_connections mc=maximum_connections
          change_client_validation sp=true
        end_define_client
        activate_client client=osa$5744_interface_gateway
      quit
    collect_end
  IFEND

  include_file command_file status=local_status
  delete_file command_file status=ignore_status

  IF local_status.normal THEN
    IF gateway THEN
      put_line ' OSA$5744_INTERFACE_GATEWAY application is defined' o=$response
    ELSE
      put_line ' OSA$5744_INTERFACE_DGRAM application is defined' o=$response
    IFEND
  IFEND

  EXIT PROCEDURE WITH local_status WHEN NOT local_status.normal

PROCEND rap$define_5744_interface

