Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/drivers/dcpnmx.b16
There are no other files named dcpnmx.b16 in the archive.
module DCPNMX (	! DDCMP Driver Network Management
		ident = 'X01140',
		language (bliss16)
		) =
begin

!
!                    COPYRIGHT (c) 1980, 1981, 1982
!                    DIGITAL EQUIPMENT CORPORATION
!                        Maynard, Massachusetts
!
!     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: MCB DDCMP Protocol Driver
!
! ABSTRACT:
!
!	This module contains the DDCMP protocol Network Management routines.
!
! ENVIRONMENT: MCB V3.2
!
! AUTHOR: Alan D. Peckham	CREATION DATE: 5-Apr-81
!
! MODIFIED BY:
!
!	Alan D. Peckham, 5-Apr-81: Version 1
! 01	- New module for DCP.
! 03	- Maintain line state.
! 04	- Change to routine called by LINE ON/OFF coding.
! 05	- Handle 16 bits of RETRANSMIT TIMER.
! 06	- Use $MCB_GET_DEVICE_NAME to get line/device name.
!	  Remove common counter routines.
! 07	- Use NMX$PARAMETER to get CIRCUIT/LINE names.
!	  Add support of SERVICE TIMER.
!	  Update counters to NM V3.0 .
! 08	- Update parameters to V3.0 .
! 09	- Remove 'counters zeroed' event.
! 10	- Get parameters from KDP process for LINE CHARACTERISTICS.
! 11	- De-commit half-duplex.
! 12	- Fix CLEAR CIRCUIT/LINE ALL to work.
! 13	- Fix SET_LINE_RETRANSMIT_TIMER bug introduced in #5.
! 14	- Add seconds-since-last-zeroed support for lines.
!	  Eliminate double line counter report from owner and provider.
!--
!
! INCLUDE FILES:
!

library 'MCBLIB';

library 'XPORTX';

library 'NMXLIB';

library 'DCPDAT';

!
! TABLE OF CONTENTS:
!

linkage
    DCP_DB = jsr (register = 5) :
	nopreserve (0, 1, 2, 3, 4),
    DCP_DB_CCB = jsr (register = 5, register = 4) :
	nopreserve (0, 1, 2, 3),
    DCP_DB_NUM = jsr (register = 5, register = 0) : nopreserve (0, 1, 2);

forward routine
    DCPNM : DCP_DB_CCB novalue,
    PARAMETER_CIRCUIT_COUNTERS : LINKAGE_DB novalue;

forward routine
    CLEAR_CIRCUIT : DCP_DB_CCB,
    CLEAR_LINE : DCP_DB_CCB,
    IDENTIFY_PARAMETER,
    MANAGEMENT_PROGRAMMING_ERROR : DCP_DB_CCB,
    SET_CIRCUIT : DCP_DB_CCB,
    SET_LINE : DCP_DB_CCB,
    SET_LINE_CLOCK : DCP_DB_NUM,
    SET_LINE_CONTROLLER : DCP_DB_NUM,
    SET_LINE_DUPLEX : DCP_DB_NUM,
    SET_LINE_PROTOCOL : DCP_DB_NUM,
    SET_LINE_RETRANSMIT_TIMER : DCP_DB_NUM,
    SET_LINE_SERVICE_TIMER : DCP_DB_NUM,
    SET_LINE_STATE : DCP_DB_NUM,
    SHOW_AND_ZERO_CIRCUIT_COUNTERS : DCP_DB_CCB,
    SHOW_AND_ZERO_LINE_COUNTERS : DCP_DB_CCB,
    SHOW_CIRCUIT : DCP_DB_CCB,
    SHOW_LINE : DCP_DB_CCB,
    SHOW_SUCCESS : DCP_DB_CCB,
    SUCCESS : DCP_DB_CCB,
    ZERO_CIRCUIT_COUNTERS : DCP_DB_CCB,
    ZERO_LINE_COUNTERS : DCP_DB_CCB;

!
! MACROS:
!
!	None
!
! EQUATED SYMBOLS:
!

literal
    TRUE = 1 EQL 1,
    FALSE = 1 EQL 0,
    NO_OPERATION = 0;

macro
    $DCP_LINE_PARAMETERS =
	0, 1100, 1105, 1110, 1111, 1112, 1113, 1120, 1121 %,
    $DCP_PARAMETER_NAMES (ENTITY) [NUMBER] =
	literal %name (ENTITY, '_', NUMBER) = %count; %,
    $DCP_PARAMETER_NAME_LIST (ENTITY) [NUMBER] =
	%name (ENTITY, '_', NUMBER) %,
    $DCP_PARAMETER_NUMBER_LIST (ENTITY) [NUMBER] =
	NUMBER %,
    $DCP_PARAMETERS (ENTITY) =
	$DCP_PARAMETER_NAMES (ENTITY, %remaining)
	literal %name (ENTITY, '_MINIMUM') =
	    min ($DCP_PARAMETER_NAME_LIST (ENTITY, %remaining));
	literal %name (ENTITY, '_MAXIMUM') =
	    max ($DCP_PARAMETER_NAME_LIST (ENTITY, %remaining));
	bind %name (ENTITY, '_NUMBERS') =
	    plit ($DCP_PARAMETER_NUMBER_LIST (ENTITY, %remaining)) : vector; %;

$DCP_PARAMETERS (LINE, $DCP_LINE_PARAMETERS)

!
! OWN STORAGE:
!

external routine
    $DSPCR : novalue;

!
! EXTERNAL REFERENCES:
!

external routine
    SET_DEVICE : DCP_DB novalue,
    SET_LINK : DCP_DB novalue;

external
    MCB$GAW_PROCESS_DATA_BASE : vector [2],
    MCB$GW_PROCESS_HANDLE;

bind
    DB = MCB$GAW_PROCESS_DATA_BASE [1],
    DB_BIAS = MCB$GAW_PROCESS_DATA_BASE [0];

macro
    GET_DCP_DATA_BASE (NAME) =
	%if %declared (NAME)
	%then map NAME : ref
	%else bind NAME = .MCB$GAW_PROCESS_DATA_BASE [1] :
	%fi block field (D_FIELDS) %;
routine CLEAR_CIRCUIT

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    if .CCB [C_CNT] eql 0
    then
	NM$SUC
    else
	NE$PNA
    end;
routine CLEAR_LINE

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    if .CCB [C_CNT] eql 0
    then
	NM$SUC
    else
	NE$PNA
    end;
global routine DCPNM

