*copyc osd$default_pragmats
MODULE rfm$network_displays;
?? TITLE := 'RHFAM_NETWORK_DISPLAYS' ??
?? NEWTITLE := '  RING BRACKETS 23D' ??
?? NEWTITLE := '    XREF procedures', EJECT ??
*copyc clp$convert_integer_to_rjstring
*copyc clp$new_display_line
*copyc clp$put_display
*copyc jmp$convert_name_to_ssn
*copyc jmp$system_job
*copyc osp$format_message
*copyc osp$get_message_level
*copyc osp$set_status_abnormal
*copyc oss$job_paged_literal
*copyc pmp$format_compact_time
*copyc pmp$get_microsecond_clock
*copyc rfp$lock_table
*copyc rfp$unlock_table
?? TITLE := '    INLINE procedures', EJECT ??
*copyc pmp$get_executing_task_gtid
*copyc rfp$find_client_entry
*copyc syp$cycle
?? NEWTITLE := '      rfp$clear_display_active', EJECT ??
  PROCEDURE [INLINE] rfp$clear_display_active;

    rfp$lock_table (rfv$status_table.lock);
    rfv$status_table.display_active := tmv$null_global_task_id;
    rfp$unlock_table (rfv$status_table.lock);

  PROCEND rfp$clear_display_active;
?? TITLE := '      rfp$convert_tcu_mask', EJECT ??
  PROCEDURE [INLINE] rfp$convert_tcu_mask (tcu_mask: rft$tcu_mask;
        VAR tcu_mask_string: string (4));
    VAR
      tcu_index: rfc$min_tcu .. rfc$max_tcu;

    tcu_mask_string := '0000';

    FOR tcu_index := LOWERBOUND(tcu_mask) TO UPPERBOUND(tcu_mask) DO
      IF tcu_mask[tcu_index] THEN
        tcu_mask_string (1+tcu_index,1) := '1';
      IFEND;
    FOREND;

  PROCEND rfp$convert_tcu_mask;
?? TITLE := '      rfp$set_display_active', EJECT ??
  PROCEDURE [INLINE] rfp$set_display_active ( display_command: STRING(*); VAR status: ost$status);

    VAR
      task_id: ost$global_task_id;

    pmp$get_executing_task_gtid (task_id);

  /set_display_active/
    REPEAT
      rfp$lock_table (rfv$status_table.lock);
      IF NOT rfv$status_table.system_task_is_up THEN
        osp$set_status_abnormal (rfc$product_id, rfe$system_task_not_active, display_command, status);
        EXIT /set_display_active/;
      IFEND;
      IF rfv$status_table.display_active = tmv$null_global_task_id THEN
        rfv$status_table.display_active := task_id;
      ELSE
        rfp$unlock_table (rfv$status_table.lock);
        syp$cycle;
      IFEND
    UNTIL rfv$status_table.display_active = task_id;

    rfp$unlock_table (rfv$status_table.lock);

  PROCEND rfp$set_display_active;
?? OLDTITLE, EJECT ??
?? TITLE := '    TYPE/CONST Definitions', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc rfe$condition_codes
?? POP ??
*copyc rft$manage_rhfam_network_types
*copyc rfv$network_break_rc
*copyc rfv$status_table
*copyc rfv$rhfam_client_table
*copyc rfv$rhfam_job_table
*copyc rfv$rhfam_server_table
*copyc tmv$null_global_task_id
?? TITLE := '    rfp$display_active_appl_r3', EJECT ??
  PROCEDURE [XDCL, #GATE] rfp$display_active_appl_r3 (job_name_list: ARRAY [1 .. *] OF ost$name;
    application_name_list: ARRAY [1 .. *] OF rft$application_name;
    display_type: rft$application_display_type;
    VAR display_control: clt$display_control;
    VAR status: ost$status);

