/*
* Copyright (c) 1980 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that this notice is preserved and that due credit is given
+ * to the University of California at Berkeley. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
*/
#ifndef lint
-static char sccsid[] = "@(#)query.c 5.7 (Berkeley) 5/15/86";
-#endif not lint
+char copyright[] =
+"@(#) Copyright (c) 1980 Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#ifndef lint
+static char sccsid[] = "@(#)query.c 5.9 (Berkeley) 6/11/88";
+#endif /* not lint */
#include <sys/param.h>
#include <sys/protosw.h>
{
int cc, count, bits;
struct sockaddr from;
- int fromlen = sizeof(from);
+ int fromlen = sizeof(from), size = 32*1024;
struct timeval shorttime;
if (argc < 2) {
perror("socket");
exit(2);
}
+ if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) < 0)
+ perror("setsockopt SO_RCVBUF");
argv++, argc--;
if (*argv[0] == '-') {
rip_input(&from, cc);
count--;
}
+ exit (count > 0 ? count : 0);
}
query(host)
if (hp)
name = hp->h_name;
}
- printf("\t%s(%s), metric %d\n", name,
- inet_ntoa(sin->sin_addr), n->rip_metric);
+ printf("\t%-17s metric %2d name %s\n",
+ inet_ntoa(sin->sin_addr), n->rip_metric, name);
} else
- printf("\t%s, metric %d\n",
+ printf("\t%-17s metric %2d\n",
inet_ntoa(sin->sin_addr), n->rip_metric);
break;
}