From: Vasu Dasari <vdasari@gmail.com>
[mpls-ldp-portable.git] / common / mpls_tree_impl.h
blob5d89c63ece9ba7a5605b966caff7883c1334def0
2 /*
3 * Copyright (C) James R. Leu 2002
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 _MPLS_TREE_IMPL_H_
11 #define _MPLS_TREE_IMPL_H_
13 #include "mpls_struct.h"
16 * in: depth
17 * return: mpls_tree_handle
19 extern mpls_tree_handle mpls_tree_create(const int depth);
22 * in: tree
24 extern void mpls_tree_delete(const mpls_tree_handle tree);
27 * in: tree,key, length, node
28 * return: mpls_return_enum
30 extern mpls_return_enum mpls_tree_insert(const mpls_tree_handle tree,
31 const uint32_t key, const int length, void *node);
34 * in: tree, key, length, node
35 * return: mpls_return_enum
37 extern mpls_return_enum mpls_tree_remove(const mpls_tree_handle tree,
38 const uint32_t key, const int length, void **node);
41 * in: tree, key, length, nnode, onode
42 * return: mpls_return_enum, onode
44 extern mpls_return_enum mpls_tree_replace(const mpls_tree_handle tree,
45 const uint32_t key, const int length, void *nnode, void **onode);
48 * in: tree, key, length, node
49 * return: mpls_return_enum
51 extern mpls_return_enum mpls_tree_get(const mpls_tree_handle tree,
52 const uint32_t key, const int length, void **node);
55 * in: tree, key, length, node
56 * return: mpls_return_enum
58 extern mpls_return_enum mpls_tree_get_longest(const mpls_tree_handle tree,
59 const uint32_t key, void **node);
61 extern void mpls_tree_dump(const mpls_tree_handle tree,
62 ldp_tree_callback callback);
64 #endif