home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _AEC14BBB52ABAE7C64C464EEA554CACE < prev    next >
Text File  |  2007-11-01  |  4KB  |  118 lines

  1. /* Licensed to the Apache Software Foundation (ASF) under one or more
  2.  * contributor license agreements.  See the NOTICE file distributed with
  3.  * this work for additional information regarding copyright ownership.
  4.  * The ASF licenses this file to You under the Apache License, Version 2.0
  5.  * (the "License"); you may not use this file except in compliance with
  6.  * the License.  You may obtain a copy of the License at
  7.  *
  8.  *     http://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  * Unless required by applicable law or agreed to in writing, software
  11.  * distributed under the License is distributed on an "AS IS" BASIS,
  12.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  * See the License for the specific language governing permissions and
  14.  * limitations under the License.
  15.  */
  16.  
  17. /**
  18.  * @file apr_ldap_url.h
  19.  * @brief  APR-UTIL LDAP ldap_init() functions
  20.  */
  21. #ifndef APR_LDAP_URL_H
  22. #define APR_LDAP_URL_H
  23.  
  24. /**
  25.  * @defgroup APR_Util_LDAP LDAP
  26.  * @ingroup APR_Util
  27.  * @{
  28.  */
  29.  
  30. #if APR_HAS_LDAP
  31.  
  32. #include "apu.h"
  33. #include "apr_pools.h"
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif /* __cplusplus */
  38.  
  39. /** Structure to access an exploded LDAP URL */
  40. typedef struct apr_ldap_url_desc_t {
  41.     struct  apr_ldap_url_desc_t  *lud_next;
  42.     char    *lud_scheme;
  43.     char    *lud_host;
  44.     int     lud_port;
  45.     char    *lud_dn;
  46.     char    **lud_attrs;
  47.     int     lud_scope;
  48.     char    *lud_filter;
  49.     char    **lud_exts;
  50.     int     lud_crit_exts;
  51. } apr_ldap_url_desc_t;
  52.  
  53. #ifndef APR_LDAP_URL_SUCCESS
  54. #define APR_LDAP_URL_SUCCESS          0x00    /* Success */
  55. #define APR_LDAP_URL_ERR_MEM          0x01    /* can't allocate memory space */
  56. #define APR_LDAP_URL_ERR_PARAM        0x02    /* parameter is bad */
  57. #define APR_LDAP_URL_ERR_BADSCHEME    0x03    /* URL doesn't begin with "ldap[si]://" */
  58. #define APR_LDAP_URL_ERR_BADENCLOSURE 0x04    /* URL is missing trailing ">" */
  59. #define APR_LDAP_URL_ERR_BADURL       0x05    /* URL is bad */
  60. #define APR_LDAP_URL_ERR_BADHOST      0x06    /* host port is bad */
  61. #define APR_LDAP_URL_ERR_BADATTRS     0x07    /* bad (or missing) attributes */
  62. #define APR_LDAP_URL_ERR_BADSCOPE     0x08    /* scope string is invalid (or missing) */
  63. #define APR_LDAP_URL_ERR_BADFILTER    0x09    /* bad or missing filter */
  64. #define APR_LDAP_URL_ERR_BADEXTS      0x0a    /* bad or missing extensions */
  65. #endif
  66.  
  67. /**
  68.  * Is this URL an ldap url? ldap://
  69.  * @param url The url to test
  70.  */
  71. APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
  72.  
  73. /**
  74.  * Is this URL an SSL ldap url? ldaps://
  75.  * @param url The url to test
  76.  */
  77. APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
  78.  
  79. /**
  80.  * Is this URL an ldap socket url? ldapi://
  81.  * @param url The url to test
  82.  */
  83. APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
  84.  
  85. /**
  86.  * Parse an LDAP URL.
  87.  * @param pool The pool to use
  88.  * @param url_in The URL to parse
  89.  * @param ludpp The structure to return the exploded URL
  90.  * @param result_err The result structure of the operation
  91.  */
  92. APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
  93.                                         const char *url_in,
  94.                                         apr_ldap_url_desc_t **ludpp,
  95.                                         apr_ldap_err_t **result_err);
  96.  
  97. /**
  98.  * Parse an LDAP URL.
  99.  * @param pool The pool to use
  100.  * @param url_in The URL to parse
  101.  * @param ludpp The structure to return the exploded URL
  102.  * @param result_err The result structure of the operation
  103.  */
  104. APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool,
  105.                                     const char *url_in,
  106.                                     apr_ldap_url_desc_t **ludpp,
  107.                                     apr_ldap_err_t **result_err);
  108.  
  109. #ifdef __cplusplus
  110. }
  111. #endif
  112.  
  113. #endif /* APR_HAS_LDAP */
  114.  
  115. /** @} */
  116.  
  117. #endif /* APR_LDAP_URL_H */
  118.