aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-03-07 22:10:31 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2018-03-09 11:20:41 +0000
commit4e6d989df43af78439fccd24a176a14c534aea99 (patch)
treefe3e181869ec7deacc248bf1ae0f4c824761eddd
parent572f78a8610282151e7d165b11e0bf5092efbb5a (diff)
Add MaxMindDB 1.3.2 library to Windows
Change-Id: I328b6a05cc356be59ac63e80eae55a832bf76a47 Reviewed-on: https://code.wireshark.org/review/26347 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--CMakeLists.txt7
-rw-r--r--cmake/modules/FindMaxMindDB.cmake5
-rw-r--r--epan/maxmind_db.c4
-rw-r--r--packaging/nsis/CMakeLists.txt1
-rw-r--r--packaging/nsis/config.nsh.in2
-rw-r--r--packaging/nsis/wireshark.nsi3
-rw-r--r--tools/win-setup.ps19
7 files changed, 18 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4104f1a87..bb9097037f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1716,9 +1716,9 @@ if(WIN32)
if (CARES_FOUND)
list (APPEND OPTIONAL_DLLS "${CARES_DLL_DIR}/${CARES_DLL}")
endif(CARES_FOUND)
- if (GEOIP_FOUND)
- list (APPEND OPTIONAL_DLLS "${GEOIP_DLL_DIR}/${GEOIP_DLL}")
- endif(GEOIP_FOUND)
+ if (MAXMINDDB_FOUND)
+ list (APPEND OPTIONAL_DLLS "${MAXMINDDB_DLL_DIR}/${MAXMINDDB_DLL}")
+ endif(MAXMINDDB_FOUND)
if (LIBSSH_FOUND)
list (APPEND OPTIONAL_DLLS "${LIBSSH_DLL_DIR}/${LIBSSH_DLL}")
endif(LIBSSH_FOUND)
@@ -2926,6 +2926,7 @@ if (MAXMINDDB_FOUND)
add_executable(mmdbresolve ${mmdbresolve_FILES})
set_extra_executable_properties(mmdbresolve "Executables")
target_link_libraries(mmdbresolve ${mmdbresolve_LIBS})
+ target_include_directories(mmdbresolve PUBLIC ${MAXMINDDB_INCLUDE_DIR})
install(TARGETS mmdbresolve RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
diff --git a/cmake/modules/FindMaxMindDB.cmake b/cmake/modules/FindMaxMindDB.cmake
index cad4499e5b..3f1c5636c3 100644
--- a/cmake/modules/FindMaxMindDB.cmake
+++ b/cmake/modules/FindMaxMindDB.cmake
@@ -25,12 +25,13 @@ endif()
FIND_PATH(MAXMINDDB_INCLUDE_DIR maxminddb.h
HINTS
${PC_LIBMAXMINDDB_INCLUDEDIR} ${PC_LIBMAXMINDDB_INCLUDE_DIRS}
+ "${MAXMINDDB_HINTS}/include"
PATH_SUFFIXES maxminddb
)
find_library(MAXMINDDB_LIBRARY
NAMES
- maxminddb libmaxminddb
+ maxminddb libmaxminddb libmaxminddb-0
HINTS
${PC_LIBMAXMINDDB_LIBDIR} ${PC_LIBMAXMINDDB_LIBRARY_DIRS}
"${MAXMINDDB_HINTS}/lib"
@@ -56,7 +57,7 @@ IF(MAXMINDDB_FOUND)
CACHE PATH "Path to the MaxMindDB DLL"
)
file( GLOB _MAXMINDDB_dll RELATIVE "${MAXMINDDB_DLL_DIR}"
- "${MAXMINDDB_DLL_DIR}/libmaxminddb*.dll"
+ "${MAXMINDDB_DLL_DIR}/libmaxminddb-*.dll"
)
set ( MAXMINDDB_DLL ${_MAXMINDDB_dll}
# We're storing filenames only. Should we use STRING instead?
diff --git a/epan/maxmind_db.c b/epan/maxmind_db.c
index 78973555fc..ece13f819d 100644
--- a/epan/maxmind_db.c
+++ b/epan/maxmind_db.c
@@ -117,7 +117,7 @@ static const void *chunkify_v6_addr(const ws_in6_addr *addr) {
void *chunk_v6_bytes = (char *) wmem_map_lookup(mmdb_ipv6_map, addr->bytes);
if (!chunk_v6_bytes) {
- chunk_v6_bytes = wmem_memdup(wmem_epan_scope(), addr->bytes, sizeof(struct in6_addr));
+ chunk_v6_bytes = wmem_memdup(wmem_epan_scope(), addr->bytes, sizeof(ws_in6_addr));
wmem_map_insert(mmdb_ipv6_map, chunk_v6_bytes, chunk_v6_bytes);
}
@@ -135,7 +135,7 @@ process_mmdbr_stdout(int fd) {
while (ws_pipe_data_available(fd)) {
read_buf[0] = '\0';
- ssize_t read_status = ws_read(fd, read_buf, read_buf_size);
+ ssize_t read_status = ws_read(fd, read_buf, (unsigned int)read_buf_size);
if (read_status < 1) {
MMDB_DEBUG("read error %s", g_strerror(errno));
mmdb_resolve_stop();
diff --git a/packaging/nsis/CMakeLists.txt b/packaging/nsis/CMakeLists.txt
index 7dae484872..4ad9ea973a 100644
--- a/packaging/nsis/CMakeLists.txt
+++ b/packaging/nsis/CMakeLists.txt
@@ -44,6 +44,7 @@ elseif ("${WIRESHARK_TARGET_PLATFORM}" STREQUAL "win64")
else()
message(FATAL_ERROR "Your mysterious moon-man architecture \"${WIRESHARK_TARGET_PLATFORM}\" frightens and confuses us.")
endif()
+set (MMDBRESOLVE_EXE ${MAXMINDDB_FOUND})
# Path to the WinPcap installer.
# XXX Come up with a better variable, e.g. cache WIRESHARK_LIB_DIR in FindWSWinLibs.
diff --git a/packaging/nsis/config.nsh.in b/packaging/nsis/config.nsh.in
index c35371dcc1..db66e05419 100644
--- a/packaging/nsis/config.nsh.in
+++ b/packaging/nsis/config.nsh.in
@@ -23,7 +23,7 @@
!endif
!define PRODUCT_VERSION @PRODUCT_VERSION@
-!define MMDBRESOLVE_EXE @MAXMINDDB_FOUND@
+!define MMDBRESOLVE_EXE @MMDBRESOLVE_EXE@
!define VCREDIST_EXE "@VCREDIST_EXE@"
diff --git a/packaging/nsis/wireshark.nsi b/packaging/nsis/wireshark.nsi
index 5af8ad5dc4..50bf42afc6 100644
--- a/packaging/nsis/wireshark.nsi
+++ b/packaging/nsis/wireshark.nsi
@@ -1118,7 +1118,7 @@ File "${STAGING_DIR}\rawshark.html"
SectionEnd
!ifdef MMDBRESOLVE_EXE
-Section /o "MMDBResolve" SecMMDBResolve
+Section "MMDBResolve" SecMMDBResolve
;-------------------------------------------
SetOutPath $INSTDIR
File "${STAGING_DIR}\mmdbresolve.html"
@@ -1218,6 +1218,7 @@ SectionEnd
!insertmacro MUI_DESCRIPTION_TEXT ${SecDFTest} "Shows display filter byte-code, for debugging dfilter routines"
!insertmacro MUI_DESCRIPTION_TEXT ${SecCapinfos} "Print information about capture files."
!insertmacro MUI_DESCRIPTION_TEXT ${SecRawshark} "Raw packet filter."
+ !insertmacro MUI_DESCRIPTION_TEXT ${SecMMDBResolve} "MaxMind Database resolution tool"
!ifdef USER_GUIDE_DIR
!insertmacro MUI_DESCRIPTION_TEXT ${SecUsersGuide} "Install an offline copy of the User's Guide."
diff --git a/tools/win-setup.ps1 b/tools/win-setup.ps1
index c54fe989ce..6b37d4b40e 100644
--- a/tools/win-setup.ps1
+++ b/tools/win-setup.ps1
@@ -87,15 +87,14 @@ Param(
# trouble instead of trying to catch exceptions everywhere.
$ErrorActionPreference = "Stop"
-$Win64CurrentTag = "2017-08-26"
-$Win32CurrentTag = "2017-08-26"
+$Win64CurrentTag = "2018-03-09"
+$Win32CurrentTag = "2018-03-09"
# Archive file / subdir.
$Win64Archives = @{
"AirPcap_Devpack_4_1_0_1622.zip" = "AirPcap_Devpack_4_1_0_1622";
"bcg729-1.0.4-win64ws.zip" = "";
"c-ares-1.13.0-win64ws.zip" = "";
- #"GeoIP-1.6.10-win64ws.zip" = "";
"gnutls-3.4.11-1.35-win64ws.zip" = "";
"gtk+-bundle_2.24.23-3.39-2_win64ws.zip" = "gtk2";
"kfw-3-2-2-x64-ws.zip" = "";
@@ -105,6 +104,7 @@ $Win64Archives = @{
"libxml2-2.9.4-win64ws.zip" = "";
"lua-5.2.4_Win64_dllw4_lib.zip" = "lua5.2.4";
"lz4-1.7.5-win64ws.zip" = "";
+ "MaxMindDB-1.3.2-win64ws.zip" = "";
"nghttp2-1.14.0-1-win64ws.zip" = "";
"portaudio_v19_2.zip" = "";
"sbc-1.3-1-win64ws.zip" = "";
@@ -119,7 +119,6 @@ $Win32Archives = @{
"AirPcap_Devpack_4_1_0_1622.zip" = "AirPcap_Devpack_4_1_0_1622";
"bcg729-1.0.4-win32ws.zip" = "";
"c-ares-1.13.0-win32ws.zip" = "";
- #"GeoIP-1.6.10-win32ws.zip" = "";
"gnutls-3.4.11-1.36-win32ws.zip" = "";
"gtk+-bundle_2.24.23-1.1-1_win32ws.zip" = "gtk2";
"kfw-3-2-2-i386-ws-vc6.zip" = "";
@@ -129,6 +128,7 @@ $Win32Archives = @{
"libxml2-2.9.4-win32ws.zip" = "";
"lua-5.2.4_Win32_dllw4_lib.zip" = "lua5.2.4";
"lz4-1.7.5-win32ws.zip" = "";
+ "MaxMindDB-1.3.2-win32ws.zip" = "";
"nghttp2-1.14.0-1-win32ws.zip" = "";
"portaudio_v19_2.zip" = "";
"sbc-1.3-1-win32ws.zip" = "";
@@ -181,6 +181,7 @@ $CleanupItems = @(
"lua5.1.4"
"lua5.2.?"
"lz4-*-win??ws"
+ "MaxMindDB-1.3.2-win??ws"
"nghttp2-*-win??ws"
"portaudio_v19"
"portaudio_v19_2"