00001 /* ==================================================================== 00002 * The Apache Software License, Version 1.1 00003 * 00004 * Copyright (c) 2000-2003 The Apache Software Foundation. All rights 00005 * reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in 00016 * the documentation and/or other materials provided with the 00017 * distribution. 00018 * 00019 * 3. The end-user documentation included with the redistribution, 00020 * if any, must include the following acknowledgment: 00021 * "This product includes software developed by the 00022 * Apache Software Foundation (http://www.apache.org/)." 00023 * Alternately, this acknowledgment may appear in the software itself, 00024 * if and wherever such third-party acknowledgments normally appear. 00025 * 00026 * 4. The names "Apache" and "Apache Software Foundation" must 00027 * not be used to endorse or promote products derived from this 00028 * software without prior written permission. For written 00029 * permission, please contact apache@apache.org. 00030 * 00031 * 5. Products derived from this software may not be called "Apache", 00032 * nor may "Apache" appear in their name, without prior written 00033 * permission of the Apache Software Foundation. 00034 * 00035 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00036 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00037 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00038 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00039 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00040 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00041 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00042 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00043 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00044 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00045 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00046 * SUCH DAMAGE. 00047 * ==================================================================== 00048 * 00049 * This software consists of voluntary contributions made by many 00050 * individuals on behalf of the Apache Software Foundation. For more 00051 * information on the Apache Software Foundation, please see 00052 * <http://www.apache.org/>. 00053 * 00054 * Portions of this software are based upon public domain software 00055 * originally written at the National Center for Supercomputing Applications, 00056 * University of Illinois, Urbana-Champaign. 00057 */ 00058 00059 /* 00060 * apr_uri.h: External Interface of apr_uri.c 00061 */ 00062 00068 #ifndef APR_URI_H 00069 #define APR_URI_H 00070 00071 #include "apu.h" 00072 00073 #include "apr_network_io.h" 00074 00075 #ifdef __cplusplus 00076 extern "C" { 00077 #endif 00078 00085 #define APR_URI_FTP_DEFAULT_PORT 21 00086 #define APR_URI_SSH_DEFAULT_PORT 22 00087 #define APR_URI_TELNET_DEFAULT_PORT 23 00088 #define APR_URI_GOPHER_DEFAULT_PORT 70 00089 #define APR_URI_HTTP_DEFAULT_PORT 80 00090 #define APR_URI_POP_DEFAULT_PORT 110 00091 #define APR_URI_NNTP_DEFAULT_PORT 119 00092 #define APR_URI_IMAP_DEFAULT_PORT 143 00093 #define APR_URI_PROSPERO_DEFAULT_PORT 191 00094 #define APR_URI_WAIS_DEFAULT_PORT 210 00095 #define APR_URI_LDAP_DEFAULT_PORT 389 00096 #define APR_URI_HTTPS_DEFAULT_PORT 443 00097 #define APR_URI_RTSP_DEFAULT_PORT 554 00098 #define APR_URI_SNEWS_DEFAULT_PORT 563 00099 #define APR_URI_ACAP_DEFAULT_PORT 674 00100 #define APR_URI_NFS_DEFAULT_PORT 2049 00101 #define APR_URI_TIP_DEFAULT_PORT 3372 00102 #define APR_URI_SIP_DEFAULT_PORT 5060 00106 #define APR_URI_UNP_OMITSITEPART (1U<<0) 00107 00108 #define APR_URI_UNP_OMITUSER (1U<<1) 00109 00110 #define APR_URI_UNP_OMITPASSWORD (1U<<2) 00111 00112 #define APR_URI_UNP_OMITUSERINFO (APR_URI_UNP_OMITUSER | \ 00113 APR_URI_UNP_OMITPASSWORD) 00114 00115 #define APR_URI_UNP_REVEALPASSWORD (1U<<3) 00116 00117 #define APR_URI_UNP_OMITPATHINFO (1U<<4) 00118 00119 #define APR_URI_UNP_OMITQUERY (1U<<5) 00120 00122 typedef struct apr_uri_t apr_uri_t; 00123 00127 struct apr_uri_t { 00129 char *scheme; 00131 char *hostinfo; 00133 char *user; 00135 char *password; 00137 char *hostname; 00139 char *port_str; 00141 char *path; 00143 char *query; 00145 char *fragment; 00146 00148 struct hostent *hostent; 00149 00151 apr_port_t port; 00152 00154 unsigned is_initialized:1; 00155 00157 unsigned dns_looked_up:1; 00159 unsigned dns_resolved:1; 00160 }; 00161 00162 /* apr_uri.c */ 00169 APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str); 00170 00172 APU_DECLARE(apr_port_t) apr_uri_default_port_for_scheme(const char *scheme_str); 00173 00191 APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, 00192 const apr_uri_t *uptr, 00193 unsigned flags); 00194 00204 APU_DECLARE(int) apr_uri_parse(apr_pool_t *p, const char *uri, 00205 apr_uri_t *uptr); 00206 00214 APU_DECLARE(int) apr_uri_parse_hostinfo(apr_pool_t *p, 00215 const char *hostinfo, 00216 apr_uri_t *uptr); 00217 00219 #ifdef __cplusplus 00220 } 00221 #endif 00222 00223 #endif /* APR_URI_H */