From: Vasu Dasari <vdasari@gmail.com>
[mpls-ldp-portable.git] / ldp / ldp_pdu_setup.h
blob374e790a3f03d2afde0cc22f9bd916df6bbc7aae
2 /*
3 * Copyright (C) James R. Leu 2000
4 * jleu@mindspring.com
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
8 */
10 #ifndef _PDU_SETUP_
11 #define _PDU_SETUP_
13 #include "ldp_struct.h"
14 #include "ldp_nortel.h"
15 void setBaseMsgId(mplsLdpMsg_t * baseMsg, unsigned int msgId);
16 void setupBaseMsg(mplsLdpMsg_t * baseMsg, unsigned int type, int uBit,
18 unsigned int msgId);
19 int setupChpTlv(mplsLdpChpTlv_t * chpTlv, int target, int request, int res,
21 int holdTime);
22 int setupPinningTlv(mplsLdpPinningTlv_t * pinningTlv, int pBit, int res);
23 int setupResClassTlv(mplsLdpResClsTlv_t * resClsTlv, unsigned int rsCls);
24 int setupPreemptTlv(mplsLdpPreemptTlv_t * preemptTlv, unsigned char setPrio,
25 unsigned char holdPrio, unsigned short res);
26 int addErHop2ErHopTvl(mplsLdpErTlv_t * erHopTlv, mplsLdpErHop_t * erHop,
27 unsigned short type); int setupErHopTlv(mplsLdpErTlv_t * erHopTlv);
28 int setupTrAddrTlv(mplsLdpTrAdrTlv_t * trAddrTlv, unsigned int trAddr);
29 int setupCsnTlv(mplsLdpCsnTlv_t * csnTlv, unsigned int confSeqNum);
30 int setupCspTlv(mplsLdpCspTlv_t * cspTlv, uint16_t keepalive,
31 uint8_t adv_discp, uint8_t loop, uint8_t pvl, uint16_t mtu,
32 uint32_t remote_lsraddr, uint16_t remote_labelspace, uint32_t res);
33 int addLblRng2AspTlv(mplsLdpAspTlv_t * aspTlv, unsigned int minvpi,
34 unsigned int minvci, unsigned int maxvpi, unsigned int maxvci);
35 int addLblRng2FspTlv(mplsLdpFspTlv_t * fspTlv, unsigned int resmin,
36 unsigned int len, unsigned int mindlci, unsigned int resmax,
38 unsigned int maxdlci);
39 int setupAspTlv(mplsLdpAspTlv_t * aspTlv, uint8_t merge, uint8_t direction);
40 int setupFspTlv(mplsLdpFspTlv_t * fspTlv, uint8_t merge, uint8_t direction);
41 int setupFecTlv(mplsLdpFecTlv_t * fecTlv);
44 #if 0
45 mplsFecElement_t * createFecElemFromFecType(struct mpls_fec *fec);
47 mplsFecElement_t * createFecElemFromRoute(routeT * r);
48 void copyLabelType2MapLabelTlv(struct mpls_label *label,
50 mplsLdpLblMapMsg_t * lblMap);
51 void copyAtmLblTlv2MplsLabel(mplsLdpAtmLblTlv_t * atmLblTlv,
53 struct mpls_label *label);
54 void copyFrLblTlv2MplsLabel(mplsLdpFrLblTlv_t * frLblTlv,
56 struct mpls_label *label);
57 void copyGenLblTlv2MplsLabel(mplsLdpGenLblTlv_t * genLblTlv,
59 struct mpls_label *label);
60 #endif /* */
61 int addFecElem2FecTlv(mplsLdpFecTlv_t * fecTlv, mplsFecElement_t * elem);
62 int setupAtmLblTlv(mplsLdpAtmLblTlv_t * atmLblTlv, int res, int v,
63 unsigned int vpi, unsigned int vci);
64 int setupFrLblTlv(mplsLdpFrLblTlv_t * frLblTlv, int res, int len,
66 unsigned int dlci);
67 int setupGenLblTlv(mplsLdpGenLblTlv_t * genLblTlv, int label);
68 int setupHopCountTlv(mplsLdpHopTlv_t * hopCountTlv, unsigned int hopCount);
69 int setupPathTlv(mplsLdpPathTlv_t * pathTlv);
70 int addLsrId2PathTlv(mplsLdpPathTlv_t * pathTlv, unsigned int lsrId);
71 int setupAddrTlv(mplsLdpAdrTlv_t * addrTlv);
72 int addAddrElem2AddrTlv(mplsLdpAdrTlv_t * addrTlv, unsigned int addr);
73 int setupStatusTlv(mplsLdpStatusTlv_t * statTlv, int fatal, int forward,
74 int status, unsigned int msgId, int msgType);
75 int setupExStatusTlv(mplsLdpExStatusTlv_t * exStatus, unsigned int value);
76 int setupRetPduTlv(mplsLdpRetPduTlv_t * retPduTvl, unsigned int len,
77 mplsLdpHeader_t * hdr, void *data);
78 int setupRetMsgTlv(mplsLdpRetMsgTlv_t * retMsgTlv, unsigned type, unsigned len,
80 void *data);
81 int setupLspidTlv(mplsLdpLspIdTlv_t * lspidTlv, int res,
82 unsigned int localCrlspId, unsigned int routerId);
83 int setupTrafficTlv(mplsLdpTrafficTlv_t * trafficTlv, unsigned char freq,
84 unsigned char res, unsigned char weight, float pdr, float pbs, float cdr,
85 float cbs, float ebs);
86 int setupLblMsgIdTlv(mplsLdpLblMsgIdTlv_t * lblMsgIdTlv, unsigned int msgId);
89 #endif /* */