3 * Copyright (C) James R. Leu 2000
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
13 #include "ldp_struct.h"
14 #include "ldp_entity.h"
15 #include "ldp_session.h"
17 #define LDP_CFG_ADD 0x00000001
18 #define LDP_CFG_DEL 0x10000000
20 #define LDP_GLOBAL_CFG_ADMIN_STATE 0x00000002
21 #define LDP_GLOBAL_CFG_CONTROL_MODE 0x00000004
22 #define LDP_GLOBAL_CFG_RETENTION_MODE 0x00000008
23 #define LDP_GLOBAL_CFG_REPAIR_MODE 0x00000010
24 #define LDP_GLOBAL_CFG_PROPOGATE_RELEASE 0x00000020
25 #define LDP_GLOBAL_CFG_LABEL_MERGE 0x00000040
26 #define LDP_GLOBAL_CFG_LOOP_DETECTION_MODE 0x00000080
27 #define LDP_GLOBAL_CFG_TTLLESS_DOMAIN 0x00000100
28 #define LDP_GLOBAL_CFG_LOCAL_TCP_PORT 0x00000200
29 #define LDP_GLOBAL_CFG_LOCAL_UDP_PORT 0x00000400
30 #define LDP_GLOBAL_CFG_LSR_IDENTIFIER 0x00000800
31 #define LDP_GLOBAL_CFG_TRANS_ADDR 0x00001000
32 #define LDP_GLOBAL_CFG_KEEPALIVE_TIMER 0x00002000
33 #define LDP_GLOBAL_CFG_KEEPALIVE_INTERVAL 0x00004000
34 #define LDP_GLOBAL_CFG_HELLOTIME_TIMER 0x00008000
35 #define LDP_GLOBAL_CFG_HELLOTIME_INTERVAL 0x00010000
36 #define LDP_GLOBAL_CFG_LSR_HANDLE 0x00020000
38 #define LDP_GLOBAL_CFG_WHEN_DOWN (LDP_GLOBAL_CFG_LOCAL_TCP_PORT|\
39 LDP_GLOBAL_CFG_LOCAL_UDP_PORT|\
40 LDP_GLOBAL_CFG_LSR_IDENTIFIER)
42 #define LDP_ENTITY_CFG_TRANS_ADDR 0x00000002
43 #define LDP_ENTITY_CFG_PROTO_VER 0x00000004
44 #define LDP_ENTITY_CFG_REMOTE_TCP 0x00000008
45 #define LDP_ENTITY_CFG_REMOTE_UDP 0x00000010
46 #define LDP_ENTITY_CFG_MAX_PDU 0x00000020
47 #define LDP_ENTITY_CFG_KEEPALIVE_TIMER 0x00000040
48 #define LDP_ENTITY_CFG_KEEPALIVE_INTERVAL 0x00000080
49 #define LDP_ENTITY_CFG_HELLOTIME_TIMER 0x00000100
50 #define LDP_ENTITY_CFG_HELLOTIME_INTERVAL 0x00000200
51 #define LDP_ENTITY_CFG_SESSION_SETUP_COUNT 0x00000400
52 #define LDP_ENTITY_CFG_SESSION_BACKOFF_TIMER 0x00000800
53 #define LDP_ENTITY_CFG_DISTRIBUTION_MODE 0x00001000
54 #define LDP_ENTITY_CFG_PATHVECTOR_LIMIT 0x00002000
55 #define LDP_ENTITY_CFG_HOPCOUNT_LIMIT 0x00004000
56 #define LDP_ENTITY_CFG_REQUEST_TIMER 0x00008000
57 #define LDP_ENTITY_CFG_REQUEST_COUNT 0x00010000
58 #define LDP_ENTITY_CFG_ADMIN_STATE 0x00020000
59 #define LDP_ENTITY_CFG_ADJ_COUNT 0x00040000
60 #define LDP_ENTITY_CFG_TYPE 0x00080000
61 #define LDP_ENTITY_CFG_SUB_INDEX 0x00100000
62 #define LDP_ENTITY_CFG_INHERIT_FLAG 0x00200000
63 #define LDP_ENTITY_CFG_MESG_TX 0x00400000
64 #define LDP_ENTITY_CFG_MESG_RX 0x00800000
65 #define LDP_ENTITY_CFG_ADJ_INDEX 0x01000000
67 #define LDP_ENTITY_CFG_WHEN_DOWN (LDP_CFG_DEL|\
68 LDP_ENTITY_CFG_TRANS_ADDR|\
69 LDP_ENTITY_CFG_PROTO_VER|\
70 LDP_ENTITY_CFG_REMOTE_TCP|\
71 LDP_ENTITY_CFG_REMOTE_UDP|\
72 LDP_ENTITY_CFG_DISTRIBUTION_MODE|\
74 LDP_ENTITY_CFG_SUB_INDEX)
76 #define LDP_FEC_CFG_BY_INDEX 0x00000002
77 #define LDP_FEC_NEXTHOP_CFG_BY_INDEX 0x00000004
79 #define LDP_IF_CFG_LABEL_SPACE 0x00000002
80 #define LDP_IF_CFG_INDEX 0x00000004
81 #define LDP_IF_CFG_ENTITY_INDEX 0x00000008
82 #define LDP_IF_CFG_OPER_STATE 0x00000010
83 #define LDP_IF_CFG_BY_INDEX 0x00000080
84 #define LDP_IF_ADDR_CFG_BY_INDEX 0x00000100
85 #define LDP_IF_CFG_HANDLE 0x00000200
87 #define LDP_IF_CFG_WHEN_DOWN (LDP_CFG_DEL|\
88 LDP_IF_CFG_LABEL_SPACE|\
90 LDP_IF_CFG_ENTITY_INDEX|\
91 LDP_IF_CFG_OPER_STATE|\
94 #define LDP_PEER_CFG_LABEL_SPACE 0x00000002
95 #define LDP_PEER_CFG_DEST_ADDR 0x00000004
96 #define LDP_PEER_CFG_TARGET_ROLE 0x00000008
97 #define LDP_PEER_CFG_ENTITY_INDEX 0x00000010
98 #define LDP_PEER_CFG_OPER_STATE 0x00000020
99 #define LDP_PEER_CFG_PEER_NAME 0x00000040
100 #define LDP_PEER_CFG_LOCAL_SOURCE_ADDR 0x00000080
102 #define LDP_PEER_CFG_WHEN_DOWN (LDP_CFG_DEL|\
103 LDP_PEER_CFG_LABEL_SPACE|\
104 LDP_PEER_CFG_DEST_ADDR|\
105 LDP_PEER_CFG_TARGET_ROLE)
107 #define LDP_SESSION_CFG_INDEX 0x00000002
108 #define LDP_SESSION_CFG_STATE 0x00000004
109 #define LDP_SESSION_CFG_MAX_PDU 0x00000008
110 #define LDP_SESSION_CFG_KEEPALIVE 0x00000010
111 #define LDP_SESSION_CFG_PATH_LIMIT 0x00000020
112 #define LDP_SESSION_CFG_DIST_MODE 0x00000040
113 #define LDP_SESSION_CFG_LOOP_DETECTION 0x00000080
114 #define LDP_SESSION_CFG_REMOTE_MAX_PDU 0x00000100
115 #define LDP_SESSION_CFG_REMOTE_KEEPALIVE 0x00000200
116 #define LDP_SESSION_CFG_REMOTE_PATH_LIMIT 0x00000400
117 #define LDP_SESSION_CFG_REMOTE_DIST_MODE 0x00000800
118 #define LDP_SESSION_CFG_REMOTE_LOOP_DETECTION 0x00001000
119 #define LDP_SESSION_CFG_REMOTE_ADDR 0x00002000
120 #define LDP_SESSION_CFG_REMOTE_PORT 0x00004000
121 #define LDP_SESSION_CFG_LABEL_RESOURCE_STATE_LOCAL 0x00008000
122 #define LDP_SESSION_CFG_LABEL_RESOURCE_STATE_REMOTE 0x00010000
123 #define LDP_SESSION_CFG_ENTITY_INDEX 0x00020000
124 #define LDP_SESSION_CFG_ADJ_INDEX 0x00040000
125 #define LDP_SESSION_CFG_MESG_TX 0x00080000
126 #define LDP_SESSION_CFG_MESG_RX 0x00100000
127 #define LDP_SESSION_CFG_OPER_UP 0x00200000
129 #define LDP_SESSION_RADDR_CFG_ADDR 0x00000002
130 #define LDP_SESSION_RADDR_CFG_INDEX 0x00000004
132 #define LDP_ATTR_CFG_STATE 0x00000002
133 #define LDP_ATTR_CFG_FEC 0x00000004
134 #define LDP_ATTR_CFG_LABEL 0x00000008
135 #define LDP_ATTR_CFG_HOP_COUNT 0x00000010
136 #define LDP_ATTR_CFG_PATH 0x00000020
137 #define LDP_ATTR_CFG_SESSION_INDEX 0x00000040
138 #define LDP_ATTR_CFG_INLABEL_INDEX 0x00000080
139 #define LDP_ATTR_CFG_OUTLABEL_INDEX 0x00000100
140 #define LDP_ATTR_CFG_INGRESS 0x00000200
142 #define LDP_ADJ_CFG_REMOTE_TRADDR 0x00000002
143 #define LDP_ADJ_CFG_REMOTE_SRCADDR 0x00000004
144 #define LDP_ADJ_CFG_REMOTE_LSRADDR 0x00000008
145 #define LDP_ADJ_CFG_REMOTE_CSN 0x00000010
146 #define LDP_ADJ_CFG_REMOTE_LABELSPACE 0x00000020
147 #define LDP_ADJ_CFG_REMOTE_HELLOTIME 0x00000040
148 #define LDP_ADJ_CFG_ENTITY_INDEX 0x00000080
149 #define LDP_ADJ_CFG_REMOTE_SESSION_INDEX 0x00000100
150 #define LDP_ADJ_CFG_ROLE 0x00000200
152 #define LDP_INLABEL_CFG_LABELSPACE 0x00000002
153 #define LDP_INLABEL_CFG_LABEL 0x00000004
154 #define LDP_INLABEL_CFG_OUTLABEL_INDEX 0x00000008
156 #define LDP_OUTLABEL_CFG_NH_INDEX 0x00000002
157 #define LDP_OUTLABEL_CFG_SESSION_INDEX 0x00000004
158 #define LDP_OUTLABEL_CFG_LABEL 0x00000008
159 #define LDP_OUTLABEL_CFG_MERGE_COUNT 0x00000010
161 #define LDP_TUNNEL_CFG_INDEX 0x00000002
162 #define LDP_TUNNEL_CFG_INSTANCE 0x00000004
163 #define LDP_TUNNEL_CFG_INGRESS 0x00000008
164 #define LDP_TUNNEL_CFG_EGRESS 0x00000010
165 #define LDP_TUNNEL_CFG_NAME 0x00000020
166 #define LDP_TUNNEL_CFG_IS_IF 0x00000040
167 #define LDP_TUNNEL_CFG_OUTLABEL 0x00000080
168 #define LDP_TUNNEL_CFG_SETUP_PRIO 0x00000100
169 #define LDP_TUNNEL_CFG_HOLD_PRIO 0x00000200
170 #define LDP_TUNNEL_CFG_INSTANCE_PRIO 0x00000400
171 #define LDP_TUNNEL_CFG_LOCAL_PROTECT 0x00000800
172 #define LDP_TUNNEL_CFG_RESOURCE_INDEX 0x00001000
173 #define LDP_TUNNEL_CFG_HOP_LIST_INDEX 0x00002000
174 #define LDP_TUNNEL_CFG_ROLE 0x00004000
175 #define LDP_TUNNEL_CFG_ADMIN_STATE 0x00008000
176 #define LDP_TUNNEL_CFG_FEC 0x00010000
178 #define LDP_TUNNEL_CFG_WHEN_DOWN (LDP_CFG_DEL|\
179 LDP_TUNNEL_CFG_OUTLABEL|\
180 LDP_TUNNEL_CFG_RESOURCE_INDEX|\
181 LDP_TUNNEL_CFG_HOP_LIST_INDEX)
183 #define LDP_RESOURCE_CFG_INDEX 0x00000002
184 #define LDP_RESOURCE_CFG_MAXBPS 0x00000004
185 #define LDP_RESOURCE_CFG_MEANBPS 0x00000008
186 #define LDP_RESOURCE_CFG_BURSTSIZE 0x00000010
188 #define LDP_RESOURCE_CFG_WHEN_DOWN (LDP_CFG_DEL|\
189 LDP_RESOURCE_CFG_MAXBPS|\
190 LDP_RESOURCE_CFG_MEANBPS|\
191 LDP_RESOURCE_CFG_BURSTSIZE)
193 #define LDP_HOP_CFG_INDEX 0x00000002
194 #define LDP_HOP_CFG_LIST_INDEX 0x00000004
195 #define LDP_HOP_CFG_PATH_OPTION 0x00000008
196 #define LDP_HOP_CFG_ADDR 0x00000010
197 #define LDP_HOP_CFG_TYPE 0x00000020
199 #define LDP_HOP_CFG_WHEN_DOWN (LDP_CFG_DEL|\
201 LDP_HOP_CFG_LIST_INDEX|\
205 extern mpls_cfg_handle
ldp_cfg_open(mpls_instance_handle data
);
206 extern void ldp_cfg_close(mpls_cfg_handle handle
);
208 extern mpls_return_enum
ldp_cfg_global_get(mpls_cfg_handle handle
,
209 ldp_global
* g
, uint32_t flag
);
210 extern mpls_return_enum
ldp_cfg_global_set(mpls_cfg_handle handle
,
211 ldp_global
* g
, uint32_t flag
);
212 extern void ldp_cfg_global_attr(mpls_cfg_handle handle
);
214 extern mpls_return_enum
ldp_cfg_entity_get(mpls_cfg_handle handle
,
215 ldp_entity
* e
, uint32_t flag
);
216 extern mpls_return_enum
ldp_cfg_entity_getnext(mpls_cfg_handle handle
,
217 ldp_entity
* e
, uint32_t flag
);
218 extern mpls_return_enum
ldp_cfg_entity_test(mpls_cfg_handle handle
,
219 ldp_entity
* e
, uint32_t flag
);
220 extern mpls_return_enum
ldp_cfg_entity_set(mpls_cfg_handle handle
,
221 ldp_entity
* e
, uint32_t flag
);
222 extern mpls_return_enum
ldp_cfg_entity_adj_getnext(mpls_cfg_handle handle
,
225 extern mpls_return_enum
ldp_cfg_attr_get(mpls_cfg_handle handle
, ldp_attr
* a
,
227 extern mpls_return_enum
ldp_cfg_attr_getnext(mpls_cfg_handle handle
,
228 ldp_attr
* a
, uint32_t flag
);
230 extern mpls_return_enum
ldp_cfg_peer_get(mpls_cfg_handle handle
, ldp_peer
* p
,
232 extern mpls_return_enum
ldp_cfg_peer_getnext(mpls_cfg_handle handle
,
233 ldp_peer
* p
, uint32_t flag
);
234 extern mpls_return_enum
ldp_cfg_peer_test(mpls_cfg_handle handle
, ldp_peer
* p
,
236 extern mpls_return_enum
ldp_cfg_peer_set(mpls_cfg_handle handle
, ldp_peer
* p
,
239 extern mpls_return_enum
ldp_cfg_fec_get(mpls_cfg_handle handle
, mpls_fec
* p
,
241 extern mpls_return_enum
ldp_cfg_fec_getnext(mpls_cfg_handle handle
,
242 mpls_fec
* p
, uint32_t flag
);
243 extern mpls_return_enum
ldp_cfg_fec_test(mpls_cfg_handle handle
, mpls_fec
* p
,
245 extern mpls_return_enum
ldp_cfg_fec_set(mpls_cfg_handle handle
, mpls_fec
* p
,
248 extern mpls_return_enum
ldp_cfg_fec_nexthop_get(mpls_cfg_handle handle
,
249 mpls_fec
* p
, mpls_nexthop
*nh
, uint32_t flag
);
250 extern mpls_return_enum
ldp_cfg_fec_nexthop_getnext(mpls_cfg_handle handle
,
251 mpls_fec
* p
, mpls_nexthop
*nh
, uint32_t flag
);
252 extern mpls_return_enum
ldp_cfg_fec_nexthop_test(mpls_cfg_handle handle
,
253 mpls_fec
* p
, mpls_nexthop
*nh
, uint32_t flag
);
254 extern mpls_return_enum
ldp_cfg_fec_nexthop_set(mpls_cfg_handle handle
,
255 mpls_fec
* p
, mpls_nexthop
*nh
, uint32_t flag
);
257 extern mpls_return_enum
ldp_cfg_addr_get(mpls_cfg_handle handle
, ldp_addr
* a
,
259 extern mpls_return_enum
ldp_cfg_addr_getnext(mpls_cfg_handle handle
,
260 ldp_addr
* a
, uint32_t flag
);
262 extern mpls_return_enum
ldp_cfg_if_get(mpls_cfg_handle handle
, ldp_if
* i
,
264 extern mpls_return_enum
ldp_cfg_if_getnext(mpls_cfg_handle handle
, ldp_if
* i
,
266 extern mpls_return_enum
ldp_cfg_if_test(mpls_cfg_handle handle
, ldp_if
* i
,
268 extern mpls_return_enum
ldp_cfg_if_set(mpls_cfg_handle handle
, ldp_if
* i
,
271 extern mpls_return_enum
ldp_cfg_if_addr_get(mpls_cfg_handle handle
, ldp_if
* i
,
272 ldp_addr
* a
, uint32_t flag
);
273 extern mpls_return_enum
ldp_cfg_if_addr_getnext(mpls_cfg_handle handle
,
274 ldp_if
* i
, ldp_addr
*a
, uint32_t flag
);
275 extern mpls_return_enum
ldp_cfg_if_addr_set(mpls_cfg_handle handle
, ldp_if
*i
,
276 ldp_addr
* a
, uint32_t flag
);
278 extern mpls_return_enum
ldp_cfg_labelrange_get(mpls_cfg_handle handle
,
279 mpls_range
* r
, uint32_t flag
);
280 extern mpls_return_enum
ldp_cfg_labelrange_test(mpls_cfg_handle handle
,
281 mpls_range
* r
, uint32_t flag
);
282 extern mpls_return_enum
ldp_cfg_labelrange_set(mpls_cfg_handle handle
,
283 mpls_range
* r
, uint32_t flag
);
285 extern mpls_return_enum
ldp_cfg_adj_get(mpls_cfg_handle handle
, ldp_adj
* a
,
287 extern mpls_return_enum
ldp_cfg_adj_getnext(mpls_cfg_handle handle
, ldp_adj
* a
,
289 extern mpls_return_enum
ldp_cfg_adj_entity_getnext(mpls_cfg_handle handle
,
292 extern mpls_return_enum
ldp_cfg_session_get(mpls_cfg_handle handle
,
293 ldp_session
* s
, uint32_t flag
);
294 extern mpls_return_enum
ldp_cfg_session_getnext(mpls_cfg_handle handle
,
295 ldp_session
* s
, uint32_t flag
);
297 extern mpls_return_enum
ldp_cfg_session_raddr_get(mpls_cfg_handle handle
,
298 ldp_session
* s
, ldp_addr
* a
, uint32_t flag
);
299 extern mpls_return_enum
ldp_cfg_session_raddr_getnext(mpls_cfg_handle handle
,
300 ldp_session
* s
, ldp_addr
* a
, uint32_t flag
);
302 extern mpls_return_enum
ldp_cfg_inlabel_get(mpls_cfg_handle handle
,
303 ldp_inlabel
* i
, uint32_t flag
);
304 mpls_return_enum
ldp_cfg_inlabel_getnext(mpls_cfg_handle handle
,
305 ldp_inlabel
* i
, uint32_t flag
);
306 extern mpls_return_enum
ldp_cfg_outlabel_get(mpls_cfg_handle handle
,
307 ldp_outlabel
* o
, uint32_t flag
);
308 mpls_return_enum
ldp_cfg_outlabel_getnext(mpls_cfg_handle handle
,
309 ldp_outlabel
* o
, uint32_t flag
);
311 extern mpls_return_enum
ldp_cfg_range_set(mpls_cfg_handle handle
,
312 mpls_range
* r
, uint32_t flag
);
313 extern mpls_return_enum
ldp_cfg_range_test(mpls_cfg_handle handle
,
314 mpls_range
* r
, uint32_t flag
);
315 extern mpls_return_enum
ldp_cfg_range_get(mpls_cfg_handle handle
,
316 mpls_range
* r
, uint32_t flag
);
318 extern mpls_return_enum
ldp_cfg_tunnel_set(mpls_cfg_handle handle
,
319 ldp_tunnel
* r
, uint32_t flag
);
320 extern mpls_return_enum
ldp_cfg_tunnel_test(mpls_cfg_handle handle
,
321 ldp_tunnel
* r
, uint32_t flag
);
322 extern mpls_return_enum
ldp_cfg_tunnel_get(mpls_cfg_handle handle
,
323 ldp_tunnel
* r
, uint32_t flag
);
325 extern mpls_return_enum
ldp_cfg_resource_set(mpls_cfg_handle handle
,
326 ldp_resource
* r
, uint32_t flag
);
327 extern mpls_return_enum
ldp_cfg_resource_test(mpls_cfg_handle handle
,
328 ldp_resource
* r
, uint32_t flag
);
329 extern mpls_return_enum
ldp_cfg_resource_get(mpls_cfg_handle handle
,
330 ldp_resource
* r
, uint32_t flag
);
332 extern mpls_return_enum
ldp_cfg_hop_set(mpls_cfg_handle handle
, ldp_hop
* r
,
334 extern mpls_return_enum
ldp_cfg_hop_test(mpls_cfg_handle handle
, ldp_hop
* r
,
336 extern mpls_return_enum
ldp_cfg_hop_get(mpls_cfg_handle handle
, ldp_hop
* r
,