summaryrefslogtreecommitdiff
path: root/randpkt_core/randpkt_core.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-02-14 17:00:38 -0800
committerGuy Harris <guy@alum.mit.edu>2016-02-15 08:31:06 +0000
commit58d00bad1a2c4298bd58013e4808899feb657422 (patch)
treec609d6f4b56c9f99432f4da736797af94161952c /randpkt_core/randpkt_core.h
parent21ab9b2cbefeb73cdc605a90e8980240452567c0 (diff)
downloadwireshark-58d00bad1a2c4298bd58013e4808899feb657422.tar.gz
Build the extcap programs in the extcap directory.
That lets the version of Wireshark built with autotools find the extcap programs. Don't install the extcap programs under ${datadir} - that puts it under a share directory, and share directories are for platform-independent files, which executable images aren't (they're instruction-set dependent, hence platform-dependent). Change-Id: I992eeb984bdbe6b3476777f7114628c83df6080f Reviewed-on: https://code.wireshark.org/review/13943 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'randpkt_core/randpkt_core.h')
-rw-r--r--randpkt_core/randpkt_core.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/randpkt_core/randpkt_core.h b/randpkt_core/randpkt_core.h
new file mode 100644
index 0000000000..35265480cb
--- /dev/null
+++ b/randpkt_core/randpkt_core.h
@@ -0,0 +1,84 @@
+/*
+ * randpkt_core.h
+ * ---------
+ * Creates random packet traces. Useful for debugging sniffers by testing
+ * assumptions about the veracity of the data found in the packet.
+ *
+ * Copyright (C) 1999 by Gilbert Ramirez <gram@alumni.rice.edu>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __RANDPKT_CORE_H__
+#define __RANDPKT_CORE_H__
+
+#include <glib.h>
+#include "wiretap/wtap.h"
+
+#define MAXBYTES_LIMIT 65536
+
+typedef struct {
+ const char* abbrev;
+ const char* longname;
+ int produceable_type;
+ int sample_wtap_encap;
+ guint8* sample_buffer;
+ int sample_length;
+ guint8* pseudo_buffer;
+ guint pseudo_length;
+ wtap_dumper* dump;
+ const char* filename;
+ guint produce_max_bytes;
+
+} randpkt_example;
+
+/* Return the number of active examples */
+guint randpkt_example_count(void);
+
+/* Return the list of the active examples */
+void randpkt_example_list(const char*** abbrev_list, const char*** longname_list, unsigned* list_num);
+
+/* Seed the random-number generator */
+void randpkt_seed(void);
+
+/* Parse command-line option "type" and return enum type */
+int randpkt_parse_type(char *string);
+
+/* Find pkt_example record and return pointer to it */
+randpkt_example* randpkt_find_example(int type);
+
+/* Init a new example */
+void randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes);
+
+/* Loop the packet generation */
+void randpkt_loop(randpkt_example* example, guint64 produce_count);
+
+/* Close the current example */
+gboolean randpkt_example_close(randpkt_example* example);
+
+#endif
+
+/*
+ * Editor modelines - http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=4 noexpandtab:
+ * :indentSize=4:tabSize=4:noTabs=false:
+ */