2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SIP_PARSE_URI 3SIP "Jan 25, 2007"
8 sip_parse_uri, sip_free_parsed_uri \- parse a URI and free a parsed URI
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ]
15 \fBsip_uri_t\fR \fIsip_parse_uri\fR(\fBsip_str_t *\fR\fIuri_str\fR,
16 \fBint *\fR\fIerror\fR);
21 \fBvoid\fR \fIsip_free_parsed_uri\fR(\fBsip_uri_t\fR \fIsip_uri\fR);
27 For functions that return a pointer of type \fIsip_str_t\fR, \fIsip_str_t\fR is
32 typedef struct sip_str {
41 The \fIsip_str_ptr\fR parameter points to the start of the returned value and
42 \fIsip_str_len\fR supplies the length of the returned value.
45 For example, given the following request line in a \fBSIP\fR message input to
46 \fBsip_get_request_uri_str()\fR:
50 INVITE sip:marconi@radio.org SIP/2.0
56 the return is a pointer to \fIsip_str_t\fR with the \fIsip_str_ptr\fR member
57 pointing to "\fBs\fR" of \fBsip:marconi@radio.org\fR and \fIsip_str_len\fR
58 being set to \fB21\fR, the length of \fBsip:marconi@radio.org\fR.
61 The \fBsip_parse_uri()\fR function takes a \fBURI\fR string in the form
62 \fIsip_str_t\fR and returns a parsed \fBURI\fR \fIsip_uri\fR. The syntax of the
63 \fBURI\fR is as specified in RFC 3261, section 25.1. If the parser encounters
64 an error when parsing a component, it sets the appropriate error bit in the
65 error flags and proceeds to the next component, if present.
68 The \fBsip_free_parsed_uri()\fR function takes a parsed \fBURI\fR
69 \fIsip_uri\fR, obtained from \fBsip_parse_uri()\fR, and frees any associated
74 The \fBsip_parse_uri()\fR function returns the parsed \fBURI\fR \fIsip_uri\fR
75 on success. It returns a \fBNULL\fR if memory cannot be allocated for the
79 The value of \fBerrno\fR is not changed by these calls in the event of an
84 If the error is non-null, the following values is set:
91 The \fBSIP\fR header value of the \fBSIP\fR message is \fBNULL\fR or there is
94 The input \fBURI\fR is null or the requested \fBURI\fR component is invalid.
95 The error flag is set for the requested component.
97 The \fBURI\fR parameters or headers are requested from a non-\fBSIP[S]\fR
98 \fBURI\fR; or the '\fBopaque\fR', '\fBquery\fR', '\fBpath\fR', '\fBreg-name\fR'
99 components are requested from a \fBSIP[S]\fR \fBURI\fR.
104 On success, the value of the location pointed to by \fIerror\fR is set to
109 See \fBattributes\fR(5) for descriptions of the following attributes:
117 ATTRIBUTE TYPE ATTRIBUTE VALUE
119 Interface Stability Committed