aboutsummaryrefslogtreecommitdiff
path: root/sys/ki/kishownet.x
blob: 63765aee63866418a90b6b83d46885879426914f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<mach.h>
include	<config.h>
include	"ki.h"

procedure ki_shownet (fd)

int	fd			# output file

int	i, j, n
int	ki_gethosts()
include	"kinode.com"

begin
	if (n_nnodes == 0)
	    n = ki_gethosts()

	call fprintf (fd, "Local node `%s' (%d), default node `%s', ")
	    call pargstr (n_localnode)
	    call pargi (n_local)
	    call pargstr (n_defaultnode)
	call fprintf (fd, "%d nodes in local network\n")
	    call pargi (n_nnodes)

	if (n_local == 0) {
	    call fprintf (fd, "Network interface disabled ")
	    call fprintf (fd, "(no entry for local node in dev$hosts)\n")
	}

	if (n_nnodes == MAX_NODES)
	    call fprintf (fd, "HOST NAME TABLE IS FULL\n")
	else if (n_nnodes <= 0)
	    return

	# Print node table.
	call fprintf (fd, "\n    NODE SERVER NREFS STATUS  ALIASES\n")
	do i = 1, n_nnodes {
	    call fprintf (fd, "%8d %6d %5d  %05o ")
		call pargi (i)
		call pargi (n_kschan[i])
		call pargi (n_nrefs[i])
		call pargi (n_status[i])

	    do j = 1, n_nalias[i] {
		call fprintf (fd, " %s")
		    call pargstr (n_alias[1,j,i])
	    }

	    call fprintf (fd, "\n")
	}

#	The following should no longer be needed as ki_mapname and the
#	"node!" syntax should prevent accidential aliasing of node names
#	and non-network related environment variables.
#
#	n = 0
#	do i = 1, n_nnodes
#	    do j = 1, n_nalias[i]
#		if (envfind (n_alias[1,j,i], Memc[text], SZ_FNAME) > 0) {
#		    if (n == 0)
#			call fprintf (fd, "\n")
#		    call fprintf (fd,
#			"Warning: node name `%s' is an alias for `%s'\n")
#			call pargstr (n_alias[1,j,i])
#			call pargstr (Memc[text])
#		    n = n + 1
#		}
end