⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldpstr.h

📁 技术文件名称:MPLSv1.0软件模块测试规程
💻 H
字号:
/* ****************************************************************** */
/* Product Name:MplsModule                                            */
/* Modul Name: 	LdpPro             File Name : ldpstr.h	              */
/* Creat Date:  01.10.10           Author : shi.zhaohui               */
/* Version:    1.0                                                   */
/* History:                                                           */
/* Date          Version           Modifier            Activies       */
/* ****************************************************************** */


#ifndef LDPSTR_H
#define LDPSTR_H

#include "ldpcomn.h"
#include "ldpmib.h"
#include "mplsldp.h"
#include "ldp.h"
#include "_noalign.h"

typedef struct  {
	unsigned long		lsrId;                  
	unsigned char		labelRetentionMode;	  
	unsigned char       loopDetectionForPV;  
	unsigned char       pathVectorLimit;    
    unsigned char       edgeId;                 
} MPLS_PACK mplsLsrAttr_t; 

typedef struct{
	unsigned short          num;             /*0:没有数据,1:有数据 */
	unsigned char           operatype;       /*1:配置数据,2:删除 */
    mplsLsrAttr_t 	lsrAttribute;
    unsigned char           PlatformType;    /* 机架类型 */
} MPLS_PACK MIB_LDPLSRATTR_ACK;

/*  interface config struct  */
typedef struct{
	unsigned short 		 	    	ifIndex;
	unsigned long       	    	ifIpAddress;
	mplsLdpId_t		    	entityLdpId;
	mplsLdpAtmLblRange_t	conflblRngList;
	unsigned long               genlblRngListmin;  /* general label min range */
	unsigned long               genlblRngListmax;  /* general label max range */
	unsigned char			    adminStatus;
	unsigned char			    operStatus;
} MPLS_PACK mplsLdpInterface_t;


typedef struct  {
	unsigned short              num;
   	mplsLdpInterface_t 	interface[MPLSLDPINTERFACE_MAX];
} MPLS_PACK MIB_LDPINTERFACE_ACK;

  /* entity config struct  */
typedef struct{
	mplsLdpId_t				ldpId;
	unsigned long			index;
	unsigned short 		 	ifArray;
	unsigned char			ifNumber;
 	unsigned char          	protocolVersion;
	unsigned char        	adminStatus;
	unsigned char 			operStatus;
	unsigned short			wellKnownDiscoveryPort;
	unsigned short         	maxPduLength;
	unsigned long			keepAliveHoldTimer;
	unsigned long 			helloHoldTimer;
	unsigned char 		    failedInitSessiontrapenable;
	unsigned long 		    failedInitSessionThreshold;
	unsigned char			labelDistributionMethod;
	unsigned char			labelretentionmode;
	unsigned char			pvLimitMismatchtrapenabled;
	unsigned char			pathvectorlimit;
	unsigned char			hopcountlimit;
	unsigned char			targetedPeer;
	unsigned short          targetedPeerAddrType;
	unsigned long           targetedPeerAddr;
	unsigned char			optionalParameters;
	unsigned char           loopDetectionCapable;
	unsigned char 	        atmMergeCap;
	unsigned char	        atmVcDirectionality;
	unsigned char	        atmLsrConnectivity;
	unsigned short	        defaultControlVpi;
	unsigned short          defaultControlVci;
	unsigned short	        unlabTrafVpi;
	unsigned short          unlabTrafVci;
	unsigned long			transportAddr;		/* by hyh */
	unsigned long 			helloSendTimer;		/* send hello time negotiated */
	unsigned long 			csn;
	long					hellotmd;			/* 发送hello定时器 */
} MPLS_PACK mplsLdpEntity_t;

typedef struct  {
		unsigned short              num;
    	mplsLdpEntity_t 	entity[MPLSLDPINTERFACE_MAX];
} MPLS_PACK MIB_LDPENTITY_ACK;

/*  hello adjacency struct  */
typedef struct{
	mplsLdpId_t	entityLdpId;
	mplsLdpId_t	peerLdpId;
	unsigned long   	index;              /* 全局变量,每增加一个hello,index加1 */
	unsigned long 		sessionIndex;       /* 对应session表的index */
	unsigned long  		holdTimeRemaining;  /* not valid now */
	unsigned char   	helloType;          /* link/targeted---link now */
	unsigned long     	cfgNum;             /* config number */
	unsigned short		ifIndex;			/* 本端口的interface index */
	unsigned long 		EntityIndex;		/* 新增:Entity Index */
	unsigned long 		helloHoldTime;		/* 新增:hello维持时间 */
	unsigned long     	helloPeerAddr;      /* 新增:transport address */
	unsigned long   	nexthopAddr;        /* 新增:直联对端端口地址 */
	unsigned long		adj_timerid;        /* 新增:hello维持定时器 */
} MPLS_PACK mplsLdpHello_t;

typedef struct{
	mplsLdpId_t		entityLdpId;
	unsigned long   ifIndex;
	mplsLdpId_t		peerLdpId;
} MPLS_PACK unionIndex_t;

