;;; -*- Mode:gate; Fonts:(HL12 HL12I HL12B CPTFONTB HL12BI HL12B HL12I ) -*- =Node: 4Hosts* =Text: 3HOSTS* Each host known to the Lisp Machine is represented by a flavor instance known as a host object. The host object records such things as the name(s) of the host, its operating system type, and its network address(es). Host objects print like 2#FS:TOPS20-CHAOS-HOST "MIT-OZ"*, so they can be read back in. Not all hosts support file access. Those that do support it appear on the list 2fs:*pathname-host-list** and can be the host component of pathnames. A host object is also used as an argument when you make a Chaosnet connection for any purpose. The hosts that you can use for making network connections appear in the value of 2si:host-alist*. Most of the hosts you can use for pathnames are among these; but some, such as logical hosts, are not. =Node: 4Parsing Hostnames* =Text: 3PARSING HOSTNAMES si:parse-host* 1namestring* &optional 1no-error-p* 1(unknown-ok* 1t)* Returns a host object that recognizes the specified name. If the name is not recognized, it is an error, unless 1no-error-p* is non-2nil*; in that case, 2nil* is returned. If 1unknown-ok* is non-2nil* (the default), a host table server on the local network is contacted, to see if perhaps it can find the name there. If it can't, an error is signalled or 2nil* is returned, according to 1no-error-p*. The host instance created in this manner contains all the kinds of information that a host defined from the host table file has. If a string of the form 2CHAOS|1nnn** is used, a host object is created and given 1nnn* (interpreted as octal) as its Chaosnet address. This can be done regardless of the 1unknown-ok* argument. The first argument is allowed to be a host object instead of a string. In this case, that argument is simply returned. 3sys:unknown-host-name* (3sys:local-network-error* 3sys:network-error* 3error*)1Condition* This condition is signaled by 2si:parse-host* when the host is not recognized, if that is an error. The 2:name* operation on the condition instance returns the string given to 2si:parse-host*. 3si:get-host-from-address* 1address* 1network* Returns a host object given an address and the name of the network which that address is for. Usually the symbol 2:chaos* is used as the network name. 2nil* is returned if there is no known host with that address. 3fs:get-pathname-host* 1name* &optional 1no-error-p* Returns a host object that can be used in pathnames. If the name is not recognized, it is an error, unless 1no-error-p* is non-2nil*; in that case, 2nil* is returned. The first argument is allowed to be a host object instead of a string. In this case, that argument is simply returned. 2si:parse-host* and 2fs:get-pathname-host* differ in the set of hosts searched. 3fs:unknown-pathname-host* (3fs:pathname-error* 3error*) 1Condition* This condition is signaled by 2fs:get-pathname-host* when the host is not recognized, if that is an error. The 2:name* operation on the condition instance returns the string given to 2fs:get-pathname-host*. 3fs:*pathname-host-list** 1Variable* This is a list of all the host objects that support file access. 3si:host-alist* 1Variable* This variable is a list of one element for each known network host. The element looks like this: 3(1full-name* 1host-object* (1nickname* 1nickname2* ... 1full-name*)* 3 1system-type* 1machine-type* 1site** 3 1network* 1list-of-addresses* 1network2* 1list-of-addresses2* ...)* The 1full-name* is the host's official name. The 2:name* operation on the host object returns this. The 1host-object* is a flavor instance that represents this host. It may be 2nil* if none has been created yet; 2si:parse-host* creates them when they are referred to. The 1nickname*s are alternate names that 2si:parse-host* should recognize for this host, but which are not its official name. The 1system-type* is a symbol that tells what software the host runs. This is used to decide what flavor of host object to construct. Symbols now used include 2:lispm*, 2:its*, 2:tops-20*, 2:tenex*, 2:vms*, 2:unix*, 2:multics*, 2:minits*, 2:waits*, 2:chaos-gateway*, 2:dos*, 2:rsx*, 2:magicsix*, 2:msdos*, and others. Not all of these are specifically understood in any way by the Lisp Machine. If none of these applies to a host you wish to add, use a new symbol. The 1machine-type* is a symbol that describes the hardware of the host. Symbols in use include 2:lispm*, 2:pdp10*, 2:pdp11*, 2:vax*, 2:nu*, 2:pe3230*, and 2:ibmpc*. 2(nil)* has also been observed to appear here. Note that these machine types attempt to have wide meanings, lumping together various brands, models, etc. The 1site* does not describe anything about the host. Instead it serves to say what the Lisp Machine's site name was when the host was defined. This is so that, when a Lisp Machine system is moved to a different institution that has a disjoint set of hosts, all the old site's hosts can be deleted from the host alist by site reinitialization. The 1network*s and lists of addresses describe how to reach the host. Usually there is only one network and only one address in the list. The generality is so that hosts with multiple addresses on multiple networks can be recorded. Networks include 2:chaos* and 2:arpa*. The address is meaningful only to code for a specific network. =Node: 4Host Object Operations* =Text: 3HOST OBJECT OPERATIONS :name* 1Operation on host objects* Returns the full, official name of the host. 3:name-as-file-computer* 1Operation on host objects* Returns the name to print in pathnames on this host (assuming it supports files). This is likely to be a short nickname of the host. 3:short-name* 1Operation on host objects* Returns the shortest known nickname for this host. 3:pathname-host-namep* 1string* 1Operation on host objects* Returns 2t* if 1string* is recognized as a name for this host for purposes of pathname parsing. The local host will recognise 2LM* as a pathname host name. 3:system-type* 1Operation on host objects* Returns the operating system type symbol for this host. See 4(MISCELL-4)Site Options and Host Table*. 3:network-type* 1Operation on host objects* Returns the symbol for one network that this host is connected to, or 2nil* if it is not connected to any. 2:chaos* is preferred if it is one of the possible values. 3:network-typep* 1network* 1Operation on host objects* Returns 2t* if the host is connected to the specified network. 3:network-addresses* 1Operation on host objects* Returns an alternating list of network names and lists of addresses, such as 3(:chaos (3104) :arpa (106357002))* You can therefore find out all networks a host is known to be on, and its addresses on any network. 3:sample-pathname* 1Operation on host objects* Returns a pathname for this host, whose device, directory, name, type and version components are all 2nil*. Sample pathnames are often useful because many file-system-dependent pathname operations depend only on the pathname's host. 3:open-streams* 1Operation on host objects* Returns a list of all the open file streams for files on this host. 3:close-all-files* 1Operation on host objects* Closes all file streams open for files on this host. 3:generic-base-type* 1type-component* 1Operation on host objects* Returns the type component for a generic pathname assuming it is being made from a pathname whose type component is the one specified.