; any additional actions to do.
; 'copy_id' copies the ID from the query to the answer.
ADJUST copy_id
+ ; 'sleep=10' sleeps for 10 seconds before giving the answer (TCP is open)
+ ADJUST [sleep=<num>]
SECTION QUESTION
<RRs, one per line> ; the RRcount is determined automatically.
SECTION ANSWER
/* how to adjust the reply packet */
bool copy_id; /* copy over the ID from the query into the answer */
+ int sleeptime; /* in seconds */
/* next in list */
struct entry* next;
return;
if(str_keyword(&parse, "copy_id")) {
e->copy_id = true;
+ } else if(str_keyword(&parse, "sleep=")) {
+ e->sleeptime = strtol(parse, (char**)&parse, 10);
+ while(isspace(*parse))
+ parse++;
} else {
error("could not parse ADJUST: '%s'", parse);
}
e->match_transport = transport_any;
e->reply_list = NULL;
e->copy_id = false;
+ e->sleeptime = 0;
e->next = NULL;
return e;
}
/* copy & adjust packet */
if(match->copy_id)
ldns_pkt_set_id(answer_pkt, ldns_pkt_id(query_pkt));
+ if(match->sleeptime > 0) {
+ if(verbose) log_msg("sleeping for %d seconds\n", match->sleeptime);
+ sleep(match->sleeptime);
+ }
}
/*