Commit 84c4c99c authored by Michael Sawyer's avatar Michael Sawyer
Browse files

290. [cleanup] +twiddle option to dig (for testing only) removed.

parent e3b58cfb
290. [cleanup] +twiddle option to dig (for testing only) removed.
289. [cleanup] dig is now installed in $bindir instead of $sbindir.
host is now installed in $bindir. (Be sure to remove
any $sbindir/dig from a previous release.)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dig.c,v 1.51 2000/06/23 16:53:53 marka Exp $ */
/* $Id: dig.c,v 1.52 2000/06/28 18:20:41 mws Exp $ */
#include <config.h>
#include <stdlib.h>
......@@ -57,9 +57,6 @@ extern int ndots;
extern int tries;
extern int lookup_counter;
extern char fixeddomain[MXNAME];
#ifdef TWIDDLE
extern isc_boolean_t twiddle;
#endif
extern int exitcode;
extern isc_sockaddr_t bind_address;
extern char keynametext[MXNAME];
......@@ -151,9 +148,6 @@ show_usage(void) {
" +[no]recursive (Recursive mode)\n"
" +[no]aaonly (Set AA flag in query)\n"
" +[no]details (Show details of all requests)\n"
#ifdef TWIDDLE
" +twiddle (Intentionally form bad requests)\n"
#endif
" +ndots=### (Set NDOTS value)\n"
" +[no]comments (Control display of comment lines)\n"
" +[no]question (Control display of question)\n"
......@@ -921,10 +915,6 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
comments = ISC_FALSE;
}
#ifdef TWIDDLE
} else if (strncmp(rv[0], "+twiddle", 6) == 0) {
twiddle = ISC_TRUE;
#endif
} else if (strncmp(rv[0], "-c", 2) == 0) {
if (have_host) {
if (rv[0][2] != 0) {
......@@ -1220,28 +1210,11 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
int
main(int argc, char **argv) {
#ifdef TWIDDLE
FILE *fp;
int i, p;
#endif
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
debug ("dhmain()");
#ifdef TWIDDLE
fp = fopen("/dev/urandom", "r");
if (fp != NULL) {
fread (&i, sizeof(int), 1, fp);
srandom(i);
}
else {
srandom ((int)&main);
}
p = getpid()%16+8;
for (i = 0 ; i<p; i++);
#endif
setup_libs();
parse_args(ISC_FALSE, argc, argv);
setup_system();
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dighost.c,v 1.60 2000/06/27 23:18:14 mws Exp $ */
/* $Id: dighost.c,v 1.61 2000/06/28 18:20:43 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
......@@ -69,9 +69,6 @@ ISC_LIST(dig_searchlist_t) search_list;
isc_boolean_t have_ipv6 = ISC_FALSE, specified_source = ISC_FALSE,
free_now = ISC_FALSE, show_details = ISC_FALSE, usesearch=ISC_TRUE,
qr = ISC_FALSE, is_dst_up = ISC_FALSE;
#ifdef TWIDDLE
isc_boolean_t twiddle = ISC_FALSE;
#endif
in_port_t port = 53;
unsigned int timeout = 5;
isc_mem_t *mctx = NULL;
......@@ -222,33 +219,6 @@ istype(char *text) {
return ISC_FALSE;
}
#ifdef TWIDDLE
void
twiddlebuf(isc_buffer_t buf) {
isc_region_t r;
int len, pos, bit;
unsigned char bitfield;
int i, tw;
hex_dump(&buf);
tw=TWIDDLE;
printf ("Twiddling %d bits: ", tw);
for (i=0;i<tw;i++) {
isc_buffer_usedregion (&buf, &r);
len = r.length;
pos=(int)random();
pos = pos%len;
bit = (int)random()%8;
bitfield = 1 << bit;
printf ("%d@%03x ", bit, pos);
r.base[pos] ^= bitfield;
}
puts ("");
hex_dump(&buf);
}
#endif
dig_lookup_t
*requeue_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
dig_lookup_t *looknew;
......@@ -1231,11 +1201,6 @@ send_udp(dig_lookup_t *lookup) {
check_result(result, "isc_socket_recvv");
sendcount++;
debug("Sent count number %d", sendcount);
#ifdef TWIDDLE
if (twiddle) {
twiddlebuf(lookup->sendbuf);
}
#endif
ISC_LIST_ENQUEUE(query->sendlist, &lookup->sendbuf, link);
debug("Sending a request.");
result = isc_time_now(&query->time_sent);
......@@ -1400,11 +1365,6 @@ launch_next_query(dig_query_t *query, isc_boolean_t include_question) {
isc_buffer_putuint16(&query->slbuf, query->lookup->sendbuf.used);
ISC_LIST_ENQUEUE(query->sendlist, &query->slbuf, link);
if (include_question) {
#ifdef TWIDDLE
if (twiddle) {
twiddlebuf(query->lookup->sendbuf);
}
#endif
ISC_LIST_ENQUEUE(query->sendlist, &query->lookup->sendbuf,
link);
}
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: host.c,v 1.29 2000/06/22 22:37:31 mws Exp $ */
/* $Id: host.c,v 1.30 2000/06/28 18:20:44 mws Exp $ */
#include <config.h>
#include <stdlib.h>
......@@ -685,28 +685,11 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
int
main(int argc, char **argv) {
#ifdef TWIDDLE
FILE *fp;
int i, p;
#endif
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
debug ("dhmain()");
#ifdef TWIDDLE
fp = fopen("/dev/urandom", "r");
if (fp != NULL) {
fread (&i, sizeof(int), 1, fp);
srandom(i);
}
else {
srandom ((int)&main);
}
p = getpid() % 16 + 8;
for (i = 0 ; i < p; i++);
#endif
setup_libs();
parse_args(ISC_FALSE, argc, argv);
setup_system();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment