/*****************************************************************************
 * 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: fr_cont.h,v 1.11 1996/10/25 19:00:00 gary Exp $
 */

#ifndef	_FR_CONT_H
#define	_FR_CONT_H

/* 
 * Frame Relay IOCTL Definitions the group from F is used
 *  and does not interfere with other IOCTL definitions 
 */

#define	FRI_FRSFR_OpenPLL 	('F'<< 8 | 1)  /* Open a PLL */
#define	FRI_FRSFR_ClosePLL	('F'<< 8 | 2)  /* Close a PLL */
#define FRI_FRSFR_XonPLL	('F'<< 8 | 3)  /* Xon a PLL */
#define FRI_FRSFR_XoffPLL	('F'<< 8 | 4)  /* Xoff a PLL */
#define FRI_FRSFR_GetWriteQueueDepth ('F'<< 8 | 5) /* Get Write Queue Depth */

#define	FRI_ENCAP_OpenPLL	('F'<< 8 | 6) /* Open a Encapsulated PLL */
#define FRI_ENCAP_ClosePLL	('F'<< 8 | 7) /* Close a Encapsulated PLL */

#define FRI_FRSCONF_Init	('F'<< 8 | 8) /* Initial the FRS System */
#define FRI_FRSCONF_Disable	('F'<< 8 | 9) /* Disable the FRS System */ 
#define FRI_FRSCONF_InitLink	('F'<< 8 | 10) /* Initialize a Link */
#define FRI_FRSCONF_UnInitLink	('F'<< 8 | 11) /* UnInitialize a Link */
#define FRI_FRSCONF_GetConfig	('F'<< 8 | 12) /* Get FRS Configuration */
#define FRI_FRSCONF_SetConfig	('F'<< 8 | 13) /* Set FRS Configuration */
#define FRI_FRSCONF_GetStatistics ('F'<< 8 | 14) /* Get FRS Statistics */
#define FRI_FRSCONF_GetResetStat ('F'<< 8 | 15) /* Get and reset statistics */
#define FRI_FRSCONF_InsertLink	('F'<< 8 | 16) /* Insert a Link into the FRS */
#define FRI_FRSCONF_DeleteLink	('F'<< 8 | 17) /* Delete a Link into the FRS */
#define FRI_FRSCONF_InsertPLL   ('F'<< 8 | 18) /* Insert a PLL onto a link */
#define FRI_FRSCONF_DeletePLL	('F'<< 8 | 19) /* Delete a PLL from a Link */
#define FRI_FRSCONF_SetSysConfig ('F'<< 8 | 20) /* Set FRS System Config */
#define FRI_FRSCONF_SetLinkConfig ('F'<< 8 | 21) /* Set FRS Link Config */
#define FRI_FRSCONF_SetPLLConfig ('F'<< 8 | 22) /* Set PLL Configuration */
#define FRI_FRSCONF_ValidParam 	('F'<< 8 | 23) /* Determine Valid Parameters*/
#define FRI_FRSCONF_FindFlag	('F'<< 8 | 24) /* Find a Flag in a Config */
#define FRI_FRSCONF_SetFlag	('F'<< 8 | 25) /* Set a Flag in a Config */

#define	FRI_FRSTRACE_Enable	('F'<< 8 | 26 ) /* Enable Stream for Trace */
#define FRI_FRSTRACE_Disable	('F'<< 8 | 27 ) /* Disable Stream for Trace */

#define	FRI_SETSNID		('F'<< 8 | 28 ) /* Set SubNet ID */
#define	FRI_SNIDENT		('F'<< 8 | 29 ) /* Set SubNet Entry/Enable */

#define	FRP_FRSFR_RcvData	('F'<< 8 | 30) /* M_Proto for Upward data */
#define FRP_FRSFR_SendData	('F'<< 8 | 31) /* M_Proto for Downward Data */
#define FRP_ENCAP_SendData	('F'<< 8 | 32) /* M_Proto for Encap Downward */

