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