typedef struct  {
	unsigned long 			helloIndex;
	unionIndex_t 			unionIndex;
	unsigned long 			transAddr;	/*transport address*/
	unsigned char           indexFlag; /* 值为1对应helloIndex,值为2对应unionIndex,
										 值为3对应transAddr*/
} MPLS_PACK ldpMibHelloIndexReq_t;

typedef struct  {
   	unsigned char      operateType; /* LDP_SET:1,  LDP_SEARCH:2,  LDP_DELETE:3 */
   	union {
      	mplsLdpHello_t           set;
       	ldpMibHelloIndexReq_t    loc;
        ldpMibHelloIndexReq_t    del;
     } req;
} MPLS_PACK MIB_LDPHELLO_REQ;

typedef struct  {
	unsigned char   result;
    union   {
       	mplsLdpHello_t         	 set;
        mplsLdpHello_t        	 loc;
        unsigned char            del;
    } ret;
} MPLS_PACK MIB_LDPHELLO_ACK;


/* session dynamic struct  */
typedef struct   {
	mplsLdpId_t	    entityLdpId;
	mplsLdpId_t	    peerLdpId;
	unsigned long 		    index;
	unsigned char 			state;
	unsigned char		  	protocolVersion;
	unsigned long         	keepAliveHoldTimeRemaining;
	unsigned char	 	    labelAdvertisement;
	unsigned char		    loopDetectionForPV;
	unsigned char		    pathVectorLimit;
	unsigned short		    maxPduLength;
	unsigned long         	keepAliveHoldTime;
	unsigned char         	role;
	unsigned long         	peerIpaddr;
	unsigned char         	vcNumeberdType;
	unsigned short        	ifIndex;
	unsigned char		    lblRngNum;    /* label range component */
	union
	{
        mplsLdpAtmLblRng_t     	atmlblrnglist[MPLS_ATMLBLMAXLEN];
        mplsLdpGenLblRange_t    genlblrnglist;
	}LdpLblRng;
	unsigned long   	  	helloArray[SESSION_OWNED_HELLO];
	unsigned long		  	localIpaddr;               /* TCP连接本端地址*/
	unsigned short		  	tcpConRetry;              /* TCP重新连接尝试次数 */
    unsigned long       	tmidCon;                 /* TCP连接定时器标示 */
    unsigned short      	LocalPort;
    unsigned short      	PeerPort;
    unsigned char		  	subState;
    unsigned char         	lblflag; /* 1:general, 2: atm, 3:fr */
    unsigned long       	nexthopaddr;              /* 新增:记录本session的下一跳地址 */
    unsigned long           life_timerid;              /* 新增:session维持定时器 */
    long           			keepalive_send_timerid;    /* 新增:发送keepalive定时器 */
    char                    *pdu_buffer;        /* 记录session当前的PDU缓冲地址 */
    unsigned short          pdulen;            /* 记录 session当前PDU缓冲的大小 */
    
    struct
	{
		struct _mplsLdpUpCB    * first;
		struct _mplsLdpUpCB    * last;
	}up_cb_list;
	struct
	{
		struct _mplsLdpDownCB    * first;
		struct _mplsLdpDownCB    * last;
	}down_cb_list;
	struct
	{
		struct _mplsLdpLspCB    * first;
		struct _mplsLdpLspCB    * last;
	}lsp_up_cb_list;
	struct
	{
		struct _mplsLdpLspCB    * first;
		struct _mplsLdpLspCB    * last;
	}lsp_down_cb_list;
    
} MPLS_PACK mplsLdpSession_t;


/*   Session   Table      */
typedef struct  {
		unsigned long 			sessionIndex;
		unionIndex_t 	unionIndex;
		unsigned long           peerIpaddr;
		unsigned long           localIpaddr;        /* added on 2000.8.30*/
		unsigned short          ifIndex;
		unsigned char           indexFlag;          /* 值为1对应sessionIndex,值为2对应unionIndex,
			                                    值为3对应peerIpaddr+localIpaddr ,值为4对应ifIndex  */
} MPLS_PACK ldpMibSessionIndexReq_t;

typedef struct {
	unsigned char   operateType;
    union   {
    	mplsLdpSession_t           set;
	    ldpMibSessionIndexReq_t    loc;
        ldpMibSessionIndexReq_t    del;
	} req;
} MPLS_PACK MIB_LDP_SESSION_REQ;

typedef struct  {
	unsigned char   result;
    union   {
    	mplsLdpSession_t    	   set;
	    mplsLdpSession_t     	   loc;
	    unsigned char                      del;
    } ret;
} MPLS_PACK MIB_LDP_SESSION_ACK;

/* peer 动态表  */
typedef struct   {
	mplsLdpId_t	ldpId;
	unsigned long		index;
	unsigned short      internetworkAddrType;
	unsigned long       internetworkAddr;
	unsigned char       labelDistributionMethod;
	unsigned char       loopDetectionForPV;
	unsigned char       pathVectorLimit;
	unsigned short		ifIndex;		/* interfaec index */
} MPLS_PACK mplsLdpPeer_t;

 typedef mplsLdpId_t ldpMibPeerIndexReq_t;

