/*****************************************************************************
 * 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.14 1997/09/30 16:05:56 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_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 */ 
#define FRI_GetDLCIEntrys   ('F' << 8 | 45) /* Get the DLCI entrys from the FULL STATUS Update Msg */

/* 
 *	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 */
#ifdef CISCO_IP_TEMP
#define PID_IP                0x14 //0x0b /* Internet Protocol */
#else
#define PID_IP                0x0b /* Internet Protocol */
#endif
#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 */

#ifdef CISCO_IP_TEMP
#define PID_CISCO_IP          0x0B //0x14 /* CISCO IP ENCAPSULATION */
#else
#define PID_CISCO_IP          0x14 /* CISCO IP ENCAPSULATION */
#endif
#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 
 */

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

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

typedef struct frs_pll_cfg
{
    int8     frs_conf_name[FRS_PLL_NAME_SIZE+1];
    u_long  frs_pll_ndx;   /* frmrly_ccbcfg[] index(0..FRS_MAX_CHANNELS-1) */
    u_long  frs_pll_link;  /* link number (1..FRS_MAX_LINKS) */
    u_long  frs_pll_next;  /* the next PLL in this chain of PLLs */
    u_long  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_long  frs_pll_CMP;   /* CMP Timer - Congestion Monitor Period */

    u_long  frs_pll_fwd_node;  /* Fwd dest. node: WAN Channel */
    u_long  frs_pll_fwd_link;  /* Fwd dest. link: WAN Channel */
    u_long  frs_pll_fwd_dlci;  /* Fwd dest. dlci number (0 == PLL disabled) */
    
    u_long  frs_pll_state; /* State of PLL: Enabled(1) or Disabled(0) */          
    /* These parameters relate to FRF.9 */
    u_long   frs_pll_FRF9RetryPeriod; /* Seconds between Mode One retries */
    u_long   frs_pll_FRF9RetryCount;  /* # of times Mode One retries are sent */
    u_long   frs_pll_FRF9ModesWanted; /* FRF.9 Quality of Service desired */
    u_long  frs_pll_FRF9ContextMax;  /* Maximum compression contexts allowed */
}
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_long  frs_link_snid;       /* SNID */
    u_long  frs_link_flags;      /* Options - See FRS_OPT_* in frs.h... */
    u_long  frs_link_lmi_dlci;   /* LMI DLCI (if enabled in link flags) */
    u_long  frs_link_1st_pllcfg; /* The base-0 index of the first channel */
    u_long  frs_link_max_frsize; /* Max Frame Size */
    u_long  frs_link_mN1;        /* FULL STATUS Enq Freq (DTE only) */
    u_long  frs_link_mN2;        /* Number of errors before error reported */
    u_long  frs_link_mN3;        /* Error recovery count */
    u_long  frs_link_mN4;        /* Max # of Stat Enqs rcvd (DCE only) */
    u_long  frs_link_mP1;        /* Maximum PLLs */
    u_long  frs_link_mP10;       /* Maximum multicast groups */
    u_long  frs_link_mT1;        /* STATUS ENQ Freq (DTE only) */
    u_long  frs_link_mT2;        /* Expected Stat Enq Frequency (DCE only) */
    u_long  frs_link_mT3;        /* Measurement interval for mN4 (DCE only */
    u_long  frs_link_state;      /* State of link: Enabled(1) or Disabled(0) */
    u_long  frs_link_tslotmap;   /* Maps to T1 DS0 partitions */
}
FRS_LINK_CFG;

typedef struct FRSFR_OpenPLL_struct {
	u_long snid ;
	u_long dlci ;
	u_long pll_handle ;
}FRSFR_OpenPLL_t ;

typedef struct FRSFR_ClosePLL_struct {
	u_long pll_handle ;
}FRSFR_ClosePLL_t ;

typedef struct FRSFR_XoffPLL_struct {
	u_long snid ;
	u_long dlci ;
}FRSFR_XoffPLL_t ;

typedef struct FRSFR_XonPLL_struct {
	u_long snid ;
	u_long dlci ;
}FRSFR_XonPLL_t ;

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

typedef struct ENCAP_OpenPLL_struct {
	u_long snid ;
	u_long dlci ;
	u_long pll_handle ;
	u_long protocol_id ;
}ENCAP_OpenPLL_t ;

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

typedef struct FRSCONF_InitLink_struct {
	FRS_LINK_CFG cfgInfo ;
}FRSCONF_InitLink_t ;

typedef struct FRSCONF_UnInitLink_struct {
	u_long linknum ;
}FRSCONF_UnInitLink_t ;

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

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

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

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

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

