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

📄 ldp_nortel.h

📁 实现了MPLS中的标签分发协议(LDP 3036 )的基本功能
💻 H
📖 第 1 页 / 共 5 页
字号:
  u_char hcValue;               /* hop count value */} mplsLdpHopTlv_t;/***********************************************************************   Path Vector 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| Path Vector (0x0104)      |        Length                 |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                            LSR Id 1                           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                                                               |   ~                                                               ~   |                                                               |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |                            LSR Id n                           |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpPathTlv_s {  struct mplsLdpTlv_s baseTlv;  u_int lsrId[MPLS_MAXHOPSNUMBER];} mplsLdpPathTlv_t;/***********************************************************************   Lbl request message id Tlv encoding***********************************************************************/typedef struct mplsLdpLblMsgIdTlv_s {  struct mplsLdpTlv_s baseTlv;  u_int msgId;} mplsLdpLblMsgIdTlv_t;/***********************************************************************   Preemption 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| Preemption-TLV  (0x0820)  |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |  SetPrio      | HoldPrio      |      Reserved                 |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpPreemptTlv_s {  struct mplsLdpTlv_s baseTlv;  u_char setPrio;               /* 0 => most important path */  u_char holdPrio;              /* 0 => most important path */  u_short res;} mplsLdpPreemptTlv_t;/***********************************************************************   Resource class 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|      ResCls-TLV  (0x0822) |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                             RsCls                             |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpResClsTlv_s {  struct mplsLdpTlv_s baseTlv;  u_int rsCls;                  /* resource class bit mask */} mplsLdpResClsTlv_t;/***********************************************************************   Lbl return message id Tlv encoding***********************************************************************/typedef struct mplsLdpRetMsgIdTlv_s {  struct mplsLdpTlv_s baseTlv;} mplsLdpLblRetMsgIdTlv_t;/***********************************************************************   ER flag structure which is common to IPV4 and IPV6 ER TLV***********************************************************************/typedef struct mplsLdpErIPFlag_s {  BITFIELDS_ASCENDING_3(u_int l:1, /* 0 => loose hop */    u_int res:23, u_int preLen:8)} mplsLdpErIPFlag_t;/***********************************************************************   ER flag structure which is common to AS and LSPID ER TLV***********************************************************************/typedef struct mplsLdpErFlag_s {  BITFIELDS_ASCENDING_2(u_short l:1, /* 0 => loose hop */    u_short res:15)} mplsLdpErFlag_t;/***********************************************************************   Explicit Routing IPv4 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|         0x801             |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |L|      Reserved                               |    PreLen     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    IPv4 Address (4 bytes)                     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpErIpv4_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpErIPFlag_s flags;    u_int mark;  } flags;  u_int address;} mplsLdpErIpv4_t;/***********************************************************************   Explicit Routing IPv6 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|          0x802            |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |L|             Reserved                        |    PreLen     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                  IPV6 address                                 |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                  IPV6 address (continued)                     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                  IPV6 address (continued)                     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                  IPV6 address (continued)                     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpErIpv6_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpErIPFlag_s flags;    u_int mark;  } flags;  u_char address[MPLS_IPV6ADRLENGTH];} mplsLdpErIpv6_t;/***********************************************************************   Explicit Routing Autonomous systen number 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|          0x803            |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |L|          Reserved           |                AS Number      |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpErAs_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpErFlag_s flags;    u_short mark;  } flags;  u_short asNumber;} mplsLdpErAs_t;/***********************************************************************   Explicit Routing 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|          0x804            |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |L|          Reserved           |               Local LSPID     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                       Ingress LSR Router ID                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef struct mplsLdpErLspId_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpErFlag_s flags;    u_short mark;  } flags;  u_short lspid;  u_int routerId;} mplsLdpErLspId_t;/***********************************************************************   Constraint Routing 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|         ER-TLV  (0x0800)  |      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                          ER-Hop TLV 1                         |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                          ER-Hop TLV 2                         |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     ~                          ............                         ~     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                          ER-Hop TLV n                         |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+***********************************************************************/typedef union mplsLdpErHop_u {  struct mplsLdpErIpv4_s erIpv4;  struct mplsLdpErIpv6_s erIpv6;  struct mplsLdpErAs_s erAs;  struct mplsLdpErLspId_s erLspId;} mplsLdpErHop_t;typedef struct mplsLdpErTlv_s {  struct mplsLdpTlv_s baseTlv;  union mplsLdpErHop_u erHopArray[MPLS_MAX_ER_HOPS];  u_short erHopTypes[MPLS_MAX_ER_HOPS]; /* need to know the                                            types when handle                                           the union */  u_short numberErHops;} mplsLdpErTlv_t;/***********************************************************************   Traffic 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| Traf. Param. TLV  (0x0810)|      Length                   |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |     Flags     |    Frequency  |     Reserved  |    Weight     |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    Peak Data Rate (PDR)                       |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    Peak Burst Size (PBS)                      |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    Committed Data Rate (CDR)                  |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    Committed Burst Size (CBS)                 |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+     |                    Excess Burst Size (EBS)                    |     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+    Flag field:     +--+--+--+--+--+--+--+--+     | Res |F6|F5|F4|F3|F2|F1|     +--+--+--+--+--+--+--+--+***********************************************************************/typedef struct mplsLdpTrafficFlag_s {  BITFIELDS_ASCENDING_7(u_char res:2,    u_char f6Bit:1,    u_char f5Bit:1,    u_char f4Bit:1, u_char f3Bit:1, u_char f2Bit:1, u_char f1Bit:1)} mplsLdpTrafficFlag_t;typedef struct mplsLdpTrafficTlv_s {  struct mplsLdpTlv_s baseTlv;  union {    struct mplsLdpTrafficFlag_s flags;    u_char mark;  } flags;  u_char freq;  u_char res;  u_char weight;  union {    float pdr;    u_int mark;  } pdr;  unio

⌨️ 快捷键说明

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