1SLPParseSrvURL(3SLPS)ervice Location Protocol Library FunctioSnLsPParseSrvURL(3SLP)
2
3
4
6 SLPParseSrvURL - parse service URL
7
9 cc [ flag... ] file... -lslp [ library... ]
10 #include <slp.h>
11
12 SLPError SLPParseSrvURL(const char *pcSrvURL, SLPSrvURL** ppSrvURL);
13
14
16 The SLPParseSrvURL() routine parses the URL passed in as the argument
17 into a service URL structure and returns it in the ppSrvURL
18 pointer. If a parser error occurs, returns SLP_PARSE_ERROR. The
19 structure returned in ppSrvURL should be freed with SLPFree(). If
20 the URL has no service part, the s_pcSrvPart string is the empty
21 string, "", that is, it is not NULL. If pcSrvURL is not a service:
22 URL, then the s_pcSrvType field in the returned data structure
23 is the URL's scheme, which might not be the same as the service
24 type under which the URL was registered. If the transport is
25 IP, the s_pcNetFamily field is the empty string.
26
27
28 If no error occurs, the return value is the SLP_OK. Otherwise, if
29 an error occurs, one of the SLPError codes is returned.
30
32 pcSrvURL A pointer to a character buffer containing the null
33 terminated URL string to parse. It is destructively modi‐
34 fied to produce the output structure. It may not be NULL.
35
36
37 ppSrvURL A pointer to a ponter for the SLPSrvURL structure to
38 receive the parsed URL. It may not be NULL.
39
40
42 This function or its callback may return any SLP error code. See the
43 ERRORS section in slp_api(3SLP).
44
46 Example 1 Using SLPParseSrvURL()
47
48
49 The following example uses the SLPParseSrvURL() function to parse the
50 service URL service:printer:lpr://serv/queue1:
51
52
53 SLPSrvURL* surl;
54 SLPError err;
55
56 err = SLPParseSrvURL("service:printer:lpr://serv/queue1", &surl);
57
58
60 SLP_CONF_FILE When set, use this file for configuration.
61
62
64 See attributes(5) for descriptions of the following attributes:
65
66
67
68
69 ┌─────────────────────────────┬─────────────────────────────┐
70 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
71 ├─────────────────────────────┼─────────────────────────────┤
72 │Availability │SUNWslpu │
73 └─────────────────────────────┴─────────────────────────────┘
74
76 slpd(1M), slp_api(3SLP), slp.conf(4), slpd.reg(4), attributes(5)
77
78
79 System Administration Guide: Network Services
80
81
82 Guttman, E., Perkins, C., Veizades, J., and Day, M. RFC 2608, Service
83 Location Protocol, Version 2. The Internet Society. June 1999.
84
85
86 Kempf, J. and Guttman, E. RFC 2614, An API for Service Location. The
87 Internet Society. June 1999.
88
89
90
91SunOS 5.11 16 Jan 2003 SLPParseSrvURL(3SLP)