*copyc OSD$DEFAULT_PRAGMATS
MODULE IFM$GET_TERM_CONN_ATTRIBUTES;

{ PURPOSE:  For the named file, return the requested attribute values.
{
{  DESIGN:  This ring 3 module simply calls its ring 2 counterpart,
{           iim$get_term_conn_attributes, to get the attribute values
{           from the Local Name Table (LNT) entry for the named file.

?? TITLE := 'MODULE ifm$get_term_conn_attributes' ??

?? PUSH (LISTEXT := ON) ??
*copyc FST$FILE_REFERENCE
*copyc ife$error_codes
*copyc IFK$KEYPOINTS
*copyc IFT$GET_CONNECTION_ATTRIBUTES
*copyc clp$get_ultimate_connection
*copyc IIP$GET_TERM_CONN_ATTRIBUTES
*copyc iiv$interactive_terminated
*copyc OST$STATUS
?? POP ??

*copyc osp$append_status_parameter
*copyc osp$set_status_abnormal

?? NEWTITLE := 'PROCEDURE ifp$get_term_conn_attributes', EJECT ??
*copyc ifh$get_term_conn_attributes

  PROCEDURE [XDCL, #GATE {TS_gate} ] ifp$get_term_conn_attributes
    (terminal_file_name: fst$file_reference;
    VAR term_conn_attributes: ift$get_connection_attributes;
    VAR status: ost$status);

    VAR
      i: integer,
      internal_file_name: amt$local_file_name,
      ultimate_name: amt$local_file_name;

    status.normal := TRUE;

    #KEYPOINT (osk$entry, 0, ifk$get_term_conn_attributes);

    IF STRLENGTH (terminal_file_name) <= osc$max_name_size THEN
      internal_file_name := terminal_file_name;
    ELSE
      osp$set_status_abnormal (ifc$interactive_facility_id,
            ife$file_name_ill_formed, terminal_file_name, status);
      osp$append_status_parameter (osc$status_parameter_delimiter,
        'IFP$GET_TERM_CONN_ATTRIBUTES', status);
      RETURN;
    IFEND;

    clp$get_ultimate_connection (internal_file_name, ultimate_name, status);
    IF NOT status.normal THEN
      return;
    IFEND;

    IF iiv$network_identifier = iic$dsiaf_network THEN
      IF NOT iiv$cdcnet_connection THEN

      { For those attributes which are ignored in dual state 255x connections,
      { replace their keys in term_conn_attributes with ifc$null_connection_attribute.

        FOR i := 1 TO UPPERBOUND (term_conn_attributes) DO
          CASE term_conn_attributes [i].key OF
          = ifc$trans_protocol_mode =
            term_conn_attributes [i].key := ifc$null_connection_attribute;

          ELSE
          { All other attributes will have their values returned.
          CASEND;

        FOREND;
      IFEND;
    IFEND;
    iip$get_term_conn_attributes (ultimate_name, term_conn_attributes, status);

    #KEYPOINT (osk$exit, 0, ifk$get_term_conn_attributes);

  PROCEND ifp$get_term_conn_attributes;

MODEND ifm$get_term_conn_attributes;
