/*****************************************************************************
 * Copyright (c) 1988-95 Digi International Inc., All Rights Reserved
 * 
 * This  software  contains  proprietary  and  confidential   information   of
 * Digi International  Inc.   By  accepting  transfer  of this copy, Recipient
 * agrees to retain this software in  confidence,  to  prevent  disclosure  to
 * others,  and  to make no  use of this software other than that for which it
 * was delivered.  This is an unpublished copyright work  Digi   International
 * Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is
 * strictly prohibited.
 * 
 * Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc.
 * Confidential  when   combined   with   the   aggregated  modules  for  this
 * product) OBJECT CODE ONLY SOURCE MATERIALS
 * 
 * (C) COPYRIGHT Digi International Inc. 1995
 * 
 * All Rights Reserved
 * 
 * US   Government   Users   Restricted   Rights   -   Use,   duplication   or
 * disclosure  restricted by GSA ADP Schedule Contract with Digi International
 * Inc.
 * 
 *****************************************************************************/

/*
 * $Id: x25_control.h,v 1.10 1997/09/23 16:38:25 gary Exp $
 */

/******************************************************************
 *
 *  SpiderX25 Interface Primitives
 *
 *  Copyright (C) 1991  Spider Systems Limited
 *
 *  X25_CONTROL.H
 *
 *  X.25 PLP Streams control primitives for V.3
 *
 ******************************************************************/

/******************************************************************
 *
 * M_IOCTL message type constants for I_STR 
 *
 */

#define	N_snident	(('N'<<8) | 1)
#define	N_snmode	(('N'<<8) | 2)
#define	N_snconfig	(('N'<<8) | 3)
#define	N_snread	(('N'<<8) | 4)
#define	N_getstats	(('N'<<8) | 5)
#define	N_zerostats	(('N'<<8) | 6)
#define	N_putpvcmap	(('N'<<8) | 7)
#define	N_getpvcmap	(('N'<<8) | 8)
#define	N_getvcstates	(('N'<<8) | 9)
#define N_getnliversion (('N'<<8) | 10)

/* Tracing */
#define N_traceon	(('N'<<8) | 11)
#define N_traceoff	(('N'<<8) | 12)


/*  NUI table manipulation */
#define N_nuimsg	(('N'<<8) | 13) /* prim_class for NUI msgs  */
#define N_nuiput	(('N'<<8) | 14) /* put entry into table     */
#define N_nuidel	(('N'<<8) | 15) /* delete entry from table  */
#define N_nuiget	(('N'<<8) | 16) /* return table entry       */
#define N_nuimget	(('N'<<8) | 17) /* return all table entries */
#define N_nuireset	(('N'<<8) | 18) /* reset address table      */

/* SNMP API Commands */
#define	RFC_1382_ADMN		(('M' << 8) | 49)
#define	RFC_1382_STAT		(('M' << 8) | 50)
#define	RFC_1382_CHANNEL	(('M' << 8) | 51)
#define	RFC_1382_CIRCUIT	(('M' << 8) | 52)
#define	RFC_1382_TRACE_ON	(('M' << 8) | 53)
#define	RFC_1382_TRACE_OFF	(('M' << 8) | 54)

/* SNMP Trace Events */
#define	SNMP_EVENT_CLEARED_CIRCUIT	0x01L
#define	SNMP_EVENT_CALL_PARM		0x02L
#define	SNMP_EVENT_RESTART		0x04L
#define	SNMP_EVENT_RESET		0x08L


/******************************************************************
 *
 * M_IOCTL message type definitions 
 *
 */

#define NLI_VERSION 3	/* Current NLI version, returned by N_getnliversion */

/* For host drivers */
#ifndef MAXIOCBSZ
#define	MAXIOCBSZ	1024
#endif

struct nliformat {
	uint32	version;	/* NLI version number */
};

struct xll_reg {			/* For ioctl registration */
	struct ll_reg	lreg;		/* Link registration format */
	int32		lmuxid;		/* LINK identifier */
};

struct snoptformat {
	uint32		U_SN_ID;
	uint32		newSUB_MODES;
	uint32		rd_wr;
};