#define	FRI_GetSysParameters	('F'<< 8 | 33) /* Get System Paramters */ 
#define	FRI_GetLinkParameters	('F'<< 8 | 34) /* Get Link Parameters */
#define	FRI_GetPLLParameters	('F'<< 8 | 35) /* Get PLL Parameters */
#define	FRI_GetLinkStatistics	('F'<< 8 | 36) /* Get Link Statistics */
#define	FRI_GetLinkErrors	('F'<< 8 | 37) /* Get Link Errors */
#define	FRI_GetPLLStatistics	('F'<< 8 | 38) /* Get PLL Statistics */
#define	FRI_GetLMIStatistics	('F'<< 8 | 39) /* Get LMI Statistics */
#define	FRI_GetProtocolErrorStats ('F'<< 8 | 40) /* Get Protocol Error Stats */
#define	FRI_GetPLLFragStats 	('F'<< 8 | 41) /* Get Fragmentation Stats */
#define	FRI_GetInjectionMangStats ('F'<< 8 | 42) /* Get Injection Stats */
#define FRI_GetCMIProtocolStats	('F'<< 8| 43)	/* Get CMI Protocol Stats */ 
#define FRI_GetFRF9Stats	('F'<< 8| 44)	/* Get FRF.9 Stats */ 

/* 
 *	IP-Frame Relay-Encapsulation
 */ 

#define	FRI_IFRE_ENT		('F'<< 8| 60) /*IFRE: Put an IP/DLCI/LINK mem*/
#define	FRI_IFRE_DEL		('F'<< 8| 61) /*IFRE: Del an IP/DLCI/LINK mem*/
#define	FRI_IFRE_GET		('F'<< 8| 62) /*IFRE: Get an IP/DLCI/LINK mem*/
#define	FRI_IFRE_MGET		('F'<< 8| 63) /*IFRE: Get all members */
#define	FRI_IFRE_RESET		('F'<< 8| 64) /*IFRE: Reset all members */
#define	FRI_IFRE_STATS		('F'<< 8| 65) /*IFRE: Get Stats */
#define	FRI_IFRE_STATS_INIT	('F'<< 8| 66) /*IFRE: Get Stats and Initialize*/
#define FRI_IFRE_SNREG		('F'<< 8| 67) /*IFRE: SNREG */

/*
 * FR MIB calls
 */
#define	RFC_1315_DLCMI		('M'<< 8| 17)	/* LMI Configuration */
#define	RFC_1315_CIRCUIT	('M'<< 8| 18)	/* DLCI Stats */
#define	RFC_1315_ERR		('M'<< 8| 19)	/* Error statistics */
 
#define FR_FAIL			-1   /* Failure on Write */
#define MAX_ASCII_STRING	10 /* Maximum String in atol or atoi */

/* API return codes and error codes */

#define FRS_SUCCESS             0         /* Successful operation */
#define FRS_INVALID             1         /* Invalid/out-of-range params */
#define FRS_CLOSED              2         /* PLL closed */
#define FRS_DISABLED            3         /* FRS system disabled */
#define FRS_NO_SPACE            4         /* Allocation tables full */
#define FRS_NO_BLKER            5         /* Blocking functions undefined */
#define FRS_LINK_DOWN           6         /* Link is down */
#define FRS_PLL_DOWN            7         /* PLL is down */
#define FRS_NO_BUFFERS          8         /* Memory allocation failed */
#define FRS_BAD_CCB_HANDLE      9         /* Invalid CCB handle passed */
#define FRS_ENABLED             10        /* FRS enabled */
#define FRS_OPEN                11        /* PLL Open */
#define FRS_INIT_FAILURE        12        /* Failure during initialisation */
#define FRS_DEST_UNREACH        13        /* FRS switch could not fwd frame */
#define FRS_QUEUE_EMPTY         14        /* queue is empty */
#define FRS_INCOMPLETE_FRAME    15        /* frame fragment received */
#define FRS_COMPLETE_FRAME      16        /* final frame fragment received */
#define FRS_TX_FRAME_DROPPED    17 /* in std injection mode, Bc was exceeded. */
#define FRS_IN_PROGRESS         18        /* a TxDone list entry is not
									ready to be taken out of the
									list yet */
