Wireshark Developer’s Guide Version 3.3.2 Preface Foreword This book tries to g
Wireshark Developer’s Guide Version 3.3.2 Preface 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. 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. 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 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: 1 • XXX - Please give feedback :-) And of course a big thank you to the many, many contributors of the Wireshark development community! About this document This book was developed by Ulf Lamping, updated for VS2013 by Graham Bloice, and updated for later versions of Visual Studio by various contributors. It is written in AsciiDoc. 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/ wsdg_html_chunked/. 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. 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 Go › Next Packet to move to the next packet. 2 Admonitions Important and notable items are marked as follows: WARNING This is a warning You should pay attention to a warning, otherwise data loss might occur. NOTE This is a note A note will point you to common mistakes and things that might not be obvious. TIP This is a tip Tips are helpful for your everyday work using Wireshark. 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 3 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); } 4 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. 5 Introduction Introduction This chapter will provide you with information about Wireshark development in general. 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. Supported Platforms Wireshark currently runs on most UNIX-like 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: Unix and Unix-like platforms • Apple macOS • FreeBSD • HP-UX • IBM AIX • NetBSD • OpenBSD • Oracle Solaris Linux • Arch Linux • Debian GNU/Linux • Ubuntu 6 • Fedora • Gentoo Linux • IBM S/390 Linux (Red Hat) • Mandriva Linux • PLD Linux • Red Hat Linux • Slackware Linux • Suse Linux 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. “Win64” refers to the Windows API on 64-bit platforms. Wireshark runs on and can be compiled on the following Windows versions: • Windows 10 / Windows Server 2016 / Windows Server 2019 • Windows 8.1 / Windows Server 2012 R2 • Windows 8 / Windows Server 2012 Development on Windows 7, Server 2008 R2, Vista, Server 2008, and older versions may be possible but is not supported. Some versions of Windows support case sensitive directories. We don’t officially support building or running Wireshark in this environment, but we will accept patches to fix any issues that might arise. 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! 7 It is strongly recommended to join the developer mailing list, if you are going to do any Wireshark development. See Mailing Lists about the different Wireshark mailing lists available. 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. 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. 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 uploads/s1/ developer-guide 2 .pdf
Documents similaires
-
25
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Sep 25, 2022
- Catégorie Administration
- Langue French
- Taille du fichier 3.2175MB