pdtree.c File Reference

#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"

Include dependency graph for pdtree.c:

Go to the source code of this file.

Functions

int add_to_tree (pdt_tree_t *pt, str *sp, str *sd)
strget_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)
strpdt_get_domain (pdt_tree_t *pl, str *sdomain, str *code, int *plen)
pdt_tree_tpdt_get_tree (pdt_tree_t *pl, str *sdomain)
pdt_tree_tpdt_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]


Function Documentation

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 
)

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 
)

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  ) 

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  ) 


Variable Documentation

Id
pdtree.c 4518 2008-07-28 15:39:28Z henningw

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)

Definition at line 85 of file pdt.c.

char pdt_code_buf[PDT_MAX_DEPTH+1] [static]

Definition at line 362 of file pdtree.c.

Referenced by pdt_check_pd(), and pdt_print_tree().


Generated on Thu May 24 02:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6