#include "config.h"
#include "util/log.h"
#include "util/net_help.h"
#include "testcode/replay.h"
#include "testcode/ldns-testpkts.h"
Defines | |
| #define | MAX_LINE_LEN 10240 |
| max length of lines in file | |
Functions | |
| static int | parse_keyword (char **line, char *keyword) |
| parse keyword in string. | |
| static void | replay_moment_delete (struct replay_moment *mom) |
| delete moment | |
| static void | replay_range_delete (struct replay_range *rng) |
| delete range | |
| static void | strip_end_white (char *p) |
| strip whitespace from end of string | |
| static struct replay_range * | replay_range_read (char *remain, FILE *in, const char *name, int *lineno, char *line, uint32_t *ttl, ldns_rdf **or, ldns_rdf **prev) |
| Read a range from file. | |
| static struct replay_moment * | replay_moment_read (char *remain, FILE *in, const char *name, int *lineno, uint32_t *ttl, ldns_rdf **or, ldns_rdf **prev) |
| Read a replay moment 'STEP' from file. | |
| static struct replay_scenario * | make_scenario (char *line) |
| makes scenario with title on rest of line | |
| struct replay_scenario * | replay_scenario_read (FILE *in, const char *name, int *lineno) |
| Read a replay scenario from the file. | |
| void | replay_scenario_delete (struct replay_scenario *scen) |
| Delete scenario. | |
Used to test known scenarios to get known outcomes.
| static int parse_keyword | ( | char ** | line, | |
| char * | keyword | |||
| ) | [static] |
parse keyword in string.
| line,: | if found, the line is advanced to after the keyword. | |
| keyword,: | string. |
Referenced by replay_moment_read(), replay_range_read(), and replay_scenario_read().
| static struct replay_range* replay_range_read | ( | char * | remain, | |
| FILE * | in, | |||
| const char * | name, | |||
| int * | lineno, | |||
| char * | line, | |||
| uint32_t * | ttl, | |||
| ldns_rdf ** | or, | |||
| ldns_rdf ** | prev | |||
| ) | [static, read] |
Read a range from file.
| remain,: | Rest of line (after RANGE keyword). | |
| in,: | file to read from. | |
| name,: | name to print in errors. | |
| lineno,: | incremented as lines are read. | |
| line,: | line buffer. | |
| ttl,: | for readentry | |
| or,: | for readentry | |
| prev,: | for readentry |
References replay_range::addr, replay_range::addrlen, replay_range::end_step, extstrtoaddr(), fatal_exit(), log_err(), replay_range::match, MAX_LINE_LEN, entry::next, parse_keyword(), read_entry(), replay_range_delete(), replay_range::start_step, and strip_end_white().
Referenced by replay_scenario_read().
| static struct replay_moment* replay_moment_read | ( | char * | remain, | |
| FILE * | in, | |||
| const char * | name, | |||
| int * | lineno, | |||
| uint32_t * | ttl, | |||
| ldns_rdf ** | or, | |||
| ldns_rdf ** | prev | |||
| ) | [static, read] |
Read a replay moment 'STEP' from file.
| remain,: | Rest of line (after STEP keyword). | |
| in,: | file to read from. | |
| name,: | name to print in errors. | |
| lineno,: | incremented as lines are read. | |
| ttl,: | for readentry | |
| or,: | for readentry | |
| prev,: | for readentry |
References replay_moment::addr, replay_moment::addrlen, replay_moment::evt_type, extstrtoaddr(), fatal_exit(), log_err(), replay_moment::match, parse_keyword(), read_entry(), replay_moment::repevt_back_query, replay_moment::repevt_back_reply, replay_moment::repevt_error, replay_moment::repevt_front_query, replay_moment::repevt_front_reply, replay_moment::repevt_nothing, replay_moment::repevt_timeout, and replay_moment::time_step.
Referenced by replay_scenario_read().
| struct replay_scenario* replay_scenario_read | ( | FILE * | in, | |
| const char * | name, | |||
| int * | lineno | |||
| ) | [read] |
Read a replay scenario from the file.
| in,: | file to read from. | |
| name,: | name to print in errors. | |
| lineno,: | incremented for every line read. |
References fatal_exit(), log_info(), make_scenario(), MAX_LINE_LEN, replay_scenario::mom_first, replay_scenario::mom_last, replay_moment::mom_next, replay_range::next_range, parse_keyword(), replay_scenario::range_list, replay_moment_read(), replay_range_read(), replay_scenario_delete(), and replay_moment::time_step.
Referenced by setup_playback().
| void replay_scenario_delete | ( | struct replay_scenario * | scen | ) |
Delete scenario.
| scen,: | to delete. |
References replay_scenario::mom_first, replay_moment::mom_next, replay_range::next_range, replay_scenario::range_list, replay_moment_delete(), replay_range_delete(), and replay_scenario::title.
Referenced by fake_event_cleanup(), and replay_scenario_read().
1.5.6