#define FRS_INJECT_FAILED       19        /* failure during FRSInject() */

/*****************************************************************************
*  ENCAPSULATION CONSTANTS    
*****************************************************************************/

/** User API codes for protocol identification
 **/

#define PID_ETHERNET_FCS      0x00 /* Ethernet and 802.3 (w/FCS) */
#define PID_ETHERNET          0x01 /* Ethernet and 802.3 (no FCS) */
#define PID_TOKEN_BUS_FCS     0x02 /* 802.4 (w/FCS) */
#define PID_TOKEN_BUS         0x03 /* 802.4 (no FCS) */
#define PID_TOKEN_RING_FCS    0x04 /* 802.5 (w/FCS) */
#define PID_TOKEN_RING        0x05 /* 802.5 (no FCS) */
#define PID_FDDI_FCS          0x06 /* FDDI (w/FCS) */
#define PID_FDDI              0x07 /* FDDI (no FCS) */
#define PID_MAN_FCS           0x08 /* 802.6 (w/FCS) */
#define PID_MAN               0x09 /* 802.6 (no FCS) */
#define PID_BPDU              0x0a /* 802.1(d) Bridged PDUs */
#define PID_IP                0x0b /* Internet Protocol */
#define PID_ISO_CLNP          0x0c /* ISO CLNP */
#define PID_ISO_ESIS          0x0d /* ISO ESIS */
#define PID_ISO_ISIS          0x0e /* ISO ISIS */
#define PID_OLD_ETHERNET      0x0f /* Old style Ethernet */
#define PID_SNA_SUBAREA       0x10 /* SNA Q933 frame */
#define PID_SNA_PERIPHERAL    0x11 /* SNA Q933 frame */
#define PID_SNA_APPN          0x12 /* SNA Q933 frame */
#define PID_NETBIOS           0x13 /* NETBIOS Q933 frame */
#define PID_RSVD_01           0x14 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_02           0x15 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_03           0x16 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_04           0x17 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_05           0x18 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_06           0x19 /* Reserved - see notes in frsencap.h */
#define PID_RSVD_07           0x1a /* Reserved - see notes in frsencap.h */
#define PID_RSVD_08           0x1b /* Reserved - see notes in frsencap.h */
#define PID_RSVD_09           0x1c /* Reserved - see notes in frsencap.h */
#define PID_RSVD_10           0x1d /* Reserved - see notes in frsencap.h */
#define PID_ARP               0x1e /* ARP frames with SNAP-Ethertype encap. */ 
#define PID_IPX               0x1f /* IPX frames with SNAP-Ethertype */

#define PID_NONE              0xfc /* NONE ( No Encapsulation ) */
#define END_PID_TABLE         0xfe /* Last entry in PID lookup table */
#define PID_UNKNOWN           0xff /* ?? API protocol id */

/** This define must always be 1 more than the last PID table API entry.
 **/
#define MAX_PROTOCOL          (PID_IPX+1)

/** Return codes from encapsulation API routines. See documentation for
 ** specific details.
 **/
#define ENCAP_UNK_PROT        (FRS_ENCAP_CODE_BASE+0)
#define ENCAP_UNK_PROT_RX     (FRS_ENCAP_CODE_BASE+1)
#define ENCAP_UNK_PROT_TX     (FRS_ENCAP_CODE_BASE+2)
#define ENCAP_NULL_FRAME_TX   (FRS_ENCAP_CODE_BASE+3)
#define ENCAP_NULL_FRAME_RX   (FRS_ENCAP_CODE_BASE+4)
#define ENCAP_INV_DATA_SIZE   (FRS_ENCAP_CODE_BASE+5)
#define ENCAP_INVALID         (FRS_ENCAP_CODE_BASE+6)
#define ENCAP_UNK_FRAME_RX    (FRS_ENCAP_CODE_BASE+7)
#define ENCAP_LOST_FRAME_RX   (FRS_ENCAP_CODE_BASE+8)
#define ENCAP_BUFSIZE_INVALID (FRS_ENCAP_CODE_BASE+9)
#define ENCAP_UNK_ORG_RX      (FRS_ENCAP_CODE_BASE+10)
#define ENCAP_NOT_REGISTERED  (FRS_ENCAP_CODE_BASE+11)
#define _ENCAP_NEW_FRAME      (FRS_ENCAP_CODE_BASE+12) /* reserved */

