Apache Portable Runtime Utility Library
include/apr_ldap_url.h
Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00021 #ifndef APR_LDAP_URL_H
00022 #define APR_LDAP_URL_H
00023 
00029 #if defined(DOXYGEN)
00030 #include "apr_ldap.h"
00031 #endif
00032 
00033 #if APR_HAS_LDAP
00034 
00035 #include "apu.h"
00036 #include "apr_pools.h"
00037 
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif /* __cplusplus */
00041 
00043 typedef struct apr_ldap_url_desc_t {
00044     struct  apr_ldap_url_desc_t  *lud_next;
00045     char    *lud_scheme;
00046     char    *lud_host;
00047     int     lud_port;
00048     char    *lud_dn;
00049     char    **lud_attrs;
00050     int     lud_scope;
00051     char    *lud_filter;
00052     char    **lud_exts;
00053     int     lud_crit_exts;
00054 } apr_ldap_url_desc_t;
00055 
00056 #ifndef APR_LDAP_URL_SUCCESS
00057 #define APR_LDAP_URL_SUCCESS          0x00    /* Success */
00058 #define APR_LDAP_URL_ERR_MEM          0x01    /* can't allocate memory space */
00059 #define APR_LDAP_URL_ERR_PARAM        0x02    /* parameter is bad */
00060 #define APR_LDAP_URL_ERR_BADSCHEME    0x03    /* URL doesn't begin with "ldap[si]://" */
00061 #define APR_LDAP_URL_ERR_BADENCLOSURE 0x04    /* URL is missing trailing ">" */
00062 #define APR_LDAP_URL_ERR_BADURL       0x05    /* URL is bad */
00063 #define APR_LDAP_URL_ERR_BADHOST      0x06    /* host port is bad */
00064 #define APR_LDAP_URL_ERR_BADATTRS     0x07    /* bad (or missing) attributes */
00065 #define APR_LDAP_URL_ERR_BADSCOPE     0x08    /* scope string is invalid (or missing) */
00066 #define APR_LDAP_URL_ERR_BADFILTER    0x09    /* bad or missing filter */
00067 #define APR_LDAP_URL_ERR_BADEXTS      0x0a    /* bad or missing extensions */
00068 #endif
00069 
00074 APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
00075 
00080 APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
00081 
00086 APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
00087 
00095 APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
00096                                         const char *url_in,
00097                                         apr_ldap_url_desc_t **ludpp,
00098                                         apr_ldap_err_t **result_err);
00099 
00107 APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool,
00108                                     const char *url_in,
00109                                     apr_ldap_url_desc_t **ludpp,
00110                                     apr_ldap_err_t **result_err);
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115 
00116 #endif /* APR_HAS_LDAP */
00117 
00120 #endif /* APR_LDAP_URL_H */
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines