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