/* 
 * Structures to be passed in IOCTL's 
 */

typedef uint8  u_char;           /* 8-bit */
typedef uint16 u_short;          /* 16-bit */
typedef uint32 u_int;            /* 32-bit */
typedef uint32 u_long;           /* 64-bit or 32-bit */
typedef uint32 PLL_EXTENT;   /* user definable extension within FRS_PLL_CFG */
typedef uint32 LNK_EXTENT;   /* user definable extension within FRS_LINK_CFG */

/****************************************************************************** 
 * Configuration information related to a PLL.
 ******************************************************************************/

#define FRS_PLL_NAME_SIZE       17   /* PLL Name String Length */

typedef struct frs_pll_cfg
{
    int8     frs_conf_name[FRS_PLL_NAME_SIZE+1];
    u_short  frs_pll_ndx;   /* frmrly_ccbcfg[] index(0..FRS_MAX_CHANNELS-1) */
    u_short  frs_pll_link;  /* link number (1..FRS_MAX_LINKS) */
    u_short  frs_pll_next;  /* the next PLL in this chain of PLLs */
    u_short  frs_pll_dlci;  /* dlci number (0 == PLL disabled) */
    u_long   frs_pll_BcMax; /* Bc (octets) per Tc period */
    u_long   frs_pll_BcMin; /* Bc that rate can fall back to */
    u_long   frs_pll_Be;    /* Be Excess Burst Size */
    u_long   frs_pll_CIR;   /* Committed Information Rate */
    u_short  frs_pll_CMP;   /* CMP Timer - Congestion Monitor Period */

    u_short  frs_pll_fwd_node;  /* Fwd dest. node: WAN Channel */
    u_short  frs_pll_fwd_link;  /* Fwd dest. link: WAN Channel */
    u_short  frs_pll_fwd_dlci;  /* Fwd dest. dlci number (0 == PLL disabled) */
    
    u_short  frs_pll_state; /* State of PLL: Enabled(1) or Disabled(0) */          
    /* These parameters relate to FRF.9 */
    u_char   frs_pll_FRF9RetryPeriod; /* Seconds between Mode One retries */
    u_char   frs_pll_FRF9RetryCount;  /* # of times Mode One retries are sent */
    u_char   frs_pll_FRF9ModesWanted; /* FRF.9 Quality of Service desired */
    u_short  frs_pll_FRF9ContextMax;  /* Maximum compression contexts allowed */

    /** ........................................................................
     ** The following field may be used by the target system as an extension
     ** to this structure. Note that this field does not have a corresponding
     ** OID in the H & J standard MIB. The OID for this field must be defined
     ** by the target system. The typedef PLL_EXTENT can be defined by the
     ** target system to be whatever is required.
     ** ........................................................................
     **/

    PLL_EXTENT pll_extent;      /* target system defined extension */

}
FRS_PLL_CFG;

/****************************************************************************** 
 * Configuration information related to a 'link'.
 ******************************************************************************/

#define FRS_LINK_NAME_SIZE      17   /* Link Name String length */