*copyc rfh$display_active_appl_r3

    VAR
      appl_name_index,
      job_name_index,
      current_time,
      microseconds: INTEGER,
      application_name_displayed_p: ^ARRAY[1 .. *] OF BOOLEAN,
      compact_time: ost$date_time,
      job_found: BOOLEAN,
      privileged_job: boolean,
      legible_time: ost$time,
      line: string (72),
      application_kinds: [STATIC, READ, oss$job_paged_literal]
        ARRAY [rft$application_kinds] OF
        STRING (7):= ['SERVER', 'CLIENT', 'PARTNER'],
      appl_entry_p: ^rft$application_table_entry,
      client_entry_p: ^rft$rhfam_client_table_entry,
      connect_entry_p: ^rft$connection_entry,
      job_entry_p: ^^rft$rhfam_job_table_entry,
      current_entry_p,
      previous_entry_p: ^rft$rhfam_job_table_entry,
      system_supplied_names_p: ^ARRAY[1 .. *] OF jmt$system_supplied_name,
      task_id: ost$global_task_id,
      maximum_connections: rft$application_connections,
      local_status,
      ignore_status: ost$status;

    status.normal := TRUE;
    local_status.normal := TRUE;

    PUSH system_supplied_names_p: [1 .. UPPERBOUND(job_name_list)];

    IF job_name_list[1] <> 'ALL' THEN
      privileged_job := jmp$system_job ();
      FOR job_name_index := LOWERBOUND(job_name_list) TO UPPERBOUND(job_name_list) DO
        jmp$convert_name_to_ssn (job_name_list[job_name_index], privileged_job,
        system_supplied_names_p^[job_name_index], status);
        IF NOT status.normal THEN
          RETURN;
        IFEND;
      FOREND;
    ELSE
      system_supplied_names_p^[1] := 'ALL';
    IFEND;

    PUSH application_name_displayed_p: [1 .. UPPERBOUND(application_name_list)];

    FOR appl_name_index := LOWERBOUND(application_name_list) TO UPPERBOUND(application_name_list) DO
      application_name_displayed_p^[appl_name_index] := FALSE;
    FOREND;

    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    line (1,*) := '   ';

    IF display_type = rfc$adt_connections THEN
      line (25,*) := 'ACTIVE CONNECTIONS';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line (9,*) := 'JOB            APPL   REMOTE  CONNECT      BYTES      BYTES';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line (9,*) := 'NAME           NAME    HOST    TIME         SENT     RECEIVED';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    ELSE
      line (21,*) := 'ACTIVE APPLICATIONS';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line (9,*) := 'JOB            APPL    MAXIMUM   CURRENT     APPL';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      line (9,*) := 'NAME           NAME    CONNECTS  CONNECTS    KIND';
      clp$put_display (display_control, line, clc$trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    IFEND;
    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    pmp$get_executing_task_gtid (task_id);

    pmp$get_microsecond_clock (current_time, ignore_status);

    job_entry_p := ^rfv$rhfam_job_table.first_entry;
    current_entry_p := NIL;

  /display_jobs/
    WHILE TRUE DO
      previous_entry_p := current_entry_p;
      current_entry_p := NIL;
      rfp$lock_table (rfv$rhfam_job_table.lock);
      WHILE (job_entry_p^ <> NIL) AND (current_entry_p = NIL) DO
        IF job_entry_p^^.lock = tmv$null_global_task_id THEN
          current_entry_p := job_entry_p^;
          current_entry_p^.lock := task_id;
        ELSE
          rfp$unlock_table (rfv$rhfam_job_table.lock);
          syp$cycle;
          rfp$lock_table (rfv$rhfam_job_table.lock);
        IFEND;
      WHILEND;
      rfp$unlock_table (rfv$rhfam_job_table.lock);
      IF previous_entry_p <> NIL THEN
        previous_entry_p^.lock := tmv$null_global_task_id;
      IFEND;
      IF job_entry_p^ = NIL THEN
        IF previous_entry_p = NIL THEN
          clp$put_display (display_control, '    No active applications.', clc$trim, status);
        IFEND;
        EXIT /display_jobs/;
      IFEND;
      job_entry_p := ^current_entry_p^.next_entry;
      job_found := FALSE;
      FOR job_name_index := LOWERBOUND(system_supplied_names_p^) TO UPPERBOUND(system_supplied_names_p^) DO
        IF (system_supplied_names_p^[job_name_index] = current_entry_p^.job_name) OR
              (system_supplied_names_p^[job_name_index] = 'ALL') THEN
          job_found := TRUE;
        IFEND;
      FOREND;
      IF job_found AND (current_entry_p^.application_entry <> NIL) THEN
        line (1,*) := '   ';
        line (2,*) := current_entry_p^.job_name;
        FOR appl_name_index := LOWERBOUND(application_name_list) TO UPPERBOUND(application_name_list) DO
          appl_entry_p := current_entry_p^.application_entry;
        /display_applications/
          REPEAT
            IF (application_name_list[appl_name_index] = appl_entry_p^.application_name) OR
                   (application_name_list[appl_name_index] = 'ALL') THEN
              line (23,#SIZE(rft$application_name)) := appl_entry_p^.application_name;
              connect_entry_p := appl_entry_p^.connection_table;
              IF display_type = rfc$adt_connections THEN
                WHILE connect_entry_p <> NIL DO
                  IF connect_entry_p^.connection_attributes.connection_status.connection_state <>
                        rfc$not_viable THEN
                    IF appl_entry_p^.application_kind = rfc$client THEN
                      line (32,#SIZE(rft$physical_identifier)) :=
                            connect_entry_p^.connection_attributes.server_host;
                    ELSE
                      line (32,#SIZE(rft$physical_identifier)) :=
                            connect_entry_p^.connection_attributes.client_host;
                    IFEND;
                    microseconds := current_time - connect_entry_p^.connection_statistics.connect_time;
                    compact_time.millisecond := 0;
                    compact_time.second := (microseconds DIV 1000000) MOD 60;
                    compact_time.minute := ((microseconds DIV 1000000) DIV 60) MOD 60;
                    compact_time.hour := ((microseconds DIV 1000000) DIV 60) DIV 60;
                    IF compact_time.hour > 23 THEN
                      compact_time.hour := 23;
                      line (37,1) := '*';
                    IFEND;
                    pmp$format_compact_time (compact_time, osc$hms_time, legible_time, status);
                    IF NOT status.normal THEN
                      EXIT /display_jobs/;
                    IFEND;
                    line (38,8) := legible_time.hms;
                    clp$convert_integer_to_rjstring (connect_entry_p^.connection_statistics.
                          bytes_sent, 10, FALSE, ' ', line (48,10), status);
                    IF NOT status.normal THEN
                      EXIT /display_jobs/;
                    IFEND;
                    clp$convert_integer_to_rjstring (connect_entry_p^.connection_statistics.
                          bytes_received, 10, FALSE, ' ', line (60,10), status);
                    IF NOT status.normal THEN
                      EXIT /display_jobs/;
                    IFEND;
                    clp$put_display (display_control, line, clc$trim, status);
                    IF NOT status.normal THEN
                      EXIT /display_jobs/;
                    IFEND;
                    line (1,*) := '   ';
                  IFEND;
                  connect_entry_p := connect_entry_p^.next_entry;
                WHILEND;
                IF line (23,1) <> ' ' THEN
                  clp$put_display (display_control, line, clc$trim, status);
                  IF NOT status.normal THEN
                    EXIT /display_jobs/;
                  IFEND;
                IFEND;
              ELSE
                IF NOT appl_entry_p^.system_wide_connection_mgmt THEN
                  clp$convert_integer_to_rjstring (appl_entry_p^.maximum_allowed_connections, 10, FALSE,
                        ' ', line (34,3), status);
                  IF NOT status.normal THEN
                    EXIT /display_jobs/;
                  IFEND;
                ELSE
                  rfp$lock_table (rfv$rhfam_client_table.lock);
                  rfp$find_client_entry(appl_entry_p^.application_name, FALSE, client_entry_p, status);
                  IF status.normal THEN
                    maximum_connections := client_entry_p^.maximum_connections;
                  IFEND;
                  rfp$unlock_table (rfv$rhfam_client_table.lock);
                  IF NOT status.normal THEN
                    EXIT /display_jobs/;
                  IFEND;
                  clp$convert_integer_to_rjstring (maximum_connections, 10, FALSE, ' ', line (34,3), status);
                IFEND;
                clp$convert_integer_to_rjstring (appl_entry_p^.number_of_active_connections, 10, FALSE,
                      ' ', line (44,3), status);
                IF NOT status.normal THEN
                  EXIT /display_jobs/;
                IFEND;
                line (53,7) := application_kinds[appl_entry_p^.application_kind];
                clp$put_display (display_control, line, clc$trim, status);
                IF NOT status.normal THEN
                  EXIT /display_jobs/;
                IFEND;
              IFEND;
              application_name_displayed_p^[appl_name_index] := TRUE;
              line (1,*) := '   ';
              IF application_name_list[appl_name_index] <> 'ALL' THEN
                EXIT /display_applications/;
              IFEND;
            IFEND;
            appl_entry_p := appl_entry_p^.next_entry;
          UNTIL appl_entry_p = NIL;
        FOREND;
      IFEND;
    WHILEND /display_jobs/;

    IF current_entry_p <> NIL THEN
      current_entry_p^.lock := tmv$null_global_task_id;
    IFEND;

    IF status.normal AND (application_name_list[appl_name_index] <> 'ALL') THEN
      FOR appl_name_index := LOWERBOUND(application_name_displayed_p^) TO
            UPPERBOUND(application_name_displayed_p^) DO
        IF NOT application_name_displayed_p^[appl_name_index] THEN
          IF NOT status.normal THEN
            display_status_message (status, display_control, local_status);
            IF NOT local_status.normal THEN
              status := local_status;
              RETURN;
            IFEND;
          IFEND;
          osp$set_status_abnormal (rfc$product_id, rfe$appl_not_defined,
                application_name_list[appl_name_index], status);
        IFEND;
      FOREND;
    IFEND;

  PROCEND rfp$display_active_appl_r3;
?? TITLE := '    rfp$display_rhfam_clients', EJECT ??
  PROCEDURE [XDCL, #GATE] rfp$display_rhfam_clients (
    client_list: ARRAY [1 .. *] OF rft$application_name;
    VAR display_control: clt$display_control;
    VAR status: ost$status);

*copyc rfh$display_rhfam_clients_r3

    VAR
      client_list_index: INTEGER,
      line: string (72),
      client_displayed_p: ^ARRAY[1 .. *] OF BOOLEAN,
      client_table_p: ^rft$rhfam_client_table_entry,
      local_status: ost$status;

    status.normal := TRUE;
    local_status.normal := TRUE;

    PUSH client_displayed_p: [1 .. UPPERBOUND(client_list)];

    FOR client_list_index := LOWERBOUND(client_list) TO UPPERBOUND(client_list) DO
      client_displayed_p^[client_list_index] := FALSE;
    FOREND;

    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (1,*) := '   ';
    line (10,*) := 'RHFAM CLIENT DEFINITIONS';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (10,*) := 'MAXIMUM    RESERVED  CLIENT';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (3,*) := 'NAME   CONNECTS   CONNECTS  STATUS';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /main_program/
    BEGIN

      rfp$lock_table (rfv$rhfam_client_table.lock);
      client_table_p := rfv$rhfam_client_table.first_entry;
      IF client_table_p = NIL THEN
        clp$put_display (display_control, '    No local clients defined.', clc$trim, status);
          EXIT /main_program/
      ELSE
        FOR client_list_index := LOWERBOUND(client_list) TO UPPERBOUND(client_list) DO
          client_table_p := rfv$rhfam_client_table.first_entry;
        /display_local_clients/
          REPEAT
            IF (client_list[client_list_index] = client_table_p^.client_name) OR
                  (client_list[client_list_index] = 'ALL') THEN
              line (1,*) := '   ';
              line (2, #SIZE(rft$application_name)) := client_table_p^.client_name;
              clp$convert_integer_to_rjstring (client_table_p^.maximum_connections, 10, FALSE, ' ',
                LINE (12,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              clp$convert_integer_to_rjstring (client_table_p^.connections_reserved, 10, FALSE, ' ',
                    LINE (23,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              IF client_table_p^.client_active THEN
                line (31,6) := 'ACTIVE';
              ELSE
                line (31,8) := 'INACTIVE';
              IFEND;
              clp$put_display (display_control, line, clc$trim, status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              client_displayed_p^[client_list_index] := TRUE;
              IF client_list[client_list_index] <> 'ALL' THEN
                EXIT /display_local_clients/;
              IFEND;
            IFEND;
            client_table_p := client_table_p^.next_entry;
          UNTIL client_table_p = NIL;
        FOREND;
      IFEND;

      IF client_list[1] <> 'ALL' THEN
        FOR client_list_index := LOWERBOUND(client_displayed_p^) TO UPPERBOUND(client_displayed_p^) DO
          IF client_displayed_p^[client_list_index] = FALSE THEN
            IF NOT status.normal THEN
              display_status_message (status, display_control, local_status);
              IF NOT local_status.normal THEN
                status := local_status;
                EXIT /main_program/;
              IFEND;
            IFEND;
            osp$set_status_abnormal (rfc$product_id, rfe$appl_not_defined, client_list[client_list_index],
                  status);
          IFEND;
        FOREND;
      IFEND;

    END /main_program/;

    rfp$unlock_table (rfv$rhfam_client_table.lock);

  PROCEND rfp$display_rhfam_clients;
?? TITLE := '    rfp$display_rhfam_servers', EJECT ??
  PROCEDURE [XDCL, #GATE] rfp$display_rhfam_servers (
    server_list: ARRAY [1 .. *] OF rft$application_name;
    VAR display_control: clt$display_control;
    VAR status: ost$status);

*copyc rfh$display_rhfam_servers_r3

    VAR
      server_list_index: INTEGER,
      line: string (72),
      server_displayed_p: ^ARRAY[1 .. *] OF BOOLEAN,
      server_table_p: ^rft$rhfam_server_table_entry,
      local_status: ost$status;

    status.normal := TRUE;
    local_status.normal := TRUE;

    PUSH server_displayed_p: [1 .. UPPERBOUND(server_list)];

    FOR server_list_index := LOWERBOUND(server_list) TO UPPERBOUND(server_list) DO
      server_displayed_p^[server_list_index] := FALSE;
    FOREND;

    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (1,*) := '   ';
    line (10,*) := 'RHFAM SERVER DEFINITIONS';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (10,*) := '  RHFAM-    MAXIMUM    RESERVED   CURRENT   SERVER';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    line (3,*) := 'NAME   INITIATED   CONNECTS   CONNECTS   CONNECTS  STATUS';
    clp$put_display (display_control, line, clc$trim, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    clp$new_display_line (display_control, 2, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /main_program/
    BEGIN

      rfp$lock_table (rfv$rhfam_server_table.lock);
      server_table_p := rfv$rhfam_server_table.first_entry;
      IF server_table_p = NIL THEN
        clp$put_display (display_control, '    No local servers defined.', clc$trim, status);
          EXIT /main_program/
      ELSE
        FOR server_list_index := LOWERBOUND(server_list) TO UPPERBOUND(server_list) DO
          server_table_p := rfv$rhfam_server_table.first_entry;
        /display_local_servers/
          REPEAT
            IF (server_list[server_list_index] = server_table_p^.server_name) OR
                  (server_list[server_list_index] = 'ALL') THEN
              line (1,*) := '   ';
              line (2, #SIZE(rft$application_name)) := server_table_p^.server_name;
              CASE server_table_p^.rhfam_initiated_server OF
              =TRUE=
                line (14,3) := 'YES';
              =FALSE=
                line (14,3) := 'NO';
              CASEND;
              clp$convert_integer_to_rjstring (server_table_p^.maximum_connections, 10, FALSE, ' ',
                LINE (24,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              clp$convert_integer_to_rjstring (server_table_p^.connections_reserved, 10, FALSE, ' ',
                    LINE (35,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              clp$convert_integer_to_rjstring (server_table_p^.current_connections, 10, FALSE, ' ',
                    LINE (46,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              IF server_table_p^.server_active THEN
                line (54,6) := 'ACTIVE';
              ELSE
                line (54,8) := 'INACTIVE';
              IFEND;
              clp$put_display (display_control, line, clc$trim, status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              server_displayed_p^[server_list_index] := TRUE;
              IF server_list[server_list_index] <> 'ALL' THEN
                EXIT /display_local_servers/;
              IFEND;
            IFEND;
            server_table_p := server_table_p^.next_entry;
          UNTIL server_table_p = NIL;
        FOREND;
      IFEND;

      IF server_list[1] <> 'ALL' THEN
        FOR server_list_index := LOWERBOUND(server_displayed_p^) TO UPPERBOUND(server_displayed_p^) DO
          IF server_displayed_p^[server_list_index] = FALSE THEN
            IF NOT status.normal THEN
              display_status_message (status, display_control, local_status);
              IF NOT local_status.normal THEN
                status := local_status;
                EXIT /main_program/;
              IFEND;
            IFEND;
            osp$set_status_abnormal (rfc$product_id, rfe$appl_not_defined, server_list[server_list_index],
                  status);
          IFEND;
        FOREND;
      IFEND;

    END /main_program/;

    rfp$unlock_table (rfv$rhfam_server_table.lock);

  PROCEND rfp$display_rhfam_servers;
?? TITLE := '    rfp$display_rhfam_elements', EJECT ??
  PROCEDURE [XDCL, #GATE] rfp$display_rhfam_elements (element_names: ARRAY[1 .. *] OF rft$component_name;
    display_type: rft$element_display_type;
    display_option: rft$display_option;
    VAR display_control: clt$display_control;
    VAR status: ost$status);

*copyc rfh$display_rhfam_elements

    TYPE
      trunk_info = RECORD
        name: rft$component_name,
        next_trunk: ^trunk_info,
        state: rft$element_state,
        next_nad: ^nad_info,
      RECEND,

      nad_info = RECORD
        name: rft$component_name,
        next_nad: ^nad_info,
        tcu_state: rft$element_state,
        tcu: rfc$min_tcu .. rfc$max_tcu,
      RECEND;

    VAR
      microcode_type: [STATIC, READ, oss$job_paged_literal]
        ARRAY [rft$microcode_types] OF STRING (4):= ['C180',
        'C170', 'VAX', 'IBM', 'C205', 'INET', 'NTN'],
      dump_action: [STATIC, READ, oss$job_paged_literal]
        ARRAY [rft$dump_disposition] OF STRING (7):= ['DISCARD', 'LAST', 'ALL'],
      element_name_index: INTEGER,
      local_nad_index: rft$local_nads,
      remote_nad_index: rft$remote_nads,
      tcu_index: rfc$min_tcu .. rfc$max_tcu,
      legible_time: ost$time,
      line: string (72),
      state_info: [STATIC, READ, oss$job_paged_literal]
        ARRAY [rft$element_state] OF STRING (4):= ['ON', 'OFF', 'DOWN'],
      nad_info_p: ^nad_info,
      first_trunk_info_p,
      trunk_info_p: ^trunk_info;

    status.normal := TRUE;

    IF display_type = rfc$edt_trunks THEN
      rfp$set_display_active ('DISPLAY_TRUNK_STATUS', status);
    ELSE
      rfp$set_display_active ('DISPLAY_NAD_STATUS', status);
    IFEND;
    IF NOT status.normal THEN
      RETURN;
    IFEND;

  /main_program/
    BEGIN

      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        EXIT /main_program/
      IFEND;

      CASE display_type OF
      = rfc$edt_local_nads =
        line (1,*) := '   ';
        IF display_option = rfc$do_brief THEN
          line (17,*) := 'LOCAL NADS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (4,*) := 'NAME                         CHAN  STATUS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        ELSE
          line (31,*) := 'LOCAL NADS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (55,*) := 'LOADS       DUMP';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (6,*) := 'NAME                       CHAN STATUS CONN REQS NO/MX TYPE ACTION';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        IFEND;

      /display_local_nads/
        FOR element_name_index := LOWERBOUND(element_names) TO UPPERBOUND(element_names) DO
          FOR local_nad_index := LOWERBOUND(rfv$status_table.local_nads^) TO
                UPPERBOUND(rfv$status_table.local_nads^) DO
            IF (rfv$status_table.local_nads^[local_nad_index].name = element_names[element_name_index]) OR
                  (element_names[element_name_index] = 'ALL') THEN
              line (1,*) := '   ';
              line (2, #SIZE(rft$component_name)) := rfv$status_table.local_nads^[local_nad_index].name;
              clp$convert_integer_to_rjstring (rfv$status_table.local_nads^[local_nad_index].channel_number,
                    10, FALSE, ' ', line (33,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              line (39,4) :=
                    state_info[rfv$status_table.local_nads^[local_nad_index].current_status.device_status];
              IF display_option <> rfc$do_brief THEN
                clp$convert_integer_to_rjstring (rfv$status_table.local_nads^[local_nad_index].
                      connections_established, 10, FALSE, ' ', LINE (45,4), status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                clp$convert_integer_to_rjstring (rfv$status_table.local_nads^[local_nad_index].
                      requests_posted, 10, FALSE, ' ', LINE (50,3), status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                clp$convert_integer_to_rjstring (rfv$status_table.local_nads^[local_nad_index].
                      maintenance_status.reloads_performed, 10, FALSE, ' ', LINE (54,3), status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                clp$convert_integer_to_rjstring (rfv$status_table.local_nads^[local_nad_index].
                      maintenance_selections.reload_threshold, 10, FALSE, ' ', LINE (57,3), status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                line (57,1) := '/';
                line (61,4) := 'C180';
                line (66,7) := dump_action[rfv$status_table.local_nads^[local_nad_index].
                      maintenance_selections.dump_disposition];
              IFEND;
              clp$put_display (display_control, line, clc$trim, status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              IF element_names[element_name_index] <> 'ALL' THEN
                CYCLE /display_local_nads/;
              IFEND;
            IFEND;
          FOREND;
          IF element_names[element_name_index] = 'ALL' THEN
            EXIT /display_local_nads/;
          IFEND;
          osp$set_status_abnormal (rfc$product_id, rfe$element_not_found, element_names[element_name_index],
                status);
          EXIT /main_program/;
        FOREND /display_local_nads/;

      = rfc$edt_remote_nads =
        IF rfv$status_table.remote_nads = NIL THEN
          clp$put_display (display_control, '    No remote NADs defined.', clc$trim, status);
          EXIT /main_program/
        IFEND;
        line (1,*) := '   ';
        IF display_option = rfc$do_brief THEN
          line (17,*) := 'REMOTE NADS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (4,*) := 'NAME                         ADDR  STATUS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        ELSE
          line (31,*) := 'REMOTE NADS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (46,*) := 'LAST';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (6,*) := 'NAME                       ADDR STATUS CONNECT   TYPE';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        IFEND;

      /display_remote_nads/
        FOR element_name_index := LOWERBOUND(element_names) TO UPPERBOUND(element_names) DO
          FOR remote_nad_index := LOWERBOUND(rfv$status_table.remote_nads^) TO
                UPPERBOUND(rfv$status_table.remote_nads^) DO
            IF (rfv$status_table.remote_nads^[remote_nad_index].name = element_names[element_name_index]) OR
                  (element_names[element_name_index] = 'ALL') THEN
              line (1,*) := '   ';
              line (2, #SIZE(rft$component_name)) := rfv$status_table.remote_nads^[remote_nad_index].name;
              clp$convert_integer_to_rjstring (rfv$status_table.remote_nads^[remote_nad_index].address, 16,
                    FALSE, ' ', line (33,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              line (33,1) := ' ';
              line (39,4) :=
                    state_info[rfv$status_table.remote_nads^[remote_nad_index].current_status.device_status];
              IF display_option <> rfc$do_brief THEN
                pmp$format_compact_time (rfv$status_table.remote_nads^[remote_nad_index].last_connect_time,
                      osc$hms_time, legible_time, status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                line (45,8) := legible_time.hms;
                line (55,4) := microcode_type[rfv$status_table.remote_nads^[remote_nad_index].microcode_type];
              IFEND;
              clp$put_display (display_control, line, clc$trim, status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              IF element_names[element_name_index] <> 'ALL' THEN
                CYCLE /display_remote_nads/;
              IFEND;
            IFEND;
          FOREND;
          IF element_names[element_name_index] = 'ALL' THEN
            EXIT /display_remote_nads/;
          IFEND;
          osp$set_status_abnormal (rfc$product_id, rfe$element_not_found, element_names[element_name_index],
            status);
          EXIT /main_program/;
        FOREND /display_remote_nads/;

      = rfc$edt_trunks =
        line (1,*) := '   ';
        IF display_option = rfc$do_brief THEN
          line (17,*) := 'TRUNKS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (1,*) := '   ';
          line (4,*) := 'NAME                          STATUS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        ELSE
          line (31,*) := 'TRUNKS';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          line (4,*) := 'NAME                              NAD NAME                   TCU STAT';
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/
          IFEND;
        IFEND;

        PUSH first_trunk_info_p;
        first_trunk_info_p^.name := '';
        first_trunk_info_p^.next_trunk := NIL;

        FOR local_nad_index := LOWERBOUND(rfv$status_table.local_nads^) TO
              UPPERBOUND(rfv$status_table.local_nads^) DO
          FOR tcu_index := LOWERBOUND(rfv$status_table.local_nads^[local_nad_index].trunk_control_units) TO
                  UPPERBOUND(rfv$status_table.local_nads^[local_nad_index].trunk_control_units) DO
            IF rfv$status_table.local_nads^[local_nad_index].trunk_control_units[tcu_index] <> '' THEN
              trunk_info_p := first_trunk_info_p;

            /search_local_nad_tcus/
              BEGIN

              /build_local_trunk_list/
                WHILE TRUE DO
                  IF trunk_info_p^.name =
                        rfv$status_table.local_nads^[local_nad_index].trunk_control_units[tcu_index] THEN
                    EXIT /search_local_nad_tcus/;
                  ELSEIF trunk_info_p^.next_trunk = NIL THEN
                    EXIT /build_local_trunk_list/;
                  IFEND;
                  trunk_info_p := trunk_info_p^.next_trunk;
                WHILEND /build_local_trunk_list/;

                IF trunk_info_p^.name <> '' THEN
                  PUSH trunk_info_p^.next_trunk;
                  trunk_info_p := trunk_info_p^.next_trunk;
                IFEND;
                trunk_info_p^.name :=
                      rfv$status_table.local_nads^[local_nad_index].trunk_control_units[tcu_index];
                trunk_info_p^.next_trunk := NIL;
                trunk_info_p^.next_nad := NIL;
                trunk_info_p^.state := rfc$es_down;
              END /search_local_nad_tcus/;

              IF trunk_info_p^.next_nad = NIL THEN
                PUSH trunk_info_p^.next_nad;
                nad_info_p := trunk_info_p^.next_nad;
              ELSE
                nad_info_p := trunk_info_p^.next_nad;
                WHILE nad_info_p^.next_nad <> NIL DO
                  nad_info_p := nad_info_p^.next_nad;
                WHILEND;
                PUSH nad_info_p^.next_nad;
                nad_info_p := nad_info_p^.next_nad;
              IFEND;
              nad_info_p^.name := rfv$status_table.local_nads^[local_nad_index].name;
              nad_info_p^.next_nad := NIL;
              nad_info_p^.tcu := tcu_index;
              nad_info_p^.tcu_state :=
                    rfv$status_table.local_nads^[local_nad_index].current_status.tcu_status[tcu_index];
              IF nad_info_p^.tcu_state = rfc$es_on THEN
                trunk_info_p^.state := rfc$es_on;
              ELSEIF (nad_info_p^.tcu_state = rfc$es_off) and (trunk_info_p^.state <> rfc$es_on) THEN
                trunk_info_p^.state := rfc$es_off;
              IFEND;
            IFEND;
          FOREND;
        FOREND;

        IF rfv$status_table.remote_nads <> NIL THEN
          FOR remote_nad_index := LOWERBOUND(rfv$status_table.remote_nads^) TO
                UPPERBOUND(rfv$status_table.remote_nads^) DO
            FOR tcu_index :=
                  LOWERBOUND(rfv$status_table.remote_nads^[remote_nad_index].trunk_control_units) TO
                  UPPERBOUND(rfv$status_table.remote_nads^[remote_nad_index].trunk_control_units) DO
              IF rfv$status_table.remote_nads^[remote_nad_index].trunk_control_units[tcu_index] <> '' THEN
                trunk_info_p := first_trunk_info_p;

              /search_remote_nad_tcus/
                BEGIN

                /build_remote_trunk_list/
                  WHILE TRUE DO
                    IF trunk_info_p^.name =
                          rfv$status_table.remote_nads^[remote_nad_index].trunk_control_units[tcu_index] THEN
                      EXIT /search_remote_nad_tcus/;
                    ELSEIF trunk_info_p^.next_trunk = NIL THEN
                      EXIT /build_remote_trunk_list/;
                    IFEND;
                    trunk_info_p := trunk_info_p^.next_trunk;
                  WHILEND /build_remote_trunk_list/;

                  IF trunk_info_p^.name <> '' THEN
                    PUSH trunk_info_p^.next_trunk;
                    trunk_info_p := trunk_info_p^.next_trunk;
                  IFEND;
                  trunk_info_p^.name :=
                        rfv$status_table.remote_nads^[remote_nad_index].trunk_control_units[tcu_index];
                  trunk_info_p^.next_trunk := NIL;
                  trunk_info_p^.next_nad := NIL;
                  trunk_info_p^.state := rfc$es_down;
                END /search_remote_nad_tcus/;

                IF trunk_info_p^.next_nad = NIL THEN
                  PUSH trunk_info_p^.next_nad;
                  nad_info_p := trunk_info_p^.next_nad;
                ELSE
                  nad_info_p := trunk_info_p^.next_nad;
                  WHILE nad_info_p^.next_nad <> NIL DO
                    nad_info_p := nad_info_p^.next_nad;
                  WHILEND;
                  PUSH nad_info_p^.next_nad;
                  nad_info_p := nad_info_p^.next_nad;
                IFEND;
                nad_info_p^.name := rfv$status_table.remote_nads^[remote_nad_index].name;
                nad_info_p^.next_nad := NIL;
                nad_info_p^.tcu := tcu_index;
                nad_info_p^.tcu_state :=
                      rfv$status_table.remote_nads^[remote_nad_index].current_status.tcu_status[tcu_index];
                IF nad_info_p^.tcu_state = rfc$es_on THEN
                  trunk_info_p^.state := rfc$es_on;
                ELSEIF (nad_info_p^.tcu_state = rfc$es_off) and (trunk_info_p^.state <> rfc$es_on) THEN
                  trunk_info_p^.state := rfc$es_off;
                IFEND;
              IFEND;
            FOREND;
          FOREND;
        IFEND;

      /display_trunks/
        FOR element_name_index := LOWERBOUND(element_names) TO UPPERBOUND(element_names) DO
          line (1,*) := '   ';
          trunk_info_p := first_trunk_info_p;

          REPEAT
            IF (element_names[element_name_index] = trunk_info_p^.name) OR
                  (element_names[element_name_index] = 'ALL') THEN
              line (2, #SIZE(rft$component_name)) := trunk_info_p^.name;
              IF display_option <> rfc$do_brief THEN
                nad_info_p := trunk_info_p^.next_nad;

                REPEAT
                  line (34,#SIZE(rft$component_name)) := nad_info_p^.name;
                  clp$convert_integer_to_rjstring (nad_info_p^.tcu, 10, FALSE, ' ', LINE (65,2), status);
                  IF NOT status.normal THEN
                    EXIT /main_program/
                  IFEND;
                  line (69,4) := state_info[nad_info_p^.tcu_state];
                  clp$put_display (display_control, line, clc$trim, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/
                  IFEND;
                  line (1,*) := '   ';
                  nad_info_p := nad_info_p^.next_nad;
                UNTIL nad_info_p = NIL;

              ELSE
                line (35,4) := state_info[trunk_info_p^.state];
                clp$put_display (display_control, line, clc$trim, status);
                IF NOT status.normal THEN
                  EXIT /main_program/
                IFEND;
                line (1,*) := '   ';
              IFEND;
              clp$new_display_line (display_control, 2, status);
              IF NOT status.normal THEN
                EXIT /main_program/
              IFEND;
              IF element_names[element_name_index] <> 'ALL' THEN
                CYCLE /display_trunks/;
              IFEND;
            IFEND;
            trunk_info_p := trunk_info_p^.next_trunk;
          UNTIL trunk_info_p = NIL;

          IF element_names[element_name_index] = 'ALL' THEN
            EXIT /display_trunks/;
          IFEND;
          osp$set_status_abnormal (rfc$product_id, rfe$element_not_found, element_names[element_name_index],
                status);
          EXIT /main_program/;
        FOREND /display_trunks/;

      CASEND;

    END /main_program/;

    rfp$clear_display_active;

  PROCEND rfp$display_rhfam_elements;
?? TITLE := '    rfp$display_routing_info_r3', EJECT ??
  PROCEDURE [XDCL, #GATE] rfp$display_routing_info_r3 (physical_id_list: ARRAY [1 .. *]
        OF rft$physical_identifier;
    logical_id_list: ARRAY [1 .. *] OF rft$logical_identifier;
    local_pid_specified: BOOLEAN;
    all_pids_specified: BOOLEAN;
    all_lids_specified: BOOLEAN;
    display_type: rft$routing_display_type;
    VAR input_file_p: ^SEQ(*);
    VAR display_control: clt$display_control;
    VAR status: ost$status);

*copyc rfh$display_routing_info_r3

    VAR
      path_index: rft$paths_per_host,
      lid_index: rft$logical_ids_per_host,
      lid_list_index,
      pid_list_index: INTEGER,
      lid_displayed_p: ^ARRAY[1 .. *] OF BOOLEAN,
      line: string (72),
      local_status: ost$status,
      local_pid_selected,
      remote_pid_selected: BOOLEAN,
      mask_string: STRING (4),
      path_state: rft$element_state,
      local_status_table: rft$status_table,
      remote_host_entry_p: ^rft$remote_host_definition,
      state_reason: string(25),
      state_info: [STATIC, READ, oss$job_paged_literal]
        ARRAY [rft$element_state] OF STRING (4):= ['ON', 'OFF', 'DOWN'];

    status.normal := TRUE;
    local_status.normal := TRUE;

    IF input_file_p <> NIL THEN

      get_installed_configuration (input_file_p, local_status_table, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    ELSE
      CASE display_type OF
      = rfc$rdt_lids =
        rfp$set_display_active( 'DISPLAY_LOGICAL_IDENTIFIER', status);
      = rfc$rdt_paths =
        rfp$set_display_active( 'DISPLAY_PHYSICAL_PATH', status);
      CASEND;
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      local_status_table := rfv$status_table;
    IFEND;

    local_pid_selected := local_pid_specified;
    remote_pid_selected := all_pids_specified;

    FOR pid_list_index := LOWERBOUND(physical_id_list) TO UPPERBOUND(physical_id_list) DO
      IF physical_id_list[pid_list_index] = local_status_table.local_host^.physical_identifier THEN
        local_pid_selected := TRUE;
      ELSEIF physical_id_list[pid_list_index] <> '' THEN
        remote_pid_selected := TRUE;
      IFEND;
    FOREND;

    PUSH lid_displayed_p: [1 .. UPPERBOUND(logical_id_list)];

    FOR lid_list_index := LOWERBOUND(logical_id_list) TO UPPERBOUND(logical_id_list) DO
      lid_displayed_p^[lid_list_index] := FALSE;
    FOREND;

  /main_program/
    BEGIN

      clp$new_display_line (display_control, 2, status);
      IF NOT status.normal THEN
        EXIT /main_program/;
      IFEND;

      line (1,*) := '   ';

      CASE display_type OF
      = rfc$rdt_lids =
        line (16,*) := 'LOGICAL IDENTIFIERS';
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        clp$new_display_line (display_control, 2, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        IF input_file_p = NIL THEN
          line (2,*) := 'PID/                              HOST   STATUS';
        ELSE
          line (2,*) := 'PID/                              HOST';
        IFEND;
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        line (2,*) := '  LIDS                            TYPE';
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        clp$new_display_line (display_control, 2, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;

        IF local_pid_selected THEN
          line (1,*) := '   ';
          line (2,#SIZE(rft$physical_identifier)) := local_status_table.local_host^.physical_identifier;
          line (37,1) := 'L';
          IF input_file_p = NIL THEN
            IF local_status_table.local_host^.disabled THEN
              line (44,3) := 'OFF';
            ELSE
              line (44,2) := 'ON';
            IFEND;
          IFEND;
          clp$put_display (display_control, line, clc$trim, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;

        /display_local_lids/
          FOR lid_list_index := LOWERBOUND(logical_id_list) TO UPPERBOUND(logical_id_list) DO
            FOR lid_index := LOWERBOUND(local_status_table.local_host^.logical_identifiers) TO
                  UPPERBOUND(local_status_table.local_host^.logical_identifiers) DO
              IF (logical_id_list[lid_list_index] =
                    local_status_table.local_host^.logical_identifiers[lid_index].logical_id) OR
                    all_lids_specified THEN
                line (1,*) := '   ';
                line (4,#SIZE(rft$logical_identifier)) := local_status_table.local_host^.
                      logical_identifiers[lid_index].logical_id;
                IF input_file_p = NIL THEN
                  IF local_status_table.local_host^.logical_identifiers[lid_index].disabled THEN
                    line (44,3) := 'OFF';
                  ELSE
                    line (44,2) := 'ON';
                  IFEND;
                IFEND;
                clp$put_display (display_control, line, clc$trim, status);
                IF NOT status.normal THEN
                  EXIT /main_program/;
                IFEND;
                lid_displayed_p^[lid_list_index] := TRUE;
                IF NOT all_lids_specified THEN
                  CYCLE /display_local_lids/;
                IFEND;
              IFEND;
            FOREND;
          FOREND /display_local_lids/;

          clp$new_display_line (display_control, 2, status);
          IF NOT status.normal THEN
            EXIT /main_program/;
          IFEND;
        IFEND;

        IF all_pids_specified OR remote_pid_selected THEN

        /display_remote_pids_lids/
          FOR pid_list_index := LOWERBOUND(physical_id_list) TO UPPERBOUND(physical_id_list) DO
            remote_host_entry_p := local_status_table.remote_hosts;
            IF remote_host_entry_p = NIL THEN
              clp$put_display (display_control, '    No remote hosts defined.', clc$trim, status);
              EXIT /main_program/;
            IFEND;

            REPEAT
              IF all_pids_specified OR
                    (physical_id_list[pid_list_index] = remote_host_entry_p^.physical_identifier)  THEN
                line (1,*) := '   ';
                line (2,#SIZE(rft$physical_identifier)) := remote_host_entry_p^.physical_identifier;
                line (37,1) := 'R';
                IF input_file_p = NIL THEN
                  IF remote_host_entry_p^.disabled THEN
                    line (44,3) := 'OFF';
                  ELSE
                    line (44,2) := 'ON';
                  IFEND;
                IFEND;
                clp$put_display (display_control, line, clc$trim, status);
                IF NOT status.normal THEN
                  EXIT /main_program/;
                IFEND;

              /display_remote_lids/
                FOR lid_list_index := LOWERBOUND(logical_id_list) TO UPPERBOUND(logical_id_list) DO
                  FOR lid_index := LOWERBOUND(remote_host_entry_p^.logical_identifiers) TO
                        UPPERBOUND(remote_host_entry_p^.logical_identifiers) DO
                    IF (logical_id_list[lid_list_index] =
                          remote_host_entry_p^.logical_identifiers[lid_index].logical_id) OR
                          all_lids_specified THEN
                      line (1,*) := '   ';
                      line (4,#SIZE(rft$logical_identifier)) :=
                            remote_host_entry_p^.logical_identifiers[lid_index].logical_id;
                      IF input_file_p = NIL THEN
                        IF remote_host_entry_p^.logical_identifiers[lid_index].disabled THEN
                          line (44,3) := 'OFF';
                        ELSE
                          line (44,2) := 'ON';
                        IFEND;
                      IFEND;
                      clp$put_display (display_control, line, clc$trim, status);
                      IF NOT status.normal THEN
                        EXIT /main_program/;
                      IFEND;
                      lid_displayed_p^[lid_list_index] := TRUE;
                      IF NOT all_lids_specified THEN
                        CYCLE /display_remote_lids/;
                      IFEND;
                    IFEND;
                  FOREND;
                FOREND /display_remote_lids/;

                clp$new_display_line (display_control, 2, status);
                IF NOT status.normal THEN
                  EXIT /main_program/;
                IFEND;
                IF NOT all_pids_specified THEN
                  CYCLE /display_remote_pids_lids/;
                IFEND;
              IFEND;
              remote_host_entry_p := remote_host_entry_p^.next_entry;
            UNTIL remote_host_entry_p = NIL;

            IF all_pids_specified THEN
                EXIT /display_remote_pids_lids/;
            IFEND;
            IF NOT ((physical_id_list[pid_list_index] = local_status_table.local_host^.physical_identifier) OR
                  (physical_id_list[pid_list_index] = '')) THEN
              osp$set_status_abnormal (rfc$product_id, rfe$physical_id_not_found,
                    physical_id_list[pid_list_index], status);
              EXIT /main_program/;
            IFEND;
          FOREND /display_remote_pids_lids/;

        IFEND;

        IF logical_id_list[1] <> '' THEN
          FOR lid_list_index := LOWERBOUND(logical_id_list) TO UPPERBOUND(logical_id_list) DO
            IF lid_displayed_p^[lid_list_index] = FALSE THEN
              IF NOT status.normal THEN
                display_status_message (status, display_control, local_status);
                IF NOT local_status.normal THEN
                  status := local_status;
                  EXIT /main_program/;
                IFEND;
              IFEND;
              osp$set_status_abnormal (rfc$product_id, rfe$logical_id_not_found,
                    logical_id_list[lid_list_index], status);
            IFEND;
          FOREND;
        IFEND;
      = rfc$rdt_paths =
        line (23,*) := 'RHFAM NETWORK PATHS';
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        clp$new_display_line (display_control, 2, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        line (2,*) := 'PID HOST       LNAD LTCU  RTCU RNAD  DEST LOG LOG ACCESS';
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
           EXIT /main_program/;
        IFEND;
        IF input_file_p = NIL THEN
          line (2,*) := '    TYPE  CHAN ADDR 0123  0123 ADDR  DEV  NET NAD  CODE   STATUS';
        ELSE
          line (2,*) := '    TYPE  CHAN ADDR 0123  0123 ADDR  DEV  NET NAD  CODE';
        IFEND;
        clp$put_display (display_control, line, clc$trim, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;
        clp$new_display_line (display_control, 2, status);
        IF NOT status.normal THEN
          EXIT /main_program/;
        IFEND;

        IF local_pid_selected THEN
          line (1,*) := '   ';
          line (2,#SIZE(rft$physical_identifier)) := local_status_table.local_host^.physical_identifier;
          line (8,1) := 'L';
          IF local_status_table.local_host^.associated_paths <> NIL THEN

            FOR path_index := LOWERBOUND(local_status_table.local_host^.associated_paths^) TO
                  UPPERBOUND(local_status_table.local_host^.associated_paths^) DO
              IF input_file_p = NIL THEN
                clp$convert_integer_to_rjstring (local_status_table.local_nads^[local_status_table.
                      local_host^.associated_paths^[path_index].local_nad].channel_number, 10, FALSE, ' ',
                      line (12,3), status);
                IF NOT status.normal THEN
                  EXIT /main_program/;
                IFEND;
              ELSE
                line (13,2) := '**';
              IFEND;
              clp$convert_integer_to_rjstring (local_status_table.local_nads^[local_status_table.
                    local_host^.associated_paths^[path_index].local_nad].address, 16, FALSE, ' ', line (18,3),
                    status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              line (18,1) := ' ';

              rfp$convert_tcu_mask (
                    local_status_table.local_host^.associated_paths^[path_index].local_tcu_mask, mask_string);
              line (22,4) := mask_string;

              rfp$convert_tcu_mask (
                    local_status_table.local_host^.associated_paths^[path_index].remote_tcu_mask,
                    mask_string);
              line (28,4) := mask_string;

              CASE local_status_table.local_host^.associated_paths^[path_index].loopback OF
              = TRUE =
                clp$convert_integer_to_rjstring (local_status_table.local_nads^[local_status_table.
                      local_host^.associated_paths^[path_index].destination_nad].address, 16, FALSE, ' ',
                      line (34,3), status);
              = FALSE =
                clp$convert_integer_to_rjstring (local_status_table.remote_nads^[local_status_table.
                      local_host^.associated_paths^[path_index].remote_nad].address, 16, FALSE, ' ',
                      line (34,3), status);
              CASEND;

              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              line (34,1) := ' ';
              clp$convert_integer_to_rjstring (local_status_table.local_host^.associated_paths^[path_index].
                    destination_device, 10, FALSE,' ', line (40,2), status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              clp$convert_integer_to_rjstring (local_status_table.local_host^.associated_paths^[path_index].
                    logical_network, 16, FALSE,' ', line (44,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              clp$convert_integer_to_rjstring (local_status_table.local_host^.associated_paths^[path_index].
                    logical_nad, 16, FALSE,' ', line (48,3), status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              clp$convert_integer_to_rjstring (local_status_table.local_host^.associated_paths^[path_index].
                    access_code, 16, FALSE,' ', line (52,5), status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              IF input_file_p = NIL THEN
                determine_path_state (local_status_table, local_status_table.local_host^.
                      associated_paths^[path_index], path_state, state_reason);
                line (61,4) := state_info[path_state];
                IF path_state <> rfc$es_on THEN
                  clp$put_display (display_control, line, clc$trim, status);
                  IF NOT status.normal THEN
                    EXIT /main_program/;
                  IFEND;
                  line (1,*) := '            ***PATH UNAVAILABLE - ';
                  line (35,*) := state_reason;
                IFEND;
              IFEND;
              clp$put_display (display_control, line, clc$trim, status);
              IF NOT status.normal THEN
                EXIT /main_program/;
              IFEND;
              line (1,*) := '   ';
            FOREND;

          ELSE
            clp$put_display (display_control, line, clc$trim, status);
            IF NOT status.normal THEN
              EXIT /main_program/;
            IFEND;
          IFEND;
        IFEND;

        IF all_pids_specified OR remote_pid_selected THEN

        /display_remote_pids_paths/
          FOR pid_list_index := LOWERBOUND(physical_id_list) TO UPPERBOUND(physical_id_list) DO
            remote_host_entry_p := local_status_table.remote_hosts;
            IF remote_host_entry_p = NIL THEN
              clp$put_display (display_control, '    No remote hosts defined.', clc$trim, status);
              EXIT /main_program/;
            IFEND;

            REPEAT
              IF all_pids_specified OR
                    (physical_id_list[pid_list_index] = remote_host_entry_p^.physical_identifier) THEN
                line (1,*) := '   ';
                line (2,#SIZE(rft$physical_identifier)) := remote_host_entry_p^.physical_identifier;
                line (8,1) := 'R';
                IF remote_host_entry_p^.associated_paths <> NIL THEN

                  FOR path_index := LOWERBOUND(remote_host_entry_p^.associated_paths^) TO
                        UPPERBOUND(remote_host_entry_p^.associated_paths^) DO
                    IF input_file_p = NIL THEN
                      clp$convert_integer_to_rjstring (local_status_table.local_nads^
                            [remote_host_entry_p^.associated_paths^[path_index].local_nad].channel_number, 10,
                            FALSE, ' ', line (12,3), status);
                      IF NOT status.normal THEN
                        EXIT /main_program/;
                      IFEND;
                    ELSE
                      line (13,2) := '**';
                    IFEND;
                    clp$convert_integer_to_rjstring (local_status_table.local_nads^
                          [remote_host_entry_p^.associated_paths^[path_index].local_nad].address, 16, FALSE,
                          ' ', line (18,3), status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;

                    rfp$convert_tcu_mask (remote_host_entry_p^.associated_paths^[path_index].local_tcu_mask,
                          mask_string);
                    line (22,4) := mask_string;

                    rfp$convert_tcu_mask (remote_host_entry_p^.associated_paths^[path_index].remote_tcu_mask,
                          mask_string);
                    line (28,4) := mask_string;

                    clp$convert_integer_to_rjstring (local_status_table.remote_nads^[remote_host_entry_p^.
                          associated_paths^[path_index].remote_nad].address, 16, FALSE, ' ', line (34,3),
                          status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    clp$convert_integer_to_rjstring (remote_host_entry_p^.associated_paths^[path_index].
                          destination_device, 10, FALSE,' ', line (40,2), status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    clp$convert_integer_to_rjstring (remote_host_entry_p^.associated_paths^[path_index].
                          logical_network, 16, FALSE,' ', line (44,3), status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    clp$convert_integer_to_rjstring (
                          remote_host_entry_p^.associated_paths^[path_index].logical_nad, 16, FALSE,' ',
                          line (48,3), status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    clp$convert_integer_to_rjstring (
                          remote_host_entry_p^.associated_paths^[path_index].access_code, 16, FALSE,' ',
                          line (52,5), status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    IF input_file_p = NIL THEN
                      determine_path_state (local_status_table,
                            remote_host_entry_p^.associated_paths^[path_index], path_state, state_reason);
                      line (61,4) := state_info[path_state];
                      IF path_state <> rfc$es_on THEN
                        clp$put_display (display_control, line, clc$trim, status);
                        IF NOT status.normal THEN
                          EXIT /main_program/;
                        IFEND;
                        line (1,*) := '            ***PATH UNAVAILABLE - ';
                        line (35,*) := state_reason;
                      IFEND;
                    IFEND;
                    clp$put_display (display_control, line, clc$trim, status);
                    IF NOT status.normal THEN
                      EXIT /main_program/;
                    IFEND;
                    line (1,*) := '   ';
                  FOREND;
                ELSE
                  clp$put_display (display_control, line, clc$trim, status);
                  IF NOT status.normal THEN
                   EXIT /main_program/;
                  IFEND;
                IFEND;
                IF NOT all_pids_specified THEN
                  CYCLE /display_remote_pids_paths/;
                IFEND;
              IFEND;
              remote_host_entry_p := remote_host_entry_p^.next_entry;
            UNTIL remote_host_entry_p = NIL;

            IF all_pids_specified THEN
                EXIT /display_remote_pids_paths/;
            IFEND;
            IF NOT ((physical_id_list[pid_list_index] = local_status_table.local_host^.physical_identifier) OR
                  (physical_id_list[pid_list_index] = '')) THEN
              osp$set_status_abnormal (rfc$product_id, rfe$physical_id_not_found,
                    physical_id_list[pid_list_index], status);
              EXIT /main_program/;
            IFEND;
          FOREND /display_remote_pids_paths/;

        IFEND;
      CASEND;

    END /main_program/;

    IF input_file_p = NIL THEN
      rfp$clear_display_active;
    IFEND;

  PROCEND rfp$display_routing_info_r3;
?? TITLE := '    UTILITY SUBROUTINES', EJECT ??
?? NEWTITLE := '      determine_path_state', EJECT ??
  PROCEDURE determine_path_state (local_status_table: rft$status_table;
        path: rft$lcn_path_definition;
        VAR path_state: rft$element_state;
        VAR state_reason: STRING(*));

    VAR
      destination_nad_state: rft$element_state,
      local_tcu_index,
      remote_tcu_index: rfc$min_tcu .. rfc$max_tcu,
      remote_tcu_state: rft$element_state,
      trunk: rft$component_name,
      trunk_state: rft$element_state;

  /scan_path_elements/
    BEGIN

      state_reason := ' ';
      path_state := local_status_table.local_nads^[path.local_nad].current_status.device_status;
      CASE path_state OF
      = rfc$es_down =
        state_reason := 'the local NAD is down.';
        EXIT /scan_path_elements/;
      = rfc$es_off =
        state_reason := 'the local NAD is off.';
      ELSE
        ;
      CASEND;

      CASE path.loopback OF
      = TRUE =
        destination_nad_state :=
               local_status_table.local_nads^[path.destination_nad].current_status.device_status;
      = FALSE =
        destination_nad_state :=
               local_status_table.remote_nads^[path.remote_nad].current_status.device_status;
      CASEND;
      CASE destination_nad_state OF
      = rfc$es_off =
        IF path_state <> rfc$es_off THEN
          state_reason := 'the destination NAD is off.';
          path_state := rfc$es_off;
        IFEND;
      = rfc$es_down =
        state_reason := 'the destination NAD is down.';
        path_state := rfc$es_down;
      = rfc$es_on =
        ;
      CASEND;

      IF path_state <> rfc$es_on THEN
        EXIT /scan_path_elements/;
      IFEND;

      trunk_state := rfc$es_off;
      FOR local_tcu_index := LOWERBOUND(path.local_tcu_mask) TO UPPERBOUND(path.local_tcu_mask) DO
        IF path.local_tcu_mask[local_tcu_index] THEN

          FOR remote_tcu_index := LOWERBOUND(path.remote_tcu_mask) TO UPPERBOUND(path.remote_tcu_mask) DO
            IF path.remote_tcu_mask[remote_tcu_index] THEN
              CASE path.loopback OF
              = TRUE =
                trunk := local_status_table.local_nads^[path.destination_nad].
                      trunk_control_units[remote_tcu_index];
                remote_tcu_state := local_status_table.local_nads^[path.destination_nad].current_status.
                      tcu_status[remote_tcu_index];
              = FALSE =
                trunk :=
                      local_status_table.remote_nads^[path.remote_nad].trunk_control_units[remote_tcu_index];
                remote_tcu_state := local_status_table.remote_nads^[path.remote_nad].current_status.
                      tcu_status[remote_tcu_index];
              CASEND;
              IF trunk =
                    local_status_table.local_nads^[path.local_nad].trunk_control_units[local_tcu_index] THEN
                IF (local_status_table.local_nads^[path.local_nad].current_status.tcu_status[local_tcu_index]
                      = rfc$es_on) AND
                      (remote_tcu_state = rfc$es_on) THEN
                  EXIT /scan_path_elements/;
                ELSEIF NOT ((local_status_table.local_nads^[path.local_nad].current_status.
                      tcu_status[local_tcu_index] = rfc$es_down) OR
                      (remote_tcu_state = rfc$es_down)) THEN
                  trunk_state := rfc$es_down;
                IFEND;
              IFEND;
            IFEND;
          FOREND;

        IFEND;
      FOREND;

      state_reason := 'no trunks available';
      path_state := trunk_state;

    END /scan_path_elements/;

    IF (path_state = rfc$es_on) AND (path.failure_count <> 0) THEN
      path_state := rfc$es_down;
      state_reason := rfv$network_break_rc[path.last_network_break_rc];
    IFEND;

  PROCEND determine_path_state;
?? OLDTITLE, EJECT ??
?? NEWTITLE := '      display_status_message', EJECT ??
  PROCEDURE display_status_message (status_message: ost$status;
    VAR display_control: clt$display_control;
    VAR status: ost$status);

    VAR
      line_counter: ost$status_message_line_count,
      line_count: ^ost$status_message_line_count,
      line_size: ^ost$status_message_line_size,
      message: ^ost$status_message,
      message_level: ost$status_message_level,
      message_width: ost$max_status_message_line,
      message_line: ^string ( * );

    osp$get_message_level (message_level, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    PUSH message;
    RESET message;
    IF display_control.page_width < LOWERVALUE (message_width) THEN
      message_width := LOWERVALUE (message_width);
    ELSEIF display_control.page_width > UPPERVALUE (message_width) THEN
      message_width := UPPERVALUE (message_width);
    ELSE
      message_width := display_control.page_width;
    IFEND;
    osp$format_message (status_message, message_level, message_width, message^,
          status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;
    RESET message;
    NEXT line_count IN message;
    FOR line_counter := 1 TO line_count^ DO
      NEXT line_size IN message;
      NEXT message_line: [line_size^] IN message;
      clp$put_display (display_control, message_line^, clc$no_trim, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
    FOREND;

  PROCEND display_status_message;
?? OLDTITLE, EJECT ??
?? NEWTITLE := '      get_installed_configuration', EJECT ??
  PROCEDURE [INLINE] get_installed_configuration (VAR input_file_p: ^SEQ(*);
    VAR local_status_table: rft$status_table;
    VAR status: ost$status);

    VAR
      i: INTEGER,
      lid_count,
      nad_count,
      path_count,
      remote_host_count: ^INTEGER,
      first_entry: BOOLEAN,
      input_path_entry_p,
      path_entry_p: ^rft$lcn_paths,
      input_local_host_entry_p,
      local_host_entry_p: ^rft$local_host_definition,
      previous_remote_host,
      input_remote_host_entry_p,
      remote_host_entry_p: ^rft$remote_host_definition,
      input_local_nad_table_p,
      local_nad_table_p: ^rft$local_nad_table,
      input_remote_nad_table_p,
      remote_nad_table_p: ^rft$remote_nad_table;

  {   Move the local host definition from the input configuration file into the status_table.

      NEXT  lid_count  IN  input_file_p;
      IF  lid_count = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$required_def_missing, 'local host', status);
        RETURN;
      IFEND;
      NEXT  input_local_host_entry_p : [1..lid_count^]  IN  input_file_p;
      IF  input_local_host_entry_p = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$required_def_missing, 'local host', status);
        RETURN;
      IFEND;
      PUSH  local_host_entry_p : [1..lid_count^];
      IF  local_host_entry_p = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
        RETURN;
      IFEND;
      local_host_entry_p^ := input_local_host_entry_p^;
      local_status_table.local_host := local_host_entry_p;
      NEXT  path_count  IN  input_file_p;
      IF  path_count = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
          'the local host path count is missing', status);
        RETURN;
      IFEND;
      IF  path_count^ <> 0  THEN
        NEXT  input_path_entry_p : [1..path_count^]  IN  input_file_p;
        IF  input_path_entry_p = NIL  THEN
          osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
            'the local host path count is invalid', status);
          RETURN;
        IFEND;
        PUSH  path_entry_p : [1..path_count^];
        IF  path_entry_p = NIL  THEN
          osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
          RETURN;
        IFEND;
        path_entry_p^ := input_path_entry_p^;
        local_status_table.local_host^.associated_paths := path_entry_p;
      ELSE
        local_status_table.local_host^.associated_paths := NIL;
      IFEND;

  { Move the remote host definitions from the input configuration file into the local_status_table.

      NEXT  remote_host_count  IN  input_file_p;
      IF  (remote_host_count = NIL)  OR  (remote_host_count^ = 0) THEN
        local_status_table.remote_hosts := NIL;
      ELSE
        first_entry := TRUE;
        FOR  i := 1  TO  remote_host_count^  DO
          NEXT  lid_count  IN  input_file_p;
          IF  lid_count = NIL  THEN
            osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
                  'the remote host count is missing', status);
            RETURN;
          IFEND;
          NEXT  input_remote_host_entry_p : [1..lid_count^]  IN  input_file_p;
          IF  input_remote_host_entry_p = NIL  THEN
            osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
                  'the remote host count is invalid', status);
            RETURN;
          IFEND;
          PUSH  remote_host_entry_p : [1..lid_count^];
          IF  remote_host_entry_p = NIL  THEN
            osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
            RETURN;
          IFEND;
          remote_host_entry_p^ := input_remote_host_entry_p^;
          remote_host_entry_p^.next_entry := NIL;
          IF  first_entry  THEN
            local_status_table.remote_hosts := remote_host_entry_p;
            first_entry := FALSE;
            previous_remote_host := remote_host_entry_p;
          ELSE
            previous_remote_host^.next_entry := remote_host_entry_p;
            previous_remote_host := remote_host_entry_p;
          IFEND;
          NEXT  path_count  IN  input_file_p;
          IF  path_count = NIL  THEN
            osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
                  'a remote host path count is missing', status);
            RETURN;
          IFEND;
          IF  path_count^ <> 0  THEN
            NEXT  input_path_entry_p : [1..path_count^]  IN  input_file_p;
            IF  input_path_entry_p = NIL  THEN
              osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file,
                    'a remote host path count is invalid', status);
              RETURN;
            IFEND;
            PUSH  path_entry_p : [1..path_count^];
            IF  path_entry_p = NIL  THEN
              osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
              RETURN;
            IFEND;
            path_entry_p^ := input_path_entry_p^;
            remote_host_entry_p^.associated_paths := path_entry_p;
          ELSE
            remote_host_entry_p^.associated_paths := NIL;
          IFEND;
        FOREND;
      IFEND;

  { Move the local nad definitions from the input configuration file into the local_status_table.

      NEXT  nad_count  IN  input_file_p;
      IF  (nad_count = NIL)  OR  (nad_count^ = 0)  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$required_def_missing, 'local NAD', status);
        RETURN;
      IFEND;
      NEXT  input_local_nad_table_p : [1..nad_count^]  IN  input_file_p;
      IF  input_local_nad_table_p = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$required_def_missing, 'local NAD', status);
        RETURN;
      IFEND;
      PUSH  local_nad_table_p : [1..nad_count^];
      IF  local_nad_table_p = NIL  THEN
        osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
        RETURN;
      IFEND;
      local_nad_table_p^ := input_local_nad_table_p^;
      local_status_table.local_nads := local_nad_table_p;

  { Move the remote nad definitions from the input configuration file into the local_status_table.

      NEXT  nad_count  IN  input_file_p;
      IF  (nad_count = NIL)  OR  (nad_count^ = 0)  THEN
        local_status_table.remote_nads := NIL;
      ELSE
        NEXT  input_remote_nad_table_p : [1..nad_count^]  IN  input_file_p;
        IF  input_remote_nad_table_p = NIL  THEN
          osp$set_status_abnormal(rfc$product_id, rfe$invalid_config_file, 'the remote NAD count is missing',
                status);
          RETURN;
        IFEND;
        PUSH remote_nad_table_p : [1..nad_count^];
        IF  remote_nad_table_p = NIL  THEN
          osp$set_status_abnormal(rfc$product_id, rfe$configuration_too_big, '', status);
          RETURN;
        IFEND;
        remote_nad_table_p^ := input_remote_nad_table_p^;
        local_status_table.remote_nads := remote_nad_table_p;
      IFEND;

  PROCEND get_installed_configuration;
?? OLDTITLE ??
?? OLDTITLE ??
?? OLDTITLE ??

MODEND rfm$network_displays;
