White space cleanup and logic clearification, no functional
[mpls-ldp-portable.git] / ldp / ldp_attr.h
blob23f06cac2c2c19c0abd82ee50b80336f3934bfce
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_ATTR_H_
11 #define _LDP_ATTR_H_
12 #include "ldp_struct.h"
14 #define LDP_ATTR_LABEL 0x01
15 #define LDP_ATTR_HOPCOUNT 0x02
16 #define LDP_ATTR_PATH 0x04
17 #define LDP_ATTR_FEC 0x08
18 #define LDP_ATTR_MSGID 0x10
19 #define LDP_ATTR_LSPID 0x20
20 #define LDP_ATTR_TRAFFIC 0x40
21 #define LDP_ATTR_STATUS 0x80
22 #define LDP_ATTR_ALL 0xFF
24 extern void ldp_attr_action_callback(mpls_timer_handle timer, void *extra,
25 mpls_cfg_handle g);
27 extern void ldp_attr_add_fec(ldp_attr *a, ldp_fec *fec);
28 extern void ldp_attr_del_fec(ldp_global *g, ldp_attr *a);
30 extern void ldp_attr_add_us2ds(ldp_attr * us, ldp_attr * ds);
31 extern void ldp_attr_del_us2ds(ldp_attr * us, ldp_attr * ds);
32 extern mpls_bool ldp_attr_us_partof_ds(ldp_attr * us, ldp_attr * ds);
33 extern int ldp_attr_num_us2ds(ldp_attr * ds);
35 extern ldp_attr *ldp_attr_create(mpls_fec * fec);
36 extern void ldp_attr_delete(ldp_attr * a);
37 extern void ldp_attr2ldp_attr(ldp_attr * a, ldp_attr * b, uint32_t flag);
38 extern void ldp_attr_remove_complete(ldp_global * g, ldp_attr * attr, mpls_bool);
40 extern ldp_attr *ldp_attr_find_downstream_state2(ldp_global * g,ldp_session * s,
41 ldp_fec * f, ldp_lsp_state state);
42 extern ldp_attr *ldp_attr_find_downstream_state(ldp_global * g, ldp_session * s,
43 mpls_fec * f, ldp_lsp_state state);
44 extern ldp_attr *ldp_attr_find_upstream_state2(ldp_global * g, ldp_session * s,
45 ldp_fec * f, ldp_lsp_state state);
46 extern ldp_attr *ldp_attr_find_upstream_state(ldp_global * g, ldp_session * s,
47 mpls_fec * f, ldp_lsp_state state);
49 extern ldp_attr *ldp_attr_find_downstream_state_any2(ldp_global *g, ldp_fec *f,
50 ldp_lsp_state state);
51 extern ldp_attr *ldp_attr_find_downstream_state_any(ldp_global *g, mpls_fec *f,
52 ldp_lsp_state state);
53 extern ldp_attr *ldp_attr_find_upstream_state_any2(ldp_global * g, ldp_fec * f,
54 ldp_lsp_state state);
55 extern ldp_attr *ldp_attr_find_upstream_state_any(ldp_global * g, mpls_fec * f,
56 ldp_lsp_state state);
57 extern ldp_attr *ldp_attr_find_upstream_map_in_labelspace(ldp_fec *f,
58 int labelspace);
61 extern mpls_return_enum ldp_attr_del_outlabel(ldp_attr * a);
62 extern mpls_return_enum ldp_attr_add_outlabel(ldp_attr * a, ldp_outlabel * o);
63 extern mpls_return_enum ldp_attr_add_inlabel(ldp_attr * a, ldp_inlabel * i);
64 extern mpls_return_enum ldp_attr_del_inlabel(ldp_attr * a);
65 extern mpls_return_enum ldp_attr_add_session(ldp_attr * a, ldp_session * s);
66 extern mpls_return_enum ldp_attr_del_session(ldp_attr * a);
68 extern mpls_bool ldp_attr_is_equal(ldp_attr * a, ldp_attr * b, uint32_t flag);
69 extern ldp_attr_list *ldp_attr_find_upstream_all2(ldp_global * g,
70 ldp_session * s, ldp_fec * f);
71 extern ldp_attr_list *ldp_attr_find_upstream_all(ldp_global * g,
72 ldp_session * s, mpls_fec * f);
73 extern ldp_attr_list *ldp_attr_find_downstream_all2(ldp_global * g,
74 ldp_session * s, ldp_fec * f);
75 extern ldp_attr_list *ldp_attr_find_downstream_all(ldp_global * g,
76 ldp_session * s, mpls_fec * f);
77 extern void ldp_attr_delete_upstream(ldp_global *, ldp_session *, ldp_attr *);
78 extern void ldp_attr_delete_downstream(ldp_global *, ldp_session *, ldp_attr *);
79 extern mpls_return_enum ldp_attr_insert_upstream2(ldp_global *g,ldp_session *s,
80 ldp_attr * a, ldp_fec *f);
81 extern mpls_return_enum ldp_attr_insert_upstream(ldp_global *g, ldp_session *s,
82 ldp_attr * a);
83 extern mpls_return_enum ldp_attr_insert_downstream2(ldp_global * g,
84 ldp_session * s, ldp_attr * a, ldp_fec *f);
85 extern mpls_return_enum ldp_attr_insert_downstream(ldp_global * g,
86 ldp_session * s, ldp_attr * a);
88 extern void mpls_label_struct2ldp_attr(mpls_label_struct * l, ldp_attr * a);
89 extern void ldp_attr2mpls_label_struct(ldp_attr * a, mpls_label_struct * l);
91 #endif