40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * CDDL HEADER START
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * The contents of this file are subject to the terms of the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Common Development and Distribution License (the "License").
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * You may not use this file except in compliance with the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * See the License for the specific language governing permissions
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * and limitations under the License.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * When distributing Covered Code, include this CDDL HEADER in each
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * If applicable, add the following below this CDDL HEADER, with the
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * fields enclosed by brackets "[]" replaced with your own identifying
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * information: Portions Copyright [yyyy] [name of copyright owner]
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * CDDL HEADER END
2c2c41837e330b002c4220a39638150db504fe0evi * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Use is subject to license terms.
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi#pragma ident "%Z%%M% %I% %E% SMI"
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Parse the URI in uri_str
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get parsed URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331viconst struct sip_uri *
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if (value == NULL || value->sip_value_parse_uri == NULL ||
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return TRUE if this is a SIP URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi _uri->sip_uri_scheme.sip_str_len > 0 && _uri->sip_uri_issip) {
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Some common checks
40cb5e5daa7b80bb70fcf8dadfb20f9281566331visip_check_get_param(const struct sip_uri *uri, int *error)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return the URI scheme
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if (((_uri->sip_uri_errflags & SIP_URIERR_SCHEME) != 0 ||
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi _uri->sip_uri_scheme.sip_str_len == 0) && error != NULL) {
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return user name from URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_USER) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return password from URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331visip_get_uri_password(const struct sip_uri *uri, int *error)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_PASS) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get host from the URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_HOST) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get port from the URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi return (0);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_PARAM) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get headers from the URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331visip_get_uri_headers(const struct sip_uri *uri, int *error)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_HEADER) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return opaque value for an ABS URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_OPAQUE) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return query from an absolute URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_QUERY) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get path from an assolute URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_PATH) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Get the reg-name from absolute URI
40cb5e5daa7b80bb70fcf8dadfb20f9281566331visip_get_uri_regname(const struct sip_uri *uri, int *error)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi if ((_uri->sip_uri_errflags & SIP_URIERR_REGNAME) != 0 && error != NULL)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * Return TRUE if this is a teluser
40cb5e5daa7b80bb70fcf8dadfb20f9281566331visip_get_uri_errflags(const struct sip_uri *uri, int *error)
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi return (0);
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi * the caller is responsible for freeing the returned string
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncpy(err_info, "Error(s) in", strlen("Error(s) in"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " SCHEME,", strlen(" SCHEME,"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " PASSWORD,", strlen(" PASSWORD,"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " HEADERS,", strlen(" HEADERS,"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " OPAQUE,", strlen(" OPAQUE,"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " REG-NAME,", strlen(" REG-NAME,"));
40cb5e5daa7b80bb70fcf8dadfb20f9281566331vi (void) strncat(err_info, " part(s)", strlen(" part(s)"));