Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
randpkt_core.h
Go to the documentation of this file.
1
12
13#ifndef __RANDPKT_CORE_H__
14#define __RANDPKT_CORE_H__
15
16#include <glib.h>
17#include "wiretap/wtap.h"
18
22typedef struct {
23 const char* abbrev;
24 const char* longname;
27 uint8_t* sample_buffer;
29 uint8_t* pseudo_buffer;
30 unsigned pseudo_length;
32 const char* filename;
35
36/* Return the number of active examples */
37
43unsigned randpkt_example_count(void);
44
51void randpkt_example_list(char*** abbrev_list, char*** longname_list);
52
59int randpkt_parse_type(char *string);
60
68
69/* Init a new example */
82int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes, int file_type_subtype);
83
84/* Loop the packet generation */
85
95void randpkt_loop(randpkt_example* example, uint64_t produce_count, uint64_t packet_delay_ms);
96
97/* Close the current example */
98
108
109#endif
110
111/*
112 * Editor modelines - https://www.wireshark.org/tools/modelines.html
113 *
114 * Local variables:
115 * c-basic-offset: 8
116 * tab-width: 8
117 * indent-tabs-mode: t
118 * End:
119 *
120 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
121 * :indentSize=8:tabSize=8:noTabs=false:
122 */
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
Defines a single random packet example type for the randpkt generator.
Definition randpkt_core.h:22
const char * abbrev
Definition randpkt_core.h:23
wtap_dumper * dump
Definition randpkt_core.h:31
uint8_t * sample_buffer
Definition randpkt_core.h:27
const char * longname
Definition randpkt_core.h:24
int sample_wtap_encap
Definition randpkt_core.h:26
int produceable_type
Definition randpkt_core.h:25
const char * filename
Definition randpkt_core.h:32
uint8_t * pseudo_buffer
Definition randpkt_core.h:29
int sample_length
Definition randpkt_core.h:28
unsigned produce_max_bytes
Definition randpkt_core.h:33
unsigned pseudo_length
Definition randpkt_core.h:30
Wiretap dumper handle and associated state.
Definition wtap_module.h:163