3 Unfortunately, the closest thing to a design document is the
4 "README.developer" document in the "doc" directory of the Wireshark
5 source tree; however, although that's useful for people adding new
6 protocol dissectors to Wireshark, it doesn't describe the operations of
7 the "core" of Wireshark.
9 We have no document describing that; however, a quick summary of the
10 part of the code you'd probably be working with is:
12 for every capture file that Wireshark has open, there's a
13 "capture_file" structure - Wireshark currently supports only one
14 open capture file at a time, and that structure is named
15 "cfile" (see the "file.h" header file);
17 that structure has a member "plist", which points to a
18 "frame_data" structure - every link-layer frame that Wireshark
19 has read in has a "frame_data" structure (see the
20 "epan/packet.h" header file), the "plist" member of "cfile"
21 points to the first frame, and each frame has a "next" member
22 that points to the next frame in the capture (or is null for the
25 each "frame_data" struct has:
27 a pointer to the next frame (null for the last frame);
29 a pointer to the previous frame (null for the first
32 information such as the ordinal number of the frame in
33 the capture, the time stamps for the capture, the size
34 of the packet data in bytes, the size of the frame in
35 bytes (which might not equal the size of the packet data
36 if, for example, the program capturing the packets
37 captured no more than the first N bytes of the capture,
40 the byte offset in the capture file where the frame's
43 See the "print_packets()" routine in "file.c" for an example of a
44 routine that goes through all the packets in the capture; the loop does
46 for (fdata = cf->plist; fdata != NULL; fdata = fdata->next) {
48 update a progress bar (because it could take a
49 significant period of time to process all packets);
51 read the packet data if the packet is to be printed;
57 The "wtap_seek_read()" call read the packet data into memory; the
58 "epan_dissect_new()" call "dissects" that data, building a tree
59 structure for the fields in the packet.