typedef struct frs_link_cfg
{
    int8     frs_conf_name[FRS_LINK_NAME_SIZE+1]; /* Link Name */
    u_short  frs_link_ndx;        /* frmrly_lkcfg[] index(0..FRS_MAX_LINKS-1) */
    u_short  frs_link_flags;      /* Options - See FRS_OPT_* in frs.h... */
    u_short  frs_link_lmi_dlci;   /* LMI DLCI (if enabled in link flags) */
    u_short  frs_link_1st_pllcfg; /* The base-0 index of the first channel */
    u_short  frs_link_max_frsize; /* Max Frame Size */
    u_short  frs_link_mN1;        /* FULL STATUS Enq Freq (DTE only) */
    u_short  frs_link_mN2;        /* Number of errors before error reported */
    u_short  frs_link_mN3;        /* Error recovery count */
    u_short  frs_link_mN4;        /* Max # of Stat Enqs rcvd (DCE only) */
    u_short  frs_link_mP1;        /* Maximum PLLs */
    u_short  frs_link_mP10;       /* Maximum multicast groups */
    u_short  frs_link_mT1;        /* STATUS ENQ Freq (DTE only) */
    u_short  frs_link_mT2;        /* Expected Stat Enq Frequency (DCE only) */
    u_short  frs_link_mT3;        /* Measurement interval for mN4 (DCE only */
    u_short  frs_link_state;      /* State of link: Enabled(1) or Disabled(0) */
    u_int    frs_link_tslotmap;   /* Maps to T1 DS0 partitions */
    LNK_EXTENT lnk_extent;        /* target system defined extension */
}
FRS_LINK_CFG;

typedef struct FRSFR_OpenPLL_struct {
	u_short	link ;
	u_short	dlci ;
	u_short pll_handle ;
}FRSFR_OpenPLL_t ;

typedef struct FRSFR_ClosePLL_struct {
	u_short pll_handle ;
}FRSFR_ClosePLL_t ;

typedef struct FRSFR_XoffPLL_struct {
	u_short link ;
	u_short dlci ;
}FRSFR_XoffPLL_t ;

typedef struct FRSFR_XonPLL_struct {
	u_short link ;
	u_short dlci ;
}FRSFR_XonPLL_t ;

typedef struct FRSFR_GetWriteQueueDepth_struct {
	u_short pll_handle ;
	u_short framecount ;
	u_long bytecount ;
}FRSFR_GetWriteQueueDepth_t ;

typedef struct ENCAP_OpenPLL_struct {
	u_short link ;
	u_short dlci ;
	u_short pll_handle ;
	u_short protocol_id ;
	u_short employ_STAC;
	u_short STAC_perf_mode;
	u_short STAC_perf_parm;
	u_short padding;
}ENCAP_OpenPLL_t ;

typedef struct ENCAP_ClosePLL_struct {
	u_short pll_handle ;
	u_short protocol_id ;
}ENCAP_ClosePLL_t ;

typedef struct FRSCONF_InitLink_struct {
	FRS_LINK_CFG cfgInfo ;
}FRSCONF_InitLink_t ;

typedef struct FRSCONF_UnInitLink_struct {
	u_short linknum ;
}FRSCONF_UnInitLink_t ;

typedef struct FRSCONF_GetConfig_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_GetConfig_t ;

typedef struct FRSCONF_SetConfig_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_SetConfig_t ;

