date and time created 82/10/02 23:07:54 by comay
authorDavid S. Comay <comay@ucbvax.Berkeley.EDU>
Sun, 3 Oct 1982 15:07:54 +0000 (07:07 -0800)
committerDavid S. Comay <comay@ucbvax.Berkeley.EDU>
Sun, 3 Oct 1982 15:07:54 +0000 (07:07 -0800)
SCCS-vsn: old/berknet/listen.c 4.1

usr/src/old/berknet/listen.c [new file with mode: 0644]

diff --git a/usr/src/old/berknet/listen.c b/usr/src/old/berknet/listen.c
new file mode 100644 (file)
index 0000000..b8b726a
--- /dev/null
@@ -0,0 +1,29 @@
+static char sccsid[] = "@(#)listen.c   4.1     (Berkeley)      %G%";
+
+/*
+       listen.c
+
+       listen for a packet from the program interact.c and print it
+*/
+# include "defs.h"
+main(argc,argv)
+         char **argv;
+{
+       struct packet *pp;
+       char buf[BUFSIZ];
+       setupdaemon(argc,argv);
+       initseqno();
+       putchar('!');
+       fflush(stdout);
+       for(;;){
+               pp = getpacket();
+               printpacket(pp,buf);
+               printf("got %s\n",buf);
+               if(pp == NULL )continue;
+               pp->pcode = ACK;
+               pp->len = 0;
+               sendpacket(pp);
+               printpacket(pp,buf);
+               printf("sent %s\n",buf);
+       }
+}