typedef struct{
   	unsigned char   operateType;
	union {
		mplsLdpPeer_t           set;
	    ldpMibPeerIndexReq_t    loc;
	    ldpMibPeerIndexReq_t    del;
	} req;
} MPLS_PACK MIB_LDP_PEER_REQ;

typedef struct {
	unsigned char   result;
	union   {
		mplsLdpPeer_t      	  	  set;
	    mplsLdpPeer_t       	  loc;
	    unsigned char                     del;
	} ret;
} MPLS_PACK MIB_LDP_PEER_ACK;

typedef struct {
   	unsigned long       index;
   	unsigned short 		nextHopAddressType;
  	unsigned long   	nextHopAddress;
   	unsigned long       sessionIndex;
   	mplsLdpId_t ldpId;
} MPLS_PACK sessionPeerAddr_t;

typedef struct 	{
	unsigned short 		nextHopAddressType;
	unsigned long   	nextHopAddress;
} MPLS_PACK peerAddress_t;

typedef struct 	{
	unsigned long 			index;
	peerAddress_t 	address;
	unsigned long			sessionIndex;
	unsigned char           indexFlag;      /* 值为1对应index,值为2对应address
										值为3对应sessionIndex,用来删除多项 */
} MPLS_PACK ldpMibPeerAddrIndexReq_t;

typedef struct  {
	unsigned char   operateType;
    union   {
    	sessionPeerAddr_t 	        set;
        ldpMibPeerAddrIndexReq_t    loc;
	    ldpMibPeerAddrIndexReq_t    del;
    } req;
} MPLS_PACK MIB_LDP_SESSION_PEERADDR_REQ;

typedef struct  {
	unsigned char   result;
    union   {
    	sessionPeerAddr_t    	    set;
	    sessionPeerAddr_t       	loc;
	    unsigned char                       del;
    } ret;
} MPLS_PACK MIB_LDP_SESSION_PEERADDR_ACK;

/*  mpls ldp entity statistics table
    achieve from every card */
#if 0
typedef struct {
	mplsLdpId_t		entityLdpId;    /*the fore three entries not in the mib */
	mplsLdpId_t		peerLdpId;      /*the same as the corresponding entry in the peer table */
	unsigned long 			entityindex;    /*the same as the corresponding entry in the entity table */

	unsigned long 	attemptedsessions;                   /*(R-O),a count of the total attempted sessions for this ldp entity*/
	unsigned long   sessionrejectednohelloerrors;        /*(R-O),a count of the session rejected/no hello
	                                              error notification messages sent or received by this ldp entity*/
	unsigned long	sessionrejectedadvertisementerrors;  /*(R-O),分发模式错误的通告消息数*/
	unsigned long	sessionrejectedmaxpduerrors;         /*(R-O),最大PDU长度错误的通告消息数*/
	unsigned long	sessionrejectedlabelrangeerrors;     /*(R-O),标签范围错误的通告信息数*/
	unsigned long   badldpidentifiererrors;              /*(R-O),错误的LDPID的消息数*/
	unsigned long	badpdulengtherrros;                  /*(R-O),错误的PDU长度的消息数*/
	unsigned long	badmessagelengtherrors;              /*(R-O),错误的消息长度的消息数*/
	unsigned long	badtlvlengtherrors;                  /*(R-O),TLV长度的出错数*/
	unsigned long	malformedtlvvalueErrors;             /*(R-O),TLV类型的出错数*/
	unsigned long	KeepAliveTimerExpiredErrors;         /*(R-O),超时错误数*/
	unsigned long	ShutdownNotifReceived;               /*(R-O),收到的关掉通告数*/
	unsigned long   ShutdownNotifSent;                   /*(R-O),发出的关掉通告数*/
	unsigned short  ifIndex;     
	unsigned char	res1;
	unsigned char	res2;
	unsigned char	res3;  
	unsigned long	res4;
} MPLS_PACK mplsLdpEntityStatsTable_t;
#endif
typedef struct{
     unsigned short                     num;
     mplsLdpEntityStatsTable_t  entity[MPLSLDPINTERFACE_MAX];
} MPLS_PACK entityStats_t;
#if 0
/*  mpls ldp session statistics table  */
typedef struct {
	mplsLdpId_t		entityLdpId;    /*the fore three entries not in the mib */
	mplsLdpId_t		peerLdpId;
	unsigned long 			index;
	unsigned long 			unknownmessagetypeerrors;  /* 未知消息类型错误数 */
	unsigned long			unknowntlverrors;	       /* 未知TLV错误数 */
	unsigned short          ifIndex; 
	unsigned short			res1;
	unsigned short			res2;
	unsigned long			res3;
	unsigned long			res4;
	unsigned char			res5;
	unsigned char			res6;
	unsigned char			res7;    
} MPLS_PACK mplsLdpSessionStatsTable_t;
#endif
typedef struct{
     unsigned short                      num;
     mplsLdpSessionStatsTable_t  session[MPLSLDPINTERFACE_MAX];
} MPLS_PACK sessionStats_t;

#include "_restore.h"

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -