ld_cfg.h

00001 /*
00002  * LDAP module - Configuration file parser
00003  *
00004  * Copyright (C) 2001-2003 FhG FOKUS
00005  * Copyright (C) 2004,2005 Free Software Foundation, Inc.
00006  * Copyright (C) 2005,2006 iptelorg GmbH
00007  *
00008  * This file is part of SER, a free SIP server.
00009  *
00010  * SER is free software; you can redistribute it and/or modify it under the
00011  * terms of the GNU General Public License as published by the Free Software
00012  * Foundation; either version 2 of the License, or (at your option) any later
00013  * version.
00014  *
00015  * SER is distributed in the hope that it will be useful, but WITHOUT ANY
00016  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00018  * details.
00019  *
00020  * You should have received a copy of the GNU General Public License along
00021  * with this program; if not, write to the Free Software Foundation, Inc.,
00022  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00023  */
00024 
00025 #ifndef _LD_CFG_H
00026 #define _LD_CFG_H
00027 
00028 #include "ld_fld.h"
00029 
00030 #include "../../str.h"
00031 #include <sys/time.h>
00032 
00033 /* RFC 2251:  maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- */
00034 #define LD_MAXINT (2147483647)
00035 
00036 
00037 struct ld_cfg {
00038         str table;      
00039         str base;       
00040         int scope;      
00041         str filter;   
00042         str* field;  
00043         str* attr;   
00044         enum ld_syntax* syntax; 
00045         int n;          
00046         int sizelimit; 
00047         int timelimit; 
00048         int chase_references;  
00049         int chase_referrals;   
00050         struct ld_cfg* next; 
00051 };
00052 
00053 struct ld_con_info {
00054         str id;
00055         str host;
00056         unsigned int port;
00057         str username;
00058         str password;
00059         int authmech;
00060         int tls;  
00061         str ca_list;  
00062         str req_cert;  
00063         struct ld_con_info* next;
00064 };
00065 
00066 struct ld_cfg* ld_find_cfg(str* table);
00067 
00068 char* ld_find_attr_name(enum ld_syntax* syntax, struct ld_cfg* cfg, char* fld_name);
00069 
00070 struct ld_con_info* ld_find_conn_info(str* conn_id);
00071 
00072 int ld_load_cfg(str* filename);
00073 
00074 void ld_cfg_free(void);
00075 
00076 #endif /* _LD_CFG_H */