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

📄 ldp_nortel.h

📁 实现了MPLS中的标签分发协议(LDP 3036 )的基本功能
💻 H
📖 第 1 页 / 共 5 页
字号:
    u_int dir:1,                /* 0 => bidirectional   */    u_int res:25)} mplsLdpSPFlag_t;/***********************************************************************    ATM Session Parameters TLV  0                   1                   2                   3  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  |U|F|   ATM Sess Parms (0x0501) |      Length                   |  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  | M |   N   |D|                        Reserved                 |  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  |                 ATM Label Range Component 1                   |  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  |                                                               |  ~                                                               ~  |                                                               |  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  |                 ATM Label Range Component N                   |  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpAspTlv_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpSPFlag_s flags;    u_int mark;  } flags;  struct mplsLdpAtmLblRng_s lblRngList[MPLS_ATMLBLMAXLEN];} mplsLdpAspTlv_t;/***********************************************************************   Frame Relay Label Range Component    0                   1                   2                   3    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    | Reserved    |Len|                     Minimum DLCI            |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    | Reserved        |                     Maximum DLCI            |    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpFrFlag_s {  BITFIELDS_ASCENDING_3(u_int res_min:7, u_int len:2, u_int minDlci:23)  BITFIELDS_ASCENDING_2(u_int res_max:9, u_int maxDlci:23)} mplsLdpFrFlag_t;typedef struct mplsLdpFrLblRng_s {  union {    struct mplsLdpFrFlag_s flags;    u_int mark[2];  } flags;} mplsLdpFrLblRng_t;/**********************************************************************   Frame Relay Session Parameters TLV     0                   1                   2                   3     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |U|F|   FR Sess Parms (0x0502)  |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     | M |   N   |D|                        Reserved                 |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |             Frame Relay Label Range Component 1               |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                                                               |     ~                                                               ~     |                                                               |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |             Frame Relay Label Range Component N               |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpFspTlv_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpSPFlag_s flags;    u_int mark;  } flags;  struct mplsLdpFrLblRng_s lblRngList[MPLS_FRLBLMAXLEN];} mplsLdpFspTlv_t;/***********************************************************************   Initialization Message Encoding    0                   1                   2                   3    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |U|   Initialization (0x0200)   |      Message Length           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Message ID                                |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Common Session Parameters TLV             |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Optional Parameters                       |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpInitMsg_s {  struct mplsLdpMsg_s baseMsg;  struct mplsLdpCspTlv_s csp;  struct mplsLdpAspTlv_s asp;  struct mplsLdpFspTlv_s fsp;  u_char cspExists:1;  u_char aspExists:1;  u_char fspExists:1;} mplsLdpInitMsg_t;/***********************************************************************   Status Code Encoding      0                   1                   2                   3      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |E|F|                 Status Data                               |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpStautsFlag_s {  BITFIELDS_ASCENDING_3(u_int error:1, /* E bit */    u_int forward:1,            /* F bit */    u_int status:30)} mplsLdpStautsFlag_t;/***********************************************************************   Status (TLV) Encoding    0                   1                   2                   3    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |U|F| Status (0x0300)           |      Length                   |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Status Code                               |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Message ID                                |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |      Message Type             |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpStatusTlv_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpStautsFlag_s flags;    u_int mark;  } flags;  u_int msgId;  u_short msgType;} mplsLdpStatusTlv_t;/***********************************************************************   Extended Status (TLV) Encoding***********************************************************************/typedef struct mplsLdpExStatusTlv_s {  struct mplsLdpTlv_s baseTlv;  u_int value;                  /* additional info for status */} mplsLdpExStatusTlv_t;/***********************************************************************   Returned PDU (TLV) Encoding***********************************************************************/typedef struct mplsLdpRetPduTlv_s {  struct mplsLdpTlv_s baseTlv;  struct mplsLdpHeader_s headerTlv;  u_char data[MPLS_NOT_MAXSIZE];} mplsLdpRetPduTlv_t;/***********************************************************************   Returned MSG (TLV) Encoding***********************************************************************/typedef struct mplsLdpRetMsgTlv_s {  struct mplsLdpTlv_s baseTlv;  u_short msgType;  u_short msgLength;  u_char data[MPLS_NOT_MAXSIZE];} mplsLdpRetMsgTlv_t;/***********************************************************************   LSPID Tlv encoding      0                   1                   2                   3      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |U|F|      LSPID-TLV  (0x0821)  |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |       Reserved                |      Local CRLSP ID           |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                       Ingress LSR Router ID                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpLspIdTlv_s {  struct mplsLdpTlv_s baseTlv;  u_short res;  u_short localCrlspId;  u_int routerId;               /* ingress lsr router id */} mplsLdpLspIdTlv_t;/***********************************************************************   Notification Message Encoding    0                   1                   2                   3    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |U|   Notification (0x0001)     |      Message Length           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Message ID                                |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Status (TLV)                              |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     Optional Parameters                       |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                     LSPID TLV (optional for CR-LDP)           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpNotifMsg_s {  struct mplsLdpMsg_s baseMsg;  struct mplsLdpStatusTlv_s status;  struct mplsLdpExStatusTlv_s exStatus; /* extended status tlv */  struct mplsLdpRetPduTlv_s retPdu; /* returned PDU tlv    */  struct mplsLdpRetMsgTlv_s retMsg; /* returned MSG tlv    */  struct mplsLdpLspIdTlv_s lspidTlv; /* lspid tlv           */  u_char statusTlvExists:1;  u_char exStatusTlvExists:1;  u_char retPduTlvExists:1;  u_char retMsgTlvExists:1;  u_char lspidTlvExists:1;} mplsLdpNotifMsg_t;/***********************************************************************   Common Hello Parameters Tlv encoding       0                   1                   2                   3      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |U|F| Common Hello Parms(0x0400)|      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |      Hold Time                |T|R| Reserved                  |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpChpFlag_s {  BITFIELDS_ASCENDING_3(u_short target:1, /* T bit */    u_short request:1,          /* R bit */    u_short res:14)} mplsLdpChpFlag_t;typedef struct mplsLdpChpTlv_s {  struct mplsLdpTlv_s baseTlv;  u_short holdTime;  union {    struct mplsLdpChpFlag_s flags;    u_short mark;  } flags;} mplsLdpChpTlv_t;/***********************************************************************   Transport Address (TLV) Encoding***********************************************************************/typedef struct mplsLdpTrAdrTlv_s {  struct mplsLdpTlv_s baseTlv;  u_int address;} mplsLdpTrAdrTlv_t;/***********************************************************************   Configuration Sequence Number (TLV) Encoding***********************************************************************/

⌨️ 快捷键说明

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