struct pvcconff {
	uint32	  sn_id;        /* Subnetwork       */
	uint32    lci;          /* Logical channel  */
	uint32    locpacket;    /* Loc packet size  */
	uint32    rempacket;    /* Rem packet size  */
	uint32    locwsize;     /* Loc window size  */
	uint32    remwsize;     /* Rem window size  */
};

#define PVC_MAP_SIZE   (MAXIOCBSZ - 8)
#define MAX_PVC_ENTS   (PVC_MAP_SIZE / sizeof(struct pvcconff))

struct pvcmapf {
	struct pvcconff entries[MAX_PVC_ENTS]; /* Data buffer             */
	int32           first_ent;             /* Where to start search   */
	uint32          num_ent;               /* Number entries returned */
};

struct smallvcinfo {
	uint32    xstate;       /* VC state         */
	uint32    xtag;         /* VC check record  */
	uint32	  xu_ident;     /* subnetwork id    */
	uint32	  ampvc;	/* =1 if a PVC	    */
};

#define VC_STATES_SIZE   (MAXIOCBSZ - 8)
#define MAX_VC_ENTS      (VC_STATES_SIZE / sizeof(struct smallvcinfo))

struct vcinfof {
	struct smallvcinfo  vcinfo[MAX_VC_ENTS];   /* Data buffer             */
	int32              first_ent;             /* Where to start search   */
	int32              num_ent;               /* Number entries returned */
};

struct Nzstat {
	uint32	snid ;
};


/************************ 
  NUI Table Manipulation 
 ************************/

#define NUIMAXSIZE	64
#define NUIFACMAXSIZE	32

struct nuiformat {
	uint32	nui_len;
	uint8	nui_string[NUIMAXSIZE];	   /* Network User Identifier */
};

struct facformat {
	uint32 SUB_MODES;	/* Mode tuning bits for net */
        uint32 LOCDEFPKTSIZE;	/* Local default pkt p */
        uint32 REMDEFPKTSIZE;	/* Local default pkt p */
        uint32 LOCDEFWSIZE;	/* Local default window size */
        uint32 REMDEFWSIZE;	/* Local default window size */
	uint32 locdefthclass;   /* Local default value         */
	uint32 remdefthclass;   /* Remote default value        */
	uint32 CUG_CONTROL;	/* CUG facilities */
};

/*
 * Address table manipulation primitives
 */

struct nui_put {
	int32	prim_class;	/* Always NUI_MSG			*/
	int32	op;		/* Always NUI_ENT			*/
	struct	nuiformat	nuid;		/* NUI			*/
	struct	facformat	nuifacility;	/* NUI facilities	*/
};

struct nui_del {
	int32	prim_class;	/* Always NUI_MSG			*/
	int32	op;		/* Always NUI_DEL			*/
	struct	nuiformat	nuid;		/* NUI	to delete	*/
};

struct nui_get {
	int32		prim_class;	/* Always NUI_MSG			*/
	int32		op;		/* Always NUI_GET			*/
	struct nuiformat	nuid;		/* NUI to get		*/
/* Following field filled in in reply: (as for NUI_PUT)	*/
	struct facformat	nuifacility;	/* NUI facilities	*/
};

struct nui_reset {
	int32		prim_class;	/* Always NUI_MSG	*/
	int32		op;		/* Always NUI_RESET	*/
};

typedef struct nui_addr {
	struct facformat	nuifacility;	/* NUI facilities	*/
	int32     		next_free;	/* Next free entry      */
	struct nuiformat	nuid;		/* NUI			*/
	uint32			status;		/* temp/permanent entry */
} NUI_ADDR;

#define NUI_TEMPORARY	1	/* temporary address entry status	*/
#define NUI_PERMANENT	2	/* permanent address entry status	*/

/*
 *  Defines for the Multiple Get IOCTL
 *
 *  NOTE: This size of structure "nui_mget" must not
 *	  exceed MAXIOCBSZ byte (as defined in stream.h).
 *	  Thus if other fields are added to "nui_mget"
 *	  then MGET_NBUFSIZE must decrease to cope
 *	  with any changes made.
 */
 
#define MGET_NBUFSIZE	(MAXIOCBSZ - 20)	/*
						 * Take into account the
						 * other 5 fields by reducing
						 * the buffer size by 20
						 */
#define MGET_NMAXENT	(MGET_NBUFSIZE / sizeof(NUI_ADDR) ) 


struct nui_mget {
	int32		prim_class;	   /* Always NUI_MSG			*/
	int32		op;		   /* Always NUI_MGET			*/
	uint32		first_ent;	   /* First entry required		*/
	uint32		last_ent; 	   /* Last entry required		*/
	uint32		num_ent;	   /* Number of entries required	*/
	int8 		buf[MGET_NBUFSIZE]; /* Data Buffer			*/
};

typedef union nui_adrop {
	int32	prim_class;		/* Always NUI_MSG		*/
	struct	nui_put   nui_put;
	struct	nui_del   nui_del;
	struct	nui_get   nui_get;
	struct	nui_mget  nui_mget;
	struct	nui_reset nui_reset;
} S_NUI_ADROP;


/* ----------------------------------------------------------------------
 *
 * Definition for the configuration record structure.  Includes all
 *  parameters.
 * ---------------------------------------------------------------------- 
 */

struct wlcfg {
	uint32		U_SN_ID;	/* Upper level id for net (soft) */
	uint32		NET_MODE;	/* Prot/net in use e.g. PinkBook */
	uint32		X25_VSN;	/* Non-zero : 1984, otherwise 1980 */
	uint32		L3PLPMODE;	/* 1 DTE, 0 DCE, 2 DXE */

        /* X25 PLP virtual circuit ranges */

	int32         LPC;               /* Lowest  Permanent VC           */
	int32         HPC;               /* Highest Permanent VC           */
        int32         LIC;               /* Lowest  Incoming channel       */
        int32         HIC;               /* Highest Incoming channel       */
        int32         LTC;               /* Lowest  Two-way channel        */
        int32         HTC;               /* Highest Two-way channel        */
        int32         LOC;               /* Lowest  Outgoing channel       */
        int32         HOC;               /* Highest Outgoing channel       */
	int32         NPCchannels;	 /* Number PVC channels            */
	int32         NICchannels;       /* Number IC channels             */
	int32         NTCchannels;       /* Number TC channels             */
	int32         NOCchannels;       /* Number OC channels             */
        int32         Nochnls;           /* Total number of channels       */

	uint32	THISGFI;	/* GFI operating on net */
        uint32	LOCMAXPKTSIZE;	/* Max value acceptable for pkt p */
        uint32	REMMAXPKTSIZE;	/* Max value acceptable for pkt p */
        uint32	LOCDEFPKTSIZE;	/* Local default pkt p */
        uint32	REMDEFPKTSIZE;	/* Local default pkt p */
	uint32	LOCMAXWSIZE;	/* Max value acceptable for wsize */
	uint32	REMMAXWSIZE;	/* Max value acceptable for wsize */
        uint32	LOCDEFWSIZE;	/* Local default window size */
        uint32	REMDEFWSIZE;	/* Local default window size */

        uint32	MAXNSDULEN;	/* Max data delivery to N-user */

        /* X25 PLP timer and retransmission values */

        int32         ACKDELAY;		 /* Ack suppress and buffs low     */
        int32         T20value;          /* Restart request                */
        int32         T21value;          /* Call request                   */
        int32         T22value;          /* Reset request                  */
        int32         T23value;          /* Clear request                  */

        int32         Tvalue;            /* Ack and busy timer             */
        int32         T25value;          /* Window rotation timer          */
        int32         T26value;          /* Interrupt response             */

        int32         idlevalue;         /* Idle timeout value for link    */
        int32         connectvalue;      /* Link connect timer             */

        uint32        R20value;          /* Restart request                */
        uint32        R22value;          /* Reset request                  */
        uint32        R23value;          /* Clear request                  */

	/* Local values for qos checking */

	uint32        localdelay;       /* Internal delay locally      */
	uint32        accessdelay;      /* Line access delay locally   */

	/* Throughput Classes */
	
	uint32        locmaxthclass;    /* Local max thruput           */
	uint32        remmaxthclass;    /* Remote max thruput          */
	uint32        locdefthclass;    /* Local default value         */
	uint32        remdefthclass;    /* Remote default value        */
	uint32        locminthclass;    /* Local minimum for the PSDN  */
	uint32        remminthclass;    /* Remote minimum for the PSDN */

	uint32        CUG_CONTROL;	 /* CUG facilities subscribed to   */
	uint32        SUB_MODES;	 /* Mode tuning bits for net */

	/* PSDN localisation record */

	struct {
	uint32        SNMODES;		/* Mode tuning for PSDN */
	uint32 intl_addr_recogn;	/* Recognise intnatl  */
	uint32 intl_prioritised;	/* Prioritise intnatl */
	uint32 dnic1;			/* 4 BCD digits DNIC  */
	uint32 dnic2;			/* used when required */
	uint32 prty_encode_control;	/* Encode priority    */
	uint32 prty_pkt_forced_value;   /* Force pkt size     */
	uint32 src_addr_control;	/* Calling addr fixes */
	uint32 dbit_control;		/* Action on D-bit    */
	uint32 thclass_neg_to_def;      /* TELENET negn type  */
	uint32 thclass_type;		/* tclass map handle  */
	uint8  thclass_wmap[16];	/* tclass -> wsize    */
	uint8  thclass_pmap[16];	/* tclass -> psize    */
	} psdn_local;

	/* Link level local address or local DTE address */

	struct lsapformat local_address;

        };

/* ---- SUBNET TUNING MODE BITS ---- */

#define    SUB_EXTENDED           1  /* Subscribe extended fac               */
#define    BAR_EXTENDED           2  /* Bar extended incoming                */
#define    SUB_FSELECT            4  /* Subscribe fselect fac                */
#define    SUB_FSRRESP            8  /* Subscribe fs restrict                */
#define    SUB_REVCHARGE         16  /* Subscribe rev charge                 */
#define    SUB_LOC_CHG_PREV      32  /* Subscribe local charging prevention  */
#define    BAR_INCALL            64  /* Bar incoming calls                   */
#define    BAR_OUTCALL          128  /* Bar ougoing calls                    */
#define    SUB_TOA_NPI_FMT      256  /* Subscribe TOA/NPI Address Format     */
#define    BAR_TOA_NPI_FMT      512  /* Bar TOA/NPI Address Format incoming  */
#define    SUB_NUI_OVERRIDE    1024  /* Subscribe NUI Override  */
#define    AND_80                 0  /* BIT RESERVED 84/80                   */

/* ---- PSDN LOCALISATION TUNING MODE BITS ---- */

#define    ACC_NODIAG             1  /* Short clr etc is OK                  */
#define    USE_DIAG               2  /* Use diagnostic packet                */
#define    CCITT_CLEAR_LEN        4  /* Restrict Clear lengths               */
#define    BAR_DIAG               8  /* Bar diagnostic packets               */
#define    DISC_NZ_DIAG          16  /* Discard diag packets on non-zero LCN */
#define    ACC_HEX_ADD           32  /* Allow hex digits in dte addresses    */
#define    BAR_NONPRIV_LISTEN    64  /* Bar non privileged users from   
                                        listening for incoming calls.        */
/* ---- CUG SUBSCRIPTION BITS ------- */

#define		SUB_CUG			1
#define 	SUB_PREF		2
#define		SUB_CUGOA		4
#define		SUB_CUGIA		8
#define		BASIC			16
#define		EXTENDED		32
#define 	BAR_CUG_IN		64

/* ----- D-BIT CONTROL ACTIONS ------- */

#define 	CC_IN_CLR		1
#define 	CC_IN_ZERO		2
#define		CC_OUT_CLR		4
#define 	CC_OUT_ZERO		8
#define 	DT_IN_RST		16
#define  	DT_IN_ZERO		32
#define		DT_OUT_RST		64
#define		DT_OUT_ZERO		128


/* ------ NETWORK MODE TYPES --------- */

/* (Only X25_LLC and DATAPAC currently plumbed into code) */

