Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site k.cs.cmu.edu Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!qantel!lll-crg!seismo!rochester!pt.cs.cmu.edu!k.cs.cmu.edu!tim From: tim@k.cs.cmu.edu (Tim Maroney) Newsgroups: net.sources.mac Subject: Macintosh Internet Protocols (1 of 12 -- run me first!) Message-ID: <660@k.cs.cmu.edu> Date: Tue, 26-Nov-85 04:50:56 EST Article-I.D.: k.660 Posted: Tue Nov 26 04:50:56 1985 Date-Received: Fri, 29-Nov-85 21:25:10 EST Organization: Carnegie-Mellon University, Networking Lines: 618 # use "sh" (not "csh") to unpack these archives mkdir copyright mkdir appl mkdir t mkdir net mkdir sfmget # echo extracting copyright/notice.text... cat >copyright/notice.text <<'!E!O!F!' The Lisa Pascal distribution of MacIP is Copyright 1985 by Carnegie-Mellon University. It is made available for public use without fee, and without warranties express or implied. It is derived from the MIT version of the Internet protocols for the IBM PC, the copyright notice for which appears directly below. Initial work on the MacIP package was done by Mark Sherman; his copyright notice is shown at bottom. The current version was done by Tim Maroney at C-MU. Copyright 1983, 1984 Massachusetts Institute of Technology Permission to use, copy, modify, and distribute this program for any purpose and without fee is hereby granted, provided that this copyright and permission notice appear on all copies and supporting documentation, the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the program without specific prior permission, and notice be given in supporting documentation that copying and distribution is by permission of M.I.T. M.I.T. makes no representations about the suitability of this software for any purpose. It is pro- vided "as is" without express or implied warranty. Copyright 1984 Mark Sherman Permission to use, copy, modify, and distribute this program for any purpose and without fee is hereby granted, provided that this copyright and permission notice appear on all copies and supporting documentation, the name of Mark Sherman not be used in advertising or publicity pertaining to distribution of the program without specific prior permission, and notice be given in supporting documentation that copying and distribution is by permission of Mark Sherman. Mark Sherman makes no representations about the suitability of this software for any purpose. It is pro- vided "as is" without express or implied warranty. People acquiring, modifying or using this version of the software are requested to let the author know by sending correspondence to: Mark Sherman Department of Mathematics and Computer Science Dartmouth College Hanover, NH 03755 Mark.Sherman@CMU-CS-A.ARPA mss@Dartmouth.CSNet ...decvax!dartvax!mss !E!O!F! # # echo extracting t/applback.text... cat >t/applback.text <<'!E!O!F!' $EXEC R{un}bin-maccom S{ettings}C{onvert Text}Y{es} Y{es to filename searches} F{inder}TEXT{type} EDIT{Creator} Y{es bundle bit} N{o. don't always prompt} Q{uit settings} Lappl-cust.text appl/cust.text Lappl-tftp.text appl/tftp.text Lappl-telnet.text appl/telnet.text Lappl-custr.text appl/custr.text Lappl-tftpr.text appl/tftpr.text Lappl-telnetr.text appl/telnetr.text Lappl-cust.link.text appl/cust.link.text Lappl-tftp.link.text appl/tftp.link.text Lappl-telnet.link.text appl/telnet.link.text Lappl-custo.text appl/custo.text Lappl-tftpo.text appl/tftpo.text Lappl-telneto.text appl/telneto.text Lcopyright-notice.text copyright/notice.text Lt-assemble.text t/assemble.text Lt-compile.text t/compile.text Lt-depend.text t/depend.text Lt-link.text t/link.text Lt-make.text t/make.text Lt-netback.text t/netback.text Lt-applback.text t/applback.text Lsfmget-sfmgetfile.text sfmget/sfmgetfile.text Lsfmget-sfmgetr.text sfmget/sfmgetr.text Lsfmget-sfmtest.text sfmget/sfmtest.text Lsfmget-sfmtesto.text sfmget/sfmtesto.text Lsfmget-sfmtestr.text sfmget/sfmtestr.text Lsfmget-sfmget_asm.text sfmget/sfmget_asm.text Lsfmget-make.text sfmget/make.text E{ject}Q{uit} $ENDEXEC !E!O!F! # # echo extracting t/assemble.text... cat >t/assemble.text <<'!E!O!F!' $EXEC $if not (exists("-upper-%0.obj")) then A{ssemble}%0 { input file: PROG.TEXT where PROG is the argument } {no listing file} %0 {output file PROG.OBJ} $elseif newer("-upper-%0.text","-upper-%0.obj") then A{ssemble}%0 { input file: PROG.TEXT where PROG is the argument } {no listing file} %0 {output file PROG.OBJ} $endif $DOIT $ENDEXEC !E!O!F! # # echo extracting t/compile.text... cat >t/compile.text <<'!E!O!F!' $EXEC P{ascal compiler}%0 { input file: PROG.TEXT where PROG is the argument } {no listing file} %0 {output file PROG.I} $DOIT { forces compilation now so later dating will be right } $ENDEXEC !E!O!F! # # echo extracting t/depend.text... cat >t/depend.text <<'!E!O!F!' * *{ Please note the copyright notice in the file "copyright/notice" } * EXEC(progfile,dep1,dep2,dep3,dep4,dep5,dep6,dep7,dep8) { t-depend provides a make-like facility in which a Pascal ".text" file may be compiled or not depending on whether it is up to date with respect to ".obj" files it depends on. It is recursive, and is meant to be submitted from another exec file, as shown: SUBMIT t-depend(progfile,dep1,dep2,...,dep8) } IF dep1 = '' THEN { no dependencies given or left } IF NEWER("-upper-[progfile].text","-upper-[progfile].obj") THEN clear screen writeln "[progfile].text is newer than [progfile].obj" SUBMIT t-compile([progfile]) ENDIF ELSEIF NEWER("-upper-[dep1].obj","-upper-[progfile].obj") THEN clear screen writeln "[dep1].obj is newer than [progfile].obj" SUBMIT t-compile([progfile]) ELSE SUBMIT t-depend([progfile],[dep2],[dep3],[dep4],[dep5],[dep6],[dep7],[dep8]) ENDIF ENDEXEC !E!O!F! # # echo extracting t/link.text... cat >t/link.text <<'!E!O!F!' $EXEC { USAGE: RMac} %0 APPL { set type to APPL } %1 { set creator to second arg } Y{es, bundle bit}Q{uit} $DOIT $ENDEXEC !E!O!F! # # echo extracting t/make.text... cat >t/make.text <<'!E!O!F!' EXEC submit t-assemble(net-task_asm) submit t-assemble(net-call_asm) submit t-assemble(net-ip_listen) submit t-depend(net-calls,net-call_asm) submit t-depend(net-err_lib) submit t-depend(net-timer_lib) submit t-depend(net-cust_lib) submit t-depend(net-task_lib,net-err_lib,net-task_asm) submit t-depend(net-ip_lib,net-task_lib,net-timer_lib,net-calls,net-err_lib) submit t-depend(net-ip_lib,net-cust_lib) submit t-depend(net-name_host,net-task_lib,net-timer_lib,net-ip_lib) submit t-depend(net-icmp_lib,net-task_lib,net-timer_lib,net-ip_lib) submit t-depend(net-icmp_lib,net-calls,net-err_lib) submit t-depend(net-arp_lib,net-task_lib,net-ip_lib,net-timer_lib) submit t-depend(net-udp_lib,net-task_lib,net-timer_lib) submit t-depend(net-udp_lib,net-ip_lib,net-icmp_lib,net-calls,net-err_lib) submit t-depend(net-name_user,net-task_lib,net-timer_lib) submit t-depend(net-name_user,net-udp_lib,net-ip_lib,net-err_lib) submit t-depend(net-tftp_defs,net-task_lib,net-timer_lib,net-err_lib) submit t-depend(net-tftp_defs,net-ip_lib,net-udp_lib,net-calls) submit t-depend(net-tftp_file,net-task_lib,net-timer_lib,net-err_lib) submit t-depend(net-tftp_file,net-ip_lib,net-udp_lib,net-calls,net-tftp_defs) submit t-depend(net-tftp_lib,net-task_lib,net-timer_lib,net-err_lib,net-ip_lib) submit t-depend(net-tftp_lib,net-udp_lib,net-calls,net-tftp_defs,net-tftp_file) submit t-depend(net-term_lib) submit t-depend(net-tcp_lib,net-task_lib,net-timer_lib) submit t-depend(net-tcp_lib,net-ip_lib,net-calls,net-err_lib,net-term_lib) submit t-depend(net-tn_lib,net-task_lib,net-timer_lib,net-name_host,net-tftp_defs) submit t-depend(net-tn_lib,net-ip_lib,net-tcp_lib,net-udp_lib,net-tftp_lib) submit t-depend(net-tn_lib,net-name_user,net-err_lib,net-term_lib,net-calls) submit t-depend(appl-cust,net-task_lib,net-ip_lib,net-name_user,net-cust_lib) submit t-depend(appl-tftp,net-task_lib,net-timer_lib,net-name_host,net-arp_lib) submit t-depend(appl-tftp,net-ip_listen,net-ip_lib,net-udp_lib,net-tftp_defs) submit t-depend(appl-tftp,net-name_user,net-tftp_lib,net-err_lib,net-icmp_lib) submit t-depend(appl-telnet,net-task_lib,net-timer_lib,net-err_lib,net-arp_lib) submit t-depend(appl-telnet,net-ip_listen,net-ip_lib,net-udp_lib) submit t-depend(appl-telnet,net-tcp_lib,net-tn_lib,net-term_lib,net-icmp_lib) submit t-link(appl-cust,CUST) submit t-link(appl-tftp,TFTP) submit t-link(appl-telnet,TLNT) $rbin-maccom $EQ ENDEXEC !E!O!F! # # echo extracting t/netback.text... cat >t/netback.text <<'!E!O!F!' $EXEC R{un}bin-maccom S{ettings}C{onvert Text}Y{es} Y{es to filename searches} F{inder}TEXT{type} EDIT{Creator} Y{es bundle bit} N{o. don't always prompt} Q{uit settings} Lnet-calls.text net/calls.text Lnet-call_asm.text net/call_asm.text Lnet-err_lib.text net/err_lib.text Lnet-task_lib.text net/task_lib.text Lnet-task_asm.text net/task_asm.text Lnet-timer_lib.text net/timer_lib.text Lnet-cust_lib.text net/cust_lib.text Lnet-name_host.text net/name_host.text Lnet-arp_lib.text net/arp_lib.text Lnet-ip_listen.text net/ip_listen.text Lnet-icmp_lib.text net/icmp_lib.text Lnet-ip_lib.text net/ip_lib.text Lnet-udp_lib.text net/udp_lib.text Lnet-name_user.text net/name_user.text Lnet-tftp_defs.text net/tftp_defs.text Lnet-tftp_file.text net/tftp_file.text Lnet-tftp_lib.text net/tftp_lib.text Lnet-tcp_lib.text net/tcp_lib.text Lnet-term_lib.text net/term_lib.text Lnet-tn_lib.text net/tn_lib.text E{ject}Q{uit} $ENDEXEC !E!O!F! # # echo extracting user... cat >user <<'!E!O!F!' MacIP User Manual Tim Maroney November 1985 ----------------- This paper describes the programs that have been written to allow Apple Macintosh computers on an Appletalk network to communicate with computers on the Internet. In order to use any of these programs, your Macintosh must be connected to an Appletalk network that is connected to a router of some sort. One example of a router is the Seagate router between Appletalk and Ethernet that was developed at Stanford University. Another is the "Butcher Board" router developed at C-MU. This is normally an issue for the system maintenance staff, not a user; it is mentioned here so you won't think that plugging an Appletalk connector into the back of your Mac magically allows you to communicate with the Internet. Three programs are available, CUSTOMIZE, TFTP, and TELNET. CUSTOMIZE manages a customization file that contains various information for use by the other programs; it does not talk to Internet sites directly. TFTP is a simple file transfer program: it can be used to retrieve files to the Macintosh from Internet sites, and vice versa. TELNET is the Internet terminal emulator; with TELNET, you can log on and conduct a session at any Internet site on which you have an account. In order to run any of these programs, double-click its icon, as is normal on the Macintosh. TFTP ---- The TFTP program uses the trivial file transfer protocol running on top of the user datagram protocol to allow reliable file transfer between a Macintosh and an Internet site. The other Internet site may be a Macintosh or another computer. There are two possible modes in the TFTP program, server mode and user mode. The TFTP program can be in one or the other mode, but not both. Initially it is in neither mode; the first selection you make from the "File" menu sets the mode. Server mode is rarely useful: when a Mac is acting as a server, other Internet sites can initiate file transfers to and from it, but the Mac is completely tied up while it is acting as a server. To select server mode, select "Server" from the "File" menu. Once this is selected, the only "File" menu commands available are "Abort" and "Quit". You can still use the commands from the "Show" menu to display information about the status of the network. User mode is the one usually used on the Mac. To select user mode, pick either "Get" or "Put" from the "File" menu. This places you in user mode and begins the file transfer process. In any file transfer there are two files, a local file (the file on the Macintosh) and a remote file (the file on the other Internet site). To get the local file name, the TFTP program uses the Macintosh's standard file package, which will be familiar to you if you have used other Macintosh applications. To get the remote file name, the TFTP program uses a special-purpose remote file dialog. This contains two fields which you can edit, one for the file's name and the other for the name or address of the other Internet site. Both the standard file dialogs and the remote file dialog have buttons marked "OK" and "CANCEL". Clicking in the "OK" button (or hitting the "Return" key on the keyboard) tells the program to go on to the next step of the file transfer. Clicking "CANCEL" tells the program not to go ahead with the file transfer and to return to plain user mode. To get a file from another site to your Mac, use "Get". To put a file from your Macintosh to another site, use "Put". If something is wrong with your transfer, use "Abort" to terminate it. When you are entirely finished with TFTP, use "Quit" to leave the program and return to the Macintosh Finder. The trivial file transfer protocol uses "transfer modes" to control file transfer. The transfer modes provide information about how the file is to be transferred. The Macintosh TFTP provides four transfer modes, which can be selected from the remote file dialog, or from the "Settings" menu. The modes are "ASCII", "IMAGE", "OCTET", and "MACINTOSH". The transfer mode must be selected before you choose "Get" or "Put". The initial transfer mode is ASCII. The first three transfer modes are almost identical, and are the only modes that will be used with non-Macintosh computers in most cases. To transfer a document to or receive a document from a non-Mac computer, you should use "ASCII" or "IMAGE" modes. To transfer an application to or receive an application from a non-Mac computer, you should use "OCTET" mode. To exchange a file with a Macintosh, use "MACINTOSH" mode. Other computers such as Vaxes and Suns will probably not support MACINTOSH mode transfers; check with the system support staff for the computer in question. A Macintosh file actually has two parts or "forks", the data fork and the resource fork, unlike most other computers, on which files have only one part. This was a silly design decision in the Macintosh, since almost all files have one of the forks empty. It can also create problems in file transfer between Macs and other machines. In MACINTOSH transfer mode, both forks (as well as a little bit of data known as the "finder information") are sent, so there is no problem. In ASCII and IMAGE modes, only the data fork is sent: that will work for most documents such as MacWrite text files. In OCTET mode, only the resource fork is sent: this suffices for most Macintosh applications such as MacPaint or MacWrite. In those rare cases when both the resource and data forks are used, and you wish to send the file to a system that does not support MACINTOSH mode file transfers, you should first use one of the file compression programs such as BINHEX (not supplied with the Macintosh Internet programs, but widely available) to compress both forks into the data fork of another file, and then send the BINHEXed file's data fork. After receiving an application in OCTET mode, it will often be necessary to run the "Set File" program, distributed separately, to set the bundle bit and the application's creator. Note: Over the long-haul networks such as ARPANET and USENET, applications are usually transferred in "binhex" or some other converted format, not in the binary form OCTET mode expects. To get an application in binhex format to your Mac via TFTP, use an ASCII mode transfer and then run binhex once the transfer is complete. The "Settings" menu contains a "Remote Directory" command. Usually Macintosh files are sent to a computer such as a UNIX (tm) machine, a TOPS-20 system, or a VMS system, which has a notion of directories. When you "Put" a file, a remote directory prefix will be attached to the beginning of the file name if you have specified a remote directory. For instance, to send all your files into the directory "/usr/you/macfiles" on a UNIX machine, issue the "Remote Directory" command and specify "/usr/you/macfiles/" (note the final slash). To send all your files to the directory "pk:" on a TOPS-20 machine, issue "Remote Directory" and specify "pk:". Remember that the directory is just a string which is stuck onto the beginning of the remote file name; TFTP does not really know anything about directories as such. The file dialog that appears when you "Put" a file is a little different from the standard one for the Macintosh. It has a check box which allows you to select more than one file from the list of files you are given. All files selected will be sent, one after another, until either all are sent or an error happens. (You can bypass the check box and use shift-clicking to select multiple files if you are familiar and comfortable with shift-clicking.) This multiple-file capability is useful if you are using TFTP to back up a number of files, usually program source code files, to some other computer, because you do not have to issue a new "Put" command for each file. All the files will be sent to the same host, with the same directory prefix and transfer mode. The remote file dialog will appear after you have specified multiple file names, allowing you to set the host, the transfer mode, and the remote directory. During file transfer in either user or server mode, some statistics about the transfer will be displayed in a window that will appear on your screen. If you want to get rid of the window, click anywhere in it and it will vanish, reappearing when there is something else to say. The same goes for windows that appear as a result of selecting a command in the "Show" menu. TELNET ------ With TELNET, you can log in to any computer on the Internet for which you have an account. The Macintosh TELNET is different from (and better than) most other TELNET implementations in that you control the session with menu commands instead of hard-to-remember and easy-to-screw-up control codes. The TELNET terminal window emulates a DEC VT100 terminal, a popular type that most host computers should know how to control. To open a connection to another computer, use the "Open" command from the "Commands" menu. You will be asked for the name or address of the remote computer. To continue, click "OK"; to abort the attempt to connect, use "CANCEL". The TELNET program will then try to establish the connection. If it succeeds, the word "Open" will appear in the terminal window and the remote computer will (in most cases) prompt you for your name and password. When you are finished, logging out on the remote computer may automatically close the connection, in which case "Closed" will appear on the screen. If this does not happen, then you can yourself close the connection by using the "Close" command in the "Commands" menu. You can also do this before you log out, but you do not usually want to. The keyboard sends what you would expect. For instance, holding down the clover key and "A" causes a "control-A" to be sent. The chief exception is the key in the upper left-hand corner, which sends an "ESCAPE" character. A tilde ("~") can be sent by holding down "shift" and this key. It is a known bug in this release that there is no way to send a backquote, or any of the control characters associated with the numerical keys, such as "control-^". It is possible to use TFTP from inside TELNET. Thus, you can log on to a remote system, look around in its directories and so forth, and retrieve or send files without having to leave TELNET. This assumes that the remote computer has a TFTP command. The procedure is to issue a TFTP command on the remote system that initiates a file transfer back to your Mac. In order to do this, you will have to know your Mac's Internet address or name, which can be discovered using a command in the "Show" menu. A TFTP server runs alongside TELNET; the command from the remote system will cause that system to try to connect to the server on your Mac. If this succeeds, you will be asked by your Mac to confirm or refuse the file transfer -- ordinarily you will confirm it, since you sent the request in the first place, but it is possible someone else could try to TFTP to or from your machine, in which case you would probably want to deny the request and report the incident to the local security staff. While a file transfer is going on, it is possible but unwise to type characters to the remote system. You will be notified when the transfer is complete. You can deny all TFTP requests from the "Commands" menu; "TFTP Service" is checked if TFTP requests will be serviced as described above. TFTP service inside TELNET can only be used on a Macintosh which has 512K or more memory. It may be used inside Switcher; TELNET is pre-configured for Switcher to allow enough memory for TFTP. It is possible to listen for incoming TELNET requests by using the "Listen" command. This is usually not useful; it was added for testing. It could be used to chat back and forth between two users on different machines: one user would put his Mac in listening state, the other would TELNET to his machine. The two could then type back and forth to each other's terminal windows. It is possible to specify that what you type should not be sent until you type a return, by selecting "Send Immediately" from the "Commands" menu. This command will be checked if TELNET is in the normal state, in which characters are sent as soon as you type them, and not checked if characters will be held until return is typed. This can be useful because it reduces the network overhead of the session. However, it is impossible to see what you've typed until you hit the return, unless TELNET has been given the "Local Echo" command. It is possible to cause data to be sent before typing a return by using the "Expedite Data" command from the "Send" menu. Most computers operate in remote echo mode: characters you type are not directly printed on the screen; they are sent to the remote computer, which then echoes the characters back for printing on your terminal. Computers which operate in local echo mode can be communicated with by selecting "Local Echo" from the "Send" menu after the connection is open. The "Are You There?" command from the "Send" menu checks to see that the remote computer is still connected. If no response is received within a few seconds, TELNET will assume that the remote computer has crashed or otherwise disconnected, and shut down your side of the connection. "Abort Output" and "Break" from the "Send" menu cause special TELNET information to be transmitted. The remote computer may or may not handle these commands. In general, "Abort Output" will keep text that's being sent from being sent, perhaps while a file is being printed on your screen, but the program on the remote computer will not be interrupted. "Break" will do whatever is appropriate on the system you are connected to, usually interrupting the program on the remote computer. As with TFTP, there is a "Show" menu from which various information can be gotten. Any windows created when you select a command from the "Show" menu can be gotten rid of by clicking anywhere in them. Some menu commands in the "Show" menu are permanently disabled; they were removed to allow TELNET to run on a 128K Macintosh or in a small Switcher memory chunk. You should be able to get along just fine without them. In the future, TELNET will save text that scrolls up past the top of the screen, will allow TELNET traffic to be saved into a file, will allow you to send a text file as if you were typing it in, and will allow characters to be printed to the screen at a much higher rate. These MacTerminal-like capabilities are not included in the November 1985 release of TELNET. !E!O!F! exit -=- Tim Maroney, Professional Heretic, CMU Center for Art and Technology tim@k.cs.cmu.edu | uucp: {seismo,decwrl,ucbvax,etc.}!k.cs.cmu.edu!tim CompuServe: 74176,1360 | God is not dead; he just smells funny.