Mirror the interface changes from ldp to lsr:
[mpls-ldp-portable.git] / lsr / lsr_struct.h
blobde14a5bcc8e97f5f3215223df5aec2b3f6cdf7f0
1 /*
2 * Copyright (C) James R. Leu 2002
3 * jleu@mindspring.com
5 * This software is covered under the LGPL, for more
6 * info check out http://www.gnu.org/copyleft/lgpl.html
7 */
9 #ifndef _LSR_STRUCT_H_
10 #define _LSR_STRUCT_H_
12 #include "mpls_list.h"
13 #include "mpls_refcnt.h"
14 #include "mpls_struct.h"
16 MPLS_LIST_ROOT(lsr_outsegment_list, lsr_outsegment);
17 MPLS_LIST_ROOT(lsr_insegment_list, lsr_insegment);
18 MPLS_LIST_ROOT(lsr_xconnect_list, lsr_xconnect);
19 MPLS_LIST_ROOT(lsr_ftn_list, lsr_ftn);
20 MPLS_LIST_ROOT(lsr_if_list, lsr_if);
22 typedef enum {
23 LSR_TRACE_FLAG_INSEGMENT = 0x00000001,
24 LSR_TRACE_FLAG_OUTSEGMENT = 0x00000002,
25 LSR_TRACE_FLAG_XCONNECT = 0x00000003
26 } lsr_trace_flags;
28 #include "lsr_defaults.h"
29 #include "mpls_handle_type.h"
31 typedef struct lsr_insegment {
32 MPLS_REFCNT_FIELD;
33 MPLS_LIST_ELEM(lsr_outsegment) _outsegment;
34 MPLS_LIST_ELEM(lsr_insegment) _global;
35 struct lsr_xconnect_list xconnect_root;
37 uint32_t index;
38 struct mpls_insegment info;
40 } lsr_insegment;
42 typedef struct lsr_outsegment {
43 MPLS_REFCNT_FIELD;
44 MPLS_LIST_ELEM(lsr_outsegment) _global;
45 MPLS_LIST_ELEM(lsr_outsegment) _if;
46 struct lsr_xconnect_list xconnect_root;
47 struct lsr_ftn_list ftn_root;
49 uint32_t index;
50 struct mpls_outsegment info;
51 struct lsr_if *iff;
53 /* only valid in sets and gets */
54 uint32_t if_index;
55 } lsr_outsegment;
57 typedef struct lsr_xconnect {
58 MPLS_REFCNT_FIELD;
59 MPLS_LIST_ELEM(lsr_xconnect) _outsegment;
60 MPLS_LIST_ELEM(lsr_xconnect) _insegment;
61 MPLS_LIST_ELEM(lsr_xconnect) _global;
63 uint32_t index;
64 struct mpls_xconnect info;
65 struct lsr_outsegment *outsegment;
66 struct lsr_insegment *insegment;
68 /* only valid in sets and gets */
69 uint32_t outsegment_index;
70 uint32_t insegment_index;
71 } lsr_xconnect;
73 typedef struct lsr_ftn {
74 MPLS_REFCNT_FIELD;
75 MPLS_LIST_ELEM(lsr_ftn) _outsegment;
76 MPLS_LIST_ELEM(lsr_ftn) _global;
78 uint32_t index;
79 mpls_fec fec;
80 struct lsr_outsegment *outsegment;
82 /* only valid in sets and gets */
83 uint32_t outsegment_index;
84 } lsr_ftn;
86 typedef struct lsr_if {
87 MPLS_REFCNT_FIELD;
88 MPLS_LIST_ELEM(lsr_if) _global;
89 struct lsr_outsegment_list outsegment_root;
91 uint32_t index;
92 mpls_oper_state_enum oper_state;
93 mpls_if_handle handle;
95 } lsr_if;
97 typedef struct lsr_global {
98 struct lsr_outsegment_list outsegment;
99 struct lsr_insegment_list insegment;
100 struct lsr_xconnect_list xconnect;
101 struct lsr_ftn_list ftn;
102 struct lsr_if_list iff;
104 mpls_lock_handle global_lock;
105 mpls_instance_handle user_data;
107 mpls_ifmgr_handle ifmgr_handle;
108 mpls_mpls_handle mpls_handle;
110 mpls_admin_state_enum admin_state;
111 } lsr_global;
113 #endif