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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file apr_ldap_url.h
19 * @brief APR-UTIL LDAP ldap_init() functions
21 #ifndef APR_LDAP_URL_H
22 #define APR_LDAP_URL_H
25 * @addtogroup APR_Util_LDAP
36 #include "apr_pools.h"
40 #endif /* __cplusplus */
42 /** Structure to access an exploded LDAP URL */
43 typedef struct apr_ldap_url_desc_t {
44 struct apr_ldap_url_desc_t *lud_next;
54 } apr_ldap_url_desc_t;
56 #ifndef APR_LDAP_URL_SUCCESS
57 #define APR_LDAP_URL_SUCCESS 0x00 /* Success */
58 #define APR_LDAP_URL_ERR_MEM 0x01 /* can't allocate memory space */
59 #define APR_LDAP_URL_ERR_PARAM 0x02 /* parameter is bad */
60 #define APR_LDAP_URL_ERR_BADSCHEME 0x03 /* URL doesn't begin with "ldap[si]://" */
61 #define APR_LDAP_URL_ERR_BADENCLOSURE 0x04 /* URL is missing trailing ">" */
62 #define APR_LDAP_URL_ERR_BADURL 0x05 /* URL is bad */
63 #define APR_LDAP_URL_ERR_BADHOST 0x06 /* host port is bad */
64 #define APR_LDAP_URL_ERR_BADATTRS 0x07 /* bad (or missing) attributes */
65 #define APR_LDAP_URL_ERR_BADSCOPE 0x08 /* scope string is invalid (or missing) */
66 #define APR_LDAP_URL_ERR_BADFILTER 0x09 /* bad or missing filter */
67 #define APR_LDAP_URL_ERR_BADEXTS 0x0a /* bad or missing extensions */
71 * Is this URL an ldap url? ldap://
72 * @param url The url to test
74 APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
77 * Is this URL an SSL ldap url? ldaps://
78 * @param url The url to test
80 APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
83 * Is this URL an ldap socket url? ldapi://
84 * @param url The url to test
86 APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
90 * @param pool The pool to use
91 * @param url_in The URL to parse
92 * @param ludpp The structure to return the exploded URL
93 * @param result_err The result structure of the operation
95 APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
97 apr_ldap_url_desc_t **ludpp,
98 apr_ldap_err_t **result_err);
102 * @param pool The pool to use
103 * @param url_in The URL to parse
104 * @param ludpp The structure to return the exploded URL
105 * @param result_err The result structure of the operation
107 APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool,
109 apr_ldap_url_desc_t **ludpp,
110 apr_ldap_err_t **result_err);
116 #endif /* APR_HAS_LDAP */
120 #endif /* APR_LDAP_URL_H */