aboutsummaryrefslogtreecommitdiffstats
path: root/mmdbresolve.c
AgeCommit message (Collapse)AuthorFilesLines
2018-05-24maxmind: Move request processing to a thread.Gerald Combs1-0/+15
It's possible to block while we're writing to our mmdbresolve pipe, particularly on Windows. Move the write to a separate thread. Add an #ifdef to mmdbresolve.c which helps test blocking. Bug: 14701 Change-Id: I6cb8a46a190a268da64f1e6f54d1052d03743c95 Reviewed-on: https://code.wireshark.org/review/27750 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-10Avoid the realloc() warning from VS Code Analyzer.Guy Harris1-3/+5
It's not just worrying about the lack of a check for a null return, it's worried about the leak. Assign the result to a different variable and, if the result is null, free the old data before exiting, and if it's not null, assign the new variable to the one we're using as a pointer to the array. Change-Id: Ia1d5d271293e13708c35a7562a1f40671304c417 Reviewed-on: https://code.wireshark.org/review/26410 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-09entry_data.type is unsigned, so print it with %u.Guy Harris1-1/+1
This should squelch a warning from VS Code Analyzer. Change-Id: I69e528c3dfd851d287b1faebc1469cd700fa9ef5 Reviewed-on: https://code.wireshark.org/review/26402 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-09Check for realloc() failing.Guy Harris1-0/+4
Unlikely, but not impossible, and should squelch a VS Code Analyzer warning. Change-Id: I399c08896a3f08962ca46483d47ba5f6cbe4f28e Reviewed-on: https://code.wireshark.org/review/26400 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-03-09mmdbresolve: remove leak (found by clang).Dario Lombardo1-0/+2
Change-Id: I7de7707d75c80bc12ec2c4a30a19f6988932b0b7 Reviewed-on: https://code.wireshark.org/review/26392 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06mmdbresolve: Process our command line arguments by hand.Gerald Combs1-13/+15
Visual Studio doesn't ship with a getopt implementation, so process our arguments ourselves. Note that if we add support for more flags we'll probably want to use GOption. Change-Id: Ie78204aa64321ca68f3e66195b8c39e47ca410d9 Reviewed-on: https://code.wireshark.org/review/26288 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-06Transition from GeoIP Legacy to MaxMindDB.Gerald Combs1-0/+169
MaxMind is discontinuing its legacy databases in April in favor of GeoIP2, which use a newer database format (MaxMind DB). The reference C library (libmaxminddb) is available under the Apache 2.0 license which isn't quite compatible with ours. Add mmdbresolve, a utility that reads IPv4 and IPv6 addresses on stdin and prints resolved information on stdout. Place it under a liberal license (MIT) so that we can keep libmaxminddb at arm's length. Add epan/maxmind_db.[ch], which spawns mmdbresolve and communicates with it via stdio. Migrate the preferences and documentation to MaxMindDB. Change the IPv4 and IPv6 asnum fields to FT_UINT32s. Change the geographic coordinate fields to FT_DOUBLEs. Bug: 10658 Change-Id: I24aeed637bea1b41d173270bda413af230f4425f Reviewed-on: https://code.wireshark.org/review/26214 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>