1// WSDG Chapter Libraries
2
3[[ChapterLibraries]]
4
5== Library Reference
6
7[[ChLibIntro]]
8
9=== Introduction
10
11Several libraries are needed to build and run Wireshark. Most of them
12are split into three packages:
13
14. _Runtime_. System and third party libraries such as _vcruntime140.dll_
15and _libglib-2.0-0.dll_.
16
17. _Developer_. Documentation, header files, import libraries, and other
18files needed for compilation.
19
20. _Source_. Library sources, which are usually not required to build
21Wireshark.
22
23[TIP]
24.Our libraries are freely available
25====
26All libraries required to build Wireshark on Windows are available for download at
27https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[] and
28https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
29See <<ChLibsSetup>> for an easier way to install them.
30====
31
32[[ChLibsFormat]]
33
34=== Binary Library Formats
35
36Binary libraries are available in different formats, depending on the C
37compiler used to build it and of course the platform they were built for.
38
39
40[[ChLibsFormatUnix]]
41
42[discrete]
43==== Unix
44
45If you have installed unix binary libraries on your system, they will
46match the C compiler. If not already installed, the libraries should be
47available as a package from the platform installer, or you can download
48and compile the source and then install the binaries.
49
50
51[[ChLibsFormatWin32]]
52
53[discrete]
54==== Windows
55
56Most of the Win32 binary libraries you will find on the web are in this
57format. You will recognize MSVC libraries by the .lib/.dll file extension.
58
59
60[[ChLibsSetup]]
61
62=== Windows Automated Library Download
63
64The required libraries (apart from Qt) are automatically downloaded as part of
65the CMake generation step, and subsequently as required when libraries are updated.
66
67The libraries are downloaded into the directory indicated by the environment
68variable WIRESHARK_BASE_DIR, this must be set appropriately for your environment.
69The libraries are downloaded and extracted into WIRESHARK_BASE_DIR\wireshark-win32-libs
70and WIRESHARK_BASE_DIR\wireshark-win64-libs for 32 and 64 bit builds respectively.
71
72You may also directly set the library directory with the environment variable
73WIRESHARK_LIB_DIR, but if you switch between 32 bit and 64 bit builds, the value of this
74must be set appropriately.
75
76[[ChLibsQt]]
77
78=== Qt
79
80The Qt library is used to build the UI for Wireshark and is used to provide a
81platform independent UI. Wireshark can be built with Qt 5.3 or later.
82
83For more information on the Qt libraries, see <<ChUIQt>>.
84
85[[ChLibsUnixQt]]
86
87[discrete]
88==== Unix
89
90Most Linux distributions provide Qt and its development libraries as standard packages.
91The required libraries and tools will likely be split across several packages. For example,
92building on Ubuntu requires _qttools5-dev_, _qttools5-dev-tools_, _libqt5svg5-dev_,
93_qtmultimedia5-dev_, and possibly others.
94
95The Qt Project provides an installation tool for macOS, similar to Windows.
96It is available at https://www.qt.io/download-open-source/#section-2[].
97
98[[ChLibsWin32Qt]]
99
100[discrete]
101==== Windows
102
103Qt5 must be installed manually from the Qt installers page
104https://www.qt.io/download-open-source/#section-2[] using the version of Qt
105appropriate for your compiler.  Note that separate installations (into different directories) of Qt
106are required for 32 bit and 64 bit builds.  The environment variable QT5_BASE_DIR should be
107set as appropriate for your environment and should point to the Qt directory that contains the
108bin directory, e.g. _C:\Qt\5.15.2\msvc2019_64_.
109
110[[ChLibsGLib]]
111
112=== GLib And Supporting Libraries
113
114The GLib library is used as a basic platform abstraction library and can
115be used in both CLI and GUI applications. For a detailed description
116about GLib see <<ChCodeGLib>>.
117
118GLib depends on GNU libiconv, GNU gettext, and other libraries. You will
119typically not come into contact with these while doing Wireshark
120development. Wireshark's build system check for and require both GLib
121and its dependencies.
122
123[[ChLibsUnixGLib]]
124
125[discrete]
126==== Unix
127
128The GLib library is available for most Linux distributions and UNIX
129flavors. If it isn't already installed and isn't available as a package
130for your platform, you can get it at https://wiki.gnome.org/Projects/GLib[].
131
132[[ChLibsWin32GLib]]
133
134[discrete]
135==== Windows
136
137GLib is part of our vcpkg-export bundles and is available at
138https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
139and
140https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
141
142[[ChLibsCares]]
143
144=== c-ares
145
146C-Ares is used for asynchronous DNS resolution and lets us resolve names with a minimal performance impact.
147
148[[ChLibsUnixCares]]
149
150[discrete]
151==== Unix
152
153If this library isn't already installed or available as a package for your
154platform, you can get it at https://c-ares.org/[].
155
156[[ChLibsWin32Cares]]
157
158[discrete]
159==== Windows
160
161C-Ares is built using {vcpkg-main-url}[vcpkg] and is available at
162https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
163and
164https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
165
166[[ChLibsSMI]]
167
168=== SMI (Optional)
169
170LibSMI is used for MIB and PIB parsing and for OID resolution.
171
172[[ChLibsUnixSMI]]
173
174[discrete]
175==== Unix
176
177If this library isn't already installed or available as a
178package for your platform, you can get it at
179https://www.ibr.cs.tu-bs.de/projects/libsmi/[].
180
181[[ChLibsWin32SMI]]
182
183[discrete]
184==== Windows
185
186Wireshark uses the source libSMI distribution at
187https://www.ibr.cs.tu-bs.de/projects/libsmi/[].
188LibSMI is cross-compiled using MinGW32.
189It’s stored in the libsmi zip archives at
190https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
191and
192https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
193
194[[ChLibsZlib]]
195
196=== zlib (Optional)
197
198[quote, The zlib web site, https://www.zlib.net/]
199____
200zlib is designed to be a
201https://www.gzip.org/zlib/zlib_license.html[free],
202general-purpose, legally unencumbered -- that is, not covered by any
203patents -- lossless data-compression library for use on virtually any computer
204hardware and operating system.
205____
206
207[[ChLibsUnixZlib]]
208
209[discrete]
210==== Unix
211
212This library is almost certain to be installed on your system. If it isn't or
213you don't want to use the default library you can download it from
214https://www.zlib.net/[].
215
216[[ChLibsWin32Zlib]]
217
218[discrete]
219==== Windows
220
221zlib is part of our vcpkg-export bundles and is available at
222https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
223and
224https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
225
226[[ChLibsPcap]]
227
228=== libpcap or Npcap (Optional, But Strongly Recommended)
229
230Libpcap and Npcap provide that packet capture capabilities that are central
231to Wireshark’s core functionality.
232
233[[ChLibsLibpcap]]
234
235[discrete]
236==== Unix: libpcap
237
238If this library isn't already installed or available as a package for your
239platform, you can get it at {tcpdump-main-url}.
240
241[[ChLibsWinpPcap]]
242
243[discrete]
244==== Windows: Npcap
245
246The Windows build environment compiles and links against a libpcap SDK built using {vcpkg-main-url}[vcpkg] and includes the {npcap-main-url}[Npcap packet capture driver] with the .exe installer.
247Both are <<ChLibsSetup,automatically downloaded by CMake>>.
248
249You can download the Npcap Windows packet capture library manually from
250{npcap-main-url}.
251
252[WARNING]
253.Npcap has its own license with its own restrictions
254====
255Insecure.Com LLC, aka “The Nmap Project” has granted the Wireshark
256Foundation the right to include Npcap with the installers that we
257distribute from wireshark.org. If you wish to distribute your own
258Wireshark installer or any other package that includes Npcap you must
259comply with the {npcap-license-url}[Npcap license] and may be required
260to purchase a redistribution license. Please see {npcap-main-url} for
261more details.
262====
263
264[[ChLibsGNUTLS]]
265
266=== GnuTLS (Optional)
267
268The GNU Transport Layer Security Library is used to enable TLS decryption
269using an RSA private key.
270
271[[ChLibsUnixGNUTLS]]
272
273[discrete]
274==== Unix
275
276If this library isn't already installed or available as a
277package for your platform, you can get it at
278https://gnutls.org/[].
279
280[[ChLibsWin32GNUTLS]]
281
282[discrete]
283==== Windows
284
285We provide packages cross-compiled using MinGW32 at
286https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
287and
288https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
289
290[[ChLibsGcrypt]]
291
292=== Gcrypt
293
294The Gcrypt Library is a low-level cryptographic library that provides
295support for many ciphers and message authentication codes, such as DES, 3DES,
296AES, Blowfish, SHA-1, SHA-256, and others.
297
298[[ChLibsUnixGcrypt]]
299
300[discrete]
301==== Unix
302
303If this library isn't already installed or available as a
304package for your platform, you can get it at
305https://directory.fsf.org/wiki/Libgcrypt[].
306
307[[ChLibsWin32Gcrypt]]
308
309[discrete]
310==== Windows
311
312Part of our GnuTLS package.
313
314[[ChLibsKerberos]]
315
316=== Kerberos (Optional)
317
318The Kerberos library is used to dissect Kerberos, sealed DCERPC and
319secureLDAP protocols.
320
321[[ChLibsUnixKerberos]]
322
323[discrete]
324==== Unix
325
326If this library isn't already installed or available as a
327package for your platform, you can get it at
328https://web.mit.edu/Kerberos/dist/[].
329
330[[ChLibsWin32Kerberos]]
331
332[discrete]
333==== Windows
334
335We provide packages for Windows at
336https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
337and
338https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
339
340[[ChLibsLua]]
341
342=== LUA (Optional)
343
344The LUA library is used to add scripting support to Wireshark.
345
346[[ChLibsUnixLua]]
347
348[discrete]
349==== Unix
350
351If this library isn't already installed or available as a
352package for your platform, you can get it at
353https://www.lua.org/download.html[].
354
355[[ChLibsWin32Lua]]
356
357[discrete]
358==== Windows
359
360We provide copies of the official packages at
361https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
362and
363https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
364
365[[ChLibsMaxMindDB]]
366
367=== MaxMindDB (Optional)
368
369MaxMind Inc. publishes a set of IP geolocation databases and related
370open source libraries. They can be used to map IP addresses to
371geographical locations and other information.
372
373If libmaxminddb library isn't already installed or available as a
374package for your platform, you can get it at
375https://github.com/maxmind/libmaxminddb[].
376
377We provide packages for Windows at
378https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
379and
380https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
381
382[[ChLibsSparkle]]
383
384=== WinSparkle (Optional)
385
386WinSparkle is an easy-to-use software update library for Windows developers.
387
388[[ChLibsWinSparkle]]
389
390[discrete]
391==== Windows
392
393We provide copies of the WinSparkle package at
394https://anonsvn.wireshark.org/wireshark-win64-libs/trunk/packages/[]
395and
396https://anonsvn.wireshark.org/wireshark-win32-libs/trunk/packages/[].
397
398// End of WSDG Chapter Libraries
399