#define		X25_LLC		1	/*  X.25(84)/LLC-2	*/
#define		X25_88		2	/*  X.25(88)		*/
#define		X25_84		3	/*  X.25(84)		*/
#define		X25_80		4	/*  X.25(80)		*/
#define		PSS		5	/*  UK			*/
#define		AUSTPAC		6	/*  Australia		*/
#define		DATAPAC		7	/*  Canada		*/
#define		DDN		8	/*  USA			*/
#define		TELENET		9	/*  USA			*/
#define		TRANSPAC	10	/*  France		*/
#define		TYMNET		11	/*  USA			*/
#define		DATEX_P		12	/*  West Germany	*/
#define		DDX_P		13	/*  Japan		*/
#define		VENUS_P		14	/*  Japan		*/
#define		ACCUNET		15	/*  USA			*/
#define		ITAPAC		16	/*  Italy		*/
#define		DATAPAK		17	/*  Sweden		*/
#define		DATANET		18	/*  Holland		*/
#define		DCS		19	/*  Belgium		*/
#define		TELEPAC		20	/*  Switzerland		*/
#define		F_DATAPAC	21	/*  Finland		*/
#define		FINPAC		22	/*  Finland		*/
#define		PACNET		23	/*  New Zealand		*/

#define		G_8		0X10	/* GFI - not extended sequencing   */
#define		G_128		0X20	/* GFI - extended sequencing       */

/* Statistical Information */

#define		cll_coll	44	/* Call collision count (not rjc)  */
#define		cll_in		45	/* Calls rcvd and indicated        */
#define		cll_out		46	/* Calls sent                      */
#define		cll_uabort	47	/* Calls aborted by user b4 sent   */
#define		rjc_buflow	48	/* Calls rejd no buffs b4 sent     */
#define		rjc_coll	49	/* Calls rejd - collision DCE mode */
#define		rjc_failNRS	50	/* Calls rejd negative NRS resp    */
#define		rjc_lstate	51	/* Calls rejd link disconnecting   */
#define		rjc_nochnl	52	/* Calls rejd no lcns left         */
#define		rjc_nouser	53	/* In call but no user on NSAP     */
#define		rjc_remote	54	/* Call rejd by remote responder   */
#define		rjc_u		55	/* Call rejd by NS user            */
#define		caa_in		56	/* Call established for outgoing   */
#define		caa_out		57	/* Ditto - in call                 */
#define		dg_in		58	/* DIAG packets in                 */
#define		dg_out		59	/* DIAG packets out                */
#define		dt_in		60	/* Data packets rcvd               */
#define		dt_out		61	/* Data packets sent               */
#define		ed_in		62	/* Interrupts rcvd                 */
#define		ed_out		63	/* Interrupts sent                 */
#define		p4_ferr		64	/* Format errors in P4             */
#define		rem_perr	65	/* Remote protocol errors          */
#define		res_ferr	66	/* Restart format errors           */
#define		res_in		67	/* Restarts received (inc DTE/DXE) */
#define		res_out		68	/* Restarts sent (inc DTE/DXE)     */
#define		rnr_in		69	/* Receiver not ready rcvd         */
#define		rnr_out		70	/* Receiver not ready sent         */
#define		rr_in		71	/* Receiver ready rvcd             */
#define		rr_out		72	/* Receiver ready sent             */
#define		rst_in		73	/* Resets rcvd                     */
#define		rst_out		74	/* Resets sent                     */
#define		vcs_labort	75	/* Circuits aborted via link event */
#define		r23exp		76	/* Circuits hung by r23 expiry     */
#define		l2conin		77	/* Link level connect established  */
#define		l2conok		78	/* LLC connections accepted        */
#define		l2conrej	79	/* LLC connections rejd            */
#define		l2refusal	80	/* LLC connnect requests refused   */
#define		l2lzap		81	/* Oper requests to kill link      */
#define		l2r20exp	82	/* R20 retransmission expiry       */
#define		l2dxeexp	83	/* DXE/connect expiry              */
#define		l2dxebuf	84	/* DXE resolv abort - no buffers   */
#define		l2noconfig	85	/* No config base - error          */
#define		xiffnerror	86	/* Upper i/f bad M_PROTO type	   */
#define		xifuserror	87	/* Upper user fn/state error	   */
#define		xintdisc	88	/* Internal disconnect events	   */
#define		xifaborts	89	/* Interface abort_vc called	   */
#define		PVCusergone	90	/* Count of non-user interactions  */
#define		pinitclears	91	/* Provider-Initiated clears       */
#define		remote_rst	92	/* DTE Initiated Resets            */
#define		provider_rst	93	/* Provider Initiated Resets       */
#define		prc_errors	94	/* Procedure error count           */
#define		t20_expire	95	/* T20 expire count                */
#define		t21_expire	96	/* T21 expire count                */
#define		t22_expire	97	/* T22 expire count                */
#define		t23_expire	98	/* T23 expire count                */
#define		t26_expire	99	/* T26 expire count                */
#define		r22exp		100	/* R22 expiry count                */
#define		mon_size	101	/* 1 over last, for length         */

#define	GSTAT_SIZE	mon_size

struct Ngstat {
	uint32	snid ;
	uint32	starray[GSTAT_SIZE] ;
};

/* SNMP API Structures */
typedef struct rfc_1382_admn_struct {
        uint32  X25AdmnIndex;
        uint32  X25AdmnInterfaceMode;
        uint32  X25AdmnMaxActiveCircuits;
        uint32  X25AdmnPacketSequencing;
        uint32  X25AdmnRestartTimer;
        uint32  X25AdmnCallTimer;
        uint32  X25AdmnResetTimer;
        uint32  X25AdmnClearTimer;
        uint32  X25AdmnWindowTimer;
        uint32  X25AdmnDataRxmtTimer;
        uint32  X25AdmnInterruptTimer;
        uint32  X25AdmnRejectTimer;
        uint32  X25AdmnRegistrationRequestTimer;
        uint32  X25AdmnMinimumRecallTimer;
        uint32  X25AdmnRestartCount;
        uint32  X25AdmnResetCount;
        uint32  X25AdmnClearCount;
        uint32  X25AdmnDataRxmtCount;
        uint32  X25AdmnRejectCount;
        uint32  X25AdmnRegistrationRequestCount;
        uint32  X25AdmnNumberPVCs;
        uint32  X25AdmnDefCallParamId;
        uint8   X25AdmnLocalAddress[20];
} rfc_1382_admn_t ;

typedef struct rfc_1382_stat_struct {
        uint32  X25StatIndex;
        uint32  X25StatInCalls;
        uint32  X25StatInCallRefusals;
        uint32  X25StatInProviderInitiatedClears;
        uint32  X25StatInRemotelyInitiatedResets;
        uint32  X25StatInProviderInitiatedResets;
        uint32  X25StatInRestarts;
        uint32  X25StatInDataPackets;
        uint32  X25StatInAccusedOfProtocolErrors;
        uint32  X25StatInInterrupts;
        uint32  X25StatOutCallAttempts;
        uint32  X25StatOutCallFailures;
        uint32  X25StatOutInterrupts;
        uint32  X25StatOutDataPackets;
        uint32  X25StatOutgoingCircuits;
        uint32  X25StatIncomingCircuits;
        uint32  X25StatTwoWayCircuits;
        uint32  X25StatRestartTimeouts;
        uint32  X25StatCallTimeouts;
        uint32  X25StatResetTimeouts;
        uint32  X25StatClearTimeouts;
        uint32  X25StatDataRxmtTimeouts;
        uint32  X25StatInterruptTimeouts;
        uint32  X25StatRetryCountExceeds;
        uint32  X25StatClearCountExceeds;
} rfc_1382_stat_t ;

typedef struct rfc_1382_channel_struct {
        uint32  X25ChannelIndex;
        uint32  X25ChannelLIC;
        uint32  X25ChannelHIC;
        uint32  X25ChannelLTC;
        uint32  X25ChannelHTC;
        uint32  X25ChannelLOC;
        uint32  X25ChannelHOC;
} rfc_1382_channel_t ;