!++
! FUNCTIONAL DESCRIPTION:
!	This routine is activated by a control request from
!	Network Management.
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	CCB Contents
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB novalue =
!
! SIDE EFFECTS:
!	None
!--

    begin
    begin

    bind
	LIX = .CCB [C_LIX];

    local
	RTN;

    RTN =
	(case .CCB [C_NM_ENTITY] from NMX$ENT_lo to NMX$ENT_hi of
	    set
	    [NMX$ENT_ckt] : 			!  CIRCUIT parameter
		case .CCB [C_NM_FUNC] from NMX$FNC_lo to NMX$FNC_hi of
		    set
		    [NMX$FNC_set] :		! Set parameters
			SET_CIRCUIT;
		    [NMX$FNC_clr] :		! Clear parameters
			CLEAR_CIRCUIT;
		    [NMX$FNC_zro] :		! Zero counters
			ZERO_CIRCUIT_COUNTERS;
		    [NMX$FNC_sho] :		! Show selected items
			SHOW_CIRCUIT;
		    [NMX$FNC_szc] :		! Show and zero counters
			SHOW_AND_ZERO_CIRCUIT_COUNTERS;
		    [inrange, outrange] :
			MANAGEMENT_PROGRAMMING_ERROR;
		    tes;
	    [NMX$ENT_lin] : 			!  LINE parameter
		case .CCB [C_NM_FUNC] from NMX$FNC_lo to NMX$FNC_hi of
		    set
		    [NMX$FNC_set] :		! Set parameters
			    .(LIX + TABLE$ (SUCCESS, DCP_K_NMID_HIGH,
				(DCP_K_LINE_OWNER, SET_LINE),
				(DCP_K_LINE_PROVIDER, SET_LINE)));
		    [NMX$FNC_clr] :		! Clear parameters
			    .(LIX + TABLE$ (SUCCESS, DCP_K_NMID_HIGH,
				(DCP_K_LINE_PROVIDER, CLEAR_LINE)));
		    [NMX$FNC_zro] :		! Zero counters
			    .(LIX + TABLE$ (SUCCESS, DCP_K_NMID_HIGH,
				(DCP_K_LINE_PROVIDER, ZERO_LINE_COUNTERS)));
		    [NMX$FNC_sho] :		! Show selected items
			    .(LIX + TABLE$ (SHOW_SUCCESS, DCP_K_NMID_HIGH,
				(DCP_K_LINE_PROVIDER, SHOW_LINE)));
		    [NMX$FNC_szc] :		! Show and zero counters
			    .(LIX + TABLE$ (SHOW_SUCCESS, DCP_K_NMID_HIGH,
				(DCP_K_LINE_PROVIDER, SHOW_AND_ZERO_LINE_COUNTERS)));
		    [inrange, outrange] :
			MANAGEMENT_PROGRAMMING_ERROR;
		    tes;

	    [inrange, outrange] :
		MANAGEMENT_PROGRAMMING_ERROR;

	    tes);

    if (CCB [C_STS] = DCP_DB_CCB (.RTN, DB [D_TIM], .CCB)) eql 0
    then
	return;

    end;
    CCB [C_FNC] = FC_CCP;
    $MCB_SCHEDULE_CCB (.CCB);
    end;				! of routine DCPNM
routine IDENTIFY_PARAMETER

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (NUMBER,
	TABLE : ref vector)
!
! IMPLICIT INPUTS:
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	=
!
! SIDE EFFECTS:
!	None
!--

    begin

    incru INDEX from 1 to .TABLE [-1] do

	if .NUMBER eql .TABLE [.INDEX - 1] then return .INDEX - 1;

    .TABLE [-1]
    end;			!of routine IDENTIFY_PARAMETER
routine MANAGEMENT_PROGRAMMING_ERROR

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM$ERR_MPE
    end;
