The file /lib/ndb/local is the root of the database. Other files are included in the database if a tuple with an attribute-value pair of attribute database and no value exists in /lib/ndb/local. Within the database tuple, each pair with attribute file identifies a file to be included in the database. The files are searched in the order they appear. For example:
declares the database to be composed of the three files /lib/ndb/common, /lib/ndb/local, and /lib/ndb/global. By default, /lib/ndb/local is searched before the others. However, /lib/ndb/local may be included in the database to redefine its ordering.
Within tuples, pairs on the same line bind tighter than pairs on different lines.
Programs search the database directly using the routines in The routine ndbipinfo imposes structure on the otherwise flat database by using knowledge specific to the network. The internet is made up of networks which can be subnetted multiple times. A network must have an ipnet attribute and is uniquely identified by the values of its ip and ipmask attributes. If the ipmask is missing, the relevant Class A, B or C one is used.
A search for an attribute associated with a network or host starts at the lowest level, the entry for the host or network itself, and works its way up, bit by bit, looking at entries for nets/subnets that include the network or host. The search ends when the attribute is found. For example, consider at the following entries:
Here anna is on the subnet plan9 which is in turn on the class B net murray-hill. Assume that we're searching for anna's NTP and SMTP servers. The search starts by looking for an entry with sys=anna. We find the anna entry. Since it has an smtp=smtp2.cs.bell-labs.com pair, we're done looking for that attribute. To fulfill the NTP request, we continue by looking for networks that include anna's IP address. We lop off the right most one bit from anna's address and look for an ipnet= entry with ip=220.127.116.11. Not finding one, we drop another bit and look for an ipnet= entry with ip=18.104.22.168. There is such an entry and it has the pair, ntp=oncore.cs.bell-labs.com, ending our search.
A number of attributes are meaningful to programs and thus reserved. They are:
sys = spindle dom=spindle.research.bell-labs.com bootf=/mips/9powerboot ip=22.214.171.124 ether=080069020677 proto=il
Entries for the network mh-astro-net and its subnets.
ipnet=mh-astro-net ip=126.96.36.199 ipmask=255.255.255.0 fs=bootes.research.bell-labs.com ipgw=r70.research.bell-labs.com auth=p9auth.research.bell-labs.com ipnet=unix-room ip=188.8.131.52 ipgw=184.108.40.206 ipnet=third-floor ip=220.127.116.11 ipgw=18.104.22.168
Mappings between TCP service names and port numbers.
tcp=sysmon port=401 tcp=rexec port=512 restricted tcp=9fs port=564