4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SIP_PARSE_URI_H
28 #define _SIP_PARSE_URI_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
36 #include <sys/types.h>
39 #define SIP_URI_BUF_SIZE 128
41 #define SIP_SCHEME "sip"
42 #define SIPS_SCHEME "sips"
44 #define SIP_SCHEME_LEN 3
45 #define SIPS_SCHEME_LEN 4
48 * SIP-URI = "sip:" [ userinfo ] hostport
49 * uri-parameters [ headers ]
50 * SIPS-URI = "sips:" [ userinfo ] hostport
51 * uri-parameters [ headers ]
52 * uri-parameters = *( ";" uri-parameter)
53 * uri-parameter = transport-param / user-param / method-param
54 * / ttl-param / maddr-param / lr-param / other-param
55 * transport-param = "transport="
56 * "udp" / "tcp" / "sctp" / "tls"/ other-transport)
57 * other-transport = token
58 * headers = "?" header *( "&" header )
60 typedef struct sip_uri_sip_s
{
61 sip_param_t
*sip_params
;
62 sip_str_t sip_headers
;
66 * opaque uri opaque part
69 * regname uri reg-name
71 typedef struct sip_uri_abs_s
{
72 sip_str_t sip_uri_opaque
;
73 sip_str_t sip_uri_query
;
74 sip_str_t sip_uri_path
;
75 sip_str_t sip_uri_regname
;
79 * structure for a parsed URI
80 * sip_uri_scheme URI scheme
81 * sip_uri_user user name
82 * sip_uri_password password for the user
83 * sip_uri_host host name
84 * sip_uri_port port number for the host (0 = none specified)
85 * sip_uri_errflags error flags
86 * sip_uri_issip is this a SIP URI.
87 * sip_uri_isteluser user is a telephone-subscriber
89 typedef struct sip_uri
{
90 sip_str_t sip_uri_scheme
;
91 sip_str_t sip_uri_user
;
92 sip_str_t sip_uri_password
;
93 sip_str_t sip_uri_host
;
95 uint_t sip_uri_errflags
;
96 boolean_t sip_uri_issip
;
97 boolean_t sip_uri_isteluser
;
99 sip_uri_sip_t sip_sipuri
; /* SIP URI */
100 sip_uri_abs_t sip_absuri
; /* Absolute URI */
104 #define sip_uri_params specific.sip_sipuri.sip_params
105 #define sip_uri_headers specific.sip_sipuri.sip_headers
106 #define sip_uri_opaque specific.sip_absuri.sip_uri_opaque
107 #define sip_uri_query specific.sip_absuri.sip_uri_query
108 #define sip_uri_path specific.sip_absuri.sip_uri_path
109 #define sip_uri_regname specific.sip_absuri.sip_uri_regname
111 extern void sip_uri_parse_it(_sip_uri_t
*, sip_str_t
*);
117 #endif /* _SIP_PARSE_URI_H */