Wireshark 2.5 User guide

Type
User guide
Wireshark Developer’s Guide
For Wireshark 2.5
Ulf Lamping <ulf.lamping[AT]web.de>
Luis E. Ontanon <luis[AT]ontanon.org>
Graham Bloice <graham.bloice[AT]trihedral.com>
Wireshark Developer’s Guide: For Wireshark 2.5
by Ulf Lamping, Luis E. Ontanon, and Graham Bloice
Copyright © 2004-2014 Ulf Lamping, Luis E. Garcia Ontanon, Graham Bloice
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later
version published by the Free Software Foundation.
All logos and trademarks in this document are property of their respective owners.
Preface ............................................................................................................................. ix
1. Foreword ............................................................................................................... ix
2. Who should read this document? ............................................................................... ix
3. Acknowledgements ................................................................................................. ix
4. About this document ............................................................................................... ix
5. Where to get the latest copy of this document? ............................................................. x
6. Providing feedback about this document ...................................................................... x
7. Typographic Conventions .......................................................................................... x
7.1. Admonitions ................................................................................................. x
7.2. Shell Prompt and Source Code Examples ......................................................... xi
I. Wireshark Build Environment ............................................................................................ 1
1. Introduction ............................................................................................................ 2
1.1. Introduction .................................................................................................. 2
1.2. What is Wireshark? ....................................................................................... 2
1.3. Supported Platforms ...................................................................................... 2
1.3.1. Unix ................................................................................................. 2
1.3.2. Linux ................................................................................................ 2
1.3.3. Microsoft Windows ............................................................................ 3
1.4. Development and maintenance of Wireshark ...................................................... 3
1.4.1. Programming languages used ................................................................ 3
1.4.2. Open Source Software ......................................................................... 4
1.5. Releases and distributions ............................................................................... 4
1.5.1. Binary distributions ............................................................................. 4
1.5.2. Source code distributions ..................................................................... 5
1.6. Automated Builds (Buildbot) .......................................................................... 5
1.6.1. Advantages ........................................................................................ 5
1.6.2. What does the Buildbot do? ................................................................. 6
1.7. Reporting problems and getting help ................................................................ 6
1.7.1. Website ............................................................................................. 6
1.7.2. Wiki ................................................................................................. 6
1.7.3. FAQ ................................................................................................. 6
1.7.4. Other sources ..................................................................................... 7
1.7.5. Mailing Lists ..................................................................................... 7
1.7.6. Bug database (Bugzilla) ....................................................................... 8
1.7.7. Q&A Site .......................................................................................... 8
1.7.8. Reporting Problems ............................................................................ 8
1.7.9. Reporting Crashes on UNIX/Linux platforms ........................................... 9
1.7.10. Reporting Crashes on Windows platforms ............................................. 9
2. Quick Setup .......................................................................................................... 10
2.1. UNIX: Installation ....................................................................................... 10
2.2. Win32/64: Step-by-Step Guide ...................................................................... 10
2.2.1. Optional: Install Chocolatey ................................................................ 10
2.2.2. Install Microsoft C compiler and SDK .................................................. 10
2.2.3. Install Qt ......................................................................................... 11
2.2.4. Install Cygwin .................................................................................. 11
2.2.5. Install Python ................................................................................... 12
2.2.6. Install Git ........................................................................................ 12
2.2.7. Install CMake ................................................................................... 13
2.2.8. Install and Prepare Sources ................................................................. 13
2.2.9. Open a Visual Studio Command Prompt ............................................... 14
2.2.10. Generate the build files .................................................................... 15
2.2.11. Build Wireshark .............................................................................. 15
2.2.12. Debug Environment Setup ................................................................ 16
2.2.13. Optional: Create User’s and Developer’s Guide .................................... 16
iii
Wireshark Developer’s Guide
2.2.14. Optional: Create a Wireshark Installer ................................................. 16
3. Work with the Wireshark sources ............................................................................. 18
3.1. Introduction ................................................................................................ 18
3.2. The Wireshark Git repository ........................................................................ 18
3.2.1. The web interface to the Git repository ................................................. 18
3.3. Obtain the Wireshark sources ........................................................................ 19
3.3.1. Git over SSH or HTTPS .................................................................... 19
3.3.2. Git web interface .............................................................................. 20
3.3.3. Buildbot Snapshots ............................................................................ 21
3.3.4. Released sources ............................................................................... 21
3.4. Update the Wireshark sources ........................................................................ 21
3.4.1. Update Using Git .............................................................................. 21
3.4.2. Update Using Source Archives ............................................................ 22
3.5. Build Wireshark .......................................................................................... 22
3.5.1. Building on Unix .............................................................................. 22
3.5.2. Win32 native ................................................................................... 23
3.6. Run generated Wireshark .............................................................................. 23
3.6.1. Unix/Linux ...................................................................................... 23
3.6.2. Win32 native ................................................................................... 23
3.7. Debug your generated Wireshark ................................................................... 23
3.7.1. Unix/Linux ...................................................................................... 23
3.7.2. Win32 native ................................................................................... 24
3.8. Make changes to the Wireshark sources .......................................................... 24
3.9. Contribute your changes ............................................................................... 24
3.9.1. Some tips for a good patch ................................................................. 25
3.9.2. Code Requirements ........................................................................... 25
3.9.3. Uploading your changes ..................................................................... 26
3.9.4. Backporting a change ........................................................................ 27
3.10. Apply a patch from someone else ................................................................. 27
3.10.1. Using patch .................................................................................... 27
3.11. Binary packaging ....................................................................................... 28
3.11.1. Debian: .deb packages ...................................................................... 28
3.11.2. Red Hat: .rpm packages .................................................................... 28
3.11.3. macOS: .dmg packages ..................................................................... 29
3.11.4. Win32: NSIS .exe installer ................................................................ 29
3.11.5. Win32: PortableApps .paf.exe package ................................................ 29
4. Tool Reference ...................................................................................................... 31
4.1. Introduction ................................................................................................ 31
4.2. Chocolatey ................................................................................................. 31
4.3. Windows: Cygwin ....................................................................................... 32
4.3.1. Installing Cygwin using the Cygwin installer ......................................... 32
4.3.2. Add/Update/Remove Cygwin Packages ................................................. 32
4.3.3. Installing Cygwin using Chocolatey ..................................................... 33
4.4. GNU compiler toolchain (UNIX only) ............................................................ 33
4.4.1. gcc (GNU compiler collection) ............................................................ 33
4.4.2. gdb (GNU project debugger) ............................................................... 34
4.4.3. ddd (GNU Data Display Debugger) ...................................................... 35
4.4.4. make (GNU Make) ........................................................................... 35
4.5. Microsoft compiler toolchain (Windows native) ................................................ 36
4.5.1. Official Toolchain Packages And Alternatives ........................................ 36
4.5.2. cl.exe (C Compiler) ........................................................................... 37
4.5.3. link.exe (Linker) ............................................................................... 38
4.5.4. C-Runtime "Redistributable" Files ....................................................... 38
4.5.5. Windows (Platform) SDK .................................................................. 39
iv
Wireshark Developer’s Guide
4.5.6. HTML Help ..................................................................................... 39
4.5.7. Debugger ......................................................................................... 39
4.6. bash .......................................................................................................... 40
4.6.1. UNIX and Cygwin: GNU bash ............................................................ 41
4.7. Python ....................................................................................................... 41
4.8. Perl ........................................................................................................... 42
4.8.1. UNIX and Cygwin: Perl ..................................................................... 42
4.9. Bison ......................................................................................................... 42
4.9.1. UNIX or Cygwin: bison ..................................................................... 42
4.9.2. Windows Native: Win flex-bison and bison ........................................... 43
4.10. Flex ......................................................................................................... 43
4.10.1. UNIX or Cygwin: flex ..................................................................... 43
4.10.2. Windows Native: Win flex-bison and flex ............................................ 43
4.11. Git client .................................................................................................. 43
4.11.1. UNIX or Cygwin: git ....................................................................... 44
4.11.2. Windows native: git ......................................................................... 44
4.12. Git Powershell Extensions (optional) ............................................................. 44
4.13. Git GUI client (optional) ............................................................................. 44
4.14. patch (optional) ......................................................................................... 44
4.14.1. UNIX and Cygwin: patch ................................................................. 45
4.14.2. Windows native: patch ..................................................................... 45
4.15. Windows: NSIS (optional) .......................................................................... 45
4.16. Windows: PortableApps (optional) ................................................................ 45
5. Library Reference .................................................................................................. 47
5.1. Introduction ................................................................................................ 47
5.2. Binary library formats .................................................................................. 47
5.2.1. Unix ............................................................................................... 47
5.2.2. Win32: MSVC ................................................................................. 47
5.2.3. Win32: cygwin gcc ........................................................................... 47
5.3. Win32: Automated library download .............................................................. 47
5.4. Qt ............................................................................................................. 48
5.4.1. Unix ............................................................................................... 48
5.4.2. Win32 MSVC .................................................................................. 48
5.5. GTK+ / GLib / GDK / Pango / ATK / GNU gettext / GNU libiconv ...................... 48
5.5.1. Unix ............................................................................................... 48
5.5.2. Win32 MSVC .................................................................................. 48
5.6. SMI (optional) ............................................................................................ 49
5.6.1. Unix ............................................................................................... 49
5.6.2. Win32 MSVC .................................................................................. 49
5.7. c-ares (optional) .......................................................................................... 49
5.7.1. Unix ............................................................................................... 49
5.7.2. Win32 MSVC .................................................................................. 49
5.8. zlib (optional) ............................................................................................. 49
5.8.1. Unix ............................................................................................... 49
5.8.2. Win32 MSVC .................................................................................. 49
5.9. libpcap/WinPcap (optional) ........................................................................... 49
5.9.1. Unix: libpcap ................................................................................... 50
5.9.2. Win32 MSVC: WinPcap .................................................................... 50
5.10. GnuTLS (optional) ..................................................................................... 50
5.10.1. Unix ............................................................................................. 50
5.10.2. Win32 MSVC ................................................................................. 50
5.11. Gcrypt ..................................................................................................... 50
5.11.1. Unix ............................................................................................. 50
5.11.2. Win32 MSVC ................................................................................. 50
v
Wireshark Developer’s Guide
5.12. Kerberos (optional) .................................................................................... 50
5.12.1. Unix ............................................................................................. 50
5.12.2. Win32 MSVC ................................................................................. 50
5.13. LUA (optional) .......................................................................................... 51
5.13.1. Unix ............................................................................................. 51
5.13.2. Win32 MSVC ................................................................................. 51
5.14. PortAudio (optional) ................................................................................... 51
5.14.1. Unix ............................................................................................. 51
5.14.2. Win32 MSVC ................................................................................. 51
5.15. GeoIP (optional) ........................................................................................ 51
5.15.1. Unix ............................................................................................. 51
5.15.2. Win32 MSVC ................................................................................. 51
5.16. WinSparkle (optional) ................................................................................. 51
5.16.1. Win32 MSVC ................................................................................. 52
II. Wireshark Development ................................................................................................. 53
6. How Wireshark Works ........................................................................................... 54
6.1. Introduction ................................................................................................ 54
6.2. Overview ................................................................................................... 54
6.3. Capturing packets ........................................................................................ 56
6.4. Capture Files .............................................................................................. 56
6.5. Dissect packets ........................................................................................... 56
7. Introduction .......................................................................................................... 58
7.1. Source overview .......................................................................................... 58
7.2. Coding Style .............................................................................................. 58
7.3. The GLib library ......................................................................................... 58
8. Packet capturing .................................................................................................... 59
8.1. How to add a new capture type to libpcap ....................................................... 59
9. Packet dissection ................................................................................................... 60
9.1. How it works .............................................................................................. 60
9.2. Adding a basic dissector ............................................................................... 60
9.2.1. Setting up the dissector ...................................................................... 60
9.2.2. Dissecting the details of the protocol .................................................... 62
9.2.3. Improving the dissection information .................................................... 65
9.3. How to handle transformed data ..................................................................... 67
9.4. How to reassemble split packets ..................................................................... 68
9.4.1. How to reassemble split UDP packets ................................................... 69
9.4.2. How to reassemble split TCP Packets ................................................... 72
9.5. How to tap protocols ................................................................................... 73
9.6. How to produce protocol stats ....................................................................... 74
9.7. How to use conversations ............................................................................. 75
9.8. idl2wrs: Creating dissectors from CORBA IDL files .......................................... 75
9.8.1. What is it? ....................................................................................... 76
9.8.2. Why do this? ................................................................................... 76
9.8.3. How to use idl2wrs ........................................................................... 76
9.8.4. TODO ............................................................................................. 77
9.8.5. Limitations ...................................................................................... 78
9.8.6. Notes .............................................................................................. 78
10. Lua Support in Wireshark ...................................................................................... 79
10.1. Introduction .............................................................................................. 79
10.2. Example of Dissector written in Lua ............................................................. 79
10.3. Example of Listener written in Lua ............................................................... 80
11. Wireshark’s Lua API Reference Manual ................................................................... 82
11.1. Saving capture files .................................................................................... 82
11.1.1. Dumper ......................................................................................... 82
vi
Wireshark Developer’s Guide
11.1.2. PseudoHeader ................................................................................. 84
11.2. Obtaining dissection data ............................................................................ 85
11.2.1. Field ............................................................................................. 85
11.2.2. FieldInfo ........................................................................................ 86
11.2.3. Global Functions ............................................................................. 89
11.3. GUI support .............................................................................................. 89
11.3.1. ProgDlg ......................................................................................... 89
11.3.2. TextWindow ................................................................................... 90
11.3.3. Global Functions ............................................................................. 93
11.4. Post-dissection packet analysis ..................................................................... 96
11.4.1. Listener ......................................................................................... 96
11.5. Obtaining packet information ....................................................................... 98
11.5.1. Address ......................................................................................... 98
11.5.2. Column ......................................................................................... 99
11.5.3. Columns ...................................................................................... 100
11.5.4. NSTime ....................................................................................... 100
11.5.5. Pinfo ........................................................................................... 102
11.5.6. PrivateTable ................................................................................. 105
11.6. Functions for new protocols and dissectors ................................................... 106
11.6.1. Dissector ...................................................................................... 106
11.6.2. DissectorTable .............................................................................. 107
11.6.3. Pref ............................................................................................. 110
11.6.4. Prefs ............................................................................................ 112
11.6.5. Proto ........................................................................................... 113
11.6.6. ProtoExpert .................................................................................. 115
11.6.7. ProtoField .................................................................................... 116
11.6.8. Global Functions ........................................................................... 130
11.7. Adding information to the dissection tree ..................................................... 131
11.7.1. TreeItem ...................................................................................... 131
11.8. Functions for handling packet data .............................................................. 138
11.8.1. ByteArray .................................................................................... 138
11.8.2. Tvb ............................................................................................. 141
11.8.3. TvbRange ..................................................................................... 143
11.9. Custom file format reading/writing .............................................................. 150
11.9.1. CaptureInfo .................................................................................. 150
11.9.2. CaptureInfoConst ........................................................................... 152
11.9.3. File ............................................................................................. 154
11.9.4. FileHandler ................................................................................... 155
11.9.5. FrameInfo .................................................................................... 160
11.9.6. FrameInfoConst ............................................................................. 161
11.9.7. Global Functions ........................................................................... 163
11.10. Directory handling functions .................................................................... 163
11.10.1. Dir ............................................................................................ 163
11.11. Utility Functions .................................................................................... 166
11.11.1. Global Functions .......................................................................... 166
11.12. Handling 64-bit Integers .......................................................................... 169
11.12.1. Int64 .......................................................................................... 169
11.12.2. UInt64 ....................................................................................... 176
11.13. Binary encode/decode support .................................................................. 182
11.13.1. Struct ......................................................................................... 184
11.14. GLib Regular Expressions ........................................................................ 186
11.14.1. GRegex ...................................................................................... 187
12. User Interface .................................................................................................... 194
12.1. Introduction ............................................................................................. 194
vii
Wireshark Developer’s Guide
12.2. The Qt Application Framework .................................................................. 194
12.2.1. User Experience Considerations ....................................................... 194
12.2.2. Qt Creator .................................................................................... 195
12.2.3. Source Code Overview ................................................................... 195
12.2.4. Coding Practices and Naming Conventions ......................................... 195
12.2.5. Other Issues and Information ........................................................... 197
12.3. The GTK library ...................................................................................... 198
12.3.1. GTK Version 2.x ........................................................................... 198
12.3.2. GTK Version 3.x ........................................................................... 198
12.3.3. Compatibility GTK versions ............................................................ 199
12.3.4. GTK resources on the web .............................................................. 199
12.4. Human Interface Reference Documents ........................................................ 199
12.5. Adding/Extending Dialogs ......................................................................... 199
12.6. Widget naming ........................................................................................ 199
12.7. Common GTK programming pitfalls ........................................................... 200
12.7.1. Usage of gtk_widget_show() / gtk_widget_show_all() .......................... 200
13. This Document’s License (GPL) ........................................................................... 201
viii
Preface
1. Foreword
This book tries to give you a guide to start your own experiments into the wonderful world of Wireshark
development.
Developers who are new to Wireshark often have a hard time getting their development environment up
and running. This is especially true for Win32 developers, as a lot of the tools and methods used when
building Wireshark are much more common in the UNIX world than on Win32.
The first part of this book will describe how to set up the environment needed to develop Wireshark.
The second part of this book will describe how to change the Wireshark source code.
We hope that you find this book useful, and look forward to your comments.
2. Who should read this document?
The intended audience of this book is anyone going into the development of Wireshark.
This book is not intended to explain the usage of Wireshark in general. Please refer the Wireshark User’s
Guide about Wireshark usage.
By reading this book, you will learn how to develop Wireshark. It will hopefully guide you around
some common problems that frequently appear for new (and sometimes even advanced) developers of
Wireshark.
3. Acknowledgements
The authors would like to thank the whole Wireshark team for their assistance. In particular, the authors
would like to thank:
Gerald Combs, for initiating the Wireshark project.
Guy Harris, for many helpful hints and his effort in maintaining the various contributions on the mailing
lists.
Frank Singleton from whose README.idl2wrs Section 9.8, idl2wrs: Creating dissectors from
CORBA IDL files” is derived.
The authors would also like to thank the following people for their helpful feedback on this document:
XXX - Please give feedback :-)
And of course a big thank you to the many, many contributors of the Wireshark development community!
4. About this document
This book was developed by Ulf Lamping and updated for VS2013 by Graham Bloice
ix
Preface
It is written in AsciiDoc.
5. Where to get the latest copy of this
document?
The latest copy of this documentation can always be found at: https://www.wireshark.org/docs/ in A4 PDF,
US letter PDF, single HTML, and chunked HTML.
6. Providing feedback about this document
Should you have any feedback about this document, please send it to the authors through wireshark-
dev[AT]wireshark.org.
7. Typographic Conventions
The following table shows the typographic conventions that are used in this guide.
Table 1. Typographic Conventions
Style Description Example
Italic File names, folder names, and extensions C:\Development\wireshark.
Monospace Commands, flags, and environment
variables
CMake’s -G option.
Bold
Monospace
Commands that should be run by the user Run cmake -G Ninja ...
Button Dialog and window buttons Press Launch to go to the Moon.
Key Keyboard shortcut Press Ctrl+Down to move to the next
packet.
Menu Menu item
Select GoNext Packet to move to the
next packet.
7.1. Admonitions
Important and notable items are marked as follows:
This is a warning
You should pay attention to a warning, otherwise data loss might occur.
This is a note
A note will point you to common mistakes and things that might not be obvious.
This is a tip
Tips are helpful for your everyday work using Wireshark.
x
Preface
7.2. Shell Prompt and Source Code Examples
Bourne shell, normal user.
$ # This is a comment
$ git config --global log.abbrevcommit true
Bourne shell, root user.
# # This is a comment
# ninja install
Command Prompt (cmd.exe).
>rem This is a comment
>cd C:\Development
PowerShell.
PS$># This is a comment
PS$>choco list -l
C Source Code.
#include "config.h"
/* This method dissects foos */
static int
dissect_foo_message(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void
*data _U_)
{
/* TODO: implement your dissecting code */
return tvb_captured_length(tvb);
}
xi
Part I. Wireshark Build Environment
Wireshark Build Environment
The first part describes how to set up the tools, libraries and source needed to generate Wireshark and how to do some
typical development tasks.
Chapter 1. Introduction
1.1. Introduction
This chapter will provide you with information about Wireshark development in general.
1.2. What is Wireshark?
Well, if you want to start Wireshark development, you might already know what Wireshark is doing. If not,
please have a look at the Wireshark User’s Guide, which will provide a lot of general information about it.
1.3. Supported Platforms
Wireshark currently runs on most UNIX platforms and various Windows platforms. It requires Qt, GLib,
libpcap and some other libraries in order to run.
As Wireshark is developed in a platform independent way and uses libraries (such as the Qt GUI library)
which are available for many different platforms, it’s thus available on a wide variety of platforms.
If a binary package is not available for your platform, you should download the source and try to build it.
Please report your experiences to wireshark-dev[AT]wireshark.org.
Binary packages are available for the following platforms along with many others:
1.3.1. Unix
Apple macOS
FreeBSD
HP-UX
IBM AIX
NetBSD
OpenBSD
Oracle Solaris
1.3.2. Linux
Debian GNU/Linux
Ubuntu
Gentoo Linux
IBM S/390 Linux (Red Hat)
Mandrake Linux
PLD Linux
2
Introduction
Red Hat Linux
Rock Linux
Slackware Linux
Suse Linux
1.3.3. Microsoft Windows
Wireshark supports Windows natively via the Windows API. Note that in this documentation and
elsewhere we tend to use the terms “Win32”, “Win”, and “Windows” interchangeably to refer to the
Windows API. Wireshark runs on and can be compiled on the following platforms:
Windows 10 / Windows Server 2016
Windows 8.1 / Windows Server 2012 R2
Windows 8 / Windows Server 2012
Windows 7 / Windows Server 2008 R2
Windows Vista / Windows Server 2008
Development on Windows XP, Server 2003, and older versions may be possible but is not supported.
1.4. Development and maintenance of
Wireshark
Wireshark was initially developed by Gerald Combs. Ongoing development and maintenance of Wireshark
is handled by the Wireshark core developers, a loose group of individuals who fix bugs and provide new
functionality.
There have also been a large number of people who have contributed protocol dissectors and other
improvements to Wireshark, and it is expected that this will continue. You can find a list of the people
who have contributed code to Wireshark by checking the About dialog box of Wireshark, or have a look
at the https://www.wireshark.org/about.html#authors page on the Wireshark web site.
The communication between the developers is usually done through the developer mailing list, which can
be joined by anyone interested in the development activities. At the time this document was written, more
than 500 persons were subscribed to this mailing list!
It is strongly recommended to join the developer mailing list, if you are going to do any Wireshark
development. See Section 1.7.5, “Mailing Lists” about the different Wireshark mailing lists available.
1.4.1. Programming languages used
Most of Wireshark is implemented in plain ANSI C. A notable exception is the code in ui/qt, which is
written in C++.
The typical task for a new Wireshark developer is to extend an existing, or write a new dissector for a
specific network protocol. As (almost) any dissector is written in plain old ANSI C, a good knowledge
about ANSI C will be sufficient for Wireshark development in almost any case.
3
Introduction
So unless you are going to change the build process of Wireshark itself, you won’t come in touch with any
other programming language than ANSI C (such as Perl or Python, which are used only in the Wireshark
build process).
Beside the usual tools for developing a program in C (compiler, make, …), the build process uses some
additional helper tools (Perl, Python, Sed, …), which are needed for the build process when Wireshark is to
be build and installed from the released source packages. If Wireshark is installed from a binary package,
none of these helper tools are needed on the target system.
1.4.2. Open Source Software
Wireshark is an open source software (OSS) project, and is released under the GNU General Public License
(GPL). You can freely use Wireshark on any number of computers you like, without worrying about license
keys or fees or such. In addition, all source code is freely available under the GPL. Because of that, it is
very easy for people to add new protocols to Wireshark, either as plugins, or built into the source, and
they often do!
You are welcome to modify Wireshark to suit your own needs, and it would be appreciated if you contribute
your improvements back to the Wireshark community.
You gain three benefits by contributing your improvements back to the community:
Other people who find your contributions useful will appreciate them, and you will know that you have
helped people in the same way that the developers of Wireshark have helped you and other people.
The developers of Wireshark might improve your changes even more, as there’s always room for
improvement. Or they may implement some advanced things on top of your code, which can be useful
for yourself too.
The maintainers and developers of Wireshark will maintain your code as well, fixing it when API
changes or other changes are made, and generally keeping it in tune with what is happening with
Wireshark. So if Wireshark is updated (which is done often), you can get a new Wireshark version from
the website and your changes will already be included without any effort for you.
The Wireshark source code and binary packages for some platforms are all available on the download page
of the Wireshark website: https://www.wireshark.org/download.html.
1.5. Releases and distributions
The officially released files can be found at https://www.wireshark.org/download.html. A new Wireshark
version is released after significant changes compared to the last release are completed or a serious security
issue is encountered. The typical release schedule is about every 4-8 weeks (although this may vary). There
are two kinds of distributions: binary and source; both have their advantages and disadvantages.
1.5.1. Binary distributions
Binary distributions are usually easy to install (as simply starting the appropriate file is usually the only
thing to do). They are available for the following systems:
Windows (.exe file). The typical Windows end user is used to getting a setup.exe file which will install
all the required things for him.
Win32 PAF (.paf.exe file). Another Windows end user method is to get a portable application file which
will install all the required things for him.
4
Introduction
Debian (.deb file). A user of a Debian Package Manager (DPKG) based system obtains a .deb file from
which the package manager checks the dependencies and installs the software.
Red Hat (.rpm file). A user of a RPM Package Manager (RPM) based system obtains an .rpm file from
which the package manager checks the dependencies and installs the software.
macOS (.dmg file). The typical macOS end user is used to getting a .dmg file which will install all the
required things for him.
Solaris. A Solaris user obtains a file from which the package manager (PKG) checks the dependencies
and installs the software.
However, if you want to start developing with Wireshark, the binary distributions won’t be too helpful,
as you need the source files, of course.
For details about how to build these binary distributions yourself, e.g. if you need a distribution for a
special audience, see Section 3.11, “Binary packaging”.
1.5.2. Source code distributions
It’s still common for UNIX developers to give the end user a source tarball and let the user compile it on
their target machine (configure, make, make install). However, for different UNIX (Linux) distributions
it’s becoming more common to release binary packages (e.g. .deb or .rpm files) these days.
You should use the released sources if you want to build Wireshark from source on your platform for
productive use. However, if you going to develop changes to the Wireshark sources, it might be better
to use the latest GIT sources. For details about the different ways to get the Wireshark source code see
Section 3.3, “Obtain the Wireshark sources”.
Before building Wireshark from a source distribution, make sure you have all the tools and libraries
required to build. The following chapters will describe the required tools and libraries in detail.
1.6. Automated Builds (Buildbot)
The Wireshark Buildbot automatically rebuilds Wireshark on every change of the source code repository
and indicates problematic changes. This frees the developers from repeating (and annoying) work, so time
can be spent on more interesting tasks.
1.6.1. Advantages
Recognizing (cross platform) build problems - early. Compilation problems can be narrowed down to
a few commits, making a fix much easier.
"Health status" overview of the sources. A quick look at: https://buildbot.wireshark.org/wireshark-
master/ gives a good "feeling" if the sources are currently "well". On the other hand, if all is "red", an
update of a personal source tree might better be done later …
"Up to date" binary packages are available. After a change was committed to the repository, a binary
package / installer is usually available within a few hours at: https://www.wireshark.org/download/
automated/. This can be quite helpful, e.g. a bug reporter can easily verify a bugfix by installing a recent
build.
Automated regression tests. In particular, the fuzz tests often indicate "real life" problems that are
otherwise hard to find.
5
Introduction
1.6.2. What does the Buildbot do?
The Buildbot will do the following (to a different degree on the different platforms):
Check out from the source repository
Build
Create binary packages and installers
Create source packages and run distribution checks
Run regression tests
Each step is represented at the status page by a rectangle, green if it succeeded or red if it failed. Most
steps provide a link to the corresponding console logfile, to get additional information.
The Buildbot runs on a platform collection that represents the different "platform specialties" quite well:
Windows 8.1 x86 (Win32, little endian, Visual Studio 2013)
Windows Server 2012 R2 x86-64 (Win64, little endian, Visual Studio 2013)
Ubuntu x86-64 (Linux, little endian, gcc, Clang)
macOS x86-64 (BSD, little endian, Clang)
and two buildslaves that run static code analysis to help spot coding issues:
Visual Studio Code Analysis (Win64, little endian, VS 2013)
Clang Code Analysis (Linux, little endian, Clang)
Each platform is represented at the status page by a single column, the most recent entries are at the top.
1.7. Reporting problems and getting help
If you have problems, or need help with Wireshark, there are several places that may be of interest to you
(well, beside this guide of course).
1.7.1. Website
You will find lots of useful information on the Wireshark homepage at https://www.wireshark.org/.
1.7.2. Wiki
The Wireshark Wiki at https://wiki.wireshark.org/ provides a wide range of information related to
Wireshark and packet capturing in general. You will find a lot of information not part of this developer’s
guide. For example, there is an explanation how to capture on a switched network, an ongoing effort to
build a protocol reference and a lot more.
And best of all, if you would like to contribute your knowledge on a specific topic (maybe a network
protocol you know well), you can edit the Wiki pages by simply using your webbrowser.
1.7.3. FAQ
The "Frequently Asked Questions" will list often asked questions and the corresponding answers.
6
Introduction
Before sending any mail to the mailing lists below, be sure to read the FAQ, as it will often answer any
questions you might have. This will save yourself and others a lot of time. Keep in mind that a lot of people
are subscribed to the mailing lists.
You will find the FAQ inside Wireshark by clicking the menu item Help/Contents and selecting the FAQ
page in the upcoming dialog.
An online version is available at the Wireshark website: https://www.wireshark.org/faq.html. You might
prefer this online version as it’s typically more up to date and the HTML format is easier to use.
1.7.4. Other sources
If you don’t find the information you need inside this book, there are various other sources of information:
The file doc/README.developer and all the other README.xxx files in the source code. These are
various documentation files on different topics
Read the README
README.developer is packed full with all kinds of details relevant to the developer of
Wireshark source code. Its companion file README.dissector advises you around common
pitfalls, shows you basic layout of dissector code, shows details of the APIs available to the
dissector developer, etc.
The Wireshark source code
Tool documentation of the various tools used (e.g. manpages of sed, gcc, etc.)
The different mailing lists. See Section 1.7.5, “Mailing Lists”
1.7.5. Mailing Lists
There are several mailing lists available on specific Wireshark topics:
wireshark-announce
This mailing list will inform you about new program releases, which usually appear about every 4-8
weeks.
wireshark-users
This list is for users of Wireshark. People post questions about building and using Wireshark, others
(hopefully) provide answers.
wireshark-dev
This list is for Wireshark developers. People post questions about the development of Wireshark,
others (hopefully) provide answers. If you want to start developing a protocol dissector, join this list.
wireshark-bugs
This list is for Wireshark developers. Every time a change to the bug database occurs, a mail to this
mailing list is generated. If you want to be notified about all the changes to the bug database, join this
list. Details about the bug database can be found in Section 1.7.6, “Bug database (Bugzilla)”.
wireshark-commits
This list is for Wireshark developers. Every time a change to the GIT repository is checked in, a mail to
this mailing list is generated. If you want to be notified about all the changes to the GIT repository, join
this list. Details about the GIT repository can be found in Section 3.2, “The Wireshark Git repository”.
7
Introduction
You can subscribe to each of these lists from the Wireshark web site: https://www.wireshark.org/lists/.
From there, you can choose which mailing list you want to subscribe to by clicking on the Subscribe/
Unsubscribe/Options button under the title of the relevant list. The links to the archives are included on
that page as well.
The archives are searchable
You can search in the list archives to see if someone previously asked the same question
and maybe already got an answer. That way you don’t have to wait until someone answers
your question.
1.7.6. Bug database (Bugzilla)
The Wireshark community collects bug reports in a Bugzilla database at https://bugs.wireshark.org/. This
database is filled with manually filed bug reports, usually after some discussion on wireshark-dev, and
automatic bug reports from the Buildbot tools.
1.7.7. Q&A Site
The Wireshark Q&A site at https://ask.wireshark.org/ offers a resource where questions and answers come
together. You have the option to search what questions were asked before and what answers were given
by people who knew about the issue. Answers are graded, so you can pick out the best ones easily. If your
issue isn’t discussed before you can post one yourself.
1.7.8. Reporting Problems
Test with the latest version
Before reporting any problems, please make sure you have installed the latest version of
Wireshark. Reports on older maintenance releases are usually met with an upgrade request.
If you report problems, provide as much information as possible. In general, just think about what you
would need to find that problem, if someone else sends you such a problem report. Also keep in mind that
people compile/run Wireshark on a lot of different platforms.
When reporting problems with Wireshark, it is helpful if you supply the following information:
1. The version number of Wireshark and the dependent libraries linked with it, e.g. Qt, GTK+, etc. You
can obtain this with the command wireshark -v.
2. Information about the platform you run Wireshark on.
3. A detailed description of your problem.
4. If you get an error/warning message, copy the text of that message (and also a few lines before and
after it, if there are some), so others may find the build step where things go wrong. Please don’t give
something like: "I get a warning when compiling x" as this won’t give any direction to look at.
Don’t send large files
Do not send large files (>100KB) to the mailing lists, just place a note that further data
is available on request. Large files will only annoy a lot of people on the list who are not
interested in your specific problem. If required, you will be asked for further data by the
persons who really can help you.
8
Introduction
Don’t send confidential information
If you send captured data to the mailing lists, or add it to your bug report, be sure it doesn’t
contain any sensitive or confidential information, such as passwords. Visibility of such files
can be limited to certain groups in the Bugzilla database though.
1.7.9. Reporting Crashes on UNIX/Linux platforms
When reporting crashes with Wireshark, it is helpful if you supply the traceback information (besides the
information mentioned in Section 1.7.8, “Reporting Problems”).
You can obtain this traceback information with the following commands:
$ gdb `whereis wireshark | cut -f2 -d: | cut -d' ' -f2` core >& bt.txt
backtrace
^D
$
Using GDB
Type the characters in the first line verbatim. Those are back-tics there.
backtrace is a gdb command. You should enter it verbatim after the first line shown
above, but it will not be echoed. The ^D (Control-D, that is, press the Control key and the D
key together) will cause gdb to exit. This will leave you with a file called bt.txt in the current
directory. Include the file with your bug report.
If you do not have gdb available, you will have to check out your operating system’s
debugger.
You should mail the traceback to wireshark-dev[AT]wireshark.org or attach it to your bug report.
1.7.10. Reporting Crashes on Windows platforms
You can download Windows debugging symbol files (.pdb) from the following locations:
32-bit Windows: https://www.wireshark.org/download/win32/all-versions/
64-bit Windows: https://www.wireshark.org/download/win64/all-versions/
Files are named "Wireshark-pdb-winbits-x.y.z.zip" to match their corresponding "Wireshark-winbits-
x.y.z.exe" installer packages.
9
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217

Wireshark 2.5 User guide

Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI