Apache Portable Runtime Utility Library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_ldap_url.h
Go to the documentation of this file.
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 
21 #ifndef APR_LDAP_URL_H
22 #define APR_LDAP_URL_H
23 
29 #if defined(DOXYGEN)
30 #include "apr_ldap.h"
31 #endif
32 
33 #if APR_HAS_LDAP
34 
35 #include "apu.h"
36 #include "apr_pools.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
43 typedef struct apr_ldap_url_desc_t {
44  struct apr_ldap_url_desc_t *lud_next;
45  char *lud_scheme;
46  char *lud_host;
47  int lud_port;
48  char *lud_dn;
49  char **lud_attrs;
50  int lud_scope;
51  char *lud_filter;
52  char **lud_exts;
53  int lud_crit_exts;
54 } apr_ldap_url_desc_t;
55 
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 */
68 #endif
69 
74 APU_DECLARE(int) apr_ldap_is_ldap_url(const char *url);
75 
80 APU_DECLARE(int) apr_ldap_is_ldaps_url(const char *url);
81 
86 APU_DECLARE(int) apr_ldap_is_ldapi_url(const char *url);
87 
95 APU_DECLARE(int) apr_ldap_url_parse_ext(apr_pool_t *pool,
96  const char *url_in,
97  apr_ldap_url_desc_t **ludpp,
98  apr_ldap_err_t **result_err);
99 
107 APU_DECLARE(int) apr_ldap_url_parse(apr_pool_t *pool,
108  const char *url_in,
109  apr_ldap_url_desc_t **ludpp,
110  apr_ldap_err_t **result_err);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* APR_HAS_LDAP */
117 
120 #endif /* APR_LDAP_URL_H */