First step towards making this work:
[mpls-ldp-portable.git] / ldp / ldp_struct.h
blob34df3bd850d933af59f07c7efe1f5b7bd78d90c4
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_adj_list adj;
230 struct ldp_if_list iff;
231 struct ldp_fec_list fec;
233 mpls_lock_handle global_lock;
234 mpls_instance_handle user_data;
236 mpls_tree_handle addr_tree;
237 mpls_tree_handle fec_tree;
239 mpls_socket_handle hello_socket;
240 mpls_socket_handle listen_socket;
242 mpls_timer_mgr_handle timer_handle;
243 mpls_socket_mgr_handle socket_handle;
244 mpls_fib_handle fib_handle;
245 mpls_ifmgr_handle ifmgr_handle;
247 #if MPLS_USE_LSR
248 mpls_cfg_handle lsr_handle;
249 #else
250 mpls_mpls_handle mpls_handle;
251 #endif
254 * CSN changes with every MIB set, BUT only when a entity goes through
255 * shutdown/startup cycle will it grab the new CSN and use it in hellos
257 uint32_t configuration_sequence_number;
260 * Message ID increaments with EVERY message, this means it will roll over
262 uint32_t message_identifier;
264 struct mpls_inet_addr lsr_identifier;
265 mpls_bool send_address_messages;
266 mpls_bool send_lsrid_mapping;
267 ldp_control_mode lsp_control_mode;
268 ldp_retention_mode label_retention_mode;
269 ldp_repaire_mode lsp_repair_mode;
270 mpls_bool propagate_release;
271 mpls_bool label_merge;
272 ldp_loop_detection_mode loop_detection_mode;
273 mpls_bool ttl_less_domain;
274 uint16_t local_tcp_port;
275 uint16_t local_udp_port;
276 uint16_t backoff_step;
277 int no_route_to_peer_time;
280 * some global defaults, entities will inherit these values unless
281 * instructed otherwise
283 struct mpls_inet_addr transport_address;
284 uint16_t keepalive_timer;
285 uint16_t keepalive_interval;
286 uint16_t hellotime_timer;
287 uint16_t hellotime_interval;
289 mpls_admin_state_enum admin_state;
290 } ldp_global;
292 typedef struct ldp_entity {
293 MPLS_REFCNT_FIELD;
294 MPLS_LIST_ELEM(ldp_entity) _global;
295 struct ldp_adj_list adj_root;
297 ldp_entity_type_enum entity_type;
298 union {
299 struct ldp_peer *peer;
300 struct ldp_if *iff;
301 } p;
303 ldp_state_enum state;
304 uint32_t inherit_flag;
305 uint32_t sub_index;
306 uint32_t index;
307 struct mpls_inet_addr transport_address;
308 uint8_t protocol_version;
309 uint16_t remote_tcp_port;
310 uint16_t remote_udp_port;
311 uint16_t max_pdu;
312 uint16_t keepalive_timer;
313 uint16_t keepalive_interval;
314 uint16_t hellotime_timer;
315 uint16_t hellotime_interval;
316 uint16_t session_setup_count;
317 uint16_t session_backoff_timer;
318 ldp_distribution_mode label_distribution_mode;
319 uint8_t path_vector_limit;
320 uint8_t hop_count_limit;
321 uint8_t label_request_count;
322 uint16_t label_request_timer;
323 ldp_loop_detection_mode loop_detection_mode;
324 mpls_admin_state_enum admin_state;
325 mpls_bool remote_in_ttl_less_domain;
326 mpls_bool request_retry;
328 /* mesg counters */
329 uint32_t mesg_tx;
330 uint32_t mesg_rx;
332 /* only used for cfg gets */
333 int adj_index;
334 int adj_count;
335 } ldp_entity;
337 typedef struct ldp_if {
338 MPLS_REFCNT_FIELD;
339 MPLS_LIST_ELEM(ldp_if) _global;
340 struct mpls_link_list session_root;
341 struct ldp_nexthop_list nh_root;
342 struct ldp_entity *entity;
343 mpls_timer_handle hellotime_send_timer;
344 int hellotime_send_timer_duration;
345 int label_space;
346 uint32_t index;
347 struct mpls_inet_addr local_source_address;
348 mpls_if_handle handle;
350 struct ldp_mesg *tx_message;
351 struct ldp_buf *tx_buffer;
352 struct ldp_mesg *hello;
354 /* YES this is a dest, it is what we use for sendto */
355 struct mpls_dest dest;
357 char name[MPLS_MAX_IF_NAME];
358 mpls_oper_state_enum oper_state;
359 mpls_bool used_by_ldp;
360 mpls_bool used_by_fec;
361 mpls_bool is_p2p;
363 /* only used for cfg gets */
364 uint32_t entity_index;
365 } ldp_if;
367 typedef struct ldp_peer {
368 MPLS_REFCNT_FIELD;
369 MPLS_LIST_ELEM(ldp_peer) _global;
370 struct ldp_entity *entity;
371 mpls_timer_handle no_route_to_peer_timer;
372 mpls_timer_handle hellotime_send_timer;
373 int hellotime_send_timer_duration;
374 int label_space;
375 uint32_t index;
376 struct mpls_inet_addr local_source_address;
378 struct ldp_mesg *tx_message;
379 struct ldp_buf *tx_buffer;
380 struct ldp_mesg *hello;
382 /* YES this is a dest, it is what we use for sendto */
383 struct mpls_dest dest;
384 ldp_role_enum target_role;
386 char peer_name[MPLS_MAX_IF_NAME];
387 mpls_oper_state_enum oper_state;
389 /* only used for cfg gets */
390 uint32_t entity_index;
391 } ldp_peer;
393 typedef struct ldp_session {
394 MPLS_REFCNT_FIELD;
395 MPLS_LIST_ELEM(ldp_session) _global;
396 struct ldp_outlabel_list outlabel_root;
397 struct mpls_link_list inlabel_root;
398 struct mpls_link_list addr_root;
399 struct ldp_attr_list attr_root;
400 struct ldp_adj_list adj_root;
401 mpls_timer_handle initial_distribution_timer;
402 mpls_timer_handle keepalive_recv_timer;
403 mpls_timer_handle keepalive_send_timer;
404 uint32_t index;
405 ldp_state_enum state;
406 uint32_t oper_up;
407 ldp_notif_status shutdown_notif;
408 mpls_bool shutdown_fatal;
409 mpls_socket_handle socket;
410 mpls_timer_handle backoff_timer;
411 int backoff;
413 /* operational values learned from initialization */
414 int oper_max_pdu;
415 int oper_keepalive;
416 int oper_keepalive_interval;
417 int oper_path_vector_limit;
418 ldp_distribution_mode oper_distribution_mode;
419 ldp_loop_detection_mode oper_loop_detection;
421 /* these values are learned form the remote peer */
422 ldp_distribution_mode remote_distribution_mode;
423 mpls_bool remote_loop_detection;
424 int remote_path_vector_limit;
425 int remote_keepalive;
426 int remote_max_pdu;
427 mpls_dest remote_dest;
428 uint8_t session_name[20]; /* xxx.xxx.xxx.xxx:yyy\0 */
430 mpls_bool no_label_resource_sent;
431 mpls_bool no_label_resource_recv;
432 mpls_bool on_global;
434 /* various message and buffers used for tx and rx */
435 struct ldp_mesg *keepalive;
436 struct ldp_mesg *tx_message;
437 struct ldp_buf *tx_buffer;
439 /* cached from adj's */
440 ldp_role_enum oper_role;
442 /* these are config values come from entity */
443 ldp_loop_detection_mode cfg_loop_detection_mode;
444 ldp_distribution_mode cfg_distribution_mode;
445 mpls_bool cfg_remote_in_ttl_less_domain;
446 int cfg_label_request_count;
447 int cfg_label_request_timer;
448 uint16_t cfg_peer_tcp_port;
449 int cfg_path_vector_limit;
450 int cfg_hop_count_limit;
451 int cfg_label_space;
452 int cfg_keepalive;
453 int cfg_max_pdu;
455 /* mesg counters */
456 uint32_t mesg_tx;
457 uint32_t mesg_rx;
459 /* only used by cfg gets */
460 uint32_t adj_index;
461 } ldp_session;
463 typedef struct ldp_adj {
464 MPLS_REFCNT_FIELD;
465 MPLS_LIST_ELEM(ldp_adj) _global;
466 MPLS_LIST_ELEM(ldp_adj) _session;
467 MPLS_LIST_ELEM(ldp_adj) _entity;
468 struct ldp_session *session;
469 struct ldp_entity *entity;
470 mpls_timer_handle hellotime_recv_timer;
471 mpls_oper_state_enum state;
472 ldp_role_enum role;
473 uint32_t index;
475 /* these values are learned form the remote peer */
476 struct mpls_inet_addr remote_transport_address;
477 struct mpls_inet_addr remote_source_address;
478 struct mpls_inet_addr remote_lsr_address;
479 int remote_label_space;
480 int remote_hellotime;
481 uint32_t remote_csn;
483 /* only used by cfg gets */
484 uint32_t session_index;
485 uint32_t entity_index;
486 } ldp_adj;
488 typedef struct ldp_addr {
489 MPLS_REFCNT_FIELD;
490 MPLS_LIST_ELEM(ldp_addr) _addr;
491 struct mpls_link_list session_root;
492 struct ldp_nexthop_list nh_root;
493 struct mpls_inet_addr address;
494 uint32_t index;
495 } ldp_addr;
497 struct ldp_outlabel;
499 typedef struct ldp_nexthop {
500 MPLS_REFCNT_FIELD;
501 MPLS_LIST_ELEM(ldp_nexthop) _global;
502 MPLS_LIST_ELEM(ldp_nexthop) _fec;
503 MPLS_LIST_ELEM(ldp_nexthop) _addr;
504 MPLS_LIST_ELEM(ldp_nexthop) _if;
505 MPLS_LIST_ELEM(ldp_nexthop) _outlabel;
506 enum mpls_nexthop_enum type;
507 struct ldp_fec *fec;
508 struct ldp_addr *addr;
509 struct ldp_if *iff;
510 struct ldp_outlabel *outlabel;
511 struct mpls_nexthop info;
512 uint32_t index;
513 } ldp_nexthop;
515 typedef struct ldp_outlabel {
516 MPLS_REFCNT_FIELD;
517 struct ldp_inlabel_list inlabel_root;
518 struct ldp_tunnel_list tunnel_root;
519 struct ldp_nexthop_list nh_root;
520 MPLS_LIST_ELEM(ldp_outlabel) _global;
521 MPLS_LIST_ELEM(ldp_outlabel) _session;
522 struct ldp_attr *attr;
523 uint32_t merge_count;
524 uint32_t index;
525 struct ldp_session *session;
526 struct mpls_outsegment info;
527 struct ldp_nexthop nh;
528 mpls_bool switching;
530 /* only used by get() */
531 uint32_t session_index;
532 enum mpls_nexthop_enum nh_type;
533 uint32_t if_index;
534 uint32_t addr_index;
535 uint32_t outlabel_index;
536 } ldp_outlabel;
538 typedef struct ldp_inlabel {
539 MPLS_REFCNT_FIELD;
540 MPLS_LIST_ELEM(ldp_inlabel) _global;
541 MPLS_LIST_ELEM(ldp_inlabel) _outlabel;
542 struct mpls_link_list session_root;
543 struct mpls_link_list attr_root;
544 struct ldp_outlabel *outlabel;
545 uint32_t reuse_count;
546 uint32_t index;
547 struct mpls_insegment info;
549 /* only used by get() */
550 uint32_t outlabel_index;
551 } ldp_inlabel;
553 typedef struct ldp_fec {
554 MPLS_REFCNT_FIELD;
555 MPLS_LIST_ELEM(ldp_fec) _global;
556 MPLS_LIST_ELEM(ldp_fec) _inlabel;
557 MPLS_LIST_ELEM(ldp_fec) _outlabel;
558 MPLS_LIST_ELEM(ldp_fec) _tree;
559 MPLS_LIST_ELEM(ldp_fec) _addr;
560 MPLS_LIST_ELEM(ldp_fec) _fec;
561 MPLS_LIST_ELEM(ldp_fec) _if;
562 struct ldp_fs_list fs_root_us;
563 struct ldp_fs_list fs_root_ds;
564 /* ECMP */
565 struct ldp_nexthop_list nh_root;
566 struct mpls_fec info;
567 uint32_t index;
568 } ldp_fec;
570 typedef struct ldp_fs {
571 struct ldp_attr_list attr_root;
572 MPLS_LIST_ELEM(ldp_fs) _fec;
573 struct ldp_session *session;
574 } ldp_fs;
576 typedef struct ldp_attr {
577 MPLS_REFCNT_FIELD;
578 uint32_t index;
579 uint32_t msg_id;
580 struct ldp_attr_list us_attr_root;
581 struct ldp_attr *ds_attr;
582 ldp_lsp_state state;
583 mpls_bool ingress;
584 mpls_bool filtered;
585 mpls_bool in_tree;
586 struct ldp_session *session;
587 uint32_t attempt_count;
588 mpls_timer_handle action_timer;
589 ldp_lsp_state action;
590 ldp_fec *fec;
592 MPLS_LIST_ELEM(ldp_attr) _session;
593 MPLS_LIST_ELEM(ldp_attr) _global;
594 MPLS_LIST_ELEM(ldp_attr) _ds_attr;
595 MPLS_LIST_ELEM(ldp_attr) _fs;
597 mplsLdpFecTlv_t fecTlv;
598 mplsLdpGenLblTlv_t genLblTlv;
599 mplsLdpAtmLblTlv_t atmLblTlv;
600 mplsLdpFrLblTlv_t frLblTlv;
601 mplsLdpHopTlv_t hopCountTlv;
602 mplsLdpPathTlv_t pathVecTlv;
603 mplsLdpLblMsgIdTlv_t lblMsgIdTlv;
604 mplsLdpLspIdTlv_t lspidTlv;
605 mplsLdpTrafficTlv_t trafficTlv;
606 mplsLdpStatusTlv_t statusTlv;
607 mplsLdpRetMsgTlv_t retMsgTlv;
609 uint8_t fecTlvExists:1;
610 uint8_t genLblTlvExists:1;
611 uint8_t atmLblTlvExists:1;
612 uint8_t frLblTlvExists:1;
613 uint8_t hopCountTlvExists:1;
614 uint8_t pathVecTlvExists:1;
615 uint8_t lblMsgIdTlvExists:1;
616 uint8_t lspidTlvExists:1;
617 uint8_t trafficTlvExists:1;
618 uint8_t statusTlvExists:1;
619 uint8_t retMsgTlvExists:1;
621 struct ldp_outlabel *outlabel;
622 struct ldp_inlabel *inlabel;
624 /* only used for get() */
625 uint32_t inlabel_index;
626 uint32_t outlabel_index;
627 uint32_t session_index;
628 } ldp_attr;
630 typedef struct ldp_resource {
631 MPLS_REFCNT_FIELD;
632 MPLS_LIST_ELEM(ldp_resource) _global;
633 struct ldp_tunnel *tunnel;
634 uint32_t index;
635 uint32_t max_rate;
636 uint32_t mean_rate;
637 uint32_t burst_size;
638 } ldp_resource;
640 typedef struct ldp_hop {
641 MPLS_REFCNT_FIELD;
642 MPLS_LIST_ELEM(ldp_hop) _hop_list;
643 struct ldp_hop_list *hop_list;
644 uint32_t index;
645 uint32_t hop_list_index;
646 uint32_t path_option;
647 mpls_inet_addr addr;
648 uint32_t type;
649 } ldp_hop;
651 typedef struct ldp_hop_list {
652 MPLS_REFCNT_FIELD;
653 MPLS_LIST_ELEM(ldp_hop_list) _global;
654 struct _ldp_hop_list hop;
655 struct ldp_tunnel *tunnel;
656 uint32_t index;
657 } ldp_hop_list;
659 typedef struct ldp_tunnel {
660 MPLS_REFCNT_FIELD;
661 MPLS_LIST_ELEM(ldp_tunnel) _global;
662 MPLS_LIST_ELEM(ldp_tunnel) _outlabel;
663 uint32_t index;
664 mpls_inet_addr ingress_lsrid;
665 ldp_addr egress_lsrid;
666 char name[MPLS_MAX_IF_NAME];
667 mpls_bool is_interface;
668 uint32_t outlabel_index;
669 struct ldp_outlabel *outlabel;
670 uint32_t setup_prio;
671 uint32_t hold_prio;
672 uint32_t instance_prio;
673 uint32_t resource_index;
674 struct ldp_resource *resource;
675 uint32_t hop_list_index;
676 struct ldp_hop_list *hop_list;
677 ldp_fec fec;
678 mpls_admin_state_enum admin_state;
680 uint32_t primary_instance;
681 uint32_t any_affinity;
682 uint32_t all_affinity;
683 uint32_t no_all_affinity;
684 uint32_t path_in_use;
685 uint32_t protocol;
686 mpls_bool local_protect;
687 uint32_t session_attr;
688 uint32_t owner;
689 } ldp_tunnel;
691 typedef void (*ldp_fib_callback) (mpls_cfg_handle cfg, mpls_update_enum type,
692 mpls_fec * dest);
693 typedef void (*ldp_ifmgr_callback) (mpls_cfg_handle cfg, mpls_update_enum type,
694 mpls_inet_addr *addr);
695 typedef void (*ldp_tree_callback) (void *);
697 #endif