Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - t20/nmlt20/nmlprm.bli
There are 2 other files named nmlprm.bli in the archive. Click here to see a list.
! UPD ID= 297, SNARK:<6.1.NML>NMLPRM.BLI.3,  23-Apr-85 16:14:55 by GLINDELL
!  Fix bug in SEARCH_PARAMETER.  NML would loop forever if the parameter table
!  had an odd number of entries, and the parameter searched for was not in the
!  table.
!
! UPD ID= 41, SNARK:<6.1.NML>NMLPRM.BLI.2,  24-May-84 16:31:39 by GLINDELL
! DSKT:[10,6026,NML703]NMLPRM.BLI 16-Mar-84 09:50:32, Edit by DAVENPORT
!
! Move tables to the high segment.
!
! PH4:<GLINDELL>NMLPRM.BLI.10 15-Nov-83 16:06:16, Edit by GLINDELL
!
! Ident 34
!  Support CME 'coded multiple event' format.
!
!<MCINTEE.WORK>NMLPRM.BLI.2, 22-Jun-83 14:25:18, Edit by MCINTEE
!
! Ident 33.
!
!  Fix all routines to deal with entity types containing subentity type.
!
!  Remove routines NML$STATUS, NML$INFORMATION, NML$SUMMARY. They
!  have been superseded by NML$INFORMATION.
!
!  Fix table storage macros to allow an applicability restriction to
!  be a list, (instead of just A,E,R,S, or Q) and to use the second
!  entry of a list that begins with Q as the qualifier parameter number.
!
! PH4:<PECKHAM>NMLPRM.BLI.10 16-Jun-83 12:58:21, Edit by PECKHAM
!
! Ident 32.
!  Add password (P) applicability flag.  Shuffle the flag bits around.
!  Combine PDB_ADJACENT_ONLY, PDB_REMOTE_ONLY, and PDB_SINK_ONLY flags
!  in PDB_OTHER_NODES as one bit, logically ORed, and use appropriately
!  in NML$EXECUTOR_ONLY.  The logical OR is accomplished by equivalencing
!  PDB_APPLICABLE_(A,R,S) to the same bit.
!
! PH4:<PECKHAM>NMLPRM.BLI.2 15-Jun-83 09:03:25, Edit by PECKHAM
!
! Ident 31.
!  In $$NML_ENTRY_PARSING conditionalize text data on existence
!  of corresponding field declarations, so that exclusion from the
!  MCB version is controlled in one place (the field definition).
!
! PH4:<PECKHAM>NMLPRM.BLI.2 14-Jun-83 09:22:26, Edit by PECKHAM
!
! Ident 30.
!  Fix NML$PARAMETER_DATA_SKIP to call EXTRACT_PARAMETER_DATA with
!  the right number of arguments!
!
! PH4:<PECKHAM>NMLPRM.BLI.3 10-Jun-83 08:33:42, Edit by PECKHAM
!
! Ident 29.
!  Modify EXTRACT_PARAMETER_DATA to allow it to be told to just skip
!  over the parameter data field without extracting it.
!
!  Add routine NML$PARAMETER_SKIP to skip over a parameter.
!
!  Add routines NML$ENTITY_DATA, NML$ENTITY_DATA_SKIP,  and
!  EXTRACT_ENTITY_DATA, patterned after the PARAMETER routines.
!
!<MCINTEE>NMLPRM.BLI.19,  7-Jun-83 15:34:09, Edit by MCINTEE
!
! Ident 28.
!  Change $$$NML_TYPE to handle more CMx types and added more diagnostics
!
! PH4:<PECKHAM>NMLPRM.BLI.40 27-May-83 13:26:28, Edit by PECKHAM
!
! Ident 27.
! NML$PARAMETER_DATA was broken when PDB_DATA_FORMAT was redefined to
! to be applicable only on CM-n formats.  This fix involves removing
! the check on PDB_DATA_FORMAT, and making sure the return codes in
! NML$PARAMETER_DATA and EXTRACT_PARAMETER_DATA are consistent.
!
! Allow RO to appear in layer ownership parameter of $$NML_ENTRY_PARSING.
!
! Build tables with multiple version support:
!   Merge PDB_DATA_FORMAT into PDB_DATA_TYPE to make space.
!   Add PDB_VERSION field with version selection bits.
!
! Temporary: In SEARCH_PARAMETER_TABLE add version selection based on
!            NMLVER for present.
!
! Restructure entity tables to be driven by NMARCH macro $NML$ENTITY_SET.
!
! Move coded text mapping tables into parameter tables.
!
! PH4:<PECKHAM>NMLPRM.BLI.15 17-May-83 13:14:27, Edit by PECKHAM
!
! Ident 26.
! NMARCH definitions changed to strongly resemble the Network Management
! specification during Phase IV update.  This changed $$NML_ENTRY_PARSING
! fields.
!
! Add routine NML$INFORMATION for use by external modules.  This supplies
! information type tests (C,S,*,EV,Q), and supplied a way to check if a
! parameter was a qualifier.
!
! Add routine NML$UPPER_CASE to test if parameter text should be converted
! to upper case before sending it over the wire (needed by NCPCEX).
!
! Replace global routine NML$PARAMETER_LOOKUP with local GET_PEB_ADDRESS.
! All external references from other modules have been removed and replaced
! by calls to routines which hide the data base structure.
!
! Replace NML$GET_PDB_DATA_TYPE with NML$DATA_TYPE.  The new routine
! returns an altered value if DATA TYPE is CM-n.  This value contains the
! data format value in bits 0-5, instead of the number of fields.  Thus,
! the various forms of CM-n can be more easily identified and dealt with.
!
! NET:<PECKHAM.DEVELOPMENT>NMLPRM.BLI.3 10-Dec-82 23:23:25, Edit by PECKHAM
!
! Ident 25.
! Solve bug of mis-interpreting event entity -1 => autotriggering.
! Also responds to upward compatability problem with Phase IV nodes.
!
!  Change $$NML_CODE_ENTRY to create plit instead of uplit of code text ptrs.
!  Fix NML$CODED_TEXT to range check supplied code using this plit count.
!
! NET:<PECKHAM.DEVELOPMENT>NMLPRM.BLI.2  4-Jun-82 16:26:23, Edit by PECKHAM
!
! Ident 24.
! Add NML$READ_ONLY routine for recognizing read-only parameters.
!
! NET:<VOBA.NML.DEVELOPMENT>NMLPRM.BLI.6 25-Mar-82 17:41:13, Edit by VOBA
!
! Ident 23.
! Fix EXTRACT_PARAMETER_DATA routine to parse CM2 type data correctly, i.e.
! return the pointer to the data segment of 4 bytes and the length is 4.
!
! NET:<VOBA.NML.DEVELOPMENT>NMLPRM.BLI.2 16-Mar-82 08:23:07, Edit by VOBA
!
! Ident 22.
! Fix typo bug in EXTRACT_PARAMETER_DATA routine.
!
! <VOBA.NML.DEVELOPMENT>NMLPRM.BLI.2 15-Mar-82 17:04:46, Edit by VOBA
!
! Ident 21.
! Fix EXTRACT_PARAMETER_DATA to recognize KNOWN qualifiers in NICE message
! format.
!
! NET:<VOBA.NML.DEVELOPMENT>NMLPRM.BLI.3  1-Mar-82 14:45:44, Edit by VOBA
!
! Ident 20.
! Assign HI a distinct value different from HI.
!
! NET:<PECKHAM.DEVELOPMENT>NMLPRM.BLI.3 26-Feb-82 10:32:29, Edit by PECKHAM
!
! Ident 19.
! Move the table expansion macros back from NMARCH.
!
! NET:<VOBA.NML.DEVELOPMENT>NMLPRM.BLI.8 22-Feb-82 10:29:33, Edit by VOBA
!
! Ident 18.
! Move macro definitions of NICE parameter tables to NMARCH.REQ so that
! they can be referenced by other modules of NML. The static table storage
! definition is still maintained by NMLPRM module.
!
! NET:<VOBA.NML.DEVELOPMENT>NMLPRM.BLI.30 17-Feb-82 15:04:11, Edit by VOBA
!
! Ident 17.
! Reconstruct Parameter Data Block structure so that each entry will take 2
! words both in the TOPS and MCB. Instead of having the addresses of the
! parsing routines in the each entry, a data format fode is stored and later
! examined by a single parsing routine in each major module. Also added 2 new
! fields for the MODULE parameters - QUALIFIED and QUALIFIER - to the data
! structure.
! Changed the orders of the parameters supplied to the macros defining the NICE
! parameters so that they resemble the order described in the architecture spec
! tables.
!
! Combined all 3 separate tables for MODULE entity into one. Changes of MODULE
! X25-ACCESS parameter numbers are made to the new table. Final decision for
! modifying the architecture spec to reflect this change is being solicitted.
!
! Changed local routine GET_PEB_ADDRESS to be global routine NL_PLU (alias
! NML$PARAMETER_LOOKUP) so it can be referenced from other modules.
!
! Modified the code which is used to extract data from NICE message. Changed
! from specific algorithm extracting the data based on the entity type to a
! generic algorithm extracting data based on each parameter's data format
! regardless of parameter number and/or entity type. Added local routine
! EXTRACT_PARAMETER_DATA for this function.
!
! NET:<PECKHAM.DEVELOPMENT>NMLPRM.BLI.2  7-Feb-82 15:39:02, Edit by PECKHAM
!
! Ident 16.
! Fix parameter numbers in $NML$LINE_CODES missed by #14.
!
! NET:<GUNN.DEVELOPMENT>NMLPRM.BLI.2 22-Jan-82 09:48:59, Edit by GUNN
!
! Ident 15.
! Update copyright date to 1982.
! Set info type for HOST parameter 141 (WO) so SHOW command
! will display it.
!
! NET:<GUNN.DEVELOPMENT>NMLPRM.BLI.7  5-Jan-82 17:35:29, Edit by GUNN
!
! Ident 14.
! Add data type for NODE parameter #101 (MANAGEMENT VERSION) to PVB
! table.
!
! Update parameter tables to reflect Version 3.0.0 of Network
! Management Architecture Specification.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.4  4-Jun-81 08:45:25, Edit by GUNN
!
! Ident 13.
! Change LINE and CIRCUIT state parameters to be owned by NML.
! Put X25 and coded parameter text tables under conditional.
! Remove external reference to NMU$MEMORY_MANAGER and NMU$TEXT_MANAGER.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.9 13-May-81 09:18:39, Edit by GUNN
!
! Ident 12.
! Change text for parameter #110 to SERVICE CIRCUIT.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.7 12-May-81 13:44:48, Edit by VOBA
!
! Ident 11.
! Add data definitions for X.25 Modules (Access, Protocol, and Server).
! 
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.6 11-May-81 10:46:42, Edit by GUNN
!
! Ident 10.
! Change text for coded NODE parameter values to agree with keywords
! coded in NCP3TB.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.4  7-May-81 15:19:50, Edit by GUNN
!
! Fix logic in NML$EXECUTOR_ONLY.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.3  7-May-81 13:45:42, Edit by GUNN
!
! Fix definition of PDB structure, had invalid use of $SUB_BLOCK.
! Make SETTABILITY, APPLICABILITY, and INFO_TYPE fields part of PDB
! structure. 
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.17 16-Apr-81 15:55:38, Edit by GUNN
!
! Add tables and routines to support conversion of coded parameter
! values to text.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.5 10-Apr-81 10:33:37, Edit by GUNN
!
! Fix case of the missing dot "." on reference to PTR_ADR in the
! D_field-type routines.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.4  9-Apr-81 18:11:53, Edit by GUNN
!
! Change D_8BYTE routine to return a pointer to the Hexadecimal string.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.3  3-Apr-81 14:07:44, Edit by GUNN
!
! Change D_NODEID to return pointer rather than value.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.15 29-Mar-81 22:13:35, Edit by GUNN
!
! Update IDENT edit number.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.12 12-Mar-81 10:37:14, Edit by GUNN
!
! Add code to extract parameter data and return length.
!
! NET:<DECNET20-V3P1.NML>NMLPRM.BLI.86  5-Mar-81 12:25:56, Edit by GUNN
!
! Make compilation of NML$PARAMETER_TEXT routine be dependent on system
! type. Only required by NCP.
!
%title 'NMLPRM -- Table Lookup Entity Parameters'
module NMLPRM	(
                 ident = 'X03.34'
                 ) =
begin

!                    COPYRIGHT (c) 1981, 1982 BY
!           DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
!
! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH  LICENSE AND WITH THE
! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR  ANY  OTHER
! COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
! TRANSFERRED.
!
! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE  WITHOUT  NOTICE
! AND  SHOULD  NOT  BE  CONSTRUED  AS  A COMMITMENT BY DIGITAL EQUIPMENT
! CORPORATION.
!
! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF  ITS
! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
!

!++
! FACILITY:	DECnet-10/20 V3.0 Network Management Layer (NML)
!
! ABSTRACT:
!
!	Provides the table lookup function for Network Management 
!       entity parameters, and provides automatic table generation.
!
! ENVIRONMENT:	TOPS-10/20 & MCB/RSX11 User mode under NML
!
! AUTHOR: Dale C. Gunn , CREATION DATE:  5-Jan-81
!
! MODIFIED BY:
!
!	, : VERSION
! 01	-
!--
!
! INCLUDE FILES:
!

library 'NMLLIB';                       ! All required definitions

!
! TABLE OF CONTENTS
!

forward routine
        %if not $MCB %then              ! Text not included or required in MCB
        NML$PARAMETER_TEXT,		! Return parameter name text pointer
        NML$CODED_TEXT,			! Return name for coded parameter value
        %fi
        NML$EXECUTOR_ONLY,              ! Check for applicability
	NML$VALID_PARAMETER,            ! Determine if a parameter is valid
        NML$CLEARABLE,                  ! Determine if parameter can be cleared
        NML$UPPER_CASE,                 ! Determine if parameter must be upper case
        NML$INFORMATION,                ! Check information type applicability
        NML$READ_ONLY,			! Determine if parameter is read-only
        NML$VDB_PARAMETER,              ! Determine if parameter belongs to NML
        NML$DATA_TYPE,                  ! Return data type/format
        NML$ENTITY_DATA,                ! Return data for entity
        NML$ENTITY_DATA_SKIP,           ! Skip over data for entity
        NML$PARAMETER_DATA,             ! Return data for parameter
        NML$PARAMETER_DATA_SKIP,        ! Skip over data for parameter
        EXTRACT_ENTITY_DATA,            ! Extract entity data field
        EXTRACT_PARAMETER_DATA,         ! Extract parameter data field
        GET_PEB_ADDRESS,                ! Find entry in data vector
        SEARCH_PARAMETER_TABLE; 	! Searches a parameter table 
