summaryrefslogtreecommitdiff
path: root/randpkt_core/randpkt_core.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20Use more of the cfile_ failure message routines.Guy Harris1-3/+3
Change-Id: Iceb15f15622d391da0332e6ed55aac0e74abd0e2 Reviewed-on: https://code.wireshark.org/review/21261 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-20Use cfile_write_failure_message() in the randpkt code.Guy Harris1-58/+6
Change-Id: I32ef7ff85f854782e5dd02c3e7f12436a120bc13 Reviewed-on: https://code.wireshark.org/review/21259 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-06randpkt: Add support to generate IEEE802.15.4 packetsRémy Léone1-0/+9
Change-Id: I17a93c18d204cb7ab70a5c6898f866b32f745a4b Reviewed-on: https://code.wireshark.org/review/20878 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-03-28randpkt_core: Fix a handful of warningsMichael Mann1-8/+6
1. randpkt_core.c(559): warning C6262: Function uses '65596' bytes of stack: exceeds /analyze:stacksize '16384'. Consider moving some data to heap. 2. randpkt_core.c(615): warning C6386: Buffer overrun while writing to 'buffer': the writable size is '65536' bytes, but '-1' bytes might be written. Change-Id: I0f3bcd19b49d6c8cde0d2ad9f745b14f5462a708 Reviewed-on: https://code.wireshark.org/review/20763 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-14wiretap: add cleanup routine.Dario Lombardo1-3/+8
The cleanup routine has been added to exit section of the applications. Those which required a exit restyle have been patched as well. Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1 Reviewed-on: https://code.wireshark.org/review/19949 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-12-04Have a routine to do all the work of initializing libwiretap.Guy Harris1-1/+1
Have programs that use libwiretap call that routine rather than separately calling some or all of init_open_routines(), wtap_register_plugin_types(), and wtap_opttypes_initialize(). Also don't have routines internal to libwiretap call those. Yes, this means doing some initialization work when it isn't necessary, but scattering on-demand calls throughout the code is a great way to forget to make those calls. Change-Id: I5828e1c5591c9d94fbb3eb0a0e54591e8fc61710 Reviewed-on: https://code.wireshark.org/review/19069 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-12-02Include config.h first, for large-file-related #defines.Guy Harris1-2/+2
Change-Id: Iced77fb65c2db8bc370cefe4c48c972fe1262f92 Reviewed-on: https://code.wireshark.org/review/19039 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-27Make randpkt generate the correct IP version for IPv6João Valverde1-1/+1
IP version is always 6 and as a consequence of setting the first byte to 0x60 the 4 high-order bits for the traffic class field are set to zero. Otherwise the IPv6 dissector does not look past the first TVB byte, making randpkt useless to exercise the dissector code. Change-Id: I372ab7f71e6c972106f9dd46edec642ca53b9557 Reviewed-on: https://code.wireshark.org/review/16708 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-07-27randpkt: Add support to generate IPv6João Valverde1-0/+17
Change-Id: I23e68ef204486f6e3e388172cfa8701a595fcedc Reviewed-on: https://code.wireshark.org/review/16707 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-07-10randpkt_core: Use g_random_* for randpkt_parse_type().João Valverde1-1/+1
randpkt_parse_type() can (and most likely will) be called before randpkt_example_init(), therefore g_rand_int_range is called with a NULL GRand argument. This produces non-random output. Change-Id: Id420edc15a5f9dec427c5f1a1dd9a1f18a225319 Reviewed-on: https://code.wireshark.org/review/16367 Reviewed-by: João Valverde <j@v6e.pt>
2016-07-09randpkt_core: change rand() to g_rand_int (CID 1355360).Dario Lombardo1-65/+20
Change-Id: I48560cbb6007eb16aa545a3e8e6a0e8e3b206930 Reviewed-on: https://code.wireshark.org/review/16326 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-06-16randpktdump: fix a crash.Dario Lombardo1-0/+3
Randpktdump requires the init the wtap opttypes. Fixed making the init function public and calling it. Bug: 12539 Change-Id: I02585c41012deacff1526b51ed09ab555cbfc8ce Reviewed-on: https://code.wireshark.org/review/15951 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-01randpkt: restyle the list generation to get rid of the const compiler warning.Dario Lombardo1-7/+8
Change-Id: Id7c62ef18f919ba8a476898bc88c02fd3b6bf5a1 Reviewed-on: https://code.wireshark.org/review/14730 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-25Clean up modelines and indentation.Guy Harris1-4/+4
HT tab stops are set every 8 spaces on UN*X; UN*X tools that treat an HT character as tabbing to 4-space tab stops, or that even are configurable but *default* to 4-space tab stops (I'm looking at *you*, Xcode!) are broken. tab-width: 4, tabstop=4, and tabSize=4 are errors if you ever expect anybody to look at your file with a UN*X tool, and every text file will probably be looked at by a UN*X tool at some point, so Don't Do That. Adjust indentation to reflect the mode lines. Change-Id: Icf0831717de10fc615971fa1cf75af2f1ea2d03d Reviewed-on: https://code.wireshark.org/review/14150 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-19Get rid of PCAP_ENCAP_USB.Guy Harris1-8/+0
It doesn't correspond to anything we support - and the old Linux USB LINKTYPE_ value of 186 doesn't give enough information to dissect the packets (it discards the event type, for example), so we drop the rest of our support for it as well. Change-Id: I6f537d9263174aba4320edf5140e1d1540e979c8 Reviewed-on: https://code.wireshark.org/review/14020 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-15Build the extcap programs in the extcap directory.Guy Harris1-0/+813
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>