Add mpls_socket_get_local_name and mpls_socket_get_remote_name
[mpls-ldp-portable.git] / ldp / ldp_struct.h
blob7a727697c1a1032d0a6bd01558d086532a6befd2
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;
453 mpls_dest local_name;
454 mpls_dest remote_name;
455 } ldp_session;
457 typedef struct ldp_adj {
458 MPLS_REFCNT_FIELD;
459 MPLS_LIST_ELEM(ldp_adj) _global;
460 MPLS_LIST_ELEM(ldp_adj) _session;
461 MPLS_LIST_ELEM(ldp_adj) _entity;
462 struct ldp_session *session;
463 struct ldp_entity *entity;
464 mpls_timer_handle hellotime_recv_timer;
465 mpls_oper_state_enum state;
466 ldp_role_enum role;
467 uint32_t index;
469 /* these values are learned form the remote peer */
470 struct mpls_inet_addr remote_transport_address;
471 struct mpls_inet_addr remote_source_address;
472 struct mpls_inet_addr remote_lsr_address;
473 int remote_label_space;
474 int remote_hellotime;
475 uint32_t remote_csn;
477 /* only used by cfg gets */
478 uint32_t session_index;
479 uint32_t entity_index;
480 } ldp_adj;
482 typedef struct ldp_addr {
483 MPLS_REFCNT_FIELD;
484 MPLS_LIST_ELEM(ldp_addr) _global;
485 MPLS_LIST_ELEM(ldp_addr) _if;
486 struct ldp_session *session;
487 struct ldp_nexthop_list nh_root;
488 struct mpls_inet_addr address;
489 struct ldp_if *iff;
492 * if an address has a if_handle it is locally attached
494 mpls_if_handle if_handle;
495 uint32_t index;
498 * only used durring gets
500 uint32_t session_index;
501 uint32_t nexthop_index;
502 uint32_t if_index;
503 } ldp_addr;
505 struct ldp_outlabel;
507 typedef struct ldp_nexthop {
508 MPLS_REFCNT_FIELD;
509 MPLS_LIST_ELEM(ldp_nexthop) _global;
510 MPLS_LIST_ELEM(ldp_nexthop) _fec;
511 MPLS_LIST_ELEM(ldp_nexthop) _addr;
512 MPLS_LIST_ELEM(ldp_nexthop) _if;
513 MPLS_LIST_ELEM(ldp_nexthop) _outlabel;
514 struct ldp_outlabel_list outlabel_root;
515 struct ldp_fec *fec;
516 struct ldp_addr *addr;
517 struct ldp_if *iff;
518 struct ldp_outlabel *outlabel;
519 struct mpls_nexthop info;
521 uint32_t index;
522 } ldp_nexthop;
524 typedef struct ldp_outlabel {
525 MPLS_REFCNT_FIELD;
526 MPLS_LIST_ELEM(ldp_outlabel) _global;
527 MPLS_LIST_ELEM(ldp_outlabel) _session;
528 MPLS_LIST_ELEM(ldp_outlabel) _nexthop;
529 struct ldp_inlabel_list inlabel_root;
530 struct ldp_tunnel_list tunnel_root;
531 struct ldp_nexthop_list nh_root;
532 uint32_t merge_count;
533 struct ldp_attr *attr;
534 struct ldp_session *session;
535 struct ldp_nexthop *nh;
536 struct mpls_outsegment info;
537 uint32_t index;
538 mpls_bool switching;
540 /* only used by get() */
541 uint32_t session_index;
542 uint32_t nh_index;
543 uint32_t attr_index;
544 } ldp_outlabel;
546 typedef struct ldp_inlabel {
547 MPLS_REFCNT_FIELD;
548 MPLS_LIST_ELEM(ldp_inlabel) _global;
549 MPLS_LIST_ELEM(ldp_inlabel) _outlabel;
550 struct mpls_link_list session_root;
551 struct mpls_link_list attr_root;
552 struct ldp_outlabel *outlabel;
553 uint32_t reuse_count;
554 uint32_t index;
555 struct mpls_insegment info;
557 /* only used by get() */
558 uint32_t outlabel_index;
559 } ldp_inlabel;
561 typedef struct ldp_fec {
562 MPLS_REFCNT_FIELD;
563 MPLS_LIST_ELEM(ldp_fec) _global;
564 MPLS_LIST_ELEM(ldp_fec) _inlabel;
565 MPLS_LIST_ELEM(ldp_fec) _outlabel;
566 MPLS_LIST_ELEM(ldp_fec) _tree;
567 MPLS_LIST_ELEM(ldp_fec) _addr;
568 MPLS_LIST_ELEM(ldp_fec) _fec;
569 MPLS_LIST_ELEM(ldp_fec) _if;
570 struct ldp_fs_list fs_root_us;
571 struct ldp_fs_list fs_root_ds;
572 /* ECMP */
573 struct ldp_nexthop_list nh_root;
574 struct mpls_fec info;
575 mpls_bool is_route;
576 uint32_t index;
577 } ldp_fec;
579 typedef struct ldp_fs {
580 struct ldp_attr_list attr_root;
581 MPLS_LIST_ELEM(ldp_fs) _fec;
582 struct ldp_session *session;
583 } ldp_fs;
585 typedef struct ldp_attr {
586 MPLS_REFCNT_FIELD;
587 uint32_t index;
588 uint32_t msg_id;
589 struct ldp_attr_list us_attr_root;
590 struct ldp_attr *ds_attr;
591 ldp_lsp_state state;
592 mpls_bool ingress;
593 mpls_bool filtered;
594 mpls_bool in_tree;
595 struct ldp_session *session;
596 uint32_t attempt_count;
597 mpls_timer_handle action_timer;
598 ldp_lsp_state action;
599 ldp_fec *fec;
601 MPLS_LIST_ELEM(ldp_attr) _session;
602 MPLS_LIST_ELEM(ldp_attr) _global;
603 MPLS_LIST_ELEM(ldp_attr) _ds_attr;
604 MPLS_LIST_ELEM(ldp_attr) _fs;
606 mplsLdpFecTlv_t fecTlv;
607 mplsLdpGenLblTlv_t genLblTlv;
608 mplsLdpAtmLblTlv_t atmLblTlv;
609 mplsLdpFrLblTlv_t frLblTlv;
610 mplsLdpHopTlv_t hopCountTlv;
611 mplsLdpPathTlv_t pathVecTlv;
612 mplsLdpLblMsgIdTlv_t lblMsgIdTlv;
613 mplsLdpLspIdTlv_t lspidTlv;
614 mplsLdpTrafficTlv_t trafficTlv;
615 mplsLdpStatusTlv_t statusTlv;
616 mplsLdpRetMsgTlv_t retMsgTlv;
618 uint8_t fecTlvExists:1;
619 uint8_t genLblTlvExists:1;
620 uint8_t atmLblTlvExists:1;
621 uint8_t frLblTlvExists:1;
622 uint8_t hopCountTlvExists:1;
623 uint8_t pathVecTlvExists:1;
624 uint8_t lblMsgIdTlvExists:1;
625 uint8_t lspidTlvExists:1;
626 uint8_t trafficTlvExists:1;
627 uint8_t statusTlvExists:1;
628 uint8_t retMsgTlvExists:1;
630 struct ldp_outlabel *outlabel;
631 struct ldp_inlabel *inlabel;
633 /* only used for get() */
634 uint32_t inlabel_index;
635 uint32_t outlabel_index;
636 uint32_t session_index;
637 } ldp_attr;
639 typedef struct ldp_resource {
640 MPLS_REFCNT_FIELD;
641 MPLS_LIST_ELEM(ldp_resource) _global;
642 struct ldp_tunnel *tunnel;
643 uint32_t index;
644 uint32_t max_rate;
645 uint32_t mean_rate;
646 uint32_t burst_size;
647 } ldp_resource;
649 typedef struct ldp_hop {
650 MPLS_REFCNT_FIELD;
651 MPLS_LIST_ELEM(ldp_hop) _hop_list;
652 struct ldp_hop_list *hop_list;
653 uint32_t index;
654 uint32_t hop_list_index;
655 uint32_t path_option;
656 mpls_inet_addr addr;
657 uint32_t type;
658 } ldp_hop;
660 typedef struct ldp_hop_list {
661 MPLS_REFCNT_FIELD;
662 MPLS_LIST_ELEM(ldp_hop_list) _global;
663 struct _ldp_hop_list hop;
664 struct ldp_tunnel *tunnel;
665 uint32_t index;
666 } ldp_hop_list;
668 typedef struct ldp_tunnel {
669 MPLS_REFCNT_FIELD;
670 MPLS_LIST_ELEM(ldp_tunnel) _global;
671 MPLS_LIST_ELEM(ldp_tunnel) _outlabel;
672 uint32_t index;
673 mpls_inet_addr ingress_lsrid;
674 ldp_addr egress_lsrid;
675 char name[MPLS_MAX_IF_NAME];
676 mpls_bool is_interface;
677 uint32_t outlabel_index;
678 struct ldp_outlabel *outlabel;
679 uint32_t setup_prio;
680 uint32_t hold_prio;
681 uint32_t instance_prio;
682 uint32_t resource_index;
683 struct ldp_resource *resource;
684 uint32_t hop_list_index;
685 struct ldp_hop_list *hop_list;
686 ldp_fec fec;
687 mpls_admin_state_enum admin_state;
689 uint32_t primary_instance;
690 uint32_t any_affinity;
691 uint32_t all_affinity;
692 uint32_t no_all_affinity;
693 uint32_t path_in_use;
694 uint32_t protocol;
695 mpls_bool local_protect;
696 uint32_t session_attr;
697 uint32_t owner;
698 } ldp_tunnel;
700 typedef void (*ldp_tree_callback) (void *);
702 #endif