5 * Creates random packet traces. Useful for debugging sniffers by testing
6 * assumptions about the veracity of the data found in the packet.
8 * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu>
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __RANDPKT_CORE_H__
14 #define __RANDPKT_CORE_H__
17 #include "wiretap/wtap.h"
23 int sample_wtap_encap
;
24 uint8_t* sample_buffer
;
26 uint8_t* pseudo_buffer
;
27 unsigned pseudo_length
;
30 unsigned produce_max_bytes
;
34 /* Return the number of active examples */
35 unsigned randpkt_example_count(void);
37 /* Return the list of the active examples */
38 void randpkt_example_list(char*** abbrev_list
, char*** longname_list
);
40 /* Parse command-line option "type" and return enum type */
41 int randpkt_parse_type(char *string
);
43 /* Find pkt_example record and return pointer to it */
44 randpkt_example
* randpkt_find_example(int type
);
46 /* Init a new example */
47 int randpkt_example_init(randpkt_example
* example
, char* produce_filename
, int produce_max_bytes
, int file_type_subtype
);
49 /* Loop the packet generation */
50 void randpkt_loop(randpkt_example
* example
, uint64_t produce_count
, uint64_t packet_delay_ms
);
52 /* Close the current example */
53 bool randpkt_example_close(randpkt_example
* example
);
58 * Editor modelines - https://www.wireshark.org/tools/modelines.html
66 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
67 * :indentSize=8:tabSize=8:noTabs=false: