Commit Graph

16 Commits

Author SHA1 Message Date
Guy Harris 9141bd9700 Add more fields to packet_info structure and use them.
Add fields for the absolute time stamp (and another field for a presence
flag for the absolute time stamp) and the packet encapsulation for the
packet.

This lets us remove the field for the packet encapsulation in the
frame_data structure; do so.

Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39
Reviewed-on: https://code.wireshark.org/review/13499
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:50:58 +00:00
Guy Harris e406703c5f Fix handling of the byte order magic number.
Just treat it as an array of bytes.  When checking for whether it's a
pcapng file, also determine whether it's big-endian or little-endian.
Note that reading it in *host* byte order will tell you whether it's in
your byte order or byte-swapped; you have to know your byte order to
know whether that means little-endian or big-endian.

Have a #define for the byte-order magic number size, as all byte order
magic number values must be that size, and use that as the size of the
magic-number arrays.

Also use a #define for the SHB block type magic number.

Get rid of a now-unused expert info.  (If the magic number isn't
something we recognize, we don't treat the file as a pcap file, so it
can never be "unknown".)

Change-Id: Ic74cceac17d1490eb70a28f67cb4dbb512e031ac
Reviewed-on: https://code.wireshark.org/review/13494
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 01:15:54 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Guy Harris 91f4e3b73d Have a separate dissector for pcap/pcapng-format packet data.
Put that dissector into its own file, and get handles for it from the
pcap and pcapng file dissectors.  Put the value_string of pcap/pcapng
LINKTYPE_ values there, and have the pcap and pcapng file dissectors
import it.

Expand that table to include all LINKTYPE_ values in the current
libpcap.

Change-Id: I9397035efa5711e8a18a26e056d3b54494fd3148
Reviewed-on: https://code.wireshark.org/review/12000
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-21 02:52:57 +00:00
Michal Labedzki fef4714e72 File-format: Add ISO_14443 linktype for PCAP/PCAPNG
Assign numbers for LinkTypes on webpage
http://www.tcpdump.org/linktypes.html were changed, so update
it for file dissector for PCAP/PCAPNG.

Change-Id: Icb52c2a8f19bd056723de155700b83497d5fded4
Reviewed-on: https://code.wireshark.org/review/11983
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-11-20 16:02:43 +00:00
João Valverde 3df2333155 Remaining ADDRESS macro to address function conversions
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788
Reviewed-on: https://code.wireshark.org/review/11463
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-03 12:20:34 +00:00
Guy Harris 4ba522537a Point to GitHub for the pcapng specification.
Change-Id: I33faa41e8b0f36ee49d29fe391feafd94d0a7e80
Reviewed-on: https://code.wireshark.org/review/10245
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-25 01:47:26 +00:00
Pascal Quantin eeafab579e file-pcapng: always set pinfo->fd->num before calling next layer dissectors/file-pcapng
Also fix an off by 1 error for EPB case

Change-Id: I895d82a58ec02c577dcaa67a97d456b42460b947
Reviewed-on: https://code.wireshark.org/review/10149
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-21 08:34:28 +00:00
Pascal Quantin bc8b94d571 file-pcapng: differentiate captured length and reported length when calling next dissector and catch bound errors
Otherwise dissection will fail when analyzing a capture with a snap length set

Change-Id: If6714364efffdd1fbf88c947743929a71f75c663
Reviewed-on: https://code.wireshark.org/review/10135
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-08-20 11:43:56 +00:00
Pascal Quantin 2046368574 file-pcapng: fix dissection of options in blocks
- fix the loop logic
- flags in EPB include link-layer-dependent errors

Change-Id: Iae0b4869b556abbf3c14f3b865d0f23cee182c84
Reviewed-on: https://code.wireshark.org/review/10132
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-08-20 10:04:13 +00:00
Pascal Quantin d9dd323d4f file-pcapng: remove useless hf_pcapng_timestamp_data entry
Change-Id: I82b2d4e4b0be8179103b827e0d11a0d8b10e1374
Reviewed-on: https://code.wireshark.org/review/10133
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-19 21:00:37 +00:00
Alexis La Goutte 6ed3e080e9 pcapng(file): fix duplicate break
Change-Id: Ife7170c050402ab94d368acc6c233714be764824
Reviewed-on: https://code.wireshark.org/review/10114
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-18 19:20:03 +00:00
Guy Harris 4abec47c05 Clean up handling of time stamps.
Use common code for all time stamps, so it's handled the same for the
Packet Block, Enhanced Packet Block, and Interface Statistics Block.

Show the high and low parts of the time stamp as fields; file dissectors
should show the raw file details.  Mark the calculated time stamp as
generated, as it's not the raw file data.

Get the 64-bit time stamp by shifting the high part left 32 bits and
ORing in the low part; no need to play games with unions and byte order

Change-Id: I19b2c3227a3ca1e93ec653f279136aa18687581f
Reviewed-on: https://code.wireshark.org/review/10116
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-18 19:17:56 +00:00
Guy Harris ea7cf08368 Cast away 64 -> 32 narrowing complaints.
"secs" in an nstime_t is a time_t; cast the calculated seconds portion
to time_t.

Change-Id: Ieaad4c18bb21384a5781f50eadd3a537b414a369
Reviewed-on: https://code.wireshark.org/review/10113
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-08-18 18:52:01 +00:00
AndersBroman a3c175a823 Add casts to passify buildboot.
Change-Id: I8aa4695f1f8dfdfc5bfcd4fb4f36e1b332581d5a
Reviewed-on: https://code.wireshark.org/review/10106
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-18 14:50:58 +00:00
Michal Labedzki dd57c6bf38 File-format: Add PCAP and PCAPNG dissectors
They have educational values and can be used to debugging some issues.
Now Wireshark can open three files (BTSNOOP, PCAP, PCAPNG)
in two modes: Capture (Traditional) and File-Format.

Change-Id: I833b2464d11864f170923dc989a1925d3d217943
Reviewed-on: https://code.wireshark.org/review/10089
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-18 12:52:03 +00:00