📄 ldpmib.h
字号:
/* ****************************************************************** */
/* Product Name:MPLSModule */
/* Modul Name: ldppro File Name : _LDPMIB.H */
/* Creat Date: 01.10.16 Author : shi.zhaohui */
/* Version: 1.0 */
/* History: */
/* Date Version Modifier Activies */
/* ****************************************************************** */
/*******************************************************************/
/* */
/* 本文件中定义了LDP进程自己管理的数据库结构 */
/* */
/*******************************************************************/
#ifndef __LDPMIB_H
#define __LDPMIB_H
/*NA--not accessible, RO--read only, RW--read and write, RC--read and create*/
#include "mplstype.h"
#include "encdec.h"
#include "ldp.h"
#include "_noalign.h"
#define MPLS_ATMLBLMAXLEN 10
#define SESSION_OWNED_HELLO 8
/* wengqing modify the interface/entity/session MPLSLDP_MAX = 48, for performance when go through session */
#define MPLSLDPINTERFACE_MAX /*256*/48
#define MPLSLDPENTITY_MAX /*256*/48
#define MPLSLDP_MAX /*256*/48
#define mplsINDEX_MAX 4294967295
#ifndef VAL_RowStatus_active
#define VAL_RowStatus_active ( unsigned char )1
#endif
#define VAL_RowStatus_null 0
/* 动态生成表 */
typedef struct /**** 3.通过发现机制得到的对等方的属性表 *****/
{
unsigned char RowStatus; /*(R-W)1:此表项被创建, 0:此表项被删除*/
mplsLdpId_t ldpId; /*(NA)peerLdpId和peerIndex都可以用来检索此表*/
unsigned long index; /*(NA)值为0表示暂时不能分配表项*/
unsigned short internetworkAddrType; /*(RO)*/
unsigned long internetworkAddr; /*(RO)*/
unsigned char labelDistributionMethod; /*(RO)downstreamOnDemand(1),downstreamUnsolicited(2)*/
unsigned char loopDetectionForPV; /*(RO)基于Path Vector的环路检测,disabled(0),enabled(1)*/
unsigned char pathVectorLimit; /*(RO)当peerLoopDetectionForPV=enabled(1)时,*/
unsigned short ifIndex; /* interfaec index */
} MPLS_PACK struct_MplsLdpPeerTable;
typedef struct_MplsLdpPeerTable MplsLdpPeerTable[MPLSLDP_MAX];
typedef struct /**** 4.Hello邻接表 *****/
{
unsigned char RowStatus; /*(R-W)1:此表项被创建, 0:此表项被删除*/
mplsLdpId_t entityLdpId;
mplsLdpId_t peerLdpId;
unsigned long index; /*(NA),唯一标识*/
unsigned long sessionIndex; /*(NA)*/
unsigned long holdTimeRemaining; /*(RO),TimeInterval,当下一个Hello来时改变此值*/
unsigned char helloType; /*(RO),link(1),targeted(2)*/
unsigned long cfgNum; /* 配置计数 */
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 struct_MplsLdpHelloTable;
typedef struct_MplsLdpHelloTable MplsLdpHelloTable[MPLSLDP_MAX];
typedef struct /**** 5.一个Entity和一个Peer建立的会话表 *****/
{
unsigned char RowStatus; /*(R-W)1:此表项被创建, 0:此表项被删除*/
mplsLdpId_t entityLdpId; /*entityLdpId和entityIndex都可以用来检索此表*/
mplsLdpId_t peerLdpId; /*(NA)peerLdpId和peerIndex都可以用来检索此表*/
unsigned long index; /*(NA)*/
unsigned char state; /*(RO)NONEXISTENT(1),INITIALIZED(2),OPENREC(3),OPENSENT(4),OPERATIONAL(5)*/
unsigned char protocolVersion; /*(RO)*/
unsigned long keepAliveHoldTimeRemaining; /*(RO)*/
unsigned char labelAdvertisement; /*(RO)downStreamUnsolicited(0),downStreamOnDemand(1)*/
unsigned char loopDetectionForPV; /*(RO)基于Path Vector的环路检测,disabled(0),enabled(1)*/
unsigned char pathVectorLimit; /*(RO)当peerLoopDetectionForPV=enabled(1)时,
值域范围是1-255;否则disable(0)时,取值0*/
unsigned short maxPduLength; /*(RO)*/
unsigned long keepAliveHoldTime; /*会话双方协商成功的HoldTime*/
unsigned char role; /* ACTIVE(1),PASSIVE(2) */
unsigned long peerIpaddr; /*TCP连接对方的IP地址 */
unsigned char vcNumeberdType; /* LDP_ODD(1), LDP_EVEN(2) */
unsigned short ifIndex; /* 每个session对应一个ifIndex */
unsigned char lblRngNum;
union
{
mplsLdpAtmLblRange_t atmlblrnglist[MPLS_ATMLBLMAXLEN];
mplsLdpGenLblRange_t genlblrnglist;
}LdpLblRng;
unsigned long helloArray[SESSION_OWNED_HELLO]; /* 对于ATM采用per interface标记空间,所以HELLOMAX = 1 */
unsigned long localIpaddr; /* TCP连接本端的IP地址 */
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缓冲的大小 */
/**add by wengqing**/
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 struct_MplsLdpSessionTable;
typedef struct_MplsLdpSessionTable MplsLdpSessionTable[MPLSLDP_MAX];
typedef struct /*Address Msg 告知的地址与LdpId对应关系*/
{
unsigned char RowStatus;
unsigned long index;
unsigned short nextHopAddressType; /*(RO),AddressFamilyNumbers*/
unsigned long nextHopAddress; /*(RO),Ldp协议只定义了IPV4地址*/
unsigned long sessionIndex;
mplsLdpId_t ldpId;
} MPLS_PACK struct_MplsLdpSessionPeerAddrTable;
typedef struct_MplsLdpSessionPeerAddrTable MplsLdpSessionPeerAddrTable[MPLSLDP_MAX];
typedef struct {
unsigned char RowStatus;
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; /* interface index */
} MPLS_PACK struct_mplsLdpEntityStatsTable;
typedef struct_mplsLdpEntityStatsTable MplsLdpEntityStatsTable[MPLSLDP_MAX];
typedef struct {
unsigned char RowStatus;
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; /* interface index */
} MPLS_PACK struct_mplsLdpSessionStatsTable;
typedef struct_mplsLdpSessionStatsTable MplsLdpSessionStatsTable[MPLSLDP_MAX];
extern MplsLdpPeerTable MplsLdpPeerEntry;
extern MplsLdpHelloTable MplsLdpHelloEntry;
extern MplsLdpSessionTable MplsLdpSessionEntry;
extern MplsLdpSessionPeerAddrTable MplsLdpSessionPeerAddrEntry;
extern MplsLdpEntityStatsTable MplsLdpEntityStatsEntry;
extern MplsLdpSessionStatsTable MplsLdpSessionStatsEntry;
#include "_restore.h"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -