1SLPReg(3SLP)      Service Location Protocol Library Functions     SLPReg(3SLP)
2
3
4

NAME

6       SLPReg - register an SLP advertisement
7

SYNOPSIS

9       cc [ flag... ] file... -lslp [ library... ]
10       #include <slp.h>
11
12       SLPError SLPReg(SLPHandle hSLP, const char *pcSrvURL,
13            const unsigned short usLifetime, const char *pcSrvType,
14            const char *pcAttrs, SLPBoolean fresh,
15            SLPRegReport callback, void *pvCookie);
16
17

DESCRIPTION

19       The  SLPReg()  function  registers  the   URL  in pcSrvURL  having  the
20       lifetime  usLifetime with   the  attribute   list  in   pcAttrs.    The
21       pcAttrs  list  is  a comma-separated list of  attribute  assignments in
22       on-the-wire format (including   escaping   of   reserved   characters).
23       The  sLifetime  parameter  must  be  nonzero  and less than or equal to
24       SLP_LIFETIME_MAXIMUM. If the fresh  flag is  SLP_TRUE, then the  regis‐
25       tration  is   new, the SLP protocol  fresh  flag is set, and the regis‐
26       tration replaces any existing registrations.
27
28
29       The pcSrvType parameter is a service type name and can be included  for
30       service  URLs  that  are not in the service:  scheme.  If the URL is in
31       the service:  scheme, the pcSrvType parameter is ignored.  If the fresh
32       flag  is SLP_FALSE, then an existing registration is updated. Rules for
33       new  and  updated  registrations,  and  the  format  for  pcAttrs   and
34       pcScopeList,  can  be found in RFC 2608. Registrations and updates take
35       place in the language locale of the hSLP handle.
36
37
38       The API library is required to perform  the  operation  in  all  scopes
39       obtained through configuration.
40

PARAMETERS

42       hSLP          The  language  specific   SLPHandle on which to  register
43                     the advertisement.  hSLP cannot be NULL.
44
45
46       pcSrvURL      The URL  to register.  The value of  pcSrvURL  cannot  be
47                     NULL  or the  empty  string.
48
49
50       usLifetime    An  unsigned  short  giving  the life time of the service
51                     advertisement, in seconds.  The value must be an unsigned
52                     integer less than or equal to SLP_LIFETIME_MAXIMUM.
53
54
55       pcSrvType     The  service  type. If pURL is  a service: URL, then this
56                     parameter is ignored. pcSrvType cannot be NULL.
57
58
59       pcAttrs       A  comma-separated    list   of   attribute    assignment
60                     expressions  for  the   attributes of the  advertisement.
61                     pcAttrs  cannot  be NULL.  Use the  empty   string,   "",
62                     to indicate no attributes.
63
64
65       fresh         An SLPBoolean that is SLP_TRUE if the registration is new
66                     or  SLP_FALSE if it is a reregistration.
67
68
69       callback      A callback to report the  operation  completion   status.
70                     callback cannot be NULL.
71
72
73       pvCookie      Memory  passed  to  the  callback  code  from the client.
74                     pvCookie can be NULL.
75
76

ERRORS

78       This function or its callback may return any SLP error  code.  See  the
79       ERRORS section in slp_api(3SLP).
80

EXAMPLES

82       Example 1 An Initial Registration
83
84
85       The  following  example  shows  an  initial  registration for the "ser‐
86       vice:video://bldg15" camera service for three hours:
87
88
89         SLPError err;
90         SLPHandle hSLP;
91         SLPRegReport regreport;
92         err = SLPReg(hSLP, "service:video://bldg15",
93              10800, "", "(location=B15-corridor),
94              (scan-rate=100)", SLP_TRUE,
95              regRpt, NULL);
96
97

ENVIRONMENT VARIABLES

99       SLP_CONF_FILE    When set, use this file for configuration.
100
101

ATTRIBUTES

103       See attributes(5)  for descriptions of the following attributes:
104
105
106
107
108       ┌─────────────────────────────┬─────────────────────────────┐
109       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
110       ├─────────────────────────────┼─────────────────────────────┤
111       │Availability                 │SUNWslpu                     │
112       └─────────────────────────────┴─────────────────────────────┘
113

SEE ALSO

115       slpd(1M), slp_api(3SLP), slp.conf(4), slpd.reg(4), attributes(5)
116
117
118       System Administration Guide: Network Services
119
120
121       Guttman, E.,  Perkins, C., Veizades, J., and Day, M.,RFC 2608,  Service
122       Location Protocol, Version 2. The Internet Society. June 1999.
123
124
125       Kempf,  J.  and  Guttman, E. RFC 2614, An API for Service Location. The
126       Internet Society. June 1999.
127
128
129
130SunOS 5.11                        16 Jan 2003                     SLPReg(3SLP)
Impressum