typedef struct rfc_1382_circuit_struct {
        uint32  X25CircuitIndex;
        uint32  X25CircuitChannel;
        uint32  X25CircuitStatus;
        uint32  X25CircuitEstablishTime;
        uint32  X25CircuitDirection;
        uint32  X25CircuitInOctets;
        uint32  X25CircuitInPDUs;
        uint32  X25CircuitRemotelyInitiatedResets;
        uint32  X25CircuitProviderInitiatedResets;
        uint32  X25CircuitInInterrupts;
        uint32  X25CircuitOutOctets;
        uint32  X25CircuitOutPDUs;
        uint32  X25CircuitOutInterrupts;
        uint32  X25CircuitDataRxmtTimeouts;
        uint32  X25CircuitResetTimeouts;
        uint32  X25CircuitInterruptTimeouts;
        uint32  X25CircuitCallParamId;
        uint8   X25CircuitCalledDteAddress[20];
        uint8   X25CircuitCallingDteAddress[20];
        uint8   X25CircuitOriginallyCalledAddress[20];
} rfc_1382_circuit_t ;

typedef struct SNMP_clearedcircuit_event_struct {
        uint32			Event;
        uint32			X25ClearedCircuitIndex;
        uint32			X25ClearedCircuitPleIndex;
        uint32			X25ClearedCircuitTimeEstablished;
        uint32			X25ClearedCircuitTimeCleared;
        uint32			X25ClearedCircuitChannel;
        uint32			X25ClearedCircuitClearingCause;
        uint32			X25ClearedCircuitDiagnosticCode;
        uint32			X25ClearedCircuitInPDUs;
        uint32			X25ClearedCircuitOutPDUs;
        uint8			X25ClearedCircuitCalledAddress[20];
        uint8			X25ClearedCircuitCallingAddress[20];
        uint8			X25ClearedCircuitClearFacilities[112];
        rfc_1382_circuit_t	X25ClearedCircuitFinalStats;
} SNMP_ClearedCircuit_Event_t ;

typedef struct SNMP_callparm_event_struct {
        uint32  Event;
        uint32  X25CallParmIndex;
        uint32  X25CallParmChannel;
        uint32  X25CallParmStatus;
        uint32  X25CallParmRefCount;
        uint32  X25CallParmInPacketSize;
        uint32  X25CallParmOutPacketSize;
        uint32  X25CallParmInWindowSize;
        uint32  X25CallParmOutWindowSize;
        uint32  X25CallParmAcceptReverseCharging;
        uint32  X25CallParmProposeReverseCharging;
        uint32  X25CallParmFastSelect;
        uint32  X25CallParmInThruputClassSize;
        uint32  X25CallParmOutThruputClassSize;
        uint8   X25CallParmCUG[8];
        uint8   X25CallParmCUGOA[8];
        uint8   X25CallParmBCUG[4];
        uint8   X25CallParmNUI[112];
        uint32  X25CallParmChargingInfo;
        uint8   X25CallParmRPOA[112];
        uint32  X25CallParmTrnstDly;
        uint8   X25CallParmCallingExt[44];
        uint8   X25CallParmCalledExt[44];
        uint32  X25CallParmInMinThruputCls;
        uint32  X25CallParmOutMinThruputCls;
        uint8   X25CallParmEndTrnsDly[8];
        uint8   X25CallParmPriority[8];
        uint8   X25CallParmProtection[112];
        uint32  X25CallParmExptData;
        uint8   X25CallParmUserData[132];
        uint8   X25CallParmCallingNetworkFacilities[112];
        uint8   X25CallParmCalledNetworkFacilities[112];
} SNMP_CallParm_Event_t ;

typedef struct SNMP_restart_event_struct {
        uint32  Event;
        uint32  X25OperIndex;
} SNMP_Restart_Event_t ;

typedef struct SNMP_reset_event_struct {
        uint32  Event;
        uint32  X25CircuitIndex;
        uint32  X25CircuitChannel;
} SNMP_Reset_Event_t ;

typedef union SNMP_trace_union {
        uint32				Event;
        SNMP_ClearedCircuit_Event_t	ClearedCircuitEvent;
        SNMP_CallParm_Event_t		CallParmEvent;
        SNMP_Restart_Event_t		RestartEvent;
        SNMP_Reset_Event_t		ResetEvent;
} SNMP_trace_t ;

