Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!qantel!lll-lcc!lll-crg!seismo!brl-adm!brl-smoke!smoke!rgoguen@bbn-vax.arpa From: rgoguen@bbn-vax.arpa (Robert J Goguen) Newsgroups: net.unix-wizards Subject: A change to /etc/gettable 4.2bsd Message-ID: <356@brl-smoke.ARPA> Date: Mon, 28-Apr-86 13:52:01 EDT Article-I.D.: brl-smok.356 Posted: Mon Apr 28 13:52:01 1986 Date-Received: Fri, 2-May-86 22:45:53 EDT Sender: news@brl-smoke.ARPA Lines: 66 Recently I recieved several complaints from the adminstrator at the NIC in regards to too many ftp connections retreiving the host table . To help in cutting down the number of times I pulled over a "new" host table , I modified the sources to /etc/gettable to allow a command to be sent to the "nicname" server. The following commands are allowed. 1.) all - this is the default and it gets the entire host table 2.) version - gets the sequential version number 3.) "hname host" - gets the adddres of that particular host 4.) "haddr address" - gets the hostname of that particular address /etc/gettable is used the exact same way except a "-c" was added to over-ride the default ALL command . e.g /etc/gettable sri-nic -c version The above command would retreive the current version number from the hostname server at sri-nic and place it in host.txt. I could then use this current version number and compare it to my current version number and decide on whether or not I retreive the host table . Following is a diff on the sources . diff gettable.new.c gettable.old.c ------------------------------------------------------------------------------- 0a1 > 13a15 > #define QUERY "version\r\n" /* query to hostname server */ 30d31 < char QUERY[80] ; 34d34 < strcpy(QUERY,"ALL\r\n"); 36,37c36,37 < if (argc < 1 || argc > 4) { < fprintf(stderr,"usage: gettable host [ file ] [-c command ]\n"); --- > if (argc < 1 || argc > 2) { > fprintf(stderr, "usage: gettable host [ file ]\n"); 45,61c45,46 < while ( argc > 0 ) < { /* parse command line arguements */ < if (( argv[0][0] == '-') && ( argv[0][1] == 'c' )) < { < ++argv ; < --argc ; < strcpy(QUERY,*argv); < strcat(QUERY,"\r\n"); < } < else < if ( *host == NULL ) < host = *argv ; < else < outfile = *argv ; < ++argv ; < --argc ; < } --- > host = *argv; > argv++, argc--; 67a53,54 > if (argc > 0) > outfile = *argv;