tcp.1 revision 1.2
11.1SbgraysonUse the following configuration file, tcp.1.conf: 21.1Sbgrayson 31.1Sbgraysontcp/ tcp tcp/ 41.1Sbgrayson 51.1SbgraysonNow mount it, and cat the contents of /p/tcp/localhost/daytime: 61.1Sbgrayson% mkdir portal 71.1Sbgrayson% mount_portal /usr/share/examples/mount_portal/tcp.1.conf `pwd`/portal 81.1Sbgrayson% cat portal/tcp/localhost/daytime 91.1SbgraysonThu Aug 5 23:31:21 1999 101.1Sbgrayson 111.1SbgraysonPhilosophy: With a pathname of <path to mountpount>/tcp/a/b[/priv], 121.1Sbgraysonthe portal daemon opens a connection to host a, port b. If /priv 131.1Sbgraysonis specified, the socket will be created via rresvport(), rather 141.1Sbgraysonthan socket(). 151.1Sbgrayson 161.1SbgraysonFor the above example, we open a connection to the daytime port 171.1Sbgrayson(port 13, according to /etc/services), and read data. 181.1Sbgrayson 191.1Sbgrayson 201.1SbgraysonAdvanced usage: finger 211.1SbgraysonUsing the already-mounted portal file system, open a connection 221.1Sbgraysonto the finger daemon, and do a finger. Use the simple C program 231.1Sbgraysonin fing.c in this directory. 241.1Sbgrayson 251.1Sbgrayson% make fing 261.2Swizcc -O2 -o fing fing.c 271.1Sbgrayson% fing 281.1SbgraysonLogin Name Tty Idle Login Time Office Office Phone 291.2Swizbgrayson Brian C. Grayson p0 - Thu 22:31 ENS406 301.2Swizbgrayson Brian C. Grayson p1 10 Thu 22:32 ENS406 311.2Swizbgrayson Brian C. Grayson p2 - Thu 23:20 ENS406 321.1Sbgrayson% fing root 331.1SbgraysonLogin: root Name: Root @ marvin 341.1SbgraysonDirectory: /root Shell: /bin/tcsh 351.1SbgraysonLast login Wed Aug 4 18:11 (CDT) on ttyp1 from c3p0.ece.utexas. 361.1Sbgrayson... 371.1Sbgrayson 381.1SbgraysonPhilosophy: fing.c opens portal/tcp/localhost/finger as a 391.1Sbgraysonread-write file. First, we write the username for the finger (or 401.1Sbgraysona blank line to see all users), then we read the results sent 411.1Sbgraysonover the socket. 42