9075 Improve ZFS pool import/load process and corrupted pool recovery
[unleashed.git] / usr / src / man / man3sip / sip_parse_uri.3sip
blob878fab7d14710298c5c3d29cd5a123d7bf0f7bd6
1 '\" te
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"
7 .SH NAME
8 sip_parse_uri, sip_free_parsed_uri \- parse a URI and free a parsed URI
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsip\fR [ \fIlibrary\fR ... ]
13 #include <sip.h>
15 \fBsip_uri_t\fR \fIsip_parse_uri\fR(\fBsip_str_t *\fR\fIuri_str\fR,
16      \fBint *\fR\fIerror\fR);
17 .fi
19 .LP
20 .nf
21 \fBvoid\fR \fIsip_free_parsed_uri\fR(\fBsip_uri_t\fR \fIsip_uri\fR);
22 .fi
24 .SH DESCRIPTION
25 .sp
26 .LP
27 For functions that return a pointer of type \fIsip_str_t\fR, \fIsip_str_t\fR is
28 supplied by:
29 .sp
30 .in +2
31 .nf
32 typedef struct sip_str {
33      char *sip_str_ptr;
34      int  sip_str_len;
35 }sip_str_t;
36 .fi
37 .in -2
39 .sp
40 .LP
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.
43 .sp
44 .LP
45 For example, given the following request line in a \fBSIP\fR message input to
46 \fBsip_get_request_uri_str()\fR:
47 .sp
48 .in +2
49 .nf
50 INVITE sip:marconi@radio.org SIP/2.0
51 .fi
52 .in -2
54 .sp
55 .LP
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.
59 .sp
60 .LP
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.
66 .sp
67 .LP
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
70 memory.
71 .SH RETURN VALUES
72 .sp
73 .LP
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
76 parsed \fBURI\fR.
77 .sp
78 .LP
79 The value of \fBerrno\fR is not changed by these calls in the event of an
80 error.
81 .SH ERRORS
82 .sp
83 .LP
84 If the error is non-null, the following values is set:
85 .sp
86 .ne 2
87 .na
88 \fB\fBEINVAL\fR\fR
89 .ad
90 .RS 10n
91 The \fBSIP\fR header value of the \fBSIP\fR message is \fBNULL\fR or there is
92 no \fBURI\fR.
93 .sp
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.
96 .sp
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
105 \fB0\fR.
106 .SH ATTRIBUTES
109 See \fBattributes\fR(5) for descriptions of the following attributes:
114 box;
115 c | c
116 l | l .
117 ATTRIBUTE TYPE  ATTRIBUTE VALUE
119 Interface Stability     Committed
121 MT-Level        MT-Safe
124 .SH SEE ALSO
127 \fBlibsip\fR(3LIB)