typedef struct FRSCONF_GetStatistics_struct {
	u_short link ;
	u_short dlci ;
	u_short stat_id ;
	u_short	protocol ; 
	int8 stat_value[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_GetStatistics_t ;

typedef struct FRSCONF_SetStatistics_struct {
	u_short link ;
	u_short dlci ;
	u_short stat_id ;
	u_short	protocol ; 
	int8 stat_value[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_SetStatistics_t ;

typedef struct FRSCONF_GetResetStats_struct {
	u_short link ;
	u_short dlci ;
	u_short stat_id ;
	u_short	protocol ; 
	int8 stat_value[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_GetResetStats_t ;

typedef struct FRSCONF_InsertLink_struct {
	u_short link ;
	FRS_LINK_CFG linkconfig ;
}FRSCONF_InsertLink_t ;

typedef struct FRSCONF_DeleteLink_struct {
	u_short link ;
}FRSCONF_DeleteLink_t ;

typedef struct FRSCONF_InsertPLL_struct {
	u_short link ;
	u_short dlci ;
	FRS_PLL_CFG pllconfig ;
}FRSCONF_InsertPLL_t ;

typedef struct FRSCONF_DeletePLL_struct {
	u_short link ;
	u_short dlci ;
}FRSCONF_DeletePLL_t ;

typedef struct FRSCONF_SetSysConfig_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value_str[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_SetSysConfig_t ;

typedef struct FRSCONF_SetLinkConfig_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value_str[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_SetLinkConfig_t ;

typedef struct FRSCONF_SetPLLConfig_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value_str[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_SetPLLConfig_t ;

typedef struct FRSCONF_ValidParam_struct {
	u_short link ;
	u_short dlci ;
	u_short param_id ;
	int8 param_value_str[FRS_PLL_NAME_SIZE + 1] ;
}FRSCONF_ValidParam_t ;

typedef struct FRSTRACE_Enable_struct {
	u_short link ;
}FRSTRACE_Enable_t ;

typedef struct FRSTRACE_Disable_struct {
	u_short link ;
}FRSTRACE_Disable_t ;

typedef struct FRI_SETSNID_struct {
/* Ioctl block for L_SETSNID and L_GETSNID commands */
    u_short	    fri_type ;
    u_short         fri_spare; 	   /*   (for alignment)			*/
    u_long          fri_snid;      /* Subnetwork ID character		*/
    u_long          fri_index;     /* Link index			*/
}FRI_SETSNID_t ;

typedef struct FRI_SNIDENT_struct {
	/* Interface structures */
    u_short	fr_type;
    u_short	fr_class;
    u_short	fr_regstatus;
    u_short	fr_spare;
    u_long	fr_snid;
    u_short	fr_link;
}FRI_SNIDENT_t ;

typedef struct FRP_FRSFR_RcvData_struct {
	u_short command ;
	u_short type ;
	u_short link ;
	u_short dlci ;
	u_short protocol_id ;
	u_short code ;
}FRP_FRSFR_RcvData_t ;

typedef struct FRP_SendData_struct {
	u_short command ;
	u_short ccb_handle ;
	u_short protocol_id ;
	u_short error ;
} FRP_SendData_t ;

typedef struct FRI_GetSysParameters_struct {
	int8	sys_sw_rel[18] ;
	u_short	sys_max_links ;
	u_short sys_max_plls ;
	u_short	sys_bufsize ;
	u_short	sys_node_num ;
	u_short	sys_cmi_mT1 ;
} FRI_GetSysParameters_t ;	


typedef struct FRI_GetLinkParameters_struct {
	u_short	link ;
	int8	link_conf_name[18] ;
	u_short	link_address ;
	u_short	link_ndx ;
	u_short	link_flags ;
	u_short	link_enable ;
	u_short link_multi ;
	u_short	link_lmixon ;
	u_short	link_stats ;
	u_short	link_lmiband ;
	u_short	link_type ;
	u_short	link_becn ;
	u_short	link_inject ;
	u_short	link_encap ;
	u_short	link_lmi_dlci ;
	u_short	link_max_frsize ;
	u_short	link_mN1 ;
	u_short	link_mN2 ;
	u_short	link_mN3 ;
	u_short	link_mN4 ;
	u_short	link_mP1 ;
	u_short	link_mP10 ;
	u_short	link_mT1 ;
	u_short	link_mT2 ;
	u_short	link_mT3 ;
	u_short	link_lmi ;
	u_short	link_state ;
#if PRI
	u_int	link_tslotmap ;
#endif
} FRI_GetLinkParameters_t ;

typedef struct FRI_GetPLLParameters_struct {
	u_short	link ;
	u_short	dlci ;
	int8	pll_conf_name[18] ;
	u_short	pll_link ;
	u_short	pll_number ;
	u_short	pll_dlci ;
	u_long 	pll_bcmax ;
	u_long	pll_bcmin ;
	u_long 	pll_be ;
	u_long 	pll_cir ;
	u_long 	pll_cmp ;
	u_short	pll_fwd_node ;
	u_short	pll_fwd_link ;
	u_short	pll_fwd_dlci ;
	u_short	pll_state ;
} FRI_GetPLLParameters_t ;

typedef struct FRI_GetLinkStatistics_struct {
	u_short	link ;
	u_long	sendframes ;
	u_long	rcvframes ;
	u_long	sendchars ;
	u_long	rcvchars ;
	u_long	rcvfecns ;
	u_long	rcvbecns ;
	u_long	link_create_time ;
	u_long	link_err_time ;
	u_long	link_err_type ;
}FRI_GetLinkStatistics_t ;

typedef struct FRI_GetLinkErrors_struct {
	u_short	link ;
	u_long	rcvframe_inv ;
	u_long	rcvinv_short ;
	u_long	rcvinv_long ;
	u_long	rcvinv_dlci ;
	u_long	rcvunk_dlci ;
	u_long	rcvunk_error ;
} FRI_GetLinkErrors_t ;

typedef struct FRI_GetPLLStatistics_struct {
	u_short	link ;
	u_short	dlci ;
	u_long	ccb_rev_count ;
	u_long	ccb_create_time ;
	u_long	ccb_stat_chng ;
	u_long	inj_norm_cnt ;
	u_long	inj_excess_cnt ;
	u_long	inj_hold_cnt ;
	u_long	fallbacks ;
	u_long	fallforwards ;
	u_long	total_rbits ;
	u_long	ccb_writeq ;
	u_long	ccb_readq ;
} FRI_GetPLLStatistics_t ;

typedef struct FRI_GetLMIStatistics_struct {
	u_short	link ;
	u_int	lmi_net_seq_num ;
	u_int	lmi_local_seq_num ;
	u_int	lmi_stat_enq_cnt ;
	u_int	lmi_total_stat_enqs ;
	u_int	lmi_full_stat_enqs ;
	u_int	lmi_total_status ;
	u_int	lmi_full_status ;
	u_int	lmi_total_updates ;
	u_int   lmi_inv_msg_rcvd ;
	u_int   lmi_no_ie_rep_type ;
	u_int	lmi_no_ie_keep_alive ;
	u_int	lmi_lost_seq_num ;
	u_int	lmi_stat_resp_timeout ;
	u_int	lmi_unsupp_ie_msg ;
	u_int	lmi_unexpected_pvc_num ;
	u_int	lmi_unexpected_pvc_stat_msg ;
	u_int	lmi_stat_enq_rate_plus ;
	u_int	lmi_stat_enq_timeout ;
}FRI_GetLMIStatistics_t ; 

typedef struct FRI_GetProtocolErrorStats_struct {
	u_short	link ;
	u_short dlci ;
	u_short	rcv_unkprot ;
	u_short	rcv_unkframe ;
	u_short	rcv_lostframe ;
	u_short	tx_unkprot ;
	u_short	rcv_unkorg ;
} FRI_GetProtocolErrorStats_t ;

typedef struct FRI_GetInjectionMangStats_struct {
	u_short	link ;
	u_short	dlci ;
	u_long	InjNormalFrames ;
	u_long	InjNormalChars ;
	u_long	InjExcessFrames ;
	u_long	InjExcessChars ;
	u_long	InjHoldFrames ;
	u_long	InjHoldChars ;
	u_long	InjFramesDropped ;
	u_long	InjCharsDropped ;
} FRI_GetInjectionMangStats_t ;

typedef struct FRI_GetPLLFragStats_struct {
	u_short	link ;
	u_short	dlci ;
	u_short	protocol_id ;
	u_long	CreateTime ;
    u_long SendFragmented;     /* Total User Frames Fragmented */    
    u_long SendFragments;      /* Total Frames Transmitted */
    u_long RcvFragments;       /* Total Frames Rcvd */
    u_long RcvReassembled;     /* Total User Frames Reassembled */
    u_long RcvReassembleFail;  /* Total Frame Reassembly Failures */
    u_long SendFrames;               /* Total Frames Transmitted */
    u_long RcvFrames;                /* Total Frames Rcvd */
    u_long SendChars;                /* Total Chars Transmitted */
    u_long RcvChars;                 /* Total Chars Rcvd */
    u_long RcvFECNs;                 /* Total Frames /w FECN */
    u_long RcvBECNs;                 /* Total Frames /w BECN */

} FRI_GetPLLFragStats_t ;

typedef struct FRI_GetCMIProtocolStats_struct {
	u_short	link ;
	u_long	cmi_total_stat_enqs ;
	u_long	cmi_total_stat_rcvd ;
	u_long	cmi_frame_errors ;
	u_long	cmi_inv_msg_rcvd ;
	u_long	cmi_ie_missing ;
	u_long	cmi_ie_unknown ;
	u_long	cmi_unexp_pvc_stat ;
	u_long	cmi_unexp_link_stat ;
}FRI_GetCMIProtocolStats_t ;
	
/*
    Format for control part of trace messages
*/
typedef struct fr_trc_ctl_struct {
    uint8           fr_trc_prim;    /* Trace msg identifier     */
    uint8           fr_trc_mid;     /* Id of protocol module    */
    uint16          fr_trc_spare;   /* for alignment	     */
    uint32          fr_trc_snid;    /* Subnetwork Id            */
    uint8           fr_trc_rcv;     /* Message tx or rx         */
    uint8           fr_trc_spare2[3]; /* for alignment	     */
    uint32          fr_trc_time;    /* Time stamp               */
    uint16          fr_trc_seq;     /* Message seq number       */
    uint16	    fr_trc_lmi;     /* LMI DLCI              */
    uint16          fr_trc_dlci;    /* DLCI of this trace */
    uint16	    fr_trc_opts ;   /* Options on this link */
    uint16	    fr_trc_ccb_prot ; /* CCB's Protocol ID */
    uint16	    fr_trc_ccb_stat ; /* CCB's Status */
}fr_trc_msg_t;

/*
 * Contains statistics concerning the operation of an FRF.9 session
 */
typedef struct FRF9_Statistics_struct {
	uint32 PacketsCompressed;
	uint32 PacketsDecompressed;
	uint32 UncompressedPackets;
	uint32 BytesBeforeCompression;
	uint32 BytesAfterCompression;
	uint32 BytesBeforeDecompression;
	uint32 BytesAfterDecompression;
	uint32 CompressionFailures;
	uint32 DecompressionFailures;
	uint32 LCBFailures;
	uint32 SequenceFailures;
	uint32 CompressionsUndone;
	uint32 RASent;
	uint32 RAReceived;
	uint32 RRSent;
	uint32 RRReceived;
	uint32 DropsDuringReset;
	uint32 ModeOneReqRcvd;
	uint32 ModeOneReqSent;
	uint32 ModeOneRespRcvd;
	uint32 ModeOneRespSent;
	uint32 UnknownCtrlFrames;
	uint32 NoEBit;
	uint32 OverflowErr;
} FRF9_Stats_t;

typedef struct FRI_GetFRF9Stats_struct {
	u_short link ;
	u_short dlci ;
	FRF9_Stats_t FRF9_Stats ;
} FRI_GetFRF9Stats_t ;

/* FR MIB structures */
typedef struct rfc_1315_dlcmi_struct {
	uint32	frDlcmiIndex ;
	uint32	frDlcmiDlcmiState ;
	uint32	frDlcmiAddress ;
	uint32	frDlcmiAddressLen ;
	uint32	frDlcmiPollingInterval ;
	uint32	frDlcmiFullEnquiryInterval ;
	uint32	frDlcmiErrorThreshold ;
	uint32	frDlcmiMonitoredEvents ;
	uint32	frDlcmiMaxSupportedVCs ;
	uint32	frDlcmiMulticast ;
} rfc_1315_dlcmi_t ;

typedef struct rfc_1315_circuit_struct {
	uint32	frCircuitIndex ;
	uint32	frCircuitDlci ;
	uint32	frCircuitState ;
	uint32	frCircuitReceivedFECNs ;
	uint32	frCircuitReceivedBECNs ;
	uint32	frCircuitSentFrames ;
	uint32	frCircuitSentOctets ;
	uint32	frCircuitReceivedFrames ;
	uint32	frCircuitReceivedOctets ;
	uint32	frCircuitCreationTime ;
	uint32	frCircuitLastTimeChange ;
	uint32	frCircuitCommittedBurst ;
	uint32	frCircuitExcessBurst ;
	uint32	frCircuitThroughput ;
} rfc_1315_circuit_t ;

#endif /* _FR_CONT_H */
