?? LEFT := 1, RIGHT := 110 ??
?? TITLE := 'NOS/VE Command Processors for NAMVE attribute mgmt.' ??
?? NEWTITLE := '  External Procedures and Variables' ??
MODULE nam$manage_nam_attributes;
{
{ The following command procedures are used to modify and display the
{ nam attributes. This module resides on OSF$JOB_TEMPLATE_2DD library.
{
?? PUSH (LISTEXT := ON) ??
*copyc clt$parameter_list
*copyc nat$nam_attributes
*copyc oss$job_paged_literal
*copyc ost$name
*copyc ost$status
?? POP ??
*copyc clp$evaluate_parameters
*copyc clp$build_standard_title
*copyc clp$convert_integer_to_string
*copyc clp$close_display
*copyc clp$new_display_line
*copyc clp$open_display_reference
*copyc clp$put_partial_display
*copyc clp$put_display
*copyc clp$reset_for_next_display_page
*copyc nap$change_nam_attributes_r3
*copyc nap$get_nam_attributes_r3
*copyc osp$establish_block_exit_hndlr
*copyc osp$disestablish_cond_handler

TYPE
  nam_attributes_set = SET OF nat$nam_attribute_kind;

VAR
  boolean_string: [STATIC, READ, oss$job_paged_literal] array [boolean] of string (5) := ['FALSE', 'TRUE'];

?? TITLE := 'NAP$CHANGE_NAM_ATTRIBUTES', EJECT ??
  PROCEDURE [XDCL, #GATE] nap$change_nam_attributes (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE change_nam_attr_pdt (
{   enable_statistics, es: boolean = $optional
{   maximum_connections, mc: integer 0..4096 = $optional
{   maximum_login_attempts, mla: integer 1..10 = $optional
{   mci_reset_down_threshold, mrdt: any of
{       key
{         none
{       keyend
{       integer 2..100
{     anyend = $optional
{   ica_reset_down_threshold, irdt: any of
{       key
{         none
{       keyend
{       integer 2..100
{     anyend = $optional
{   additional_login_prompts, alp: list of key
{       all
{       (account, a)
{       (family, f)
{       (project, p)
{       none
{     keyend = $optional
{   force_password_prompt, fpp: boolean = $optional
{   tcpip_refresh_interval, tri: integer 10..86400 = $optional
{   tcpip_stale_release_interval, tsri: integer 10..86400 = $optional
{   directory_version, dv: integer 2..3 = $optional
{   display_directory_traffic, ddt: (BY_NAME, ADVANCED) boolean = $optional
{   log_tcpip_routing, ltr: (BY_NAME, ADVANCED) boolean = $optional
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 25] of clt$pdt_parameter_name,
      parameters: array [1 .. 13] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type3: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type4: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type5: record
        header: clt$type_specification_header,
        qualifier: clt$union_type_qualifier,
        type_size_1: clt$type_specification_size,
        element_type_spec_1: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 1] of clt$keyword_specification,
        recend,
        type_size_2: clt$type_specification_size,
        element_type_spec_2: record
          header: clt$type_specification_header,
          qualifier: clt$integer_type_qualifier,
        recend,
      recend,
      type6: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 8] of clt$keyword_specification,
        recend,
      recend,
      type7: record
        header: clt$type_specification_header,
      recend,
      type8: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type9: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type10: record
        header: clt$type_specification_header,
        qualifier: clt$integer_type_qualifier,
      recend,
      type11: record
        header: clt$type_specification_header,
      recend,
      type12: record
        header: clt$type_specification_header,
      recend,
      type13: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [95, 8, 8, 11, 35, 44, 284],
    clc$command, 25, 13, 0, 2, 0, 0, 13, ''], [
    ['ADDITIONAL_LOGIN_PROMPTS       ',clc$nominal_entry, 6],
    ['ALP                            ',clc$abbreviation_entry, 6],
    ['DDT                            ',clc$abbreviation_entry, 11],
    ['DIRECTORY_VERSION              ',clc$nominal_entry, 10],
    ['DISPLAY_DIRECTORY_TRAFFIC      ',clc$nominal_entry, 11],
    ['DV                             ',clc$abbreviation_entry, 10],
    ['ENABLE_STATISTICS              ',clc$nominal_entry, 1],
    ['ES                             ',clc$abbreviation_entry, 1],
    ['FORCE_PASSWORD_PROMPT          ',clc$nominal_entry, 7],
    ['FPP                            ',clc$abbreviation_entry, 7],
    ['ICA_RESET_DOWN_THRESHOLD       ',clc$nominal_entry, 5],
    ['IRDT                           ',clc$abbreviation_entry, 5],
    ['LOG_TCPIP_ROUTING              ',clc$nominal_entry, 12],
    ['LTR                            ',clc$abbreviation_entry, 12],
    ['MAXIMUM_CONNECTIONS            ',clc$nominal_entry, 2],
    ['MAXIMUM_LOGIN_ATTEMPTS         ',clc$nominal_entry, 3],
    ['MC                             ',clc$abbreviation_entry, 2],
    ['MCI_RESET_DOWN_THRESHOLD       ',clc$nominal_entry, 4],
    ['MLA                            ',clc$abbreviation_entry, 3],
    ['MRDT                           ',clc$abbreviation_entry, 4],
    ['STATUS                         ',clc$nominal_entry, 13],
    ['TCPIP_REFRESH_INTERVAL         ',clc$nominal_entry, 8],
    ['TCPIP_STALE_RELEASE_INTERVAL   ',clc$nominal_entry, 9],
    ['TRI                            ',clc$abbreviation_entry, 8],
    ['TSRI                           ',clc$abbreviation_entry, 9]],
    [
{ PARAMETER 1
    [7, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 2
    [15, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 3
    [16, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 4
    [18, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 5
    [11, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 84, clc$optional_parameter,
  0, 0],
{ PARAMETER 6
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 319,
  clc$optional_parameter, 0, 0],
{ PARAMETER 7
    [9, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 8
    [22, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 9
    [23, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 10
    [4, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 20, clc$optional_parameter,
  0, 0],
{ PARAMETER 11
    [5, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 12
    [13, clc$advanced_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 3, clc$optional_parameter, 0
  , 0],
{ PARAMETER 13
    [21, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
  clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$boolean_type]],
{ PARAMETER 2
    [[1, 0, clc$integer_type], [0, 4096, 10]],
{ PARAMETER 3
    [[1, 0, clc$integer_type], [1, 10, 10]],
{ PARAMETER 4
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [2, 100, 10]]
    ],
{ PARAMETER 5
    [[1, 0, clc$union_type], [[clc$integer_type, clc$keyword_type],
    FALSE, 2],
    44, [[1, 0, clc$keyword_type], [1], [
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 1]]
      ],
    20, [[1, 0, clc$integer_type], [2, 100, 10]]
    ],
{ PARAMETER 6
    [[1, 0, clc$list_type], [303, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [8], [
      ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 2],
      ['ACCOUNT                        ', clc$nominal_entry, clc$normal_usage_entry, 2],
      ['ALL                            ', clc$nominal_entry, clc$normal_usage_entry, 1],
      ['F                              ', clc$abbreviation_entry, clc$normal_usage_entry, 3],
      ['FAMILY                         ', clc$nominal_entry, clc$normal_usage_entry, 3],
      ['NONE                           ', clc$nominal_entry, clc$normal_usage_entry, 5],
      ['P                              ', clc$abbreviation_entry, clc$normal_usage_entry, 4],
      ['PROJECT                        ', clc$nominal_entry, clc$normal_usage_entry, 4]]
      ]
    ],
{ PARAMETER 7
    [[1, 0, clc$boolean_type]],
{ PARAMETER 8
    [[1, 0, clc$integer_type], [10, 86400, 10]],
{ PARAMETER 9
    [[1, 0, clc$integer_type], [10, 86400, 10]],
{ PARAMETER 10
    [[1, 0, clc$integer_type], [2, 3, 10]],
{ PARAMETER 11
    [[1, 0, clc$boolean_type]],
{ PARAMETER 12
    [[1, 0, clc$boolean_type]],
{ PARAMETER 13
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$enable_statistics = 1,
      p$maximum_connections = 2,
      p$maximum_login_attempts = 3,
      p$mci_reset_down_threshold = 4,
      p$ica_reset_down_threshold = 5,
      p$additional_login_prompts = 6,
      p$force_password_prompt = 7,
      p$tcpip_refresh_interval = 8,
      p$tcpip_stale_release_interval = 9,
      p$directory_version = 10,
      p$display_directory_traffic = 11,
      p$log_tcpip_routing = 12,
      p$status = 13;

    VAR
      pvt: array [1 .. 13] of clt$parameter_value;

    VAR
      attribute_seq: ^SEQ ( REP nac$max_nam_attributes OF nat$nam_attribute),
      keyword: clt$keyword,
      list_element: ^clt$data_value,
      local_status: ost$status,
      nam_attributes: ^nat$nam_attributes,
      parameter_count: integer,
      prompt_for_account: boolean,
      prompt_for_family: boolean,
      prompt_for_project: boolean;

    status.normal := TRUE;
    parameter_count := 0;
    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH attribute_seq;
    RESET attribute_seq;
    NEXT nam_attributes: [1 .. nac$max_nam_attributes] IN attribute_seq;

    IF pvt [p$enable_statistics].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$enable_statistics_attr;
      nam_attributes^ [parameter_count].enable_statistics := pvt [p$enable_statistics].value^.boolean_value.
            value;
    IFEND;

    IF pvt [p$maximum_connections].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$max_connections_attr;
      nam_attributes^ [parameter_count].maximum_connections := pvt [p$maximum_connections].value^.
            integer_value.value;
    IFEND;

    IF pvt [p$maximum_login_attempts].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$maximum_login_attempts_attr;
      nam_attributes^ [parameter_count].maximum_login_attempts := pvt [p$maximum_login_attempts].value^.
            integer_value.value;
    IFEND;

    IF pvt [p$ica_reset_down_threshold].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$ica_reset_down_thresh_attr;
      IF pvt [p$ica_reset_down_threshold].value^.kind = clc$keyword THEN
        nam_attributes^ [parameter_count].ica_reset_down_threshold := 0;
      ELSE
        nam_attributes^ [parameter_count].ica_reset_down_threshold := pvt [p$ica_reset_down_threshold].value^.
              integer_value.value;
      IFEND;
    IFEND;

    IF pvt [p$mci_reset_down_threshold].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$mci_reset_down_thresh_attr;
      IF pvt [p$mci_reset_down_threshold].value^.kind = clc$keyword THEN
        nam_attributes^ [parameter_count].mci_reset_down_threshold := 0;
      ELSE
        nam_attributes^ [parameter_count].mci_reset_down_threshold := pvt [p$mci_reset_down_threshold].value^.
              integer_value.value;
      IFEND;
    IFEND;

    IF pvt [p$additional_login_prompts].specified THEN
      prompt_for_family := FALSE;
      prompt_for_account := FALSE;
      prompt_for_project := FALSE;

      list_element := pvt [p$additional_login_prompts].value;
      WHILE list_element <> NIL DO
        keyword := list_element^.element_value^.keyword_value;
        IF keyword = 'ALL' THEN
          prompt_for_family := TRUE;
          prompt_for_account := TRUE;
          prompt_for_project := TRUE;
        ELSEIF (keyword = 'FAMILY') THEN
          prompt_for_family := TRUE;
        ELSEIF (keyword = 'ACCOUNT') THEN
          prompt_for_account := TRUE;
        ELSEIF (keyword = 'PROJECT') THEN
          prompt_for_project := TRUE;
        ELSE  { keyword NONE specified
          prompt_for_family := FALSE;
          prompt_for_account := FALSE;
          prompt_for_project := FALSE;
        IFEND;
        list_element := list_element^.link;
      WHILEND;
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$prompt_for_family_name_attr;
      nam_attributes^ [parameter_count].prompt_for_family_name := prompt_for_family;
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$prompt_for_account_attr;
      nam_attributes^ [parameter_count].prompt_for_account := prompt_for_account;
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$prompt_for_project_attr;
      nam_attributes^ [parameter_count].prompt_for_project := prompt_for_project;
    IFEND;

    IF pvt [p$force_password_prompt].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$force_password_prompt_attr;
      nam_attributes^ [parameter_count].force_password_prompt := pvt [p$force_password_prompt].value^.
            boolean_value.value;
    IFEND;

    IF pvt [p$tcpip_refresh_interval].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$tcpip_refresh_interval;
      nam_attributes^ [parameter_count].tcpip_refresh_interval := pvt [p$tcpip_refresh_interval].
            value^.integer_value.value * 1000;
    IFEND;

    IF pvt [p$tcpip_stale_release_interval].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$tcpip_stale_release_intervl;
      nam_attributes^ [parameter_count].tcpip_stale_release_interval := pvt [p$tcpip_stale_release_interval].
            value^.integer_value.value * 1000;
    IFEND;

    IF pvt [p$directory_version].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$directory_version;
      nam_attributes^ [parameter_count].directory_version := pvt [p$directory_version].value^.integer_value.
            value;
    IFEND;

    IF pvt [p$display_directory_traffic].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$display_directory_traffic;
      nam_attributes^ [parameter_count].display_directory_traffic := pvt [p$display_directory_traffic].value^.
            boolean_value.value;
    IFEND;

    IF pvt [p$log_tcpip_routing].specified THEN
      parameter_count := parameter_count + 1;
      nam_attributes^ [parameter_count].kind := nac$log_tcpip_routing;
      nam_attributes^ [parameter_count].log_tcpip_routing := pvt [p$log_tcpip_routing].value^.
            boolean_value.value;
    IFEND;

    IF parameter_count > 0 THEN
      RESET attribute_seq;
      NEXT nam_attributes: [1 .. parameter_count] IN attribute_seq;
      nap$change_nam_attributes_r3 (nam_attributes^,status );
    IFEND;

  PROCEND nap$change_nam_attributes;
?? TITLE := 'nap$display_nam_attributes', EJECT ??
  PROCEDURE [XDCL, #GATE] nap$display_nam_attributes (parameter_list: clt$parameter_list;
    VAR status: ost$status);

{ PROCEDURE display_nam_attr_pdt (
{   display_options, display_option, do: list of key
{       all
{       (enable_statistics, es)
{       (maximum_connections, mc)
{       (current_connections, cc)
{       (maximum_login_attempts, mla)
{       (mci_reset_down_threshold, mrdt)
{       (ica_reset_down_threshold, irdt)
{       (prompt_for_login_account, pfla)
{       (prompt_for_login_family, pflf)
{       (prompt_for_login_project, pflp)
{       (force_password_prompt, fpp)
{       (system_identifier, si)
{       (tcpip_refresh_interval, tri)
{       (tcpip_stale_release_interval, tsri)
{       (directory_version, dv)
{     keyend = all
{   output, o: file = $output
{   status)

?? PUSH (LISTEXT := ON) ??
?? FMT (FORMAT := OFF) ??

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 6] of clt$pdt_parameter_name,
      parameters: array [1 .. 3] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$list_type_qualifier_v2,
        element_type_spec: record
          header: clt$type_specification_header,
          qualifier: clt$keyword_type_qualifier,
          keyword_specs: array [1 .. 29] of clt$keyword_specification,
        recend,
        default_value: string (3),
      recend,
      type2: record
        header: clt$type_specification_header,
        default_value: string (7),
      recend,
      type3: record
        header: clt$type_specification_header,
      recend,
    recend := [
    [1,
    [90, 7, 31, 10, 51, 13, 726],
    clc$command, 6, 3, 0, 0, 0, 0, 3, ''], [
    ['DISPLAY_OPTION                 ',clc$alias_entry, 1],
    ['DISPLAY_OPTIONS                ',clc$nominal_entry, 1],
    ['DO                             ',clc$abbreviation_entry, 1],
    ['O                              ',clc$abbreviation_entry, 2],
    ['OUTPUT                         ',clc$nominal_entry, 2],
    ['STATUS                         ',clc$nominal_entry, 3]],
    [
{ PARAMETER 1
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 1096, clc$optional_default_parameter, 0, 3],
{ PARAMETER 2
    [5, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name, clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_default_parameter, 0, 7],
{ PARAMETER 3
    [6, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_by_name],
    clc$pass_by_reference, clc$immediate_evaluation,
  clc$standard_parameter_checking, 3, clc$optional_parameter, 0, 0]],
{ PARAMETER 1
    [[1, 0, clc$list_type], [1080, 1, clc$max_list_size, 0, FALSE, FALSE],
      [[1, 0, clc$keyword_type], [29], [
      ['ALL                            ', clc$nominal_entry,
  clc$normal_usage_entry, 1],
      ['CC                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 4],
      ['CURRENT_CONNECTIONS            ', clc$nominal_entry,
  clc$normal_usage_entry, 4],
      ['DIRECTORY_VERSION              ', clc$nominal_entry,
  clc$normal_usage_entry, 15],
      ['DV                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 15],
      ['ENABLE_STATISTICS              ', clc$nominal_entry,
  clc$normal_usage_entry, 2],
      ['ES                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 2],
      ['FORCE_PASSWORD_PROMPT          ', clc$nominal_entry,
  clc$normal_usage_entry, 11],
      ['FPP                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 11],
      ['ICA_RESET_DOWN_THRESHOLD       ', clc$nominal_entry,
  clc$normal_usage_entry, 7],
      ['IRDT                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 7],
      ['MAXIMUM_CONNECTIONS            ', clc$nominal_entry,
  clc$normal_usage_entry, 3],
      ['MAXIMUM_LOGIN_ATTEMPTS         ', clc$nominal_entry,
  clc$normal_usage_entry, 5],
      ['MC                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 3],
      ['MCI_RESET_DOWN_THRESHOLD       ', clc$nominal_entry,
  clc$normal_usage_entry, 6],
      ['MLA                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 5],
      ['MRDT                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 6],
      ['PFLA                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 8],
      ['PFLF                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 9],
      ['PFLP                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 10],
      ['PROMPT_FOR_LOGIN_ACCOUNT       ', clc$nominal_entry,
  clc$normal_usage_entry, 8],
      ['PROMPT_FOR_LOGIN_FAMILY        ', clc$nominal_entry,
  clc$normal_usage_entry, 9],
      ['PROMPT_FOR_LOGIN_PROJECT       ', clc$nominal_entry,
  clc$normal_usage_entry, 10],
      ['SI                             ', clc$abbreviation_entry,
  clc$normal_usage_entry, 12],
      ['SYSTEM_IDENTIFIER              ', clc$nominal_entry,
  clc$normal_usage_entry, 12],
      ['TCPIP_REFRESH_INTERVAL         ', clc$nominal_entry,
  clc$normal_usage_entry, 13],
      ['TCPIP_STALE_RELEASE_INTERVAL   ', clc$nominal_entry,
  clc$normal_usage_entry, 14],
      ['TRI                            ', clc$abbreviation_entry,
  clc$normal_usage_entry, 13],
      ['TSRI                           ', clc$abbreviation_entry,
  clc$normal_usage_entry, 14]]
      ]
    ,
    'all'],
{ PARAMETER 2
    [[1, 0, clc$file_type],
    '$output'],
{ PARAMETER 3
    [[1, 0, clc$status_type]]];

?? FMT (FORMAT := ON) ??
?? POP ??

    CONST
      p$display_options = 1,
      p$output = 2,
      p$status = 3;

    VAR
      pvt: array [1 .. 3] of clt$parameter_value;
*copyc clv$display_variables
?? NEWTITLE := 'abort_handler', EJECT ??
  PROCEDURE abort_handler (condition: pmt$condition;
        condition_information: ^pmt$condition_information;
        save_area: ^ost$stack_frame_save_area;
    VAR handler_status: ost$status);

    VAR
      ignore_status: ost$status;

    IF output_open THEN
      clp$close_display (display_control, ignore_status);
      output_open := FALSE;
    IFEND;

  PROCEND abort_handler;
*copyc clp$new_page_procedure
?? TITLE := 'put_subtitle ', EJECT ??

    PROCEDURE put_subtitle (VAR display_control: clt$display_control;
      VAR status: ost$status);

      clv$subtitles_built := FALSE;

    PROCEND put_subtitle;
?? TITLE := 'put_attribute', EJECT ??

  PROCEDURE put_attribute (header: string ( * );
        value: string ( * ));

    CONST
      max_attribute_name_size = 31,
      tab_over = max_attribute_name_size + 3;

    VAR
      edited_header: string (tab_over);

    status.normal := TRUE;
    edited_header := header;
    edited_header (tab_over - 1) := ':';

    clp$put_partial_display (display_control, edited_header, clc$no_trim, amc$start, status);
    IF NOT status.normal THEN
      EXIT nap$display_nam_attributes
    IFEND;
    clp$put_partial_display (display_control, value, clc$trim, amc$terminate, status);
    IF NOT status.normal THEN
      EXIT nap$display_nam_attributes
    IFEND;

  PROCEND put_attribute;
?? OLDTITLE, EJECT ??
      VAR
        attribute: nat$nam_attribute_kind,
        attributes: nam_attributes_set,
        attribute_seq: ^SEQ ( REP nac$max_nam_attributes OF nat$nam_attribute),
        attribute_count: 0 .. nac$max_nam_attributes,
        default_ring_attributes: amt$ring_attributes,
        display_control: clt$display_control,
        i: integer,
        keyword: clt$keyword,
        local_status: ost$status,
        number_string: ost$string,
        requested_attributes: ^nat$nam_attributes,
        output_open: boolean,
        value: ^clt$data_value;

      status.normal := TRUE;
      clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      attributes := $nam_attributes_set [];
      value := pvt [p$display_options].value;

    /get_attributes/
      WHILE value <> NIL DO
        keyword := value^.element_value^.keyword_value;
        IF (keyword = 'ALL') THEN
          attributes := -$nam_attributes_set [];
          EXIT /get_attributes/;
        ELSEIF (keyword = 'ENABLE_STATISTICS') THEN
          attributes := attributes + $nam_attributes_set [nac$enable_statistics_attr];
        ELSEIF (keyword = 'MAXIMUM_CONNECTIONS') THEN
          attributes := attributes + $nam_attributes_set [nac$max_connections_attr];
        ELSEIF (keyword = 'MAXIMUM_LOGIN_ATTEMPTS') THEN
          attributes := attributes + $nam_attributes_set [nac$maximum_login_attempts_attr];
        ELSEIF (keyword = 'MCI_RESET_DOWN_THRESHOLD') THEN
          attributes := attributes + $nam_attributes_set [nac$mci_reset_down_thresh_attr];
        ELSEIF (keyword = 'ICA_RESET_DOWN_THRESHOLD') THEN
          attributes := attributes + $nam_attributes_set [nac$ica_reset_down_thresh_attr];
        ELSEIF (keyword = 'PROMPT_FOR_LOGIN_ACCOUNT') THEN
          attributes := attributes + $nam_attributes_set [nac$prompt_for_account_attr];
        ELSEIF (keyword = 'PROMPT_FOR_LOGIN_FAMILY') THEN
          attributes := attributes + $nam_attributes_set [nac$prompt_for_family_name_attr];
        ELSEIF (keyword = 'PROMPT_FOR_LOGIN_PROJECT') THEN
          attributes := attributes + $nam_attributes_set [nac$prompt_for_project_attr];
        ELSEIF (keyword = 'CURRENT_CONNECTIONS') THEN
          attributes := attributes + $nam_attributes_set [nac$current_connections_status];
        ELSEIF (keyword = 'FORCE_PASSWORD_PROMPT') THEN
          attributes := attributes + $nam_attributes_set [nac$force_password_prompt_attr];
        ELSEIF (keyword = 'SYSTEM_IDENTIFIER') THEN
          attributes := attributes + $nam_attributes_set [nac$system_identifier_attr];
        ELSEIF (keyword = 'TCPIP_REFRESH_INTERVAL') THEN
          attributes := attributes + $nam_attributes_set [nac$tcpip_refresh_interval];
        ELSEIF (keyword = 'TCPIP_STALE_RELEASE_INTERVAL') THEN
          attributes := attributes + $nam_attributes_set [nac$tcpip_stale_release_intervl];
        ELSEIF (keyword = 'DIRECTORY_VERSION') THEN
          attributes := attributes + $nam_attributes_set [nac$directory_version];
        IFEND;
        value := value^.link;
      WHILEND /get_attributes/;

      output_open := FALSE;
      default_ring_attributes.r1 := #RING (^default_ring_attributes);
      default_ring_attributes.r2 := #RING (^default_ring_attributes);
      default_ring_attributes.r3 := #RING (^default_ring_attributes);

      osp$establish_block_exit_hndlr (^abort_handler);
      clp$open_display_reference (pvt [p$output].value^.file_value^, ^clp$new_page_procedure, fsc$list,
            default_ring_attributes, display_control, status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;
      output_open := TRUE;
      clv$titles_built := FALSE;
      clv$command_name := 'display_nam_attributes';
      IF display_control.page_width < clc$narrow_page_width THEN
        clv$page_width := clc$narrow_page_width;
      ELSEIF display_control.page_width > clc$wide_page_width THEN
        clv$page_width := clc$wide_page_width;
      ELSE
        clv$page_width := display_control.page_width;
      IFEND;

      PUSH attribute_seq;
      RESET attribute_seq;
      NEXT requested_attributes: [1 .. nac$max_nam_attributes] IN attribute_seq;
      attribute_count := 0;
      FOR attribute := LOWERVALUE (attribute) TO UPPERVALUE (attribute) DO
        IF attribute IN attributes THEN
          attribute_count := attribute_count + 1;
          requested_attributes^ [attribute_count].kind := attribute;
        IFEND;
      FOREND;
      RESET attribute_seq;
      NEXT requested_attributes: [1 .. attribute_count] IN attribute_seq;

      nap$get_nam_attributes_r3 (requested_attributes^,status);
      IF NOT status.normal THEN
        RETURN;
      IFEND;

      FOR i := 1 TO attribute_count DO
        CASE requested_attributes^ [i].kind OF
        = nac$enable_statistics_attr =
          put_attribute ('Enable_Statistics', boolean_string [requested_attributes^ [i].enable_statistics]);

        = nac$max_connections_attr =
          clp$convert_integer_to_string (requested_attributes^ [i].maximum_connections,
                10, FALSE, number_string, {ignore} local_status);
          put_attribute ('Maximum_Connections', number_string.value (1, number_string.size));

        = nac$current_connections_status =
          clp$convert_integer_to_string (requested_attributes^ [i].current_connections,
                10, FALSE, number_string, {ignore} local_status);
          put_attribute ('Current_Connections', number_string.value (1, number_string.size));

        = nac$maximum_login_attempts_attr =
          clp$convert_integer_to_string (requested_attributes^ [i].maximum_login_attempts,
                10, FALSE, number_string, {ignore} local_status);
          put_attribute ('Maximum_Login_Attempts', number_string.value (1, number_string.size));

        = nac$mci_reset_down_thresh_attr =
          IF requested_attributes^ [i].mci_reset_down_threshold = 0 THEN
            put_attribute ('MCI_Reset_Down_Threshold', 'None');
          ELSE
            clp$convert_integer_to_string (requested_attributes^ [i].mci_reset_down_threshold,
                  10, FALSE, number_string, {ignore} local_status);
            put_attribute ('MCI_Reset_Down_Threshold', number_string.value (1, number_string.size));
          IFEND;

        = nac$ica_reset_down_thresh_attr =
          IF requested_attributes^ [i].ica_reset_down_threshold = 0 THEN
            put_attribute ('ICA_Reset_Down_Threshold', 'None');
          ELSE
            clp$convert_integer_to_string (requested_attributes^ [i].ica_reset_down_threshold,
                  10, FALSE, number_string, {ignore} local_status);
            put_attribute ('ICA_Reset_Down_Threshold', number_string.value (1, number_string.size));
          IFEND;

        = nac$prompt_for_account_attr =
          put_attribute ('Prompt_For_Login_Account', boolean_string
                [requested_attributes^ [i].prompt_for_account]);

        = nac$prompt_for_family_name_attr =
          put_attribute ('Prompt_For_Login_Family', boolean_string
                [requested_attributes^ [i].prompt_for_family_name]);

        = nac$prompt_for_project_attr =
          put_attribute ('Prompt_For_Login_Project', boolean_string
                [requested_attributes^ [i].prompt_for_project]);

        = nac$force_password_prompt_attr =
          put_attribute ('Force_password_prompt', boolean_string
                [requested_attributes^ [i].force_password_prompt]);

        = nac$system_identifier_attr =
          clp$convert_integer_to_string (requested_attributes^ [i].system_id, 16, TRUE, number_string,
                {ignore} local_status);
          put_attribute ('System_identifier', number_string.value (1, number_string.size));

        = nac$tcpip_refresh_interval =
          clp$convert_integer_to_string (requested_attributes^ [i].tcpip_refresh_interval DIV 1000,
                10, FALSE, number_string, {ignore} local_status);
          put_attribute ('TCPIP_Refresh_Interval', number_string.value (1, number_string.size));

        = nac$tcpip_stale_release_intervl =
          clp$convert_integer_to_string (requested_attributes^ [i].tcpip_stale_release_interval DIV 1000,
                10, FALSE, number_string, {ignore} local_status);
          put_attribute ('TCPIP_Stale_Release_Interval', number_string.value (1, number_string.size));

        = nac$directory_version =
          clp$convert_integer_to_string (requested_attributes^ [i].directory_version, 10, FALSE,
                number_string, {ignore} local_status);
          put_attribute ('Directory_version', number_string.value (1, number_string.size));

        ELSE
        CASEND;
      FOREND;

      IF output_open THEN
        clp$close_display (display_control, status);
        output_open := FALSE;
      IFEND;

      osp$disestablish_cond_handler;

  PROCEND nap$display_nam_attributes;

MODEND nam$manage_nam_attributes;
