1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
'\" te
.\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH SLPREG 3SLP "Jan 16, 2003"
.SH NAME
SLPReg \- register an SLP advertisement
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR... ] \fIfile\fR... \fB-lslp\fR [ \fIlibrary\fR... ]
#include <slp.h>
\fBSLPError\fR \fBSLPReg\fR(\fBSLPHandle\fR \fIhSLP\fR, \fBconst char *\fR\fIpcSrvURL\fR,
\fBconst unsigned short\fR \fIusLifetime\fR, \fBconst char *\fR\fIpcSrvType\fR,
\fBconst char *\fR\fIpcAttrs\fR, \fBSLPBoolean\fR \fIfresh\fR,
\fBSLPRegReport\fR \fIcallback\fR, \fBvoid *\fR\fIpvCookie\fR);
.fi
.SH DESCRIPTION
.sp
.LP
The \fBSLPReg()\fR function registers the \fBURL\fR in \fIpcSrvURL\fR having
the lifetime \fIusLifetime\fR with the attribute list in \fIpcAttrs\fR.
The \fIpcAttrs\fR list is a comma-separated list of attribute assignments
in on-the-wire format (including escaping of reserved characters). The
\fIsLifetime\fR parameter must be nonzero and less than or equal to
\fBSLP_LIFETIME_MAXIMUM\fR. If the fresh flag is \fBSLP_TRUE\fR, then the
registration is new, the \fBSLP\fR protocol \fIfresh\fR flag is set, and the
registration replaces any existing registrations.
.sp
.LP
The \fIpcSrvType\fR parameter is a service type name and can be included for
service \fBURL\fRs that are not in the service: scheme. If the \fBURL\fR is
in the service: scheme, the \fIpcSrvType\fR parameter is ignored. If the
fresh flag is \fBSLP_FALSE\fR, then an existing registration is updated. Rules
for new and updated registrations, and the format for \fIpcAttrs\fR and
\fIpcScopeList\fR, can be found in \fIRFC 2608\fR. Registrations and updates
take place in the language locale of the \fIhSLP\fR handle.
.sp
.LP
The \fBAPI\fR library is required to perform the operation in all scopes
obtained through configuration.
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIhSLP\fR\fR
.ad
.RS 14n
The language specific \fBSLPHandle\fR on which to register the advertisement.
\fIhSLP\fR cannot be \fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fIpcSrvURL\fR\fR
.ad
.RS 14n
The \fBURL\fR to register. The value of \fIpcSrvURL\fR cannot be \fINULL\fR
or the empty string.
.RE
.sp
.ne 2
.na
\fB\fIusLifetime\fR\fR
.ad
.RS 14n
An \fBunsigned short\fR giving the life time of the service advertisement, in
seconds. The value must be an unsigned integer less than or equal to
\fBSLP_LIFETIME_MAXIMUM\fR.
.RE
.sp
.ne 2
.na
\fB\fIpcSrvType\fR\fR
.ad
.RS 14n
The service type. If \fIpURL\fR is a service: URL, then this parameter is
ignored. \fIpcSrvType\fR cannot be \fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fIpcAttrs\fR\fR
.ad
.RS 14n
A comma-separated list of attribute assignment expressions for the
attributes of the advertisement. \fIpcAttrs\fR cannot be \fINULL\fR. Use
the empty string, \fB""\fR, to indicate no attributes.
.RE
.sp
.ne 2
.na
\fB\fIfresh\fR\fR
.ad
.RS 14n
An \fBSLPBoolean\fR that is \fBSLP_TRUE\fR if the registration is new or
\fBSLP_FALSE\fR if it is a reregistration.
.RE
.sp
.ne 2
.na
\fB\fIcallback\fR\fR
.ad
.RS 14n
A callback to report the operation completion status. \fIcallback\fR cannot be
\fINULL\fR.
.RE
.sp
.ne 2
.na
\fB\fIpvCookie\fR\fR
.ad
.RS 14n
Memory passed to the callback code from the client. \fIpvCookie\fR can be
\fINULL\fR.
.RE
.SH ERRORS
.sp
.LP
This function or its callback may return any \fBSLP\fR error code. See the
ERRORS section in \fBslp_api\fR(3SLP).
.SH EXAMPLES
.LP
\fBExample 1 \fRAn Initial Registration
.sp
.LP
The following example shows an initial registration for the
"\fBservice:video://bldg15\fR" camera service for three hours:
.sp
.in +2
.nf
SLPError err;
SLPHandle hSLP;
SLPRegReport regreport;
err = SLPReg(hSLP, "service:video://bldg15",
10800, "", "(location=B15-corridor),
(scan-rate=100)", SLP_TRUE,
regRpt, NULL);
.fi
.in -2
.SH ENVIRONMENT VARIABLES
.sp
.ne 2
.na
\fB\fBSLP_CONF_FILE\fR\fR
.ad
.RS 17n
When set, use this file for configuration.
.RE
.SH SEE ALSO
.sp
.LP
\fBslpd\fR(1M), \fBslp_api\fR(3SLP), \fBslp.conf\fR(4), \fBslpd.reg\fR(4),
\fBattributes\fR(5)
.sp
.LP
\fISystem Administration Guide: Network Services\fR
.sp
.LP
Guttman, E., Perkins, C., Veizades, J., and Day, M.,\fIRFC 2608, Service
Location Protocol, Version 2\fR. The Internet Society. June 1999.
.sp
.LP
Kempf, J. and Guttman, E. \fIRFC 2614, An API for Service Location\fR. The
Internet Society. June 1999.
|