nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 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 | #define MAXBYTES_LIMIT 65536 |
||
31 | |||
32 | typedef struct { |
||
33 | const char* abbrev; |
||
34 | const char* longname; |
||
35 | int produceable_type; |
||
36 | int sample_wtap_encap; |
||
37 | guint8* sample_buffer; |
||
38 | int sample_length; |
||
39 | guint8* pseudo_buffer; |
||
40 | guint pseudo_length; |
||
41 | wtap_dumper* dump; |
||
42 | const char* filename; |
||
43 | guint produce_max_bytes; |
||
44 | |||
45 | } randpkt_example; |
||
46 | |||
47 | /* Return the number of active examples */ |
||
48 | guint randpkt_example_count(void); |
||
49 | |||
50 | /* Return the list of the active examples */ |
||
51 | void randpkt_example_list(char*** abbrev_list, char*** longname_list); |
||
52 | |||
53 | /* Parse command-line option "type" and return enum type */ |
||
54 | int randpkt_parse_type(char *string); |
||
55 | |||
56 | /* Find pkt_example record and return pointer to it */ |
||
57 | randpkt_example* randpkt_find_example(int type); |
||
58 | |||
59 | /* Init a new example */ |
||
60 | void randpkt_example_init(randpkt_example* example, char* produce_filename, int produce_max_bytes); |
||
61 | |||
62 | /* Loop the packet generation */ |
||
63 | void randpkt_loop(randpkt_example* example, guint64 produce_count); |
||
64 | |||
65 | /* Close the current example */ |
||
66 | gboolean randpkt_example_close(randpkt_example* example); |
||
67 | |||
68 | #endif |
||
69 | |||
70 | /* |
||
71 | * Editor modelines - http://www.wireshark.org/tools/modelines.html |
||
72 | * |
||
73 | * Local variables: |
||
74 | * c-basic-offset: 8 |
||
75 | * tab-width: 8 |
||
76 | * indent-tabs-mode: t |
||
77 | * End: |
||
78 | * |
||
79 | * vi: set shiftwidth=8 tabstop=8 noexpandtab: |
||
80 | * :indentSize=8:tabSize=8:noTabs=false: |
||
81 | */ |