typedef struct FRSCONF_InsertLink_struct {
	u_long snid ;
	FRS_LINK_CFG linkconfig ;
}FRSCONF_InsertLink_t ;

typedef struct FRSCONF_DeleteLink_struct {
	u_long snid ;
}FRSCONF_DeleteLink_t ;

typedef struct FRSCONF_InsertPLL_struct {
	u_long snid ;
	u_long dlci ;
	FRS_PLL_CFG pllconfig ;
}FRSCONF_InsertPLL_t ;

typedef struct FRSCONF_DeletePLL_struct {
	u_long snid ;
	u_long dlci ;
}FRSCONF_DeletePLL_t ;

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

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

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

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

typedef struct FRSTRACE_Enable_struct {
	u_long snid ;
}FRSTRACE_Enable_t ;

typedef struct FRSTRACE_Disable_struct {
	u_long snid ;
}FRSTRACE_Disable_t ;

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

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

typedef struct FRP_FRSFR_RcvData_struct {
	u_long command ;
	u_long snid ;
	u_long dlci ;
	u_long protocol_id ;
}FRP_FRSFR_RcvData_t ;

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

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


typedef struct FRI_GetLinkParameters_struct {
	u_long snid ;
	int8 link_conf_name[20] ;
	u_long link_address ;
	u_long link_ndx ;
	u_long link_flags ;
	u_long link_enable ;
	u_long link_multi ;
	u_long link_lmixon ;
	u_long link_stats ;
	u_long link_lmiband ;
	u_long link_type ;
	u_long link_becn ;
	u_long link_inject ;
	u_long link_encap ;
	u_long link_lmi_dlci ;
	u_long link_max_frsize ;
	u_long link_mN1 ;
	u_long link_mN2 ;
	u_long link_mN3 ;
	u_long link_mN4 ;
	u_long link_mP1 ;
	u_long link_mP10 ;
	u_long link_mT1 ;
	u_long link_mT2 ;
	u_long link_mT3 ;
	u_long link_lmi ;
	u_long link_state ;
	u_long link_tslotmap ;
} FRI_GetLinkParameters_t ;

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

typedef struct FRI_GetLinkStatistics_struct {
	u_long snid ;
	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_long snid ;
	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_long snid ;
	u_long 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_long snid ;
	u_long lmi_net_seq_num ;
	u_long lmi_local_seq_num ;
	u_long lmi_stat_enq_cnt ;
	u_long lmi_total_stat_enqs ;
	u_long lmi_full_stat_enqs ;
	u_long lmi_total_status ;
	u_long lmi_full_status ;
	u_long lmi_total_updates ;
	u_long lmi_inv_msg_rcvd ;
	u_long lmi_no_ie_rep_type ;
	u_long lmi_no_ie_keep_alive ;
	u_long lmi_lost_seq_num ;
	u_long lmi_stat_resp_timeout ;
	u_long lmi_unsupp_ie_msg ;
	u_long lmi_unexpected_pvc_num ;
	u_long lmi_unexpected_pvc_stat_msg ;
	u_long lmi_stat_enq_rate_plus ;
	u_long lmi_stat_enq_timeout ;
}FRI_GetLMIStatistics_t ; 

typedef struct FRI_GetProtocolErrorStats_struct {
	u_long snid ;
	u_long dlci ;
	u_long rcv_unkprot ;
	u_long rcv_unkframe ;
	u_long rcv_lostframe ;
	u_long tx_unkprot ;
	u_long rcv_unkorg ;
} FRI_GetProtocolErrorStats_t ;

typedef struct FRI_GetInjectionMangStats_struct {
	u_long snid ;
	u_long 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_long snid ;
	u_long dlci ;
	u_long 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_long snid ;
	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 {
    uint32          fr_trc_prim;    /* Trace msg identifier     */
    uint32          fr_trc_mid;     /* Id of protocol module    */
    uint32          fr_trc_snid;    /* Subnetwork Id            */
    uint32          fr_trc_rcv;     /* Message tx or rx         */
    uint32          fr_trc_time;    /* Time stamp               */
    uint32          fr_trc_seq;     /* Message seq number       */
    uint32	    fr_trc_lmi;     /* LMI DLCI              */
    uint32          fr_trc_dlci;    /* DLCI of this trace */
    uint32	    fr_trc_opts ;   /* Options on this link */
    uint32	    fr_trc_ccb_prot ; /* CCB's Protocol ID */
    uint32	    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_long snid ;
	u_long 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 */
