remove debug code from ldp/ldp_fec.c
[mpls-ldp-portable.git] / ldp / ldp_struct.h
blob1e9d986a1d1c93b8f1d7b23249f9f4e0611055b9
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 _LDP_STRUCT_H_
11 #define _LDP_STRUCT_H_
13 #include "mpls_struct.h"
14 #include "mpls_list.h"
15 #include "mpls_refcnt.h"
17 MPLS_LIST_ROOT(ldp_outlabel_list, ldp_outlabel);
18 MPLS_LIST_ROOT(ldp_resource_list, ldp_resource);
19 MPLS_LIST_ROOT(ldp_hop_list_list, ldp_hop_list);
20 MPLS_LIST_ROOT(ldp_inlabel_list, ldp_inlabel);
21 MPLS_LIST_ROOT(ldp_session_list, ldp_session);
22 MPLS_LIST_ROOT(ldp_nexthop_list, ldp_nexthop);
23 MPLS_LIST_ROOT(ldp_entity_list, ldp_entity);
24 MPLS_LIST_ROOT(ldp_tunnel_list, ldp_tunnel);
25 MPLS_LIST_ROOT(ldp_addr_list, ldp_addr);
26 MPLS_LIST_ROOT(ldp_attr_list, ldp_attr);
27 MPLS_LIST_ROOT(ldp_peer_list, ldp_peer);
28 MPLS_LIST_ROOT(_ldp_hop_list, ldp_hop);
29 MPLS_LIST_ROOT(ldp_adj_list, ldp_adj);
30 MPLS_LIST_ROOT(ldp_fec_list, ldp_fec);
31 MPLS_LIST_ROOT(ldp_fs_list, ldp_fs);
32 MPLS_LIST_ROOT(ldp_if_list, ldp_if);
34 typedef struct ldp_attr_list ldp_attr_list;
36 typedef enum {
37 LDP_UNKNOWN = 0,
38 LDP_DIRECT,
39 LDP_INDIRECT,
40 } ldp_entity_type_enum;
42 typedef enum {
43 LDP_CONTROL_INDEPENDENT = 1,
44 LDP_CONTROL_ORDERED
45 } ldp_control_mode;
47 typedef enum {
48 LDP_RETENTION_LIBERAL = 1,
49 LDP_RETENTION_CONSERVATIVE
50 } ldp_retention_mode;
52 typedef enum {
53 LDP_REPAIR_LOCAL = 1,
54 LDP_REPAIR_GLOBAL
55 } ldp_repaire_mode;
57 typedef enum {
58 LDP_LOOP_NONE = 0,
59 LDP_LOOP_HOPCOUNT,
60 LDP_LOOP_PATHVECTOR,
61 LDP_LOOP_HOPCOUNT_PATHVECTOR,
62 LDP_LOOP_OTHER,
63 } ldp_loop_detection_mode;
65 typedef enum {
66 LDP_TRANS_ADDR_NONE = 0,
67 LDP_TRANS_ADDR_INTERFACE,
68 LDP_TRANS_ADDR_LSRID
69 } ldp_trans_addr_mode;
71 typedef enum {
72 LDP_DISTRIBUTION_UNSOLICITED = 0,
73 LDP_DISTRIBUTION_ONDEMAND = 1,
74 } ldp_distribution_mode;
76 typedef enum {
77 LDP_INFINIT = 0,
78 } ldp_count;
80 typedef enum {
81 LDP_NONE,
82 LDP_PASSIVE,
83 LDP_ACTIVE
84 } ldp_role_enum;
86 typedef enum {
87 LDP_EVENT_HELLO = 0,
88 LDP_EVENT_CONNECT,
89 LDP_EVENT_INIT,
90 LDP_EVENT_KEEP,
91 LDP_EVENT_ADDR,
92 LDP_EVENT_LABEL,
93 LDP_EVENT_NOTIF,
94 LDP_EVENT_CLOSE,
95 LDP_EVENT_HTIMER,
96 LDP_EVENT_KTIMER,
97 LDP_EVENT_TCP_LISTEN,
98 LDP_EVENT_TCP_CONNECT,
99 LDP_EVENT_UDP_DATA,
100 LDP_EVENT_TCP_DATA,
101 } ldp_event_enum;
103 typedef enum {
104 LDP_STATE_NONE = 0,
105 LDP_STATE_NON_EXIST,
106 LDP_STATE_INITIALIZED,
107 LDP_STATE_OPENSENT,
108 LDP_STATE_OPENREC,
109 LDP_STATE_OPERATIONAL
110 } ldp_state_enum;
112 typedef enum {
113 LDP_KEEPALIVE_RECV = 1,
114 LDP_KEEPALIVE_SEND
115 } ldp_keepalive_type;
117 typedef enum {
118 LDP_LSP_STATE_REQ_RECV,
119 LDP_LSP_STATE_REQ_SENT,
120 LDP_LSP_STATE_MAP_RECV,
121 LDP_LSP_STATE_MAP_SENT,
122 LDP_LSP_STATE_WITH_SENT,
123 LDP_LSP_STATE_WITH_RECV,
124 LDP_LSP_STATE_NO_LABEL_RESOURCE_SENT,
125 LDP_LSP_STATE_NO_LABEL_RESOURCE_RECV,
126 LDP_LSP_STATE_ABORT_SENT,
127 LDP_LSP_STATE_ABORT_RECV,
128 LDP_LSP_STATE_NOTIF_SENT,
129 LDP_LSP_STATE_NOTIF_RECV
130 } ldp_lsp_state;
132 typedef enum {
133 LDP_TRACE_FLAG_ADDRESS = 0x00000001,
134 LDP_TRACE_FLAG_BINDING = 0x00000002,
135 LDP_TRACE_FLAG_DEBUG = 0x00000004,
136 LDP_TRACE_FLAG_ERROR = 0x00000008,
137 LDP_TRACE_FLAG_EVENT = 0x00000010,
138 LDP_TRACE_FLAG_GENERAL = 0x00000020,
139 LDP_TRACE_FLAG_INIT = 0x00000040,
140 LDP_TRACE_FLAG_LABEL = 0x00000080,
141 LDP_TRACE_FLAG_NORMAL = 0x00000100,
142 LDP_TRACE_FLAG_NOTIF = 0x00000200,
143 LDP_TRACE_FLAG_PACKET_DUMP = 0x00000400,
144 LDP_TRACE_FLAG_PACKET = 0x00000800,
145 LDP_TRACE_FLAG_PATH = 0x00001000,
146 LDP_TRACE_FLAG_PERIODIC = 0x00002000,
147 LDP_TRACE_FLAG_POLICY = 0x00004000,
148 LDP_TRACE_FLAG_ROUTE = 0x00008000,
149 LDP_TRACE_FLAG_STATE = 0x00010000,
150 LDP_TRACE_FLAG_TASK = 0x00020000,
151 LDP_TRACE_FLAG_TIMER = 0x00040000,
152 LDP_TRACE_FLAG_ALL = 0xFFFFFFFF
153 } ldp_trace_flags;
155 typedef enum {
156 LDP_NOTIF_NONE = 0,
157 LDP_NOTIF_SUCCESS,
158 LDP_NOTIF_BAD_LDP_ID,
159 LDP_NOTIF_BAD_PROTO,
160 LDP_NOTIF_BAD_PDU_LEN,
161 LDP_NOTIF_UNKNOWN_MESG,
162 LDP_NOTIF_BAD_MESG_LEN,
163 LDP_NOTIF_UNKNOWN_TVL,
164 LDP_NOTIF_BAD_TLV_LEN,
165 LDP_NOTIF_MALFORMED_TLV,
166 LDP_NOTIF_HOLD_TIMER_EXPIRED,
167 LDP_NOTIF_SHUTDOWN,
168 LDP_NOTIF_LOOP_DETECTED,
169 LDP_NOTIF_UNKNOWN_FEC,
170 LDP_NOTIF_NO_ROUTE,
171 LDP_NOTIF_NO_LABEL_RESOURCES_AVAILABLE,
172 LDP_NOTIF_LABEL_RESOURCES_AVAILABLE,
173 LDP_NOTIF_SESSION_REJECTED_NO_HELLO,
174 LDP_NOTIF_SESSION_REJECTED_PARAMETERS_ADVERTISEMENT_MODE,
175 LDP_NOTIF_SESSION_REJECTED_PARAMETERS_MAX_PDU_LEN,
176 LDP_NOTIF_SESSION_REJECTED_PARAMETERS_LABEL_RANGE,
177 LDP_NOTIF_KEEPALIVE_TIMER_EXPIRED,
178 LDP_NOTIF_LABEL_ABORT,
179 LDP_NOTIF_MISSING_MSG_PARAMS,
180 LDP_NOTIF_UNSUPORTED_AF,
181 LDP_NOTIF_SESSION_REJECTED_BAD_KEEPALIVE_TIME,
182 LDP_NOTIF_INTERNAL_ERROR
183 } ldp_notif_status;
185 #define LDP_STATE_NUM 6
186 #define LDP_EVENT_NUM 10
187 #define LDP_FUNC_NUM 10
189 #include "ldp_defaults.h"
190 #include "mpls_handle_type.h"
191 #include "ldp_nortel.h"
193 typedef struct ldp_mesg {
194 mplsLdpHeader_t header;
195 union {
196 mplsLdpMsg_t generic;
197 mplsLdpInitMsg_t init;
198 mplsLdpNotifMsg_t notif;
199 mplsLdpHelloMsg_t hello;
200 mplsLdpKeepAlMsg_t keep;
201 mplsLdpAdrMsg_t addr;
202 mplsLdpLblMapMsg_t map;
203 mplsLdpLblReqMsg_t request;
204 mplsLdpLbl_W_R_Msg_t release;
205 mplsLdpLblAbortMsg_t abort;
206 } u;
207 } ldp_mesg;
209 typedef struct ldp_buf {
210 uint8_t *buffer;
211 uint8_t *current;
212 int current_size;
213 int size;
214 int total;
215 int want;
216 } ldp_buf;
218 typedef struct ldp_global {
219 struct ldp_outlabel_list outlabel;
220 struct ldp_resource_list resource;
221 struct ldp_hop_list_list hop_list;
222 struct ldp_inlabel_list inlabel;
223 struct ldp_nexthop_list nexthop;
224 struct ldp_session_list session;
225 struct ldp_tunnel_list tunnel;
226 struct ldp_entity_list entity;
227 struct ldp_peer_list peer;
228 struct ldp_attr_list attr;
229 struct ldp_addr_list addr;
230 struct ldp_adj_list adj;
231 struct ldp_if_list iff;
232 struct ldp_fec_list fec;
234 mpls_lock_handle global_lock;
235 mpls_instance_handle user_data;
237 mpls_tree_handle addr_tree;
238 mpls_tree_handle fec_tree;
240 mpls_socket_handle hello_socket;
241 mpls_socket_handle listen_socket;
243 mpls_timer_mgr_handle timer_handle;
244 mpls_socket_mgr_handle socket_handle;
245 mpls_fib_handle fib_handle;
246 mpls_ifmgr_handle ifmgr_handle;
248 #if MPLS_USE_LSR
249 mpls_cfg_handle lsr_handle;
250 #else
251 mpls_mpls_handle mpls_handle;
252 #endif
255 * CSN changes with every MIB set, BUT only when a entity goes through
256 * shutdown/startup cycle will it grab the new CSN and use it in hellos
258 uint32_t configuration_sequence_number;
261 * Message ID increaments with EVERY message, this means it will roll over
263 uint32_t message_identifier;
265 struct mpls_inet_addr lsr_identifier;
266 mpls_bool send_address_messages;
267 mpls_bool send_lsrid_mapping;
268 ldp_control_mode lsp_control_mode;
269 ldp_retention_mode label_retention_mode;
270 ldp_repaire_mode lsp_repair_mode;
271 mpls_bool propagate_release;
272 mpls_bool label_merge;
273 ldp_loop_detection_mode loop_detection_mode;
274 mpls_bool ttl_less_domain;
275 uint16_t local_tcp_port;
276 uint16_t local_udp_port;
277 uint16_t backoff_step;
278 int no_route_to_peer_time;
281 * some global defaults, entities will inherit these values unless
282 * instructed otherwise
284 struct mpls_inet_addr transport_address;
285 uint16_t keepalive_timer;
286 uint16_t keepalive_interval;
287 uint16_t hellotime_timer;
288 uint16_t hellotime_interval;
290 mpls_admin_state_enum admin_state;
291 } ldp_global;
293 typedef struct ldp_entity {
294 MPLS_REFCNT_FIELD;
295 MPLS_LIST_ELEM(ldp_entity) _global;
296 struct ldp_adj_list adj_root;
298 ldp_entity_type_enum entity_type;
299 union {
300 struct ldp_peer *peer;
301 struct ldp_if *iff;
302 } p;
304 ldp_state_enum state;
305 uint32_t inherit_flag;
306 uint32_t sub_index;
307 uint32_t index;
308 struct mpls_inet_addr transport_address;
309 uint8_t protocol_version;
310 uint16_t remote_tcp_port;
311 uint16_t remote_udp_port;
312 uint16_t max_pdu;
313 uint16_t keepalive_timer;
314 uint16_t keepalive_interval;
315 uint16_t hellotime_timer;
316 uint16_t hellotime_interval;
317 uint16_t session_setup_count;
318 uint16_t session_backoff_timer;
319 ldp_distribution_mode label_distribution_mode;
320 uint8_t path_vector_limit;
321 uint8_t hop_count_limit;
322 uint8_t label_request_count;
323 uint16_t label_request_timer;
324 ldp_loop_detection_mode loop_detection_mode;
325 mpls_admin_state_enum admin_state;
326 mpls_bool remote_in_ttl_less_domain;
327 mpls_bool request_retry;
329 /* mesg counters */
330 uint32_t mesg_tx;
331 uint32_t mesg_rx;
333 /* only used for cfg gets */
334 int adj_index;
335 int adj_count;
336 } ldp_entity;
338 typedef struct ldp_if {
339 MPLS_REFCNT_FIELD;
340 MPLS_LIST_ELEM(ldp_if) _global;
341 struct mpls_link_list session_root;
342 struct ldp_nexthop_list nh_root;
343 struct ldp_addr_list addr_root;
344 struct ldp_entity *entity;
345 mpls_timer_handle hellotime_send_timer;
346 int hellotime_send_timer_duration;
347 int label_space;
348 uint32_t index;
349 mpls_if_handle handle;
351 struct ldp_mesg *tx_message;
352 struct ldp_buf *tx_buffer;
353 struct ldp_mesg *hello;
355 /* YES this is a dest, it is what we use for sendto */
356 struct mpls_dest dest;
358 mpls_oper_state_enum oper_state;
359 mpls_bool is_p2p;
361 /* only used for cfg gets */
362 uint32_t entity_index;
363 } ldp_if;
365 typedef struct ldp_peer {
366 MPLS_REFCNT_FIELD;
367 MPLS_LIST_ELEM(ldp_peer) _global;
368 struct ldp_entity *entity;
369 mpls_timer_handle no_route_to_peer_timer;
370 mpls_timer_handle hellotime_send_timer;
371 int hellotime_send_timer_duration;
372 int label_space;
373 uint32_t index;
375 struct ldp_mesg *tx_message;
376 struct ldp_buf *tx_buffer;
377 struct ldp_mesg *hello;
379 /* YES this is a dest, it is what we use for sendto */
380 struct mpls_dest dest;
381 ldp_role_enum target_role;
383 char peer_name[MPLS_MAX_IF_NAME];
384 mpls_oper_state_enum oper_state;
386 /* only used for cfg gets */
387 uint32_t entity_index;
388 } ldp_peer;
390 typedef struct ldp_session {
391 MPLS_REFCNT_FIELD;
392 MPLS_LIST_ELEM(ldp_session) _global;
393 struct ldp_outlabel_list outlabel_root;
394 struct mpls_link_list inlabel_root;
395 struct mpls_link_list addr_root;
396 struct ldp_attr_list attr_root;
397 struct ldp_adj_list adj_root;
398 mpls_timer_handle initial_distribution_timer;
399 mpls_timer_handle keepalive_recv_timer;
400 mpls_timer_handle keepalive_send_timer;
401 uint32_t index;
402 ldp_state_enum state;
403 uint32_t oper_up;
404 ldp_notif_status shutdown_notif;
405 mpls_bool shutdown_fatal;
406 mpls_socket_handle socket;
407 mpls_timer_handle backoff_timer;
408 int backoff;
410 /* operational values learned from initialization */
411 int oper_max_pdu;
412 int oper_keepalive;
413 int oper_keepalive_interval;
414 int oper_path_vector_limit;
415 ldp_distribution_mode oper_distribution_mode;
416 ldp_loop_detection_mode oper_loop_detection;
418 /* these values are learned form the remote peer */
419 ldp_distribution_mode remote_distribution_mode;
420 mpls_bool remote_loop_detection;
421 int remote_path_vector_limit;
422 int remote_keepalive;
423 int remote_max_pdu;
424 mpls_dest remote_dest;
425 uint8_t session_name[20]; /* xxx.xxx.xxx.xxx:yyy\0 */
427 mpls_bool no_label_resource_sent;
428 mpls_bool no_label_resource_recv;
429 mpls_bool on_global;
431 /* various message and buffers used for tx and rx */
432 struct ldp_mesg *keepalive;
433 struct ldp_mesg *tx_message;
434 struct ldp_buf *tx_buffer;
436 /* cached from adj's */
437 ldp_role_enum oper_role;
439 /* these are config values come from entity */
440 ldp_loop_detection_mode cfg_loop_detection_mode;
441 ldp_distribution_mode cfg_distribution_mode;
442 mpls_bool cfg_remote_in_ttl_less_domain;
443 int cfg_label_request_count;
444 int cfg_label_request_timer;
445 uint16_t cfg_peer_tcp_port;
446 int cfg_path_vector_limit;
447 int cfg_hop_count_limit;
448 int cfg_label_space;
449 int cfg_keepalive;
450 int cfg_max_pdu;
452 /* mesg counters */
453 uint32_t mesg_tx;
454 uint32_t mesg_rx;
456 /* only used by cfg gets */
457 uint32_t adj_index;
458 } ldp_session;
460 typedef struct ldp_adj {
461 MPLS_REFCNT_FIELD;
462 MPLS_LIST_ELEM(ldp_adj) _global;
463 MPLS_LIST_ELEM(ldp_adj) _session;
464 MPLS_LIST_ELEM(ldp_adj) _entity;
465 struct ldp_session *session;
466 struct ldp_entity *entity;
467 mpls_timer_handle hellotime_recv_timer;
468 mpls_oper_state_enum state;
469 ldp_role_enum role;
470 uint32_t index;
472 /* these values are learned form the remote peer */
473 struct mpls_inet_addr remote_transport_address;
474 struct mpls_inet_addr remote_source_address;
475 struct mpls_inet_addr remote_lsr_address;
476 int remote_label_space;
477 int remote_hellotime;
478 uint32_t remote_csn;
480 /* only used by cfg gets */
481 uint32_t session_index;
482 uint32_t entity_index;
483 } ldp_adj;
485 typedef struct ldp_addr {
486 MPLS_REFCNT_FIELD;
487 MPLS_LIST_ELEM(ldp_addr) _global;
488 MPLS_LIST_ELEM(ldp_addr) _if;
489 struct ldp_session *session;
490 struct ldp_nexthop_list nh_root;
491 struct mpls_inet_addr address;
492 struct ldp_if *iff;
495 * if an address has a if_handle it is locally attached
497 mpls_if_handle if_handle;
498 uint32_t index;
501 * only used durring gets
503 uint32_t session_index;
504 uint32_t nexthop_index;
505 uint32_t if_index;
506 } ldp_addr;
508 struct ldp_outlabel;
510 typedef struct ldp_nexthop {
511 MPLS_REFCNT_FIELD;
512 MPLS_LIST_ELEM(ldp_nexthop) _global;
513 MPLS_LIST_ELEM(ldp_nexthop) _fec;
514 MPLS_LIST_ELEM(ldp_nexthop) _addr;
515 MPLS_LIST_ELEM(ldp_nexthop) _if;
516 MPLS_LIST_ELEM(ldp_nexthop) _outlabel;
517 struct ldp_outlabel_list outlabel_root;
518 struct ldp_fec *fec;
519 struct ldp_addr *addr;
520 struct ldp_if *iff;
521 struct ldp_outlabel *outlabel;
522 struct mpls_nexthop info;
524 uint32_t index;
525 } ldp_nexthop;
527 typedef struct ldp_outlabel {
528 MPLS_REFCNT_FIELD;
529 MPLS_LIST_ELEM(ldp_outlabel) _global;
530 MPLS_LIST_ELEM(ldp_outlabel) _session;
531 MPLS_LIST_ELEM(ldp_outlabel) _nexthop;
532 struct ldp_inlabel_list inlabel_root;
533 struct ldp_tunnel_list tunnel_root;
534 struct ldp_nexthop_list nh_root;
535 uint32_t merge_count;
536 struct ldp_attr *attr;
537 struct ldp_session *session;
538 struct ldp_nexthop *nh;
539 struct mpls_outsegment info;
540 uint32_t index;
541 mpls_bool switching;
543 /* only used by get() */
544 uint32_t session_index;
545 uint32_t nh_index;
546 uint32_t attr_index;
547 } ldp_outlabel;
549 typedef struct ldp_inlabel {
550 MPLS_REFCNT_FIELD;
551 MPLS_LIST_ELEM(ldp_inlabel) _global;
552 MPLS_LIST_ELEM(ldp_inlabel) _outlabel;
553 struct mpls_link_list session_root;
554 struct mpls_link_list attr_root;
555 struct ldp_outlabel *outlabel;
556 uint32_t reuse_count;
557 uint32_t index;
558 struct mpls_insegment info;
560 /* only used by get() */
561 uint32_t outlabel_index;
562 } ldp_inlabel;
564 typedef struct ldp_fec {
565 MPLS_REFCNT_FIELD;
566 MPLS_LIST_ELEM(ldp_fec) _global;
567 MPLS_LIST_ELEM(ldp_fec) _inlabel;
568 MPLS_LIST_ELEM(ldp_fec) _outlabel;
569 MPLS_LIST_ELEM(ldp_fec) _tree;
570 MPLS_LIST_ELEM(ldp_fec) _addr;
571 MPLS_LIST_ELEM(ldp_fec) _fec;
572 MPLS_LIST_ELEM(ldp_fec) _if;
573 struct ldp_fs_list fs_root_us;
574 struct ldp_fs_list fs_root_ds;
575 /* ECMP */
576 struct ldp_nexthop_list nh_root;
577 struct mpls_fec info;
578 uint32_t index;
579 } ldp_fec;
581 typedef struct ldp_fs {
582 struct ldp_attr_list attr_root;
583 MPLS_LIST_ELEM(ldp_fs) _fec;
584 struct ldp_session *session;
585 } ldp_fs;
587 typedef struct ldp_attr {
588 MPLS_REFCNT_FIELD;
589 uint32_t index;
590 uint32_t msg_id;
591 struct ldp_attr_list us_attr_root;
592 struct ldp_attr *ds_attr;
593 ldp_lsp_state state;
594 mpls_bool ingress;
595 mpls_bool filtered;
596 mpls_bool in_tree;
597 struct ldp_session *session;
598 uint32_t attempt_count;
599 mpls_timer_handle action_timer;
600 ldp_lsp_state action;
601 ldp_fec *fec;
603 MPLS_LIST_ELEM(ldp_attr) _session;
604 MPLS_LIST_ELEM(ldp_attr) _global;
605 MPLS_LIST_ELEM(ldp_attr) _ds_attr;
606 MPLS_LIST_ELEM(ldp_attr) _fs;
608 mplsLdpFecTlv_t fecTlv;
609 mplsLdpGenLblTlv_t genLblTlv;
610 mplsLdpAtmLblTlv_t atmLblTlv;
611 mplsLdpFrLblTlv_t frLblTlv;
612 mplsLdpHopTlv_t hopCountTlv;
613 mplsLdpPathTlv_t pathVecTlv;
614 mplsLdpLblMsgIdTlv_t lblMsgIdTlv;
615 mplsLdpLspIdTlv_t lspidTlv;
616 mplsLdpTrafficTlv_t trafficTlv;
617 mplsLdpStatusTlv_t statusTlv;
618 mplsLdpRetMsgTlv_t retMsgTlv;
620 uint8_t fecTlvExists:1;
621 uint8_t genLblTlvExists:1;
622 uint8_t atmLblTlvExists:1;
623 uint8_t frLblTlvExists:1;
624 uint8_t hopCountTlvExists:1;
625 uint8_t pathVecTlvExists:1;
626 uint8_t lblMsgIdTlvExists:1;
627 uint8_t lspidTlvExists:1;
628 uint8_t trafficTlvExists:1;
629 uint8_t statusTlvExists:1;
630 uint8_t retMsgTlvExists:1;
632 struct ldp_outlabel *outlabel;
633 struct ldp_inlabel *inlabel;
635 /* only used for get() */
636 uint32_t inlabel_index;
637 uint32_t outlabel_index;
638 uint32_t session_index;
639 } ldp_attr;
641 typedef struct ldp_resource {
642 MPLS_REFCNT_FIELD;
643 MPLS_LIST_ELEM(ldp_resource) _global;
644 struct ldp_tunnel *tunnel;
645 uint32_t index;
646 uint32_t max_rate;
647 uint32_t mean_rate;
648 uint32_t burst_size;
649 } ldp_resource;
651 typedef struct ldp_hop {
652 MPLS_REFCNT_FIELD;
653 MPLS_LIST_ELEM(ldp_hop) _hop_list;
654 struct ldp_hop_list *hop_list;
655 uint32_t index;
656 uint32_t hop_list_index;
657 uint32_t path_option;
658 mpls_inet_addr addr;
659 uint32_t type;
660 } ldp_hop;
662 typedef struct ldp_hop_list {
663 MPLS_REFCNT_FIELD;
664 MPLS_LIST_ELEM(ldp_hop_list) _global;
665 struct _ldp_hop_list hop;
666 struct ldp_tunnel *tunnel;
667 uint32_t index;
668 } ldp_hop_list;
670 typedef struct ldp_tunnel {
671 MPLS_REFCNT_FIELD;
672 MPLS_LIST_ELEM(ldp_tunnel) _global;
673 MPLS_LIST_ELEM(ldp_tunnel) _outlabel;
674 uint32_t index;
675 mpls_inet_addr ingress_lsrid;
676 ldp_addr egress_lsrid;
677 char name[MPLS_MAX_IF_NAME];
678 mpls_bool is_interface;
679 uint32_t outlabel_index;
680 struct ldp_outlabel *outlabel;
681 uint32_t setup_prio;
682 uint32_t hold_prio;
683 uint32_t instance_prio;
684 uint32_t resource_index;
685 struct ldp_resource *resource;
686 uint32_t hop_list_index;
687 struct ldp_hop_list *hop_list;
688 ldp_fec fec;
689 mpls_admin_state_enum admin_state;
691 uint32_t primary_instance;
692 uint32_t any_affinity;
693 uint32_t all_affinity;
694 uint32_t no_all_affinity;
695 uint32_t path_in_use;
696 uint32_t protocol;
697 mpls_bool local_protect;
698 uint32_t session_attr;
699 uint32_t owner;
700 } ldp_tunnel;
702 typedef void (*ldp_tree_callback) (void *);
704 #endif