Electroneum
Loading...
Searching...
No Matches
replay.h
Go to the documentation of this file.
1/*
2 * testcode/replay.h - store and use a replay of events for the DNS resolver.
3 *
4 * Copyright (c) 2007, NLnet Labs. All rights reserved.
5 *
6 * This software is open source.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * Neither the name of the NLNET LABS nor the names of its contributors may
20 * be used to endorse or promote products derived from this software without
21 * specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
29 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
137
138#ifndef TESTCODE_REPLAY_H
139#define TESTCODE_REPLAY_H
140#include "util/netevent.h"
141#include "testcode/testpkts.h"
142#include "util/rbtree.h"
143struct replay_answer;
144struct replay_moment;
145struct replay_range;
146struct fake_pending;
147struct fake_timer;
148struct replay_var;
149struct infra_cache;
150struct sldns_buffer;
151
173
242
254 socklen_t addrlen;
255
257 struct entry* match;
258
261};
262
321
359
372
382 void (*cb)(void*);
384 void* cb_arg;
388 struct timeval tv;
389};
390
398 char* name;
400 char* value;
401};
402
410struct replay_scenario* replay_scenario_read(FILE* in, const char* name,
411 int* lineno);
412
418
420int replay_var_compare(const void* a, const void* b);
421
424
430
436
445 char* text);
446
454char* macro_lookup(rbtree_type* store, char* name);
455
463int macro_assign(rbtree_type* store, char* name, char* value);
464
467
470
471#endif /* TESTCODE_REPLAY_H */
int comm_point_callback_type(struct comm_point *, void *, int, struct comm_reply *)
Definition netevent.h:76
const GenericPointer< typename T::ValueType > T2 value
Definition pointer.h:1225
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1124
char * macro_process(rbtree_type *store, struct replay_runtime *runtime, char *text)
char * macro_lookup(rbtree_type *store, char *name)
void macro_store_delete(rbtree_type *store)
void macro_print_debug(rbtree_type *store)
void replay_scenario_delete(struct replay_scenario *scen)
struct replay_scenario * replay_scenario_read(FILE *in, const char *name, int *lineno)
void testbound_selftest(void)
int macro_assign(rbtree_type *store, char *name, char *value)
int replay_var_compare(const void *a, const void *b)
rbtree_type * macro_store_create(void)
struct fake_timer * replay_get_oldest_timer(struct replay_runtime *runtime)
unsigned char uint8_t
Definition stdint.h:124
struct replay_runtime * runtime
Definition replay.h:357
void * cb_arg
Definition replay.h:341
enum transport_type transport
Definition replay.h:351
int timeout
Definition replay.h:343
int tcp_pkt_counter
Definition replay.h:355
int serviced
Definition replay.h:353
struct fake_pending * next
Definition replay.h:346
socklen_t addrlen
Definition replay.h:331
struct sldns_buffer * buffer
Definition replay.h:327
size_t zonelen
Definition replay.h:335
comm_point_callback_type * callback
Definition replay.h:339
struct sockaddr_storage addr
Definition replay.h:329
uint8_t * zone
Definition replay.h:333
uint8_t * pkt
Definition replay.h:348
size_t pkt_len
Definition replay.h:349
void(* cb)(void *)
Definition replay.h:382
int enabled
Definition replay.h:386
void * cb_arg
Definition replay.h:384
struct fake_timer * next
Definition replay.h:378
struct replay_runtime * runtime
Definition replay.h:380
struct timeval tv
Definition replay.h:388
struct replay_answer * next
Definition replay.h:365
uint8_t * pkt
Definition replay.h:369
size_t pkt_len
Definition replay.h:370
struct comm_reply repinfo
Definition replay.h:367
enum replay_moment::replay_event_type evt_type
char * autotrust_id
Definition replay.h:238
socklen_t addrlen
Definition replay.h:230
char * string
Definition replay.h:235
int time_step
Definition replay.h:185
struct sockaddr_storage addr
Definition replay.h:228
@ repevt_infra_rtt
Definition replay.h:214
@ repevt_back_query
Definition replay.h:204
@ repevt_front_reply
Definition replay.h:196
@ repevt_front_query
Definition replay.h:194
@ repevt_autotrust_check
Definition replay.h:206
@ repevt_time_passes
Definition replay.h:200
@ repevt_tempfile_check
Definition replay.h:208
@ repevt_back_reply
Definition replay.h:202
struct timeval elapse
Definition replay.h:225
char * variable
Definition replay.h:233
struct replay_moment * mom_next
Definition replay.h:187
struct config_strlist * file_content
Definition replay.h:240
struct entry * match
Definition replay.h:222
struct replay_range * next_range
Definition replay.h:260
struct sockaddr_storage addr
Definition replay.h:252
int start_step
Definition replay.h:248
socklen_t addrlen
Definition replay.h:254
int end_step
Definition replay.h:250
struct entry * match
Definition replay.h:257
struct fake_timer * timer_list
Definition replay.h:291
struct replay_answer * answer_last
Definition replay.h:288
struct timeval now_tv
Definition replay.h:304
struct infra_cache * infra
Definition replay.h:299
struct replay_moment * now
Definition replay.h:274
void(* sig_cb)(int, void *)
Definition replay.h:307
size_t bufsize
Definition replay.h:314
struct replay_answer * answer_list
Definition replay.h:285
comm_point_callback_type * callback_query
Definition replay.h:294
time_t now_secs
Definition replay.h:302
void * sig_cb_arg
Definition replay.h:309
rbtree_type * vars
Definition replay.h:319
int exit_cleanly
Definition replay.h:311
struct replay_scenario * scenario
Definition replay.h:270
void * cb_arg
Definition replay.h:296
struct fake_pending * pending_list
Definition replay.h:280
struct replay_moment * mom_last
Definition replay.h:162
char * title
Definition replay.h:157
struct replay_range * range_list
Definition replay.h:171
struct replay_moment * mom_first
Definition replay.h:160
char * value
Definition replay.h:400
rbnode_type node
Definition replay.h:396
char * name
Definition replay.h:398