global routine PARAMETER_CIRCUIT_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
       (DB : ref block field (D_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: LINKAGE_DB novalue =
!
! SIDE EFFECTS:
!	None
!--

    begin
    COUNTER_32 (1000, DB [S_BYTES_RECEIVED]);
    COUNTER_32 (1001, DB [S_BYTES_TRANSMITTED]);
    COUNTER_32 (1010, DB [S_DATA_BLOCKS_RECEIVED]);
    COUNTER_32 (1011, DB [S_DATA_BLOCKS_TRANSMITTED]);
    COUNTER_8_BM (1020, DB [S_DATA_ERRORS_INBOUND]);
    COUNTER_8_BM (1021, DB [S_DATA_ERRORS_OUTBOUND]);
    COUNTER_8 (1030, DB [S_REMOTE_REPLY_TIMEOUTS]);
    COUNTER_8 (1031, DB [S_LOCAL_REPLY_TIMEOUTS]);
    COUNTER_8_BM (1040, DB [S_REMOTE_BUFFER_ERRORS]);
    COUNTER_8_BM (1041, DB [S_LOCAL_BUFFER_ERRORS]);
    COUNTER_8 (1050, DB [S_SELECTION_INTERVALS]);
    COUNTER_8_BM (1051, DB [S_SELECTION_TIMEOUTS]);
    end;			!of routine PARAMETER_CIRCUIT_COUNTERS
global routine PARAMETER_LINE_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
       (DB : ref block field (D_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: LINKAGE_DB novalue =
!
! SIDE EFFECTS:
!	None
!--

    begin
    COUNTER_16_TIME (0, DB [L_TIME_LINE_ZEROED]);
    COUNTER_8_BM (1100, DB [L_REMOTE_STATION_ERRORS]);
    COUNTER_8_BM (1101, DB [L_LOCAL_STATION_ERRORS]);
    end;			!of routine PARAMETER_LINE_COUNTERS
routine SET_CIRCUIT

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    NE$PNA
    end;
routine SET_LINE

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    local
	BUF_PTR,
	DATA_ID,
	DATA_VALUE;

    MAP$ (.CCB [C_BIAS]);
    BUF_PTR = .CCB [C_ADDR];
    BYT$STRING_SHORT (BUF_PTR, DATA_ID);
    DATA_ID = IDENTIFY_PARAMETER (.DATA_ID <0, 12>, LINE_NUMBERS);
    BYT$STRING_SHORT (BUF_PTR, DATA_VALUE);
    MAP$ (.DB_BIAS);

    case .DATA_ID from LINE_MINIMUM to LINE_MAXIMUM of
	set
	[LINE_0] : SET_LINE_STATE (DB [D_TIM], .DATA_VALUE <0, 8>);
	[LINE_1110] : SET_LINE_CONTROLLER (DB [D_TIM], .DATA_VALUE <0, 8>);
!	[LINE_1111] : SET_LINE_DUPLEX (DB [D_TIM], .DATA_VALUE <0, 8>);
	[LINE_1112] : SET_LINE_PROTOCOL (DB [D_TIM], .DATA_VALUE <0, 8>);
	[LINE_1113] : SET_LINE_CLOCK (DB [D_TIM], .DATA_VALUE <0, 8>);
	[LINE_1120] : SET_LINE_SERVICE_TIMER (DB [D_TIM], .DATA_VALUE);
	[LINE_1121] : SET_LINE_RETRANSMIT_TIMER (DB [D_TIM], .DATA_VALUE);
	[inrange, outrange] :		! Parameter not applicable
	    NE$PNA;
	tes

    end;
routine SET_LINE_CLOCK

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CLOCK)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    literal
	EXTERN = 0,
	INTERN = 1;

    if .DB [L_LINE_STATE] eql DL_ON then return NE$CWS;

    selectone .CLOCK of
	set
	[EXTERN, INTERN] :
	    begin
	    DB [L_CLOCK] = .CLOCK;
	    NM$SUC
	    end;
	[otherwise] : NE$IPV;
	tes

    end;
routine SET_LINE_CONTROLLER

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CONTROLLER)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    literal
	LOOPBACK = 1,
	NORMAL = 0;

    if .DB [L_LINE_STATE] eql DL_ON then return NE$CWS;

    selectone .CONTROLLER of
	set
	[NORMAL, LOOPBACK] :
	    begin
	    DB [L_CONTROLLER] = .CONTROLLER;
	    NM$SUC
	    end;
	[otherwise] : NE$IPV;
	tes

    end;
routine SET_LINE_DUPLEX

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	DUPLEX)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    literal
	FULL = 0,
	HALF = 1;

    if .DB [L_LINE_STATE] eql DL_ON then return NE$CWS;

    selectone .DUPLEX of
	set
	[FULL, HALF] : (DB [L_DUPLEX] = .DUPLEX; NM$SUC);
	[otherwise] : NE$IPV;
	tes

    end;
routine SET_LINE_PROTOCOL

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	PROTOCOL)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    literal
	DDCMP_POINT = 0,
	DDCMP_CONTROL = 1,
	DDCMP_TRIBUTARY = 2,
	DDCMP_DMC = 4;

    if .DB [L_LINE_STATE] eql DL_ON then return NE$CWS;

    selectone .PROTOCOL of
	set
	[DDCMP_POINT, DDCMP_DMC] : (DB [L_PROTOCOL] = .PROTOCOL; NM$SUC);
	[otherwise] : NE$IPV;
	tes

    end;
