4 * Creates random packet traces. Useful for debugging sniffers by testing
5 * assumptions about the veracity of the data found in the packet.
7 * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu>
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.
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.
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.
24 #ifndef __RANDPKT_CORE_H__
25 #define __RANDPKT_CORE_H__
28 #include "wiretap/wtap.h"
34 int sample_wtap_encap;
35 guint8* sample_buffer;
37 guint8* pseudo_buffer;
41 guint produce_max_bytes;
45 /* Return the number of active examples */
46 guint randpkt_example_count(void);
48 /* Return the list of the active examples */
49 void randpkt_example_list(const char*** abbrev_list, const char*** longname_list, unsigned* list_num);
51 /* Seed the random-number generator */
52 void randpkt_seed(void);
54 /* Parse command-line option "type" and return enum type */
55 int randpkt_parse_type(char *string);
57 /* Find pkt_example record and return pointer to it */
58 randpkt_example* randpkt_find_example(int type);
60 /* Init a new example */
61 void randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes);
63 /* Loop the packet generation */
64 void randpkt_loop(randpkt_example* example, guint64 produce_count);
66 /* Close the current example */
67 gboolean randpkt_example_close(randpkt_example* example);