%sbttl 'TOPS-10/20 Parameter Data Block Entry Format'

! 35                26                17                 8               0
! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------------+-----------------+
! | | | | | | | | | | | | | | | | | | |  PDB_DATA_TYPE  |   PDB_VERSION   |
! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------------+-----------------+
!  | | | | | | | | | | | | | | | | | |
!  | | | | | | | | | | | | | | | | | +- PDB_NML_PARAMETER
!  | | | | | | | | | | | | | | | | +--- PDB_PASSWORD
!  | | | | | | | | | | | | | | | +----- PDB_UPPER_CASE
!  | | | | | | | | | | | | | | +------- PDB_READ_ONLY
!  | | | | | | | | | | | | | +--------- PDB_WRITE_ONLY
!  | | | | | | | | | | | | +----------- PDB_LOOP_ONLY
!  | | | | | | | | | | | +------------- PDB_CLEARABLE
!  | | | | | | | | | | +--------------- PDB_QUALIFIED
!  | | | | | | | | | +----------------- (unused)
!  | | | | | | | | |
!  | | | | | | | | +------------------- PDB_CHARACTERISTIC
!  | | | | | | | +--------------------- PDB_STATUS
!  | | | | | | +----------------------- PDB_SUMMARY
!  | | | | | +------------------------- PDB_EVENTS
!  | | | | +--------------------------- PDB_QUALIFIER
!  | | | +----------------------------- PDB_EXECUTOR
!  | | +------------------------------- PDB_OTHER_NODES
!  | +--------------------------------- (unused)
!  +----------------------------------- PDB_CODE_TEXT
!
! 35                                                                     0
! +-----------------------------------------------------------------------+
! | PDB_NAME                                                              |
! +-----------------------------------------------------------------------+
!
! 35                                                                     0
! +-----------------------------------+-----------------------------------+
! |           PDB_CODE_CNT            |            PDB_CODE_ADR           |
! +-----------------------------------+-----------------------------------+
!
! 35                                                                     0
! +-----------------------------------+-----------------------------------+
! |         PDB_QUALIFIER_CNT         |          PDB_QUALIFIER_ADR        |
! +-----------------------------------+-----------------------------------+
!
%sbttl 'MCB Parameter Data Block Entry Format'

! 15               7             0
! +---------------+---------------+
! | PDB_DATA_TYPE |  PDB_VERSION  |
! +---------------+---------------+
!
! 15               7             0
! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
! | | | | | | | | | | | | | | | | |
! +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!  | | | | | | | | | | | | | | | |
!  | | | | | | | | | | | | | | | +- PDB_NML_PARAMETER
!  | | | | | | | | | | | | | | +--- PDB_PASSWORD
!  | | | | | | | | | | | | | +----- PDB_UPPER_CASE
!  | | | | | | | | | | | | +------- PDB_READ_ONLY
!  | | | | | | | | | | | +--------- PDB_WRITE_ONLY
!  | | | | | | | | | | +----------- PDB_LOOP_ONLY
!  | | | | | | | | | +------------- PDB_CLEARABLE
!  | | | | | | | | +--------------- PDB_QUALIFIED
!  | | | | | | | |
!  | | | | | | | +----------------- PDB_CHARACTERISTIC
!  | | | | | | +------------------- PDB_STATUS
!  | | | | | +--------------------- PDB_SUMMARY
!  | | | | +----------------------- PDB_EVENTS
!  | | | +------------------------- PDB_QUALIFIER
!  | | +--------------------------- PDB_EXECUTOR
!  ! +----------------------------- PDB_OTHER_NODES
!  +------------------------------- (unused)
%sbttl 'PDB - Parameter Data Block Structure Definition'

!
! Clever macro to skip a field without assigning a name
!
macro
    $fill (FL) = %bliss16 (%bliss36 (FL)) %;

$show (all);                            ! Start XPORT displays

$field PVL_DATA_BLOCK =
    set
    PDB_VERSION = [$byte],              ! Version applicability mask
    PDB_DATA_TYPE = [$byte],            ! Data type/format byte

        $align (byte)                   ! Restrictions
    PDB_NML_PARAMETER = [$bit],         ! ON if NML owns this parameter
    PDB_PASSWORD = [$bit],              ! (don't show passwords)
    PDB_UPPER_CASE = [$bit],            ! Parameter data upper case conversion

    PDB_READ_ONLY = [$bit],             ! Settability restrictions
    PDB_WRITE_ONLY = [$bit],
    PDB_LOOP_ONLY = [$bit],

    PDB_CLEARABLE = [$bit],             ! Clearable by user
    PDB_QUALIFIED = [$bit],

        $align (byte)                   ! Information type applicability
    PDB_CHARACTERISTIC = [$bit],
    PDB_STATUS = [$bit],
    PDB_SUMMARY = [$bit],
    PDB_EVENTS = [$bit],
    PDB_QUALIFIER = [$bit],

    PDB_EXECUTOR = [$bit],              ! Applicability restrictions
    PDB_OTHER_NODES = [$bit],

%if not $MCB %then                      ! No NCP on MCB, eliminate string text
        $fill ($bit)                    !  (to get to sign bit)
    PDB_CODE_TEXT = [$bit],             ! Coded text table included
    PDB_NAME = [$pointer],              ! Pointer to parameter name text
    PDB_CODE_ADR = [$address],          ! Address of optional code text table
    PDB_CODE_CNT = [$short_integer],    ! Length of optional code text table
    PDB_QUALIFIER_ADR = [$address],  	! Address of qualifier parameter table
    PDB_QUALIFIER_CNT = [$short_integer], ! Length of qualifier parameter table
%fi

    PDB_INFORMATION_C = [%fieldexpand(PDB_CHARACTERISTIC)],
    PDB_INFORMATION_S = [%fieldexpand(PDB_STATUS)],
    PDB_INFORMATION_$ = [%fieldexpand(PDB_SUMMARY)],
    PDB_INFORMATION_EV = [%fieldexpand(PDB_EVENTS)],
    PDB_INFORMATION_Q = [%fieldexpand(PDB_QUALIFIER)],

    PDB_APPLICABILITY_A = [%fieldexpand(PDB_OTHER_NODES)],
    PDB_APPLICABILITY_DN = [0,0,0,0],
    PDB_APPLICABILITY_E = [%fieldexpand(PDB_EXECUTOR)],
    PDB_APPLICABILITY_N = [0,0,0,0],
    PDB_APPLICABILITY_L = [0,0,0,0],
    PDB_APPLICABILITY_R = [%fieldexpand(PDB_OTHER_NODES)],
    PDB_APPLICABILITY_S = [%fieldexpand(PDB_OTHER_NODES)],
    PDB_APPLICABILITY_Q = [%fieldexpand(PDB_QUALIFIED)],

    PDB_SETTABILITY_C = [%fieldexpand(PDB_CLEARABLE)],
    PDB_SETTABILITY_LO = [%fieldexpand(PDB_LOOP_ONLY)],
    PDB_SETTABILITY_P = [%fieldexpand(PDB_PASSWORD)],
    PDB_SETTABILITY_RO = [%fieldexpand(PDB_READ_ONLY)],
    PDB_SETTABILITY_U = [%fieldexpand(PDB_UPPER_CASE)],
    PDB_SETTABILITY_WO = [%fieldexpand(PDB_WRITE_ONLY)]
    tes;

macro
     $NML$PVL_DATA_BLOCK =
         block field (PVL_DATA_BLOCK) %;
%sbttl 'EDT - Entity Data Table Structure Definition'
$field
    EDT_FIELDS =
        set
        EDT_ENTITY = [$integer],
        EDT_PARAMETER_ADR = [$address],
        EDT_PARAMETER_CNT = [$short_integer]	  
        tes;

literal
    EDT_SIZE = $field_set_size;

macro
    EDT_BLOCK = block field (EDT_FIELDS) %;

$show (none);                           ! Terminate XPORT displays
%sbttl 'Data Structure Expansion Macros'

! $NML$xxxxxxxxxx
!
!	Macros to expand lists of parameter definitions and issue preset
!       attribute parameters to initialize the parameter lookup block vector
!       structure. This structure is used to determine the validity and
!       information about any of the NML defined parameters for each entity.
!
!       The parameter entry list is a sequence of entries, one for each
!       parameter to be defined, enclosed in parentheses and seperated by
!       commas, e.g.
!
!	(entry #1), (entry #2), (entry #3), ..., (entry #n)
!
!	and each entry is itself a list of items which describe the
!       parameter. The parameters which specify each entry have
!       the following format
!
!               (Parameter number,
!                Literal name,
!                Format for data extraction,
!                Layer that exclusively owns this parameter,
!                (reserved),
!                Information type,
!                Applicability restriction,
!                Settability restriction,
!                NM versions,
!                Coded field text mappings)
!
!
!       **** CAUTION ****
!       The following macros set fields within the PVL_DATA_BLOCK structure
!       assuming a specific word order.  If the structure is re-arranged or
!       extended, corresponding changes must be made in $$NML_ENTRY_PARSING.

compiletime                             ! Avoid 'undefined' notifications
     AI = 1,
     CM = 1,
     C = 1,
     DU = 1,
     DS = 1,
     H = 1,
     HI = 1,
     O = 1,
     $$$NML$$$CNT = 0,                  ! For $$$NML_VECTOR
     $$$NML$$$INDEX = 0,
     $$$NML$$$QFLG = 0;			! For $$$NML_APPR

macro					! Top level macro.
    $NML$EDT_TABLES [] =
        literal EDT_COUNT = %length;
        $NML$PVB_TABLES (%remaining)
        own EDT_TABLES: blockvector [%length, EDT_SIZE] field (EDT_FIELDS)
	    preset ($NML$EDT_TABLE (%remaining))
	    psect ($high$) %,

    $NML$EDT_TABLE [NAM] =
        [%count, EDT_ENTITY] = %name ('ENTITY_', NAM),
        [%count, EDT_PARAMETER_ADR] = %name (NAM, '_PRM_TBL'),
        [%count, EDT_PARAMETER_CNT] = $NML$PV_LOOKUP_COUNT (%name ('$NML$',NAM,'_PARMS')) %,

    $NML$PVB_TABLES [NAM] =
        own %name (NAM, '_PRM_TBL'):
                $NML$PVB_ENTRY_VECTOR ($NML$PV_LOOKUP_COUNT (%name ('$NML$',NAM,'_PARMS')))
                preset ($NML$PV_LOOKUP (%name ('$NML$',NAM,'_PARMS')))
		psect ($high$); %;

macro                                   ! Block data count macro
     $NML$PV_LOOKUP_COUNT (ENTRY_LIST) =
         %length %;

macro                                   ! Block data field preset macro
     $NML$PV_LOOKUP [ENTRY_LIST] =
         $$NML_PV_LOOKUP_ENTRY (%count, %remove(ENTRY_LIST)) %;

macro
     $$NML_PV_LOOKUP_ENTRY (CNT, PARAMETER) =
         [CNT,PE_NUMBER] = PARAMETER,
         [CNT,PE_ADDRESS] = uplit ($$NML_ENTRY_PARSING (%remaining)) %;

macro
     $$$NML_TYPE (NAME, FORM) =
	 %if %null(FORM) %then (0) %warn (NAME, ' : No data type defined') %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),C) %then (1^7 + $$$NML_SECOND(FORM)) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),CM)
         %then (0) %warn (NAME, ' : Unassigned CM-n combination') %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),AI) %then (1^6) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),DU) %then (0^4 + $$$NML_SECOND(FORM)) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),DS) %then (1^4 + $$$NML_SECOND(FORM)) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),H) %then (2^4 + $$$NML_SECOND(FORM)) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),HI) %then (2^4) %exitmacro %fi
         %if %identical ($$$NML_FIRST(FORM),O) %then (3^4 + $$$NML_SECOND(FORM)) %exitmacro %fi
	 %if not %declared(FORM) %then (0) %warn (NAME, ' : Bad CM type in parameter table ') %exitmacro %fi
         (1^7 + 1^6 + FORM) %,

     $$$NML_LAYER (NAME) [PRM] =
         %if %identical('NML',%string(PRM)) ! Network Management Layer
         %then (1 ^ %fieldexpand(PDB_NML_PARAMETER,1)) %exitmacro %fi
         %if %identical('RO',%string(PRM))
         %then (1 ^ %fieldexpand(PDB_READ_ONLY,1)) %exitmacro %fi
         (0) %warn (NAME, ': Unknown layer parameter: ', PRM) %,

     $$$NML_VERSION (NAME, VER) =
         %if %null (VER)
         %then (1^%fieldexpand(PDB_VERSION,2) - 1)
         %else (0 or $$$NML_VER (NAME, %remove(VER)))
         %fi %,

     $$$NML_VER (NAME) [VER] =
         %if VER leq %fieldexpand(PDB_VERSION,2)
         %then 1^VER
         %else %warn (NAME, ': unsupported NM version: ', VER)
         %fi %,

     $$$NML_SET (NAME) [FLG] =
         $$$NML_FLAG (FLG, NAME, 'SETTABILITY', 'settability restriction') %,

     $$$NML_APPLICABILITY (NAME) [FLG] =
         $$$NML_APPL1 (FLG, NAME, 'APPLICABILITY', 'applicability restriction') %,

     $$$NML_APPL1 (FLG, NAME, TYPE, TEXT) =
	 %if %identical (FLG, (%remove (FLG))) 
	 %then $$$NML_FLAG ($$$NML_FIRST (FLG), NAME, TYPE, TEXT)
	 %else $$$NML_FLAG (FLG, NAME, TYPE, TEXT)
	 %fi %,

     $$$NML_INFORMATION (NAME) [FLG] =
         %if %identical ('*', %string (FLG)) ! SUMMARY
         %then $$$NML_FLAG ($, NAME, 'INFORMATION', 'information type')
         %else $$$NML_FLAG (FLG, NAME, 'INFORMATION', 'information type')
         %fi %,

     $$$NML_FLAG (FLG, NAME, TYPE, TEXT) =
         %if %declared (%name ('PDB_', TYPE, '_', FLG))
         %then %if %fieldexpand (%name ('PDB_', TYPE, '_', FLG),2) neq 0
               %then 1 ^ %fieldexpand (%name ('PDB_', TYPE, '_', FLG), 1)
               %else 0
               %fi
         %else 0 %warn (NAME, ': ', TEXT, ' ''',REST, ''' undefined')
         %fi %,

     $$$NML_CODES (LIST) =
         %assign ($$$NML$$$INDEX, 0)
         plit ($$$NML_VECTOR (%remove (LIST))) %,

     $$$NML_VECTOR [PAIR] =
         %assign ($$$NML$$$CNT, $$$NML_FIRST (PAIR) - $$$NML$$$INDEX)
         %if $$$NML$$$CNT gtr 0 %then rep $$$NML$$$CNT of (0), %fi
         CH$ASCIC ($$$NML_SECOND (PAIR))
         %assign ($$$NML$$$INDEX, $$$NML_FIRST (PAIR) + 1) %,

     $$$NML_FIRST (PLST) = 
        $$$NML_1 (%remove(PLST)) %,

     $$$NML_SECOND (PLST) = 
        $$$NML_2 (%remove(PLST)) %,

     $$$NML_1 (P1) = 
        P1 %,

     $$$NML_2 (P1, P2) = 
        P2 %,

     $$$NML_APPR_QUAL (FLG) =
	 %assign ($$$NML$$$QFLG, 1)
	 $$$NML_APPR_QUAL1 (%remove (FLG))
	 %if $$$NML$$$QFLG %then 0 %fi
	 %,

     $$$NML_APPR_QUAL1 (FLG) [] = 
	 %if %identical (FLG, (%remove (FLG)))
	 %then
	     %if %identical (%string ($$$NML_FIRST (FLG)), 'Q') 
	     %then
	         plit ($$$NML_APPR_PARMS (%remove (FLG)))
	         %assign ($$$NML$$$QFLG, 0)
		 %exitmacro
	     %else 
		 $$$NML_APPR_QUAL1 (%remaining)
	     %fi
	 %else
	     $$$NML_APPR_QUAL1 (%remaining)
	 %fi %,

     $$$NML_APPR_PARMS (FLG) [PARMS] = 
         PARMS %;

macro
     $$NML_ENTRY_PARSING (NAME, FORM, LAYER, UNASSIGNED,
                          INFO, APPR, SETR, VRSN, CODE_SET) =

         $$$NML_VERSION (NAME, VRSN) ^ %fieldexpand(PDB_VERSION,1)
         or $$$NML_TYPE (NAME, FORM) ^ %fieldexpand(PDB_DATA_TYPE,1)

         %bliss16(,0)                   ! MCB break for word boundary

         %if not %null(LAYER)           ! Layer information
         %then or $$$NML_LAYER (NAME, %remove(LAYER))
         %fi

         %if not %null(INFO)            ! Information type
         %then or $$$NML_INFORMATION (NAME, %remove(INFO))
         %fi

         %if not %null(APPR)            ! Applicability restriction
         %then or $$$NML_APPLICABILITY (NAME, %remove(APPR))
         %fi

         %if not %null(SETR)            ! Settability restriction
         %then or $$$NML_SET (NAME, %remove(SETR))
         %fi

         %if not %null(CODE_SET) and %declared (PDB_CODE_TEXT)
         %then or 1^%fieldexpand(PDB_CODE_TEXT,1) ! Codes
         %fi

         %if %declared (PDB_NAME)
         %then , CH$ASCIC (%string(NAME)) ! Lexical name of parameter
         %fi

	 %if %declared (PDB_CODE_ADR) 
	 %then 
	     %if not %null (CODE_SET)
   	     %then , $$$NML_CODES (CODE_SET) ! Codes
	     %else , 0
	     %fi
	 %fi

	 %if %declared (PDB_QUALIFIER_ADR)
 	 %then , $$$NML_APPR_QUAL (APPR) ! Qualifiers' parameter numbers
	 %fi %;
%sbttl 'Table Storage Definitions'

!
! The macros which are used to define these tables are defined in NMARCH.REQ.
!

$NML$EDT_TABLES ($NML$ENTITIES ($NML$ENTITY_SET));
%sbttl '' %if not $MCB %then
%global_routine ('NML$PARAMETER_TEXT', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Returns a character string pointer to the name of a
!       parameter known by NML.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	Character string pointer to counted ASCII name text, if known;
!       0, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS];

    !
    ! Return pointer to an I-field name string.
    !

    return ch$plus(.PDB[PDB_NAME],-1);
    end;				! End of NML$PARAMETER_TEXT
%global_routine ('NML$CODED_TEXT', ENTITY_TYPE, PARAMETER, CODE) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Returns a character string pointer to the name of a
!       coded parameter value known by NML.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!	CODE        - The value of the parameter code.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	Character string pointer to counted ASCII name text, if known;
!       0, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         ENTRY: ref $NML$PVB_ENTRY_BLOCK,
         PDB: ref $NML$PVL_DATA_BLOCK;

    !
    ! Get address of table entry for this parameter.
    ! Return zero if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return 0; 

    !
    ! Get address of coded text table from lookup table, if there is one
    !

    PDB = .ENTRY[PE_ADDRESS];

    if not .PDB[PDB_CODE_TEXT] then return 0;

    PDB = .PDB[PDB_CODE_ADR];
    begin
    map PDB: ref vector;
    !
    ! If beyond the code range, we cannot interpret.
    !

    if (.CODE geq .PDB[-1]) then return 0;

    !
    ! Return pointer to an I-field name string.
    !

    ch$plus (.PDB[.CODE], -1)
    end
    end;				! End of NML$CODED_TEXT
%fi                                     ! End of $MCB conditional compilation
%global_routine ('NML$EXECUTOR_ONLY', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether a given NODE parameter applies to the
!       executor node.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this parameter applies to the executor node;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS]; 

    !
    ! Check if any applicability restrictions apply, if so
    ! then check if applicable to executor.
    !

    return (.PDB[PDB_EXECUTOR] and not .PDB[PDB_OTHER_NODES])
    end;				! End of NML$EXECUTOR_ONLY
%global_routine ('NML$VALID_PARAMETER', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether a parameter is valid according to the
!       DNA Network Management Architecture Specification.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this is a valid parameter;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    return (GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER) neq 0);
    end;				! End of NML$VALID_PARAMETER
%global_routine ('NML$CLEARABLE', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether a given parameter could be cleared by the user.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this parameter applies to the executor node;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS]; 

    return (.PDB[PDB_CLEARABLE]);
    end;				! End of NML$CLEARABLE
%global_routine ('NML$UPPER_CASE', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether given parameter text must be upper case.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this parameter must be upper case text;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS]; 

    return (.PDB[PDB_UPPER_CASE]);
    end;				! End of NML$UPPER_CASE
%global_routine ('NML$INFORMATION', ENTITY_TYPE, PARAMETER, TYPE) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether a given parameter is a qualifier.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!       TYPE        - Information type to check.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this parameter information type is applicable;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS]; 

    case .TYPE from INFORMATION_LO to INFORMATION_HI of
        set
        [SUMMARY_] : return .PDB[PDB_SUMMARY];
        [STATUS_] : return .PDB[PDB_STATUS];
        [CHARACTERISTICS_] : return .PDB[PDB_CHARACTERISTIC];
        [EVENTS_] : return .PDB[PDB_EVENTS];
        [QUALIFIER_] : return .PDB[PDB_QUALIFIER];
        [inrange,outrange]: $false;
        tes
    end;				! End of NML$INFORMATION
%global_routine ('NML$READ_ONLY', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines whether a given parameter is read-only.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if this parameter is read-only;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK; 

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE; 

    !
    ! Get address of PVL_DATA_BLOCK from lookup table 
    !

    PDB = .ENTRY[PE_ADDRESS]; 

    return (.PDB[PDB_READ_ONLY]);
    end;				! End of NML$CLEARABLE
%global_routine ('NML$VDB_PARAMETER', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Determines if a given parameter is maintained as part of the NML
!       volatile or permanent data base. 
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	TRUE, if parameter may be written to NML data base;
!       FALSE, otherwise.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         PDB: ref $NML$PVL_DATA_BLOCK,
         ENTRY: ref $NML$PVB_ENTRY_BLOCK;

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE;

    PDB = .ENTRY[PE_ADDRESS];

    return (.PDB[PDB_NML_PARAMETER]);
    end;				! End of NML$VDB_PARAMETER
%global_routine ('NML$DATA_TYPE', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Returns the data format, for parameters maintained by NML
!       in its volatile or permanent data base, from the parameter
!       definition tables.
!
!       NOTE: The caller is responsible for ensuring that the
!       parameter number passed as argument to this routine be
!       a valid parameter for which NML is responsible for maintaining.
!       This is done by first calling NML$VDB_PARAMETER.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The data format for the specified parameter, as defined in
!       the Network Management Architecture specification.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
         ENTRY: ref $NML$PVB_ENTRY_BLOCK,
         PDB: ref $NML$PVL_DATA_BLOCK;

    !
    ! Get address of table entry for this parameter.
    ! Return false if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .PARAMETER)) eql 0
    then return $FALSE;

    PDB = .ENTRY[PE_ADDRESS];

    return .PDB[PDB_DATA_TYPE]
    end;				! End of NML$DATA_TYPE
%global_routine ('NML$ENTITY_DATA', ENTITY_TYPE, NICE, DATA) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Extracts the data value portion of an entity from a NICE
!       request message.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the entity applies.
!	NICE        - The address of a pointer into the NICE message. The
!                     pointer is updated to point to the next available
!                     byte after the entity-id.
!	DATA        - The address of a variable to contain the entity
!                     data. May be either value or pointer. In some special
!                     cases, this is the address of a vector, where each
!                     element of the vector will contain either a value or
!                     a pointer to an image field for a multiple parameter.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the entity-id field in the NICE message.
!
! SIDE EFFECTS:
!
!	The NICE message pointer is updated to point to the next available
!       byte after the entity-id. The address passed in DATA is set to
!       the value of the entity-id, if a binary value, or a pointer
!       the data is an image field.
!
!--

    begin
    EXTRACT_ENTITY_DATA (.ENTITY_TYPE, .NICE, .DATA)
    end;				! End of NML$ENTITY_DATA
%global_routine ('NML$ENTITY_DATA_SKIP', ENTITY_TYPE, NICE) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Skips the data value portion of an entity-id from a NICE
!       request message.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the ident applies.
!	NICE        - The address of a pointer into the NICE message. The
!                     pointer is updated to point to the next available
!                     byte.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the entity-id field in the NICE message.
!
! SIDE EFFECTS:
!
!	The NICE message pointer is updated to point to the next available
!       byte after the entity-id.
!
!--

    begin
    EXTRACT_ENTITY_DATA (.ENTITY_TYPE, .NICE, 0)
    end;				! End of NML$ENTITY_DATA_SKIP
%global_routine ('NML$PARAMETER_DATA', ENTITY_TYPE, NUMBER, NICE, DATA) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Extracts the data value portion of a parameter from a NICE
!       request message.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!	NUMBER      - The parameter type number for this parameter.
!	NICE        - The address of a pointer into the NICE message. The
!                     pointer is updated to point to the next available
!                     byte after the current parameter.
!	DATA        - The address of a variable to contain the parameter 
!                     data. May be either value or pointer. In some special
!                     cases, this is the address of a vector, where each
!                     element of the vector will contain either a value or
!                     a pointer to an image field for a multiple parameter.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the parameter data field in the NICE message.
!
! SIDE EFFECTS:
!
!	The NICE message pointer is updated to point to the next available
!       byte after the parameter. The address passed in PRM_DAT is set to
!       the value of the parameter data, if a binary value, or a pointer
!       the data is an image field.
!
!--

    begin

    local
         ENTRY: ref $NML$PVB_ENTRY_BLOCK;

    !
    ! Get address of table entry for this parameter.
    ! Return length of zero if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .NUMBER)) eql 0
    then return 0;

    EXTRACT_PARAMETER_DATA (.ENTRY[PE_ADDRESS], .NICE, .DATA)
    end;				! End of NML$PARAMETER_DATA
%global_routine ('NML$PARAMETER_DATA_SKIP', ENTITY_TYPE, NUMBER, NICE) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Skips the data value portion of a parameter from a NICE
!       request message.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!	NUMBER      - The parameter type number for this parameter.
!	NICE        - The address of a pointer into the NICE message. The
!                     pointer is updated to point to the next available
!                     byte after the current parameter.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the parameter data field in the NICE message.
!
! SIDE EFFECTS:
!
!	The NICE message pointer is updated to point to the next available
!       byte after the parameter.
!
!--

    begin

    local
         ENTRY: ref $NML$PVB_ENTRY_BLOCK;

    !
    ! Get address of table entry for this parameter.
    ! Return length of zero if cannot find it.
    !

    if (ENTRY = GET_PEB_ADDRESS (.ENTITY_TYPE, .NUMBER)) eql 0
    then return 0;

    EXTRACT_PARAMETER_DATA (.ENTRY[PE_ADDRESS], .NICE, 0)
    end;				! End of NML$PARAMETER_DATA_SKIP
%routine ('EXTRACT_ENTITY_DATA', ENTITY_TYPE, NICE, DATA) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Extracts entity-id from the NICE message.
!
! FORMAL PARAMETERS
!
! 	ENTITY_TYPE  - The entity type and subentity type
!
!       NICE         - The address of a character sequence pointer into
!                      the data portion NICE command. The pointer is
!                      updated to point to the next available byte after
!                      the entity-id.
!
!	DATA	     - The address of a variable to contain the parameter data.
!		       or zero if the data is not desired.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the entity-id.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin
    local DATA_FOUND, NICE_SAVE;
    map ENTITY_TYPE : FULL_ENTITY;

    NICE_SAVE = ..NICE;
    case .ENTITY_TYPE[ENTITY_MAIN] from ENTITY_LO to ENTITY_HI of
        set
       [ENTITY_NODE] :
            begin
            local CNT: $SIGNED_BYTE_VALUE;
            DATA_FOUND = ..NICE;
            CNT = ch$rchar_a (.NICE);
            if (CNT = .CNT[VALUE]) eql 0
            then .NICE = ch$plus (..NICE, 2)
            else if .CNT gtr 0
                 then .NICE = ch$plus (..NICE, .CNT);
            end;
       [ENTITY_LINE, ENTITY_CIRCUIT, ENTITY_MODULE] :
            begin
            local CNT: $SIGNED_BYTE_VALUE;
            DATA_FOUND = ..NICE;
            CNT = ch$rchar_a (.NICE);
            if (CNT = .CNT[VALUE]) gtr 0
            then .NICE = ch$plus (..NICE, .CNT);
            end;
       [ENTITY_LOGGING, ENTITY_AREA] :
            begin
            map DATA_FOUND: $SIGNED_BYTE_VALUE;
            DATA_FOUND = ch$rchar_a (.NICE);
            if (DATA_FOUND = .DATA_FOUND[VALUE]) eql 0
            then DATA_FOUND = ch$rchar_a (.NICE);
            end;
        [inrange, outrange] : DATA_FOUND = 0;
        tes;

    if .DATA neq 0 then .DATA = .DATA_FOUND;

    ch$diff (..NICE,.NICE_SAVE)
    end;                                ! End of EXTRACT_ENTITY_DATA
%routine ('EXTRACT_PARAMETER_DATA', PDB, NICE, DATA) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Extracts data from the NICE message as specified by the format.
!
! FORMAL PARAMETERS
!
!       NICE         - The address of a character sequence pointer into
!                      the data portion of the parameter. The pointer is
!                      updated to point to the next available byte after
!                      the current parameter.
!
!       If the FORMAT is
!
!       CM-2    DATA - The address of the location to contain the pointer
!                      to the data field, which includes 2 2-byte fields.
!
!
!       CM-N    DATA - The address of the location to contain the pointer
!                      to the data field, which includes the count byte and
!                      either an I-6 image field of the node name or a two
!                      bytes binary value of the node address.
!
!
!       CM-O    DATA - The address of the location to contain the pointer
!                      to the data field, which includes the count byte and
!                      either an I-6 image field of the object name or a
!                      single byte binary value of the object number.
!
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	The length of the parameter data.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    map
       PDB: ref $NML$PVL_DATA_BLOCK;

    local
         DATA_FOUND,
         NICE_SAVE;

    NICE_SAVE = ..NICE;

    if .PDB[$sub_field(PDB_DATA_TYPE,DT_CODED)] eql 0
    then begin
         if .PDB[$sub_field(PDB_DATA_TYPE,DT_FTYPE)] eql 0
         then begin
              local CNT: $SIGNED_BYTE_VALUE;
              selectone (CNT = .PDB[$sub_field(PDB_DATA_TYPE,DT_LENGTH)]) of
                   set
                   [0] :
                       begin
                       DATA_FOUND = ..NICE;
                       CNT = ch$rchar_a (.NICE);
                       if (CNT = .CNT[VALUE]) gtr 0
                       then .NICE = ch$plus (..NICE, .CNT);
                       end;
                   [1] :
                       DATA_FOUND = GETB (.NICE);
                   [2] :
                       DATA_FOUND = GETW (.NICE);
                   [3,4] :
                       DATA_FOUND = GETN (.NICE, .CNT);
                   [otherwise] :
                       .NICE = ch$plus ((DATA_FOUND = ..NICE), .CNT);
                   tes;
              end
         else begin
              local CNT: $SIGNED_BYTE_VALUE;
              DATA_FOUND = ..NICE;
              CNT = ch$rchar_a (.NICE);
              if (CNT = .CNT[VALUE]) gtr 0
              then .NICE = ch$plus (..NICE, .CNT);
              end;
         end
    else if .PDB[$sub_field(PDB_DATA_TYPE,DT_FIELDS)] eql 0
         then begin
              local CNT: $SIGNED_BYTE_VALUE;
              selectone (CNT = .PDB[$sub_field(PDB_DATA_TYPE,DT_NUMBER)]) of
                   set
                   [1] :
                       DATA_FOUND = GETB (.NICE);
                   [2] :
                       DATA_FOUND = GETW (.NICE);
                   [3,4] :
                       DATA_FOUND = GETN (.NICE, .CNT);
                   [otherwise] :
                       .NICE = ch$plus ((DATA_FOUND = ..NICE), .CNT);
                   tes;
              end
         else selectone .PDB[$sub_field(PDB_DATA_TYPE, DT_NUMBER)] of
                  set
                  [CM2] :               ! Coded 2 2-byte field
                      begin
                      DATA_FOUND = ..NICE; ! Get pointer to data bytes
                      .NICE = ch$plus (..NICE,4); ! Update pointer
                      end;
                  [CMN] :               ! Coded node field
                      begin
                      local CNT: $SIGNED_BYTE_VALUE;
                      DATA_FOUND = ..NICE; ! Always return pointer to id
                      CNT = ch$rchar_a (.NICE); ! Get format byte
                      if (CNT = .CNT[VALUE]) eql 0 ! Node address
                      then .NICE = ch$plus (..NICE, 2)
                      else if .CNT gtr 0
                           then .NICE = ch$plus (..NICE, .CNT);
                      end;
                  [CMO] :               ! Coded object field
                      begin
                      local CNT: $SIGNED_BYTE_VALUE;
                      DATA_FOUND = ..NICE; ! Always return pointer to id
                      CNT = ch$rchar_a (.NICE); ! Get format byte
                      if (CNT = .CNT[VALUE]) eql 0 ! Object number
                      then .NICE = ch$plus (..NICE, 1)
                      else if .CNT gtr 0 ! Object name
                           then .NICE = ch$plus (..NICE, .CNT);
                      end;
		  [CME] :		! Coded multiple EVENTS format
		      begin
		      local CNT: $SIGNED_BYTE_VALUE,
			    TMP;
		      DATA_FOUND = ..NICE; ! Always return pointer to id
		      CNT = ch$rchar_a(.NICE); ! Get entity type
		      TMP = .CNT[VALUE];
		      if .TMP neq NO_ENTITY_ then begin
			 CNT = ch$rchar_a(.NICE); ! Get length of entity field
			 if ((.CNT[VALUE] eql 0) and (.TMP eql ENTITY_NODE))
				then .NICE = ch$plus(..NICE,2) ! Node address
				else .NICE = ch$plus(..NICE,.CNT[VALUE]);
		         end;
		      TMP = GETW(.NICE); ! Get event class specifier
		      if .TMP<14,2> eql 0 then begin ! Bits 14-15 qualifier
			 CNT = ch$rchar_a(.NICE); ! Get length of type field
			 .NICE = ch$plus(..NICE,.CNT[VALUE]); ! Move past it
			 end;
		      end;
                  [otherwise] :         ! Unrecognized parameter format
                      DATA_FOUND = 0;
                  tes;

    if .DATA neq 0 then .DATA = .DATA_FOUND;

    ch$diff (..NICE,.NICE_SAVE)
    end;                                ! End of EXTRACT_PARAMETER_DATA
%routine ('GET_PEB_ADDRESS', ENTITY_TYPE, PARAMETER) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Searches the appropriate parameter table based on entity type
!       number and returns the address of the PEB entry.
!
! FORMAL PARAMETERS
!
!	ENTITY_TYPE - The entity type number to which the parameter applies.
!       PARAMETER   - The parameter type number.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	Address of the PEB for this parameter or
!       0 if none.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    local
        EDT: ref EDT_BLOCK;

    EDT = EDT_TABLES;
    decr I from EDT_COUNT to 1 do
        begin
        if .EDT[EDT_ENTITY] eql .ENTITY_TYPE
        then return SEARCH_PARAMETER_TABLE (.PARAMETER,
                                            .EDT[EDT_PARAMETER_ADR],
                                            .EDT[EDT_PARAMETER_CNT]);
        EDT = vector [.EDT, EDT_SIZE];
        end;

    0
    end;				! End of GET_PEB_ADDRESS
%routine ('SEARCH_PARAMETER_TABLE', PARAMETER, ADDRESS, COUNT) =

!++
! FUNCTIONAL DESCRIPTION:
!
!	Performs a binary search on a parameter table.
!
! FORMAL PARAMETERS
!
!	PARAMETER  - The value of the parameter number to be searched for.
!       ADDRESS    - The address of a parameter table.
!       COUNT      - Number of entries in table.
!
! IMPLICIT INPUTS
!
!	NONE.
!
! ROUTINE VALUE:
!
!	NONE.
!
! SIDE EFFECTS:
!
!	NONE.
!
!--

    begin

    map                                 ! Map parameter vector as one element
       ADDRESS: ref $NML$PVB_ENTRY_VECTOR (1); 

    local
         LEFT,                          ! Left boundary
         RIGHT,                         ! Right boundary
         INDEX,                         ! Index for search
         ENTRY: ref $NML$PVB_ENTRY_BLOCK;

    macro
         PDB (FLD0) = block [.ENTRY[PE_ADDRESS],FLD0,%remaining] %;

    external NMLVER;

    LEFT = 0;                           ! Initialize left (lower) bound
    RIGHT = .COUNT - 1;                 ! Initialize right (upper) bound

    while $true
    do begin                            ! Set center of bounds and test failure
       INDEX = (.LEFT+.RIGHT)/2;
       ENTRY = ADDRESS[.INDEX,0,0,0,0];

       if .PARAMETER eql .ENTRY[PE_NUMBER]
       then exitloop;                       ! Entry found

       if .LEFT geq .RIGHT then return 0;

       if .PARAMETER lss .ENTRY[PE_NUMBER]
       then RIGHT = .INDEX - 1          ! Entry is in lower bound
       else LEFT = .INDEX + 1;          ! Entry is in upper bound
       end;

       while (.INDEX geq 0)
       do begin
          ENTRY = ADDRESS[.INDEX,0,0,0,0];
          if .ENTRY[PE_NUMBER] neq .PARAMETER then exitloop;
          INDEX = .INDEX - 1;
          end;
       INDEX = .INDEX + 1;

       while (.INDEX leq .COUNT-1)
       do begin
          ENTRY = ADDRESS[.INDEX,0,0,0,0];
          if .ENTRY[PE_NUMBER] neq .PARAMETER then return 0;
          if .PDB[$sub_field(PDB_VERSION,0,.NMLVER,1,0)] eql 1
          then return .ENTRY;
          INDEX = .INDEX + 1;
          end;

       return 0
    end;				! End of SEARCH_PARAMETER_TABLE
end                                   ! End of Module NMLPRM
eludom
! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: