Solaris slpd supports advertising of legacy services using a proxy registration file. A proxy registration file is a list of service advertisements in a portable format.
A service advertisement consists of a service URL line, an optional scope line, and a series of attribute definitions. slpd reads proxy advertisements from the file, registers the advertisements, and maintains them exactly like an SA client would. The following listing shows an example of a proxy registration file. Line numbers have been added for description purposes and are not part of the file.
1 #Advertise legacy printer. 2 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 9 10 #Advertise FTP server 11 12 ftp://archive/usr/src/public,en,65535,src-server 13 content=Source code for projects 14 |
In this example, a legacy printer supporting the LPR protocol and an FTP server are being advertised.
Lines 1 and 10 |
Comment lines begin with a cross-hatch symbol (#) and do not affect the file's operation. Everything up through the end of a comment line is ignored. |
Blank lines at 2, 9, and 14 |
Delimit the advertisements |
Line 3 and 12 |
Service URLs |
Line 4 |
Scope designation |
Lines 5-8 and 13 |
Attribute definitions |
A service URL line has three required fields and one optional field, separated by commas:
First field - This field contains the service URL to be advertised. The service URL can be either a generic URL or a service: URL. See RFC 2609 for the specification of how to form a service: URL.
Second field - This field designates the language of the advertisement. In the previous example, the field designated English, en. The language is an RFC 1766 language tag.
Third field - This field establishes the 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 like any other advertisement. If the lifetime is 65535, slpd refreshes the advertisement periodically, and the lifetime is considered permanent, until slpd exits.
As a practical matter, nonpermanent proxy registrations are of limited usefulness, because once slpd removes the advertisement, it is no longer accessible to UAs. Both advertisements in the example are permanent.
Service type field (optional) - If used, this field defines the service type. If the service URL is a generic URL, then it is possible to 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, and the optional type field causes it to be advertised under the service type name src-server. The service: prefix is not added by default to the type name.
After the URL line, an optional scope line can appear. The scope line consists of the token scope followed by an equal sign, followed by a comma-separated list of scope names defined by the net.slp.useScopes configuration property. Only scopes that are part of the list of configured scopes for the host should appear in the scope list. If the scope line does not appear, the registration is made in all scopes with which slpd is configured. The scope line must appear immediately after the URL line; otherwise, it is recognized as an attribute.
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, followed by a comma-separated list of attribute values, or a single value if the attribute is single valued. In the previous example of a proxy registration file, line 8 illustrates a value list with multiple values; all other value lists have single values. The format for the attribute names and values is the same as on-the-wire SLP messages.
For a description of the format see RFC 2608. The proxy registration file supports the same convention for escaping non-ASCII characters as the configuration file. For more information about the proxy registration file format, see RFC 2614.