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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
|
'\" 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 SLP_API 3SLP "June 20, 2021"
.SH NAME
slp_api \- Service Location Protocol Application Programming Interface
.SH SYNOPSIS
.nf
\fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-l\fRslp [ \fIlibrary\fR ... ]
#include <slp.h>
.fi
.SH DESCRIPTION
The \fBslp_api\fR is a C language binding that maps directly into the
Service Location Protocol ("\fBSLP\fR") defined by \fIRFC 2614\fR. This
implementation requires minimal overhead. With the exception of the
\fBSLPDereg()\fR and \fBSLPDelAttrs()\fR functions, which map into different
uses of the \fBSLP\fR deregister request, there is one C language
function per protocol request. Parameters are for the most part character
buffers. Memory management is kept simple because the client allocates most
memory and client callback functions are required to copy incoming parameters
into memory allocated by the client code. Any memory returned directly from the
\fBAPI\fR functions is deallocated using the \fBSLPFree()\fR function.
.sp
.LP
To conform with standard C practice, all character strings passed to and
returned through the \fBAPI\fR are null-terminated, even though the \fBSLP\fR
protocol does not use null-terminated strings. Strings passed as parameters
are \fBUTF-8\fR but they may still be passed as a C string (a null-terminated
sequence of bytes.) Escaped characters must be encoded by the \fBAPI\fR client
as \fBUTF-8\fR. In the common case of \fBUS-ASCII\fR, the usual one byte per
character C strings work. \fBAPI\fR functions assist in escaping and
unescaping strings.
.sp
.LP
Unless otherwise noted, parameters to \fBAPI\fR functions and callbacks are
non-\fINULL\fR. Some parameters may have other restrictions. If any parameter
fails to satisfy the restrictions on its value, the operation returns a
\fBPARAMETER_BAD\fR error.
.SS "Syntax for String Parameters"
Query strings, attribute registration lists, attribute deregistration lists,
scope lists, and attribute selection lists follow the syntax described in
\fIRFC 2608\fR. The \fBAPI\fR reflects the strings passed from clients directly
into protocol requests, and reflects out strings returned from protocol
replies directly to clients. As a consequence, clients are responsible for
formatting request strings, including escaping and converting opaque values to
escaped byte-encoded strings. Similarly, on output, clients are required to
unescape strings and convert escaped string-encoded opaques to binary. The
\fBSLPEscape()\fR and \fBSLPUnescape()\fR functions can be used for escaping
\fBSLP\fR reserved characters, but they perform no opaque processing.
.sp
.LP
Opaque values consist of a character buffer that contains a \fBUTF-8\fR-encoded
string, the first characters of which are the non \fBUTF-8\fR encoding
"\fB\eff\fR". Subsequent characters are the escaped values for the original
bytes in the opaque. The escape convention is relatively simple. An escape
consists of a backslash followed by the two hexadecimal digits encoding the
byte. An example is "\fB\e2c\fR" for the byte \fB0x2c\fR. Clients handle opaque
processing themselves, since the algorithm is relatively simple and uniform.
.SS "System Properties"
The system properties established in \fBslp.conf\fR(4), the configuration file,
are accessible through the \fBSLPGetProperty()\fR and \fBSLPSetProperty()\fR
functions. The \fBSLPSetProperty()\fR function modifies properties only in the
running process, not in the configuration file. Errors are checked when the
property is used and, as with parsing the configuration file, are logged at the
\fBLOG_INFO\fR priority. Program execution continues without interruption by
substituting the default for the erroneous parameter. In general, individual
agents should rarely be required to override these properties, since they
reflect properties of the \fBSLP\fR network that are not of concern to
individual agents. If changes are required, system administrators should modify
the configuration file.
.sp
.LP
Properties are global to the process, affecting all threads and all handles
created with \fBSLPOpen()\fR.
.SS "Memory Management"
The only \fBAPI\fR functions that return memory specifically requiring
deallocation on the part of the client are \fBSLPParseSrvURL()\fR,
\fBSLPFindScope()\fR, \fBSLPEscape()\fR, and \fBSLPUnescape()\fR. Free this
memory with \fBSLPFree()\fR when it is no longer needed. Do not free character
strings returned by means of the \fBSLPGetProperty()\fR function.
.sp
.LP
Any memory passed to callbacks belongs to the library, and it must not be
retained by the client code. Otherwise, crashes are possible. Clients must copy
data out of the callback parameters. No other use of the memory in callback
parameters is allowed.
.SS "Asynchronous and Incremental Return Semantics"
If a handle parameter to an \fBAPI\fR function is opened asynchronously, the
\fBAPI\fR function calls on the handle to check the other parameters, opens the
appropriate operation, and returns immediately. If an error occurs in the
process of starting the operation, the error code is returned. If the handle
parameter is opened synchronously, the function call is blocked until all
results are available, and it returns only after the results are reported
through the callback function. The return code indicates whether any errors
occurred during the operation.
.sp
.LP
The callback function is called whenever the \fBAPI\fR library has results to
report. The callback code is required to check the error code parameter before
looking at the other parameters. If the error code is not \fBSLP_OK\fR, the
other parameters may be \fINULL\fR or otherwise invalid. The \fBAPI\fR library
can terminate any outstanding operation on which an error occurs. The callback
code can similarly indicate that the operation should be terminated by passing
back \fBSLP_FALSE\fR to indicate that it is not interested in receiving more
results. Callback functions are not permitted to recursively call into the
\fBAPI\fR on the same \fBSLPHandle\fR. If an attempt is made to call into the
\fBAPI\fR, the \fBAPI\fR function returns \fBSLP_HANDLE_IN_USE\fR. Prohibiting
recursive callbacks on the same handle simplifies implementation of thread safe
code, since locks held on the handle will not be in place during a second
outcall on the handle.
.sp
.LP
The total number of results received can be controlled by setting the
\fBnet.slp.maxResults\fR parameter.
.sp
.LP
On the last call to a callback, whether asynchronous or synchronous, the status
code passed to the callback has value \fBSLP_LAST_CALL\fR. There are four
reasons why the call can terminate:
.sp
.ne 2
.na
\fBDA reply received\fR
.ad
.RS 26n
A reply from a \fBDA\fR has been received and therefore nothing more is
expected.
.RE
.sp
.ne 2
.na
\fBMulticast terminated\fR
.ad
.RS 26n
The multicast convergence time has elapsed and the \fBAPI\fR library multicast
code is giving up.
.RE
.sp
.ne 2
.na
\fBMulticast null results\fR
.ad
.RS 26n
Nothing new has been received during multicast for awhile and the \fBAPI\fR
library multicast code is giving up on that (as an optimization).
.RE
.sp
.ne 2
.na
\fBMaximum results\fR
.ad
.RS 26n
The user has set the \fBnet.slp.maxResults\fR property and that number of
replies has been collected and returned.
.RE
.SS "Configuration Files"
The \fBAPI\fR library reads \fBslp.conf\fR(4), the default configuration file,
to obtain the operating parameters. You can specify the location of this file
with the \fBSLP_CONF_FILE\fR environment variable. If you do not set this
variable, or the file it refers to is invalid, the \fBAPI\fR will use the
default configuration file at \fB/etc/inet/slp.conf\fR instead.
.SS "Data Structures"
The data structures used by the \fBSLP\fR \fBAPI\fR are as follows:
.SS "The URL Lifetime Type"
.in +2
.nf
typedef enum {
SLP_LIFETIME_DEFAULT = 10800,
SLP_LIFETIME_MAXIMUM = 65535
} SLPURLLifetime;
.fi
.in -2
.sp
.LP
The enumeration \fBSLPURLLifetime\fR contains \fBURL\fR lifetime values, in
seconds, that are frequently used. \fBSLP_LIFETIME_DEFAULT\fR is 3 hours, while
\fBSLP_LIFETIME_MAXIMUM\fR is 18 hours, which corresponds to the maximum size
of the \fBlifetime\fR field in \fBSLP\fR messages. Note that on registration
\fBSLP_LIFETIME_MAXIMUM\fR causes the advertisement to be continually
reregistered until the process exits.
.SS "The SLPBoolean Type"
.in +2
.nf
typedef enum {
SLP_FALSE = 0,
SLP_TRUE = 1
} SLPBoolean;
.fi
.in -2
.sp
.LP
The enumeration \fBSLPBoolean\fR is used as a Boolean flag.
.SS "The Service URL Structure"
.in +2
.nf
typedef struct srvurl {
char *s_pcSrvType;
char *s_pcHost;
int s_iPort;
char *s_pcNetFamily;
char *s_pcSrvPart;
} SLPSrvURL;
.fi
.in -2
.sp
.LP
The \fBSLPSrvURL\fR structure is filled in by the \fBSLPParseSrvURL()\fR
function with information parsed from a character buffer containing a service
\fBURL\fR. The fields correspond to different parts of the \fBURL\fR, as
follows:
.sp
.ne 2
.na
\fB\fBs_pcSrvType\fR\fR
.ad
.RS 17n
A pointer to a character string containing the service type name, including
naming authority.
.RE
.sp
.ne 2
.na
\fB\fBs_pcHost\fR\fR
.ad
.RS 17n
A pointer to a character string containing the host identification information.
.RE
.sp
.ne 2
.na
\fB\fBs_iPort\fR\fR
.ad
.RS 17n
The port number, or zero, if none. The port is only available if the transport
is \fBIP\fR.
.RE
.sp
.ne 2
.na
\fB\fBs_pcNetFamily\fR\fR
.ad
.RS 17n
A pointer to a character string containing the network address family
identifier. Possible values are "\fBipx\fR" for the \fBIPX\fR family,
"\fBat\fR" for the Appletalk family, and \fB""\fR, the empty string, for the
\fBIP\fR address family.
.RE
.sp
.ne 2
.na
\fB\fBs_pcSrvPart\fR\fR
.ad
.RS 17n
The remainder of the \fBURL\fR, after the host identification.
.sp
The host and port should be sufficient to open a socket to the machine hosting
the service; the remainder of the \fBURL\fR should allow further
differentiation of the service.
.RE
.SS "The SLPHandle"
.in +2
.nf
typedef void* SLPHandle;
.fi
.in -2
.sp
.LP
The \fBSLPHandle\fR type is returned by \fBSLPOpen()\fR and is a parameter to
all \fBSLP\fR functions. It serves as a handle for all resources allocated on
behalf of the process by the \fBSLP\fR library. The type is opaque.
.SS "Callbacks"
Include a function pointer to a callback function specific to a particular
\fBAPI\fR operation in the parameter list when the \fBAPI\fR function is
invoked. The callback function is called with the results of the operation in
both the synchronous and asynchronous cases. When the callback function is
invoked, the memory included in the callback parameters is owned by the
\fBAPI\fR library, and the client code in the callback must copy out the
contents if it wants to maintain the information longer than the duration of
the current callback call.
.sp
.LP
Each callback parameter list contains parameters for reporting the results of
the operation, as well as an error code parameter and a cookie parameter. The
error code parameter reports the error status of the ongoing (for asynchronous)
or completed (for synchronous) operation. The cookie parameter allows the
client code that starts the operation by invoking the \fBAPI\fR function to
pass information down to the callback without using global variables. The
callback returns an \fBSLPBoolean\fR to indicate whether the \fBAPI\fR library
should continue processing the operation. If the value returned from the
callback is \fBSLP_TRUE\fR, asynchronous operations are terminated. Synchronous
operations ignore the return since the operation is already complete.
.SS "\fBSLPRegReport()\fR"
.in +2
.nf
typedef void SLPRegReport(SLPHandle hSLP,
SLPError errCode,
void *pvCookie);
.fi
.in -2
.sp
.LP
\fBSLPRegReport()\fR is the callback function to the \fBSLPReg()\fR,
\fBSLPDereg()\fR, and \fBSLPDelAttrs()\fR functions. The \fBSLPRegReport()\fR
callback has the following parameters:
.sp
.ne 2
.na
\fB\fIhSLP\fR\fR
.ad
.RS 12n
The \fBSLPHandle()\fR used to initiate the operation.
.RE
.sp
.ne 2
.na
\fB\fIerrCode\fR\fR
.ad
.RS 12n
An error code indicating if an error occurred during the operation.
.RE
.sp
.ne 2
.na
\fB\fIpvCookie\fR\fR
.ad
.RS 12n
Memory passed down from the client code that called the original \fBAPI\fR
function, starting the operation. It may be \fINULL\fR.
.RE
.SS "\fBSLPSrvTypeCallback()\fR"
.in +2
.nf
typedef SLPBoolean SLPSrvTypeCallback(SLPHandle hSLP,
const char* pcSrvTypes,
SLPError errCode,
void *pvCookie);
.fi
.in -2
.sp
.LP
The \fBSLPSrvTypeCallback()\fR type is the type of the callback function
parameter to the \fBSLPFindSrvTypes()\fR function. The results are collated
when the \fIhSLP\fR handle is opened either synchronously or asynchronously.
The \fBSLPSrvTypeCallback()\fR callback has the following parameters:
.sp
.ne 2
.na
\fB\fIhSLP\fR\fR
.ad
.RS 14n
The \fBSLPHandle\fR used to initiate the operation.
.RE
.sp
.ne 2
.na
\fB\fIpcSrvTypes\fR\fR
.ad
.RS 14n
A character buffer containing a comma-separated, null-terminated list of
service types.
.RE
.sp
.ne 2
.na
\fB\fIerrCode\fR\fR
.ad
.RS 14n
An error code indicating if an error occurred during the operation. The
callback should check this error code before processing the parameters. If the
error code is other than \fBSLP_OK\fR, then the \fBAPI\fR library may choose to
terminate the outstanding operation.
.RE
.sp
.ne 2
.na
\fB\fIpvCookie\fR\fR
.ad
.RS 14n
Memory passed down from the client code that called the original \fBAPI\fR
function, starting the operation. It can be \fINULL\fR.
.RE
.SS "SLPSrvURLCallback"
.in +2
.nf
typedef SLPBoolean SLPSrvURLCallback(SLPHandle hSLP,
const char* pcSrvURL,
unsigned short usLifetime,
SLPError errCode,
void *pvCookie);
.fi
.in -2
.sp
.LP
The \fBSLPSrvURLCallback()\fR type is the type of the callback function
parameter to the \fBSLPFindSrvs()\fR function. The results are collated,
regardless of whether the \fIhSLP\fR was opened collated or uncollated. The
\fBSLPSrvURLCallback()\fR callback has the following parameters:
.sp
.ne 2
.na
\fB\fIhSLP\fR\fR
.ad
.RS 14n
The \fBSLPHandle\fR used to initiate the operation.
.RE
.sp
.ne 2
.na
\fB\fIpcSrvURL\fR\fR
.ad
.RS 14n
A character buffer containing the returned service \fBURL\fR.
.RE
.sp
.ne 2
.na
\fB\fIusLifetime\fR\fR
.ad
.RS 14n
An unsigned short giving the life time of the service advertisement. The value
must be an unsigned integer less than or equal to \fBSLP_LIFETIME_MAXIMUM\fR.
.RE
.sp
.ne 2
.na
\fB\fIerrCode\fR\fR
.ad
.RS 14n
An error code indicating if an error occurred during the operation. The
callback should check this error code before processing the parameters. If the
error code is other than \fBSLP_OK\fR, then the \fBAPI\fR library may choose to
terminate the outstanding operation.
.RE
.sp
.ne 2
.na
\fB\fIpvCookie\fR\fR
.ad
.RS 14n
Memory passed down from the client code that called the original \fBAPI\fR
function, starting the operation. It can be \fINULL\fR.
.RE
.SS "SLPAttrCallback"
.in +2
.nf
typedef SLPBoolean SLPAttrCallback(SLPHandle hSLP,
const char* pcAttrList,
SLPError errCode,
void *pvCookie);
.fi
.in -2
.sp
.LP
The \fBSLPAttrCallback()\fR type is the type of the callback function parameter
to the \fBSLPFindAttrs()\fR function.
.sp
.LP
The behavior of the callback differs depending upon whether the attribute
request was by \fBURL\fR or by service type. If the \fBSLPFindAttrs()\fR
operation was originally called with a \fBURL\fR, the callback is called once,
in addition to the last call, regardless of whether the handle was opened
asynchronously or synchronously. The \fIpcAttrList\fR parameter contains the
requested attributes as a comma-separated list. It is empty if no attributes
match the original tag list.
.sp
.LP
If the \fBSLPFindAttrs()\fR operation was originally called with a service
type, the value of \fIpcAttrList\fR and the calling behavior depend upon
whether the handle was opened asynchronously or synchronously. If the handle
was opened asynchronously, the callback is called every time the \fBAPI\fR
library has results from a remote agent. The \fIpcAttrList\fR parameter is
collated between calls, and contains a comma-separated list of the results from
the agent that immediately returned. If the handle was opened synchronously,
the results are collated from all returning agents, the callback is called
once, and the \fIpcAttrList\fR parameter is set to the collated result.
.sp
.LP
\fBSLPAttrCallback()\fR callback has the following parameters:
.sp
.ne 2
.na
\fB\fIhSLP\fR\fR
.ad
.RS 14n
The \fBSLPHandle\fR used to initiate the operation.
.RE
.sp
.ne 2
.na
\fB\fIpcAttrList\fR\fR
.ad
.RS 14n
A character buffer containing a comma-separated and null-terminated list of
attribute id/value assignments, in \fBSLP\fR wire format.
.RE
.sp
.ne 2
.na
\fB\fIerrCode\fR\fR
.ad
.RS 14n
An error code indicating if an error occurred during the operation. The
callback should check this error code before processing the parameters. If the
error code is other than \fBSLP_OK\fR, then the \fBAPI\fR library may choose to
terminate the outstanding operation.
.RE
.sp
.ne 2
.na
\fB\fIpvCookie\fR\fR
.ad
.RS 14n
Memory passed down from the client code that called the original \fBAPI\fR
function, starting the operation. It can be \fINULL\fR.
.RE
.SH ERRORS
An interface that is part of the \fBSLP\fR \fBAPI\fR may return one of the
following values.
.sp
.ne 2
.na
\fB\fBSLP_LAST_CALL\fR\fR
.ad
.RS 30n
The \fBSLP_LAST_CALL\fR code is passed to callback functions when the \fBAPI\fR
library has no more data for them and therefore no further calls will be made
to the callback on the currently outstanding operation. The callback uses this
to signal the main body of the client code that no more data will be
forthcoming on the operation, so that the main body of the client code can
break out of data collection loops. On the last call of a callback during both
a synchronous and asynchronous call, the error code parameter has value
\fBSLP_LAST_CALL\fR, and the other parameters are all \fINULL\fR. If no results
are returned by an \fBAPI\fR operation, then only one call is made, with the
error parameter set to \fBSLP_LAST_CALL\fR.
.RE
.sp
.ne 2
.na
\fB\fBSLP_OK\fR\fR
.ad
.RS 30n
The \fBSLP_OK\fR code indicates that the no error occurred during the
operation.
.RE
.sp
.ne 2
.na
\fB\fBSLP_LANGUAGE_NOT_SUPPORTED\fR\fR
.ad
.RS 30n
No \fBDA\fR or \fBSA\fR has service advertisement information in the language
requested, but at least one \fBDA\fR or \fBSA\fR might have information for
that service in another language.
.RE
.sp
.ne 2
.na
\fB\fBSLP_PARSE_ERROR\fR\fR
.ad
.RS 30n
The \fBSLP\fR message was rejected by a remote \fBSLP\fR agent. The \fBAPI\fR
returns this error only when no information was retrieved, and at least one
\fBSA\fR or \fBDA\fR indicated a protocol error. The data supplied through the
\fBAPI\fR may be malformed or damaged in transit.
.RE
.sp
.ne 2
.na
\fB\fBSLP_INVALID_REGISTRATION\fR\fR
.ad
.RS 30n
The \fBAPI\fR may return this error if an attempt to register a service was
rejected by all \fBDA\fRs because of a malformed \fBURL\fR or
attributes.\fBSLP\fR does not return the error if at least one \fBDA\fR accepts
the registration.
.RE
.sp
.ne 2
.na
\fB\fBSLP_SCOPE_NOT_SUPPORTED\fR\fR
.ad
.RS 30n
The \fBAPI\fR returns this error if the \fBUA\fR or \fBSA\fR has been
configured with the \fBnet.slp.useScopes\fR list of scopes and the \fBSA\fR
request did not specify one or more of these allowable scopes, and no others.
It may also be returned by a \fBDA\fR if the scope included in a request is not
supported by a \fBDA\fR.
.RE
.sp
.ne 2
.na
\fB\fBSLP_AUTHENTICATION_ABSENT\fR\fR
.ad
.RS 30n
This error arises when the \fBUA\fR or \fBSA \fRfailed to send an authenticator
for requests or registrations when security is enabled and thus required.
.RE
.sp
.ne 2
.na
\fB\fBSLP_AUTHENTICATION_FAILED\fR\fR
.ad
.RS 30n
This error arises when a authentication on an \fBSLP\fR message received from a
remote \fBSLP\fR agent failed.
.RE
.sp
.ne 2
.na
\fB\fBSLP_INVALID_UPDATE\fR\fR
.ad
.RS 30n
An update for a nonexisting registration was issued, or the update includes a
service type or scope different than that in the initial registration.
.RE
.sp
.ne 2
.na
\fB\fBSLP_REFRESH_REJECTED\fR\fR
.ad
.RS 30n
The \fBSA\fR attempted to refresh a registration more frequently than the
minimum refresh interval. The \fBSA\fR should call the appropriate \fBAPI\fR
function to obtain the minimum refresh interval to use.
.RE
.sp
.ne 2
.na
\fB\fBSLP_NOT_IMPLEMENTED\fR\fR
.ad
.RS 30n
An outgoing request overflowed the maximum network \fBMTU\fR size. The request
should be reduced in size or broken into pieces and tried again.
.RE
.sp
.ne 2
.na
\fB\fBSLP_BUFFER_OVERFLOW\fR\fR
.ad
.RS 30n
An outgoing request overflowed the maximum network \fBMTU\fR size. The request
should be reduced in size or broken into pieces and tried again.
.RE
.sp
.ne 2
.na
\fB\fBSLP_NETWORK_TIMED_OUT\fR\fR
.ad
.RS 30n
When no reply can be obtained in the time specified by the configured timeout
interval, this error is returned.
.RE
.sp
.ne 2
.na
\fB\fBSLP_NETWORK_INIT_FAILED\fR\fR
.ad
.RS 30n
If the network cannot initialize properly, this error is returned.
.RE
.sp
.ne 2
.na
\fB\fBSLP_MEMORY_ALLOC_FAILED\fR\fR
.ad
.RS 30n
If the \fBAPI\fR fails to allocate memory, the operation is aborted and returns
this.
.RE
.sp
.ne 2
.na
\fB\fBSLP_PARAMETER_BAD\fR\fR
.ad
.RS 30n
If a parameter passed into an interface is bad, this error is returned.
.RE
.sp
.ne 2
.na
\fB\fBSLP_NETWORK_ERROR\fR\fR
.ad
.RS 30n
The failure of networking during normal operations causes this error to be
returned.
.RE
.sp
.ne 2
.na
\fB\fBSLP_INTERNAL_SYSTEM_ERROR\fR\fR
.ad
.RS 30n
A basic failure of the \fBAPI\fR causes this error to be returned. This occurs
when a system call or library fails. The operation could not recover.
.RE
.sp
.ne 2
.na
\fB\fBSLP_HANDLE_IN_USE\fR\fR
.ad
.RS 30n
In the C \fBAPI\fR, callback functions are not permitted to recursively call
into the \fBAPI\fR on the same \fBSLPHandle\fR, either directly or indirectly.
If an attempt is made to do so, this error is returned from the called
\fBAPI\fR function
.RE
.SH LIST OF ROUTINES
.ne 2
.na
\fB\fBSLPOpen()\fR\fR
.ad
.RS 27n
open an \fBSLP\fR handle
.RE
.sp
.ne 2
.na
\fB\fBSLPClose()\fR\fR
.ad
.RS 27n
close an open \fBSLP\fR handle
.RE
.sp
.ne 2
.na
\fB\fBSLPReg()\fR\fR
.ad
.RS 27n
register a service advertisement
.RE
.sp
.ne 2
.na
\fB\fBSLPDereg()\fR\fR
.ad
.RS 27n
deregister a service advertisement
.RE
.sp
.ne 2
.na
\fB\fBSLPDelAttrs()\fR\fR
.ad
.RS 27n
delete attributes
.RE
.sp
.ne 2
.na
\fB\fBSLPFindSrvTypes()\fR\fR
.ad
.RS 27n
return service types
.RE
.sp
.ne 2
.na
\fB\fBSLPFindSrvs()\fR\fR
.ad
.RS 27n
return service URLs
.RE
.sp
.ne 2
.na
\fB\fBSLPFindAttrs()\fR\fR
.ad
.RS 27n
return service attributes
.RE
.sp
.ne 2
.na
\fB\fBSLPGetRefreshInterval()\fR\fR
.ad
.RS 27n
return the maximum allowed refresh interval for \fBSA\fRs
.RE
.sp
.ne 2
.na
\fB\fBSLPFindScopes()\fR\fR
.ad
.RS 27n
return list of configured and discovered scopes
.RE
.sp
.ne 2
.na
\fB\fBSLPParseSrvURL()\fR\fR
.ad
.RS 27n
parse service \fBURL\fR
.RE
.sp
.ne 2
.na
\fB\fBSLPEscape()\fR\fR
.ad
.RS 27n
escape special characters
.RE
.sp
.ne 2
.na
\fB\fBSLPUnescape()\fR\fR
.ad
.RS 27n
translate escaped characters into \fBUTF-8\fR
.RE
.sp
.ne 2
.na
\fB\fBSLPGetProperty()\fR\fR
.ad
.RS 27n
return \fBSLP\fR configuration property
.RE
.sp
.ne 2
.na
\fB\fBSLPSetProperty()\fR\fR
.ad
.RS 27n
set an \fBSLP\fR configuration property
.RE
.sp
.ne 2
.na
\fB\fBslp_strerror()\fR\fR
.ad
.RS 27n
map \fBSLP\fR error code to message
.RE
.sp
.ne 2
.na
\fB\fBSLPFree()\fR\fR
.ad
.RS 27n
free memory
.RE
.SH ENVIRONMENT VARIABLES
When \fBSLP_CONF_FILE\fR is set, use this file for configuration.
.SH ATTRIBUTES
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
CSI CSI-enabled
_
MT-Level Safe
.TE
.SH SEE ALSO
\fBslpd\fR(1M), \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.
|