Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
randpkt_core.h
1 /*
2  * randpkt_core.h
3  * ---------
4  * Creates random packet traces. Useful for debugging sniffers by testing
5  * assumptions about the veracity of the data found in the packet.
6  *
7  * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu>
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  */
11 
12 #ifndef __RANDPKT_CORE_H__
13 #define __RANDPKT_CORE_H__
14 
15 #include <glib.h>
16 #include "wiretap/wtap.h"
17 
18 typedef struct {
19  const char* abbrev;
20  const char* longname;
21  int produceable_type;
22  int sample_wtap_encap;
23  guint8* sample_buffer;
24  int sample_length;
25  guint8* pseudo_buffer;
26  guint pseudo_length;
27  wtap_dumper* dump;
28  const char* filename;
29  guint produce_max_bytes;
30 
32 
33 /* Return the number of active examples */
34 guint randpkt_example_count(void);
35 
36 /* Return the list of the active examples */
37 void randpkt_example_list(char*** abbrev_list, char*** longname_list);
38 
39 /* Parse command-line option "type" and return enum type */
40 int randpkt_parse_type(char *string);
41 
42 /* Find pkt_example record and return pointer to it */
43 randpkt_example* randpkt_find_example(int type);
44 
45 /* Init a new example */
46 int randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes);
47 
48 /* Loop the packet generation */
49 void randpkt_loop(randpkt_example* example, guint64 produce_count);
50 
51 /* Close the current example */
52 gboolean randpkt_example_close(randpkt_example* example);
53 
54 #endif
55 
56 /*
57  * Editor modelines - http://www.wireshark.org/tools/modelines.html
58  *
59  * Local variables:
60  * c-basic-offset: 8
61  * tab-width: 8
62  * indent-tabs-mode: t
63  * End:
64  *
65  * vi: set shiftwidth=8 tabstop=8 noexpandtab:
66  * :indentSize=8:tabSize=8:noTabs=false:
67  */
Definition: randpkt_core.h:18
Definition: wtap-int.h:86