You cannot possible compile the LSR (or the LDP) lib without a porting
[mpls-ldp-portable.git] / ldp / ldp_attr.h
blob500570ede7a4ed1c84c32d636355935bc5422bd6
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_us2ds(ldp_attr * us, ldp_attr * ds);
28 extern void ldp_attr_del_us2ds(ldp_attr * us, ldp_attr * ds);
29 extern mpls_bool ldp_attr_us_partof_ds(ldp_attr * us, ldp_attr * ds);
30 extern int ldp_attr_num_us2ds(ldp_attr * ds);
32 extern ldp_attr *ldp_attr_create(mpls_fec * fec);
33 extern void ldp_attr_delete(ldp_attr * a);
34 extern void ldp_attr2ldp_attr(ldp_attr * a, ldp_attr * b, uint32_t flag);
35 extern void ldp_attr_remove_complete(ldp_global * g, ldp_attr * attr, mpls_bool);
37 extern ldp_attr *ldp_attr_find_downstream_state(ldp_global * g, ldp_session * s,
38 mpls_fec * f, ldp_lsp_state state);
39 extern ldp_attr *ldp_attr_find_upstream_state(ldp_global * g, ldp_session * s,
40 mpls_fec * f, ldp_lsp_state state);
42 extern ldp_attr *ldp_attr_find_downstream_state_any(ldp_global * g, mpls_fec * f,
43 ldp_lsp_state state);
44 extern ldp_attr *ldp_attr_find_upstream_state_any(ldp_global * g, mpls_fec * f,
45 ldp_lsp_state state);
47 extern mpls_return_enum ldp_attr_del_outlabel(ldp_attr * a);
48 extern mpls_return_enum ldp_attr_add_outlabel(ldp_attr * a, ldp_outlabel * o);
49 extern mpls_return_enum ldp_attr_add_inlabel(ldp_attr * a, ldp_inlabel * i);
50 extern mpls_return_enum ldp_attr_del_inlabel(ldp_attr * a);
51 extern mpls_return_enum ldp_attr_add_session(ldp_attr * a, ldp_session * s);
52 extern mpls_return_enum ldp_attr_del_session(ldp_attr * a);
54 extern mpls_bool ldp_attr_is_equal(ldp_attr * a, ldp_attr * b, uint32_t flag);
55 extern ldp_attr_list *ldp_attr_find_upstream_all(ldp_global * g,
56 ldp_session * s, mpls_fec * f);
57 extern ldp_attr_list *ldp_attr_find_downstream_all(ldp_global * g,
58 ldp_session * s, mpls_fec * f);
59 extern void ldp_attr_delete_upstream(ldp_global *, ldp_session *, ldp_attr *);
60 extern void ldp_attr_delete_downstream(ldp_global *, ldp_session *, ldp_attr *);
61 extern mpls_return_enum ldp_attr_insert_upstream(ldp_global * g, ldp_session * s,
62 ldp_attr * a);
63 extern mpls_return_enum ldp_attr_insert_downstream(ldp_global * g,
64 ldp_session * s, ldp_attr * a);
66 extern void mpls_label_struct2ldp_attr(mpls_label_struct * l, ldp_attr * a);
67 extern void ldp_attr2mpls_label_struct(ldp_attr * a, mpls_label_struct * l);
69 #endif