cmake: do not remove ws.css; ignore auto-generated files
[metze/wireshark/wip.git] / 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  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #ifndef __RANDPKT_CORE_H__
25 #define __RANDPKT_CORE_H__
26
27 #include <glib.h>
28 #include "wiretap/wtap.h"
29
30 typedef struct {
31         const char*  abbrev;
32         const char*  longname;
33         int          produceable_type;
34         int          sample_wtap_encap;
35         guint8*      sample_buffer;
36         int          sample_length;
37         guint8*      pseudo_buffer;
38         guint        pseudo_length;
39         wtap_dumper* dump;
40         const char*  filename;
41         guint        produce_max_bytes;
42
43 } randpkt_example;
44
45 /* Return the number of active examples */
46 guint randpkt_example_count(void);
47
48 /* Return the list of the active examples */
49 void randpkt_example_list(const char*** abbrev_list, const char*** longname_list, unsigned* list_num);
50
51 /* Seed the random-number generator */
52 void randpkt_seed(void);
53
54 /* Parse command-line option "type" and return enum type */
55 int randpkt_parse_type(char *string);
56
57 /* Find pkt_example record and return pointer to it */
58 randpkt_example* randpkt_find_example(int type);
59
60 /* Init a new example */
61 void randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes);
62
63 /* Loop the packet generation */
64 void randpkt_loop(randpkt_example* example, guint64 produce_count);
65
66 /* Close the current example */
67 gboolean randpkt_example_close(randpkt_example* example);
68
69 #endif