routine SET_LINE_RETRANSMIT_TIMER

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	TIME)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    if .TIME<0, 1, 0> neq 0 or
	(.TIME<1, 15, 0> mod (1000/2)) neq 0
    then return NE$IPV;

    DB [L_RETRANSMIT_TIMER] = .TIME<1, 15, 0>/(1000/2);
    NM$SUC
    end;
routine SET_LINE_SERVICE_TIMER

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	TIME)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    if (.TIME<1, 15, 0> mod 1000) neq 0 or
	.TIME<0, 1, 0> neq 0 then return NE$IPV;

    DB [L_SERVICE_TIMER] = .TIME<1, 15, 0>/(1000/2);
    NM$SUC
    end;
routine SET_LINE_STATE

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	STATE)
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_NUM =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin

    literal
	CLEARED = 3,
	OFF = 1,
	ON = 0,
	SERVICE = 2;

    if .STATE eql .DB [L_LINE_STATE] then return NM$SUC;

    selectone .STATE of
	set
	[ON] :
	    begin
	    DB [L_LINE_STATE] = .STATE;
	    DB [DC_SET_REQUESTED_STATE] = TRUE;
	    SET_DEVICE (DB [D_TIM]);
	    NM$SUC
	    end;
	[OFF] :
	    begin
	    DB [L_LINE_STATE] = .STATE;
	    SET_LINK (DB [D_TIM], SS_HALTED);
	    SET_DEVICE (DB [D_TIM]);
	    NM$SUC
	    end;
	[otherwise] : NE$IPV;
	tes

    end;
routine SHOW_AND_ZERO_CIRCUIT_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!	This routine writes the counter contents into the NM buffer.
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM_RESPONSE_BEGIN  (.CCB);
    PARAMETER_CIRCUIT_COUNTERS (DB [D_TIM]);
    $NM_RESPONSE_END (.CCB);
    ZERO_CIRCUIT_COUNTERS (DB [D_TIM], .CCB);
    .CCB [C_STS]
    end;
routine SHOW_AND_ZERO_LINE_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!	This routine writes the counter contents into the NM buffer.
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM_RESPONSE_BEGIN (.CCB);
    PARAMETER_LINE_COUNTERS (DB [D_TIM]);
    $NM_RESPONSE_END (.CCB);
    ZERO_LINE_COUNTERS (DB [D_TIM], .CCB);
    .CCB [C_STS]
    end;
routine SHOW_CIRCUIT

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM_RESPONSE_BEGIN (.CCB);

    selectone .CCB [C_NM_SELECT] of
	set

	[NMX$SEL_sum, NMX$SEL_sta] :
	    NMX$PARAMETER_CIRCUIT_USER (.DB [D_NMX_PIX], .DB [L_LINE_ENTITY], 1000);

	[NMX$SEL_cha] :
	    begin
	    NMX$PARAMETER_CIRCUIT_OWNER (.DB [D_NMX_PIX], .DB [L_LINE_ENTITY], 1100);
	    NMX$PARAMETER_LINE (.DB [D_NMX_PIX], .DB [L_LINE_ENTITY], 1110);
	    PARAMETER_C_1 (1112, DB [L_PROTOCOL]);	! TYPE
	    end;

	[NMX$SEL_cou] :
	    PARAMETER_CIRCUIT_COUNTERS (DB [D_TIM]);

	[otherwise] :
	    return $NM$ERR_MPE;

	tes;

    $NM_RESPONSE_END (.CCB);
    .CCB [C_STS]
    end;
routine SHOW_LINE

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM_RESPONSE_BEGIN (.CCB);

    selectone .CCB [C_NM_SELECT] of
	set

	[NMX$SEL_sum, NMX$SEL_sta] :
	    begin
	    PARAMETER_C_1 (0, DB [L_LINE_STATE]);		! STATE
	    end;

	[NMX$SEL_cha] :
	    begin

	    local
		PRM;

	    NMX$PARAMETER_LINE (.DB [D_NMX_PIX], .DB [L_LINE_ENTITY], 1100);
							! DEVICE
	    PARAMETER_C_1 (1110, DB [L_CONTROLLER]);	! CONTROLLER
	    PARAMETER_C_1 (1111, DB [L_DUPLEX]);	! DUPLEX
	    PARAMETER_C_1 (1112, DB [L_PROTOCOL]);	! PROTOCOL
	    PARAMETER_C_1 (1113, DB [L_CLOCK]);		! CLOCK
	    PRM = .DB [L_SERVICE_TIMER]*1000;
	    PARAMETER_DU_2 (1120, PRM);			! SERVICE TIMER
	    PRM = .DB [L_RETRANSMIT_TIMER]*1000;
	    PARAMETER_DU_2 (1121, PRM);			! RETRANSMIT TIMER

	    if .DB [K_REGISTER] neqa 0
	    then
		begin
		PARAMETER_O_2 (2650, DB [K_REGISTER]);
		PARAMETER_O_2 (2651, DB [D_REGISTER]);
		PARAMETER_O_2 (2655, DB [K_VECTOR]);
		PARAMETER_DU_1 (2660, DB [K_PRIORITY]);
		end;

	    end;

	[NMX$SEL_cou] :
	    PARAMETER_LINE_COUNTERS (DB [D_TIM]);

	[otherwise] :
	    return $NM$ERR_MPE;

	tes;

    $NM_RESPONSE_END (.CCB);
    .CCB [C_STS]
    end;
routine SHOW_SUCCESS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    CCB [C_CNT] = 0;
    NM$SUC
    end;
routine SUCCESS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_NM_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    NM$SUC
    end;
routine ZERO_CIRCUIT_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    COUNTER_ZERO (DB, S_BYTES_RECEIVED);
    COUNTER_ZERO (DB, S_BYTES_TRANSMITTED);
    COUNTER_ZERO (DB, S_DATA_BLOCKS_RECEIVED);
    COUNTER_ZERO (DB, S_DATA_BLOCKS_TRANSMITTED);
    COUNTER_ZERO (DB, S_DATA_ERRORS_INBOUND, 8);
    COUNTER_ZERO (DB, S_DATA_ERRORS_OUTBOUND, 8);
    COUNTER_ZERO (DB, S_REMOTE_REPLY_TIMEOUTS);
    COUNTER_ZERO (DB, S_LOCAL_REPLY_TIMEOUTS);
    COUNTER_ZERO (DB, S_REMOTE_BUFFER_ERRORS, 8);
    COUNTER_ZERO (DB, S_LOCAL_BUFFER_ERRORS, 8);
    COUNTER_ZERO (DB, S_SELECTION_INTERVALS);
    COUNTER_ZERO (DB, S_SELECTION_TIMEOUTS, 8);
    NM$SUC
    end;
routine ZERO_LINE_COUNTERS

!++
! FUNCTIONAL DESCRIPTION:
!
!
! FORMAL PARAMETERS:
!
       (DB : ref block field (D_FIELDS),
	CCB : ref block field (C_FIELDS))
!
! IMPLICIT INPUTS:
!	None
!
! IMPLICIT OUTPUTS:
!	None
!
! ROUTINE VALUE:
!
	: DCP_DB_CCB =
!
! COMPLETION CODES:
!	None
!
! SIDE EFFECTS:
!	None
!--

    begin
    $NM_TIME (DB [L_TIME_LINE_ZEROED]);
    COUNTER_ZERO (DB, L_REMOTE_STATION_ERRORS, 8);
    COUNTER_ZERO (DB, L_LOCAL_STATION_ERRORS, 8);
    NM$SUC
    end;
end
eludom