Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Overview of the Network Services Location Manager

The Network Services Location Manager provides

A wide variety of applications become easier to use when they call the Network Services Location Manager. For example,

The Network Services Location Manager acts as an intermediary between the providers of network services and applications that want information about such services. It also registers network services that make registration requests.

You can use the Network Services Location Manager to

This version the Network Services Location Manager runs only on Power PC computers on which Mac OS X is installed. Before your application calls the Network Services Location Manager, it should verify that Mac OS X is running.

If your Mac OS X application only calls NSLStandardGetURL, you need only link to the Carbon library. To build a Mac OS X application that calls Network Services Location Manager functions other than NSLStandardGetURL, link to /System/Library/Frameworks/CoreServices.framework.

To build an application that calls the Network Services Location Manager and that runs on both Mac OS 9 and Mac OS X, link to the Carbon library only.

In this section:

Locating Services
Registering Services


Locating Services

The Network Services Location Manager uses Open Directory to locate network services, as shown in Figure 1-1.


Figure 1-1  Search for a network service

Figure 1-1 Search for a network service

Applications that search for services can focus the search by specifying two values:

A neighborhood is abstract information about where services may reside. In Mac OS X 10.2 and later, a neighborhood consists of one or more Open Directory “nodes.” A node can be an SLP scope, a DNS domain, an AppleTalk zone, a Windows neighborhood, or a directory published by NetInfo, LDAP, or a third-party Open Directory plug-in. The Network Services Location Manager works with Open Directory to query these nodes for information about services. The Network Services Location Manager uses nodes to abstract a consistent view of the network that can be browsed in a way that is independent of the caller.

The following steps outline the conduct of a search for a service:

  1. The application creates a search request and calls the Network Services Location Manager’s NSLStartServicesLookup function.

  2. The Network Services Location Manager receives the request and passes it to Open Directory, which passes the request to the appropriate Open Directory plug-in.

  3. The Open Directory plug-in that receives the request starts to look for the requested services.

  4. Providers of the requested services send their responses to the Open Directory plug-in, which makes the responses available to Open Directory.

  5. Open Directory passes the responses to the Network Services Location Manager.

  6. The Network Services Location Manager passes the responses to the application that called NSLStartServiceLookup.

Registering Services

Applications that provide services register themselves with the Network Services Location Manager as shown in Figure 1-2 so that they can be found by applications that use their services.


Figure 1-2  Flow of a service registration

Figure 1-2 Flow of a service registration

The following steps outline the flow of a service registration:

  1. The application creates a value that specifies the URL to register. It may call the Network Services Location Manager utility function, NSLHexEncodeText, to encode portions of the URL that may contain characters (such as spaces) that are not allowed in URLs. Then the application calls the Network Services Location Manager’s NSLStandardRegisterURL function to register the URL. In most cases, applications pass a null value as the neighborhood. Passing a null value causes the Network Services Location Manager to register the service in the appropriate local neighborhood.

  2. The Network Services Location Manager receives the request and passes it to the Open Directory SLP plug-in.

  3. If the Open Directory SLP plug-in can register the URL, it returns a value indicating that the service was registered successfully, which the Network Services Location Manager passes to the calling application.

Note: Open Directory may require that the application calling the Network Services Location Manager have root privileges in order to successfully register a service. SLP service registrations and service registrations in the local.arpa DNS domain are not required to have root privileges.



< Previous PageNext Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice