2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _SIP_PARSE_URI_H
2N/A#define _SIP_PARSE_URI_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <sys/types.h>
2N/A#include <sip.h>
2N/A
2N/A#define SIP_URI_BUF_SIZE 128
2N/A
2N/A#define SIP_SCHEME "sip"
2N/A#define SIPS_SCHEME "sips"
2N/A
2N/A#define SIP_SCHEME_LEN 3
2N/A#define SIPS_SCHEME_LEN 4
2N/A
2N/A/*
2N/A * SIP-URI = "sip:" [ userinfo ] hostport
2N/A * uri-parameters [ headers ]
2N/A * SIPS-URI = "sips:" [ userinfo ] hostport
2N/A * uri-parameters [ headers ]
2N/A * uri-parameters = *( ";" uri-parameter)
2N/A * uri-parameter = transport-param / user-param / method-param
2N/A * / ttl-param / maddr-param / lr-param / other-param
2N/A * transport-param = "transport="
2N/A * "udp" / "tcp" / "sctp" / "tls"/ other-transport)
2N/A * other-transport = token
2N/A * headers = "?" header *( "&" header )
2N/A */
2N/Atypedef struct sip_uri_sip_s {
2N/A sip_param_t *sip_params;
2N/A sip_str_t sip_headers;
2N/A} sip_uri_sip_t;
2N/A
2N/A/*
2N/A * opaque uri opaque part
2N/A * query uri query
2N/A * path uri path
2N/A * regname uri reg-name
2N/A */
2N/Atypedef struct sip_uri_abs_s {
2N/A sip_str_t sip_uri_opaque;
2N/A sip_str_t sip_uri_query;
2N/A sip_str_t sip_uri_path;
2N/A sip_str_t sip_uri_regname;
2N/A} sip_uri_abs_t;
2N/A
2N/A/*
2N/A * structure for a parsed URI
2N/A * sip_uri_scheme URI scheme
2N/A * sip_uri_user user name
2N/A * sip_uri_password password for the user
2N/A * sip_uri_host host name
2N/A * sip_uri_port port number for the host (0 = none specified)
2N/A * sip_uri_errflags error flags
2N/A * sip_uri_issip is this a SIP URI.
2N/A * sip_uri_isteluser user is a telephone-subscriber
2N/A */
2N/Atypedef struct sip_uri {
2N/A sip_str_t sip_uri_scheme;
2N/A sip_str_t sip_uri_user;
2N/A sip_str_t sip_uri_password;
2N/A sip_str_t sip_uri_host;
2N/A uint_t sip_uri_port;
2N/A uint_t sip_uri_errflags;
2N/A boolean_t sip_uri_issip;
2N/A boolean_t sip_uri_isteluser;
2N/A union {
2N/A sip_uri_sip_t sip_sipuri; /* SIP URI */
2N/A sip_uri_abs_t sip_absuri; /* Absolute URI */
2N/A } specific;
2N/A}_sip_uri_t;
2N/A
2N/A#define sip_uri_params specific.sip_sipuri.sip_params
2N/A#define sip_uri_headers specific.sip_sipuri.sip_headers
2N/A#define sip_uri_opaque specific.sip_absuri.sip_uri_opaque
2N/A#define sip_uri_query specific.sip_absuri.sip_uri_query
2N/A#define sip_uri_path specific.sip_absuri.sip_uri_path
2N/A#define sip_uri_regname specific.sip_absuri.sip_uri_regname
2N/A
2N/Aextern void sip_uri_parse_it(_sip_uri_t *, sip_str_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _SIP_PARSE_URI_H */