Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
randpkt_core.h
Go to the documentation of this file.
1
13#ifndef __RANDPKT_CORE_H__
14#define __RANDPKT_CORE_H__
15
16#include <glib.h>
17#include "wiretap/wtap.h"
18
19typedef struct {
20 const char* abbrev;
21 const char* longname;
22 int produceable_type;
23 int sample_wtap_encap;
24 uint8_t* sample_buffer;
25 int sample_length;
26 uint8_t* pseudo_buffer;
27 unsigned pseudo_length;
28 wtap_dumper* dump;
29 const char* filename;
30 unsigned produce_max_bytes;
31
33
34/* Return the number of active examples */
35
41unsigned randpkt_example_count(void);
42
49void randpkt_example_list(char*** abbrev_list, char*** longname_list);
50
57int randpkt_parse_type(char *string);
58
66
67/* Init a new example */
80int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes, int file_type_subtype);
81
82/* Loop the packet generation */
83
93void randpkt_loop(randpkt_example* example, uint64_t produce_count, uint64_t packet_delay_ms);
94
95/* Close the current example */
96
106
107#endif
108
109/*
110 * Editor modelines - https://www.wireshark.org/tools/modelines.html
111 *
112 * Local variables:
113 * c-basic-offset: 8
114 * tab-width: 8
115 * indent-tabs-mode: t
116 * End:
117 *
118 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
119 * :indentSize=8:tabSize=8:noTabs=false:
120 */
int randpkt_example_init(randpkt_example *example, char *produce_filename, int produce_max_bytes, int file_type_subtype)
Initializes a random packet example with parameters for packet production.
Definition randpkt_core.c:656
randpkt_example * randpkt_find_example(int type)
Find pkt_example record and return pointer to it.
Definition randpkt_core.c:540
void randpkt_example_list(char ***abbrev_list, char ***longname_list)
Returns the list of active examples, including their abbreviations and long names.
Definition randpkt_core.c:720
bool randpkt_example_close(randpkt_example *example)
Closes a random packet example.
Definition randpkt_core.c:637
int randpkt_parse_type(char *string)
Parse command-line option "type" and return enum type.
Definition randpkt_core.c:699
unsigned randpkt_example_count(void)
Return the count of active examples.
Definition randpkt_core.c:534
void randpkt_loop(randpkt_example *example, uint64_t produce_count, uint64_t packet_delay_ms)
Loops to produce a specified number of random packets with a given delay.
Definition randpkt_core.c:556
Definition randpkt_core.h:19
Wiretap dumper handle and associated state.
Definition wtap_module.h:163