aboutsummaryrefslogtreecommitdiff
path: root/sys/ki/kilnode.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/ki/kilnode.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/ki/kilnode.x')
-rw-r--r--sys/ki/kilnode.x41
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/ki/kilnode.x b/sys/ki/kilnode.x
new file mode 100644
index 00000000..e332e8f0
--- /dev/null
+++ b/sys/ki/kilnode.x
@@ -0,0 +1,41 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include "ki.h"
+
+# KI_LOCALNODE -- Determine if the named node is the local node.
+
+int procedure ki_localnode (node)
+
+char node[ARB] # node name
+
+int ch, i
+bool streq()
+int ki_mapname()
+include "kinode.com"
+
+begin
+ if (n_local == NULL) {
+ # If local node is not identified in the host name table, this
+ # effectively disables networking. All nodes names are assumed
+ # to be local.
+
+ return (YES)
+
+ } else {
+ # We have a node name and the local node is identified in the
+ # node table. Scan the aliases of the local node to see if the
+ # referenced node is the same.
+
+ # Map possible logical node name.
+ if (ki_mapname (node, n_nodename, SZ_ALIAS) <= 0)
+ call strcpy (node, n_nodename, SZ_ALIAS)
+
+ ch = n_nodename[1]
+ do i = 1, n_nalias[n_local]
+ if (n_alias[1,i,n_local] == ch)
+ if (streq (n_alias[1,i,n_local], n_nodename))
+ return (YES)
+ }
+
+ return (NO)
+end