System Administration Guide: Network Services

Using SLP Proxy Registration to Advertise

A service advertisement consists of lines that identify the service URL, an optional scope, and a series of attribute definitions. The SLP daemon reads, registers, and maintains proxy advertisements exactly as an SA client would. The following is an example of an advertisement from a proxy registration file.

In the example, a legacy printer that supports LPR protocol and an FTP server are advertised. Line numbers have been added for description purposes and are not part of the file.

 (1) #Advertise legacy printer. 
 (3) service:lpr://bizserver/mainspool,en,65535
 (4) scope=eng,corp
 (5) make-model=Laserwriter II
 (6) location-description=B16-2345
 (7) color-supported=monochromatic
 (8) fonts-supported=Courier,Times,Helvetica 9 10
 (10) #Advertise FTP server
 (12) ftp://archive/usr/src/public,en,65535,src-server
 (13) content=Source code for projects

Note –

The proxy registration file supports the same convention for escaping non-ASCII characters as the configuration file does. For more information about the format of the proxy registration file, see RFC 2614.

Table 10–1 SLP Proxy Registration File Description

Line Numbers 


1 and 10 

Comment lines begin with a cross-hatch symbol (#) and do not affect the file's operation. All characters through the end of a comment line are ignored. 

2, 9, and 14 

Blank lines that delimit the advertisements. 

3, 12 

Service URLs that each have three required fields and one optional field that are separated by commas: 

  • Generic or service: URL advertised. See RFC 2609 for the specification of how to form a service: URL.

  • Language of the advertisement. In the previous example, the field is designated English, en. Language is an RFC 1766 language tag.

  • Lifetime of the registration, measured in seconds. The lifetime is restricted to an unsigned 16 bit-integer. If the lifetime is less than the maximum, 65535, slpd times out the advertisement. If the lifetime is 65535, slpd refreshes the advertisement periodically, and the lifetime is considered permanent, until slpd exits.

  • (Optional) Service type field – If used, this field defines the service type. If the service URL is defined, you can change the service type under which the URL is advertised. In the previous example of a proxy registration file, line 12 contains a generic FTP URL. The optional type field causes the URL to be advertised under the service type name src-server. The service prefix is not added by default to the type name.

Scope designation. 

Optional line consists of the token scope, followed by an equal sign and a comma-separated list of scope names. Scope names are defined by the net.slp.useScopes configuration property. Only scopes that are configured for the host should be included in the list. When a scope line is not added, the registration is made in all scopes with which slpd is configured. The scope line must appear immediately after the URL line. Otherwise, scope names are recognized as attributes.


Attribute definitions. 

After the optional scope line, the bulk of the service advertisement contains attribute/value list pair lines. Each pair consists of the attribute tag, followed by an equal sign, and an attribute value or a comma-separated list of values. In the previous example of a proxy registration file, line 8 illustrates an attribute list with multiple values. All other lists have single values. The format for the attribute names and values is the same as on-the-wire SLP messages.