X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/95f51977ddc18faa2e212f30c00a39540b39f325..ca67e7b465996afb3821d6a075c4dc6a7f0f5d52:/usr/src/etc/routed/tools/query.c?ds=inline diff --git a/usr/src/etc/routed/tools/query.c b/usr/src/etc/routed/tools/query.c index 29ca64ebfd..44092f90ff 100644 --- a/usr/src/etc/routed/tools/query.c +++ b/usr/src/etc/routed/tools/query.c @@ -1,12 +1,24 @@ /* * 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 #include @@ -33,7 +45,7 @@ main(argc, argv) { int cc, count, bits; struct sockaddr from; - int fromlen = sizeof(from); + int fromlen = sizeof(from), size = 32*1024; struct timeval shorttime; if (argc < 2) { @@ -46,6 +58,8 @@ usage: perror("socket"); exit(2); } + if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)) < 0) + perror("setsockopt SO_RCVBUF"); argv++, argc--; if (*argv[0] == '-') { @@ -90,6 +104,7 @@ usage: rip_input(&from, cc); count--; } + exit (count > 0 ? count : 0); } query(host) @@ -197,10 +212,10 @@ rip_input(from, size) 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; }