3 * Copyright (C) James R. Leu 2002
6 * This software is covered under the LGPL, for more
7 * info check out http://www.gnu.org/copyleft/lgpl.html
10 #ifndef _MPLS_TREE_IMPL_H_
11 #define _MPLS_TREE_IMPL_H_
13 #include "mpls_struct.h"
16 * in: mpls_tree_handle
19 extern mpls_bool
mpls_tree_handle_verify(mpls_tree_handle handle
);
23 * return: mpls_tree_handle
25 extern mpls_tree_handle
mpls_tree_create(const int depth
);
30 extern void mpls_tree_delete(const mpls_tree_handle tree
);
33 * in: tree,key, length, node
34 * return: mpls_return_enum
36 extern mpls_return_enum
mpls_tree_insert(const mpls_tree_handle tree
,
37 const uint32_t key
, const int length
, void *node
);
40 * in: tree, key, length, node
41 * return: mpls_return_enum
43 extern mpls_return_enum
mpls_tree_remove(const mpls_tree_handle tree
,
44 const uint32_t key
, const int length
, void **node
);
47 * in: tree, key, length, nnode, onode
48 * return: mpls_return_enum, onode
50 extern mpls_return_enum
mpls_tree_replace(const mpls_tree_handle tree
,
51 const uint32_t key
, const int length
, void *nnode
, void **onode
);
54 * in: tree, key, length, node
55 * return: mpls_return_enum
57 extern mpls_return_enum
mpls_tree_get(const mpls_tree_handle tree
,
58 const uint32_t key
, const int length
, void **node
);
61 * in: tree, key, length, node
62 * return: mpls_return_enum
64 extern mpls_return_enum
mpls_tree_get_longest(const mpls_tree_handle tree
,
65 const uint32_t key
, void **node
);
67 extern void mpls_tree_dump(const mpls_tree_handle tree
,
68 ldp_tree_callback callback
);