?? RIGHT := 110 ??
?? NEWTITLE := 'NOS/VE Accounting and Validation: Validation Commands' ??
MODULE avm$security_cmds_and_functions;

{ PURPOSE:
{   This module contains the command and function processors used to enforce secure operation.
{
{ DESIGN:
{   The command processors in this module convert the parameter values specified on the command into their
{   internal formats (when necessary) and call the appropriate security program interface.

?? NEWTITLE := 'Global declarations referenced by this module.', EJECT ??
*copyc avp$security_option
*copyc clp$evaluate_parameters
*copyc clp$make_boolean_value
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] avp$$security_option', EJECT ??

{ PURPOSE:
{   This is the function processor for $SECURITY_OPTION.
{
{ DESIGN:
{   AVP$SECURITY_OPTION is called to determine if the option is active.

  PROCEDURE [XDCL] avp$$security_option
    (    parameter_list: clt$parameter_list;
     VAR work_area: ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

{ FUNCTION $security_option (
{   name: key
{       console_operation_only, secure_analysis, security_audit
{     keyend = $required
{   option: key
{       (active, a)
{     keyend = active
{   )

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

  VAR
    pdt: [STATIC, READ, cls$declaration_section] record
      header: clt$pdt_header,
      names: array [1 .. 2] of clt$pdt_parameter_name,
      parameters: array [1 .. 2] of clt$pdt_parameter,
      type1: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 3] of clt$keyword_specification,
      recend,
      type2: record
        header: clt$type_specification_header,
        qualifier: clt$keyword_type_qualifier,
        keyword_specs: array [1 .. 2] of clt$keyword_specification,
        default_value: string (6),
      recend,
    recend := [
    [1,
    [89, 2, 28, 10, 2, 50, 44],
    clc$function, 2, 2, 1, 0, 0, 0, 0, ''], [
    ['NAME                           ',clc$nominal_entry, 1],
    ['OPTION                         ',clc$nominal_entry, 2]],
    [
{ PARAMETER 1
    [1, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 118,
  clc$required_parameter, 0, 0],
{ PARAMETER 2
    [2, clc$normal_usage_entry, clc$non_secure_parameter,
    $clt$parameter_spec_methods[clc$specify_positionally],
    clc$pass_by_value, clc$immediate_evaluation, clc$standard_parameter_checking, 81,
  clc$optional_default_parameter, 0, 6]],
{ PARAMETER 1
    [[1, 0, clc$keyword_type], [3], [
    ['CONSOLE_OPERATION_ONLY         ', clc$nominal_entry, clc$normal_usage_entry, 1],
    ['SECURE_ANALYSIS                ', clc$nominal_entry, clc$normal_usage_entry, 2],
    ['SECURITY_AUDIT                 ', clc$nominal_entry, clc$normal_usage_entry, 3]]
    ],
{ PARAMETER 2
    [[1, 0, clc$keyword_type], [2], [
    ['A                              ', clc$abbreviation_entry, clc$normal_usage_entry, 1],
    ['ACTIVE                         ', clc$nominal_entry, clc$normal_usage_entry, 1]]
    ,
    'active']];

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

    CONST
      p$name = 1,
      p$option = 2;

    VAR
      option_value: boolean,
      pvt: array [1 .. 2] of clt$parameter_value;

    status.normal := TRUE;

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

    avp$security_option (pvt [p$name].value^.keyword_value, option_value, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$make_boolean_value (option_value, clc$true_false_boolean, work_area, result);

  PROCEND avp$$security_option;
?? OLDTITLE ??
MODEND avm$security_cmds_and_functions;

