While the LDAPSEARCH tool performs the actual LDAP lookup, its command format can be very long, tedious to enter, and not pleasing to the eye to behold. Also, LDAP results are usually one or more lines of <key> <value> pairs that usually have a raw appearance. The Perl script performs all of the work to make the search process simple and effective, and provides a better display.
Figure 1 is a sample result of the QLANADMIN Perl script used to provide this service, searching for the LAN Administrator of a specific IP subnet. When no parameters are given, the script will display information on how to use the script, listing the various parameters accepted. Figure 2 is a sample of the the LDAPSEARCH command used and the data returned from the LDAP server.
The LDAPSEARCH command is given several ``selection attributes'' that it passes to the LDAP server to restrict the number of attributes that will be returned by the server. In this script, the four selection attributes specified were: lanadmin postofficebox telephonenumber dnsadmin.
The distinction between IP subdomains and AppleTalk zone objects is made in the DN entry. Other attributes within each entry could have been used that are not a part of the DN. There are trade-offs to both approaches, but they won't be covered here.
As it was implemented, IP subdomains were represented
by a DN which contained a Domain Component (DC) attribute for each component
of the subdomain name. In the example above, the IP subdomain
grdsch.ournet.edu
has a DN that begins with
dc=grdsch,dc=ournet,dc=edu
. A representative AppleTalk zone is
similarily identified, but only uses two DC attributes: one for the
actual AppleTalk zone name, and one for a pseudo domain of AppleTalk
.
Late note: multiple LDAPSEARCHs may, or may not, be better acccomodated with
perldap
[20].