1Use the following configuration file, tcp.1.conf: 2 3tcp/ tcp tcp/ 4 5Now mount it, and cat the contents of /p/tcp/localhost/daytime: 6% mkdir portal 7% mount_portal /usr/share/examples/mount_portal/tcp.1.conf `pwd`/portal 8% cat portal/tcp/localhost/daytime 9Thu Aug 5 23:31:21 1999 10 11Philosophy: With a pathname of <path to mountpount>/tcp/a/b[/priv], 12the portal daemon opens a connection to host a, port b. If /priv 13is specified, the socket will be created via rresvport(), rather 14than socket(). 15 16For the above example, we open a connection to the daytime port 17(port 13, according to /etc/services), and read data. 18 19 20Advanced usage: finger 21Using the already-mounted portal file system, open a connection 22to the finger daemon, and do a finger. Use the simple C program 23in fing.c in this directory. 24 25% make fing 26cc -O2 -o fing fing.c 27% fing 28Login Name Tty Idle Login Time Office Office Phone 29bgrayson Brian C. Grayson p0 - Thu 22:31 ENS406 30bgrayson Brian C. Grayson p1 10 Thu 22:32 ENS406 31bgrayson Brian C. Grayson p2 - Thu 23:20 ENS406 32% fing root 33Login: root Name: Root @ marvin 34Directory: /root Shell: /bin/tcsh 35Last login Wed Aug 4 18:11 (CDT) on ttyp1 from c3p0.ece.utexas. 36... 37 38Philosophy: fing.c opens portal/tcp/localhost/finger as a 39read-write file. First, we write the username for the finger (or 40a blank line to see all users), then we read the results sent 41over the socket. 42