#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include "../../dprint.h"#include "../../mem/shm_mem.h"#include "../../ut.h"#include "pdtree.h"

Go to the source code of this file.
Functions | |
| int | add_to_tree (pdt_tree_t *pt, str *sp, str *sd) |
| str * | get_domain (pdt_tree_t *pt, str *sp, int *plen) |
| int | pdt_add_to_tree (pdt_tree_t **dpt, str *sdomain, str *code, str *domain) |
| int | pdt_check_pd (pdt_tree_t *pt, str *sdomain, str *sp, str *sd) |
| int | pdt_check_pd_node (pdt_node_t *pn, str *sp, str *sd, char *code, int len) |
| void | pdt_free_node (pdt_node_t *pn) |
| void | pdt_free_tree (pdt_tree_t *pt) |
| str * | pdt_get_domain (pdt_tree_t *pl, str *sdomain, str *code, int *plen) |
| pdt_tree_t * | pdt_get_tree (pdt_tree_t *pl, str *sdomain) |
| pdt_tree_t * | pdt_init_tree (str *sdomain) |
| int | pdt_print_node (pdt_node_t *pn, char *code, int len) |
| int | pdt_print_tree (pdt_tree_t *pt) |
Variables | |
| str | pdt_char_list |
| static char | pdt_code_buf [PDT_MAX_DEPTH+1] |
| int add_to_tree | ( | pdt_tree_t * | pt, | |
| str * | sp, | |||
| str * | sd | |||
| ) |
Definition at line 80 of file pdtree.c.
References _pdt_node::child, _pdt_node::domain, _pdt_tree::head, len, _str::len, LM_ERR, NULL, PDT_MAX_DEPTH, PDT_NODE_SIZE, _str::s, shm_malloc(), and strpos.
Referenced by pdt_add_to_tree().
| str* get_domain | ( | pdt_tree_t * | pt, | |
| str * | sp, | |||
| int * | plen | |||
| ) |
Definition at line 233 of file pdtree.c.
References _pdt_node::child, _pdt_node::domain, domain, _pdt_tree::head, _str::len, len, LM_ERR, NULL, PDT_MAX_DEPTH, PDT_NODE_SIZE, _str::s, and strpos.
Referenced by pdt_get_domain().
| int pdt_add_to_tree | ( | pdt_tree_t ** | dpt, | |
| str * | sdomain, | |||
| str * | code, | |||
| str * | domain | |||
| ) |
Definition at line 174 of file pdtree.c.
References add_to_tree(), LM_ERR, _pdt_tree::next, NULL, pdt_init_tree(), _str::s, _pdt_tree::sdomain, and str_strcmp().
Referenced by pdt_load_db().
| int pdt_check_pd | ( | pdt_tree_t * | pt, | |
| str * | sdomain, | |||
| str * | sp, | |||
| str * | sd | |||
| ) |
Definition at line 422 of file pdtree.c.
References _pdt_tree::head, _str::len, len, LM_ERR, _pdt_tree::next, NULL, pdt_check_pd_node(), pdt_code_buf, _str::s, and _pdt_tree::sdomain.
Referenced by pdt_load_db(), and pdt_mi_add().
| int pdt_check_pd_node | ( | pdt_node_t * | pn, | |
| str * | sp, | |||
| str * | sd, | |||
| char * | code, | |||
| int | len | |||
| ) |
Definition at line 379 of file pdtree.c.
References _pdt_node::domain, domain, _str::len, LM_DBG, NULL, PDT_MAX_DEPTH, PDT_NODE_SIZE, and _str::s.
Referenced by pdt_check_pd().
| void pdt_free_node | ( | pdt_node_t * | pn | ) |
Definition at line 300 of file pdtree.c.
References _pdt_node::child, _pdt_node::domain, domain, _str::len, NULL, PDT_NODE_SIZE, _str::s, and shm_free.
Referenced by pdt_free_tree().
| void pdt_free_tree | ( | pdt_tree_t * | pt | ) |
Definition at line 326 of file pdtree.c.
References _pdt_tree::head, _pdt_tree::next, NULL, pdt_free_node(), pdt_free_tree(), _str::s, _pdt_tree::sdomain, and shm_free.
Referenced by mod_destroy(), pdt_free_tree(), and pdt_load_db().
| str* pdt_get_domain | ( | pdt_tree_t * | pl, | |
| str * | sdomain, | |||
| str * | code, | |||
| int * | plen | |||
| ) |
Definition at line 274 of file pdtree.c.
References domain, get_domain(), len, LM_ERR, _pdt_tree::next, NULL, _str::s, _pdt_tree::sdomain, and str_strcmp().
Referenced by prefix2domain().
| pdt_tree_t* pdt_get_tree | ( | pdt_tree_t * | pl, | |
| str * | sdomain | |||
| ) |
Definition at line 150 of file pdtree.c.
References LM_ERR, _pdt_tree::next, NULL, _str::s, _pdt_tree::sdomain, and str_strcmp().
| pdt_tree_t* pdt_init_tree | ( | str * | sdomain | ) |
Definition at line 43 of file pdtree.c.
References _pdt_tree::head, _str::len, LM_ERR, NULL, PDT_NODE_SIZE, pt, _str::s, _pdt_tree::sdomain, shm_free, and shm_malloc().
Referenced by pdt_add_to_tree().
| int pdt_print_node | ( | pdt_node_t * | pn, | |
| char * | code, | |||
| int | len | |||
| ) |
Definition at line 343 of file pdtree.c.
References _pdt_node::domain, domain, _str::len, LM_DBG, NULL, PDT_MAX_DEPTH, PDT_NODE_SIZE, and _str::s.
Referenced by pdt_print_tree().
| int pdt_print_tree | ( | pdt_tree_t * | pt | ) |
Definition at line 363 of file pdtree.c.
References _pdt_tree::head, _str::len, len, LM_DBG, _pdt_tree::next, NULL, pdt_code_buf, pdt_print_node(), pdt_print_tree(), _str::s, and _pdt_tree::sdomain.
Referenced by mod_init(), and pdt_print_tree().
Copyright (C) 2005 Voice Sistem SRL (Voice-System.RO)
This file is part of Kamailio, a free SIP server.
This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version
This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
History: ------- 2005-01-25 first tree version (ramona) 2006-01-30 multi domain support added (ramona)
char pdt_code_buf[PDT_MAX_DEPTH+1] [static] |
1.5.6