1sip_parse_uri(3SIPS)ession Initiation Protocol Library Functiosnisp_parse_uri(3SIP)
2
3
4

NAME

6       sip_parse_uri, sip_free_parsed_uri - parse a URI and free a parsed URI
7

SYNOPSIS

9       cc [ flag ... ] file ... -lsip [ library ... ]
10       #include <sip.h>
11
12       sip_uri_t sip_parse_uri(sip_str_t *uri_str,
13            int *error);
14
15
16       void sip_free_parsed_uri(sip_uri_t sip_uri);
17
18

DESCRIPTION

20       For  functions  that  return  a pointer of type sip_str_t, sip_str_t is
21       supplied by:
22
23         typedef struct sip_str {
24              char *sip_str_ptr;
25              int  sip_str_len;
26         }sip_str_t;
27
28
29
30       The sip_str_ptr parameter points to the start of the returned value and
31       sip_str_len supplies the length of the returned value.
32
33
34       For example, given the following request line in a SIP message input to
35       sip_get_request_uri_str():
36
37         INVITE sip:marconi@radio.org SIP/2.0
38
39
40
41       the return is a pointer to sip_str_t with the sip_str_ptr member point‐
42       ing  to  "s"  of sip:marconi@radio.org and sip_str_len being set to 21,
43       the length of sip:marconi@radio.org.
44
45
46       The sip_parse_uri() function takes a URI string in the  form  sip_str_t
47       and returns a parsed URI sip_uri. The syntax of the URI is as specified
48       in RFC 3261, section 25.1. If the parser encounters an error when pars‐
49       ing  a  component, it sets the appropriate error bit in the error flags
50       and proceeds to the next component, if present.
51
52
53       The sip_free_parsed_uri() function takes a parsed URI sip_uri, obtained
54       from sip_parse_uri(), and frees any associated memory.
55

RETURN VALUES

57       The sip_parse_uri() function returns the parsed URI sip_uri on success.
58       It returns a NULL if memory cannot be allocated for the parsed URI.
59
60
61       The value of errno is not changed by these calls in  the  event  of  an
62       error.
63

ERRORS

65       If the error is non-null, the following values is set:
66
67       EINVAL    The  SIP  header value of the SIP message is NULL or there is
68                 no URI.
69
70                 The input URI is null  or  the  requested  URI  component  is
71                 invalid. The error flag is set for the requested component.
72
73                 The URI parameters or headers are requested from a non-SIP[S]
74                 URI; or the 'opaque', 'query', 'path', 'reg-name'  components
75                 are requested from a SIP[S] URI.
76
77
78
79       On success, the value of the location pointed to by error is set to 0.
80

ATTRIBUTES

82       See attributes(5) for descriptions of the following attributes:
83
84
85
86
87       ┌─────────────────────────────┬─────────────────────────────┐
88       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
89       ├─────────────────────────────┼─────────────────────────────┤
90       │Interface Stability          │Committed                    │
91       ├─────────────────────────────┼─────────────────────────────┤
92       │MT-Level                     │MT-Safe                      │
93       └─────────────────────────────┴─────────────────────────────┘
94

SEE ALSO

96       libsip(3LIB)
97
98
99
100SunOS 5.11                        25 Jan 2007              sip_parse_uri(3SIP)
Impressum