summaryrefslogtreecommitdiff
path: root/epan/geoip_db.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-14Update Windows binaries to GeoIP 1.6.10 with a local GeoIP_free functionPascal Quantin1-1/+1
This solves a crash occurring when trying to free memory allocated by GeoIP (cross-compiled with mingw(32|64)) with MSVC function Bug: 13598 Change-Id: I757cff13660bd485d7ea91d10660e9bf86404728 Reviewed-on: https://code.wireshark.org/review/21090 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-1/+1
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-02-22geoip_db: replace g_free with free.Dario Lombardo1-16/+22
Fix also a const cast by using the proper constness. Change-Id: Ifcf1854051c7f5dec911331d9cfc809e6b2dd42e Reviewed-on: https://code.wireshark.org/review/20246 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: João Valverde <j@v6e.pt>
2017-02-06geoip_db: remove leak.Dario Lombardo1-0/+2
Change-Id: I40911820fa09111c167a5c526027f10381038dbb Reviewed-on: https://code.wireshark.org/review/19952 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-01-13geoip: free resources to avoid leak.Dario Lombardo1-1/+4
Change-Id: Ia4a938e8a6b3856959c375f4bfcdf565a21eabef Reviewed-on: https://code.wireshark.org/review/19629 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Dario Lombardo <lomato@gmail.com>
2017-01-12uat: add a reset callback.Dario Lombardo1-3/+17
This function will free the resources allocated by the caller. Change-Id: Ib486c14e4fd3c321662fb71f7fd06733ce9a64a4 Reviewed-on: https://code.wireshark.org/review/19375 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-11-22Improve name resolution preference tooltips.Jaap Keuter1-3/+3
Change the tooltips texts to make them better describe the preference. Bug: 13130 Bug: 13131 Change-Id: Ie753e3703a702bdafed91cf0f41b306347088526 Reviewed-on: https://code.wireshark.org/review/18878 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-30Add GeoIP database UN*X system pathJoão Valverde1-7/+18
Most distros provide GeoIP database packages that install to /usr/share/GeoIP. Use this as a system default. Change-Id: I2b4ddf7e2467263491b18a97e908a247db0ac9a3 Reviewed-on: https://code.wireshark.org/review/16767 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-06-19Don't assume we have an array of GeoIP databases.Guy Harris1-1/+1
The attempt to open them might fail; if geoip_dat_arr is null, just return 0 as the number of databases, don't crash. Change-Id: I967d863d328a42d7dce79f58d4fa67d922d0cb2c Reviewed-on: https://code.wireshark.org/review/16025 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18We need epan/wmem/wmem.h regardless of whether we have GeoIP.Guy Harris1-4/+6
It's used to generate the "sorry, we don't have GeoIP" message. Change-Id: Ibd4e15508d3e2d09d81951b4dc23a1264971bb7a Reviewed-on: https://code.wireshark.org/review/6610 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18Try to make Mac OS X Buildbots happyAlexis La Goutte1-2/+2
fix return makes pointer from integer without a cast Change-Id: Iaa55de58c36b1a59b08946836e519fee7bb889fc Reviewed-on: https://code.wireshark.org/review/6607 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-18Remove emem from GeoIPMichael Mann1-23/+56
Change-Id: Ifa96dc38a277b86c28f762489251dcc595afae67 Reviewed-on: https://code.wireshark.org/review/6603 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-13Consistently use the "g_string_free returns a C string pointer" idiom.Guy Harris1-4/+1
g_string_free(str, FALSE) frees the GString container but not the underlying g_malloc()ed string; instead, it returns a pointer to the g_malloc()ed string. Fix those places that didn't already get the string pointer from g_string_free() to do so rather than manually extracting the string themselves. And fix one place that didn't even need to use a string - it was just scanning a C string without even modifying it. Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5 Reviewed-on: https://code.wireshark.org/review/6532 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-17Qt: Add the "Map" button to the Endpoints dialog.Gerald Combs1-0/+6
Move the map creation code from ui/gtk/hostlist_table.c to ui/traffic_table_ui.c. Add CMake commands to copy ipmap.html to the run directory so that WIRESHARK_RUN_FROM_BUILD_DIRECTORY works for the endpoint map. Not sure if they're entirely correct but they appear to work. Add boundary checkes to geoip_db_lookup_ipv[46]. To do: - It looks like there are prettier maps and newer APIs that we might want to use. Change-Id: Ie06992c9bc9c9aa683328aecab3f5f69c9cab966 Reviewed-on: https://code.wireshark.org/review/4011 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-17Qt: Remove duplicate GeoIP columns.Gerald Combs1-2/+2
Different GeoIP databases have the same column name, e.g. "City" currently matches two revisions each for IPv4 and IPv6. Map each uniquely named column to a list of databases and populate EndpointTreeWidgetItem columns based on the first database match. Fix a copy/pasteo introduced in g30f3d52: Make sure geoip_db_lookup_ipv[46] returns longitude instead of latitude. Change-Id: Idd31f976dfd1cb011cfa7b5aec14b7031ee0e25e Reviewed-on: https://code.wireshark.org/review/4157 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-09-05Qt: Refactor ConversationDialog for endpoints.Gerald Combs1-40/+29
Create a TrafficTableDialog (for lack of a better name) parent class from the general parts of ConversationDialog. Use it to create EndpointsDialog. Move the contents of conversation_tree_widget.{cpp,h} to conversation_dialog.{cpp,h} to match endpoint_dialog and traffic_table_dialog. Fill in GeoIP columns dynamically instead of using a hard-coded limit. Use "endp_" and "ENDP_" prefixes for a lot of endpoint variables and defines. Try to make geoip_db_lookup_ipv4 and geoip_db_lookup_ipv6 more robust. Clean up some includes. Fix a shadowed variable. Change-Id: I23054816ac7f8c6edb3b1f01c8536db37ba4122d Reviewed-on: https://code.wireshark.org/review/3462 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-01-14Don't cast away constness.Guy Harris1-1/+1
svn path=/trunk/; revision=54798
2014-01-13Get rid of unused routine (the initialization is done inGuy Harris1-29/+0
geoip_db_post_update_cb() - as the comment says, "and also once on startup"). svn path=/trunk/; revision=54726
2013-10-25Add a very small hack to make the UAT update callback error string freeable, andEvan Huus1-1/+1
convert all existing UAT update callbacks to use glib memory instead of ephemeral memory for that string. UAT code paths are entirely distinct from packet dissection, so using ephemeral memory was the wrong choice, because there was no guarantees about when it would be freed. The move away from emem still needs to be propogated deeper into the UAT code itself at some point. Net effect: remove another bunch of emem calls from dissectors, where replacing with wmem would have caused assertions. svn path=/trunk/; revision=52854
2013-07-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-1/+2
there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
2013-03-21From beroset:Bill Meier1-8/+8
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachments #10423,#10424 svn path=/trunk/; revision=48450
2013-02-21String passed to val_to_str() must have int format specifier (%u, %d, %x, ↵Jakub Zawadzki1-1/+1
and so on...). Fix some cases (easy to grep) by call to val_to_str_const(). svn path=/trunk/; revision=47807
2012-12-26geoip_db_get_paths() is exported from libwireshark, so it has to existGuy Harris1-0/+5
regardless of whether we have GeoIP or not. However, regardless of whether it's exported from GeoIP or not, it should return a g_mallocated string. svn path=/trunk/; revision=46798
2012-12-26Don't define geoip_db_get_paths() unless we have GeoIP - we don't use itGuy Harris1-5/+0
unless it's defined. svn path=/trunk/; revision=46791
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-07-18Fix some system header files that were #included with "" instead of <>.Evan Huus1-2/+2
They made cppcheck unhappy. svn path=/trunk/; revision=43779
2012-07-13Fix crash in geoip_db_pref_init() when changing to a new profile.Bill Meier1-2/+2
(Use g_free() not free() for g_malloc'd memory). svn path=/trunk/; revision=43688
2012-07-08From Evan Huus:Guy Harris1-10/+64
Don't initialize GeoIP from epan_init(), as we probably haven't loaded the preferences for it yet (thanks to it's new use of the UAT framework). Instead, register a post_update callback with UAT and load it there. As a bonus, this also means that applying GeoIP preferences no longer requires restarting Wireshark - everything should Just Work with the new databases right away. Fixes bug 7446. svn path=/trunk/; revision=43604
2012-07-08UATs could be put into "categories". The categories were defined onlyGuy Harris1-2/+4
implicitly by the #define name and string they were defined to; not all UATs neatly fit into any of the categories, so some of them were put into categories that weren't obviously correct for them, and one - the display filter macro UAT - wasn't put into any category at all (which caused crashes when editing them, as the GUI code that handled UAT changes from a dialog assumed the category field was non-null). The category was, in practice, used only to decide, in the aforementioned GUI code, whether the packet summary pane needed to be updated or not. It also offered no option of "don't update the packet summary pane *and* don't redissect anything", which is what would be appropriate for the display filter macro UAT. Replace the category with a set of fields indicating what the UAT affects; we currently offer "dissection", which applies to most UATs (any UAT in libwireshark presumably affects dissection at a minimum) and "the set of named fields that exist". Changing any UAT that affects dissection requires a redissection; changing any UAT that affects the set of named fields that exist requires a redissection *and* rebuilding the packet summary pane. Perhaps we also need "filtering", so that if you change a display filter macro, we re-filter, in case the display is currently filtered with a display filter that uses a macro that changed. svn path=/trunk/; revision=43603
2012-07-06From Michael Mann:Anders Broman1-11/+18
Generic preferences implementation - Printing and Name Resolution. svn path=/trunk/; revision=43579
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-28Constify the "string to return if not found" argument toGuy Harris1-13/+7
geoip_db_lookup_ipv4() and geoip_db_lookup_ipv6(). In both of those routines, "ret" is always set to a non-null value - it's initially set to the aforementioned string - so always return it. svn path=/trunk/; revision=43526
2012-03-21'tab-width/tabstop/tabSize' in editor modelines should really always be 8.Bill Meier1-1/+1
svn path=/trunk/; revision=41725
2011-10-06Don't stuff "(null)" into the protocol tree.Gerald Combs1-14/+26
svn path=/trunk/; revision=39300
2011-10-06Assume all strings coming from GeoIP are ISO-8859-1. Fix IPv6Gerald Combs1-4/+35
destination GeoIP lookups. svn path=/trunk/; revision=39299
2011-10-06It seems like GEOIP_NETSPEED_EDITION_REV1_V6 was added to GeoIP 1.4.8.Stig Bjørlykke1-1/+3
svn path=/trunk/; revision=39291
2011-10-06Don't break strict aliasing rules.Gerald Combs1-6/+8
svn path=/trunk/; revision=39287
2011-10-05GEOIP_NETSPEED_EDITION_V6 → GEOIP_NETSPEED_EDITION_REV1_V6.Gerald Combs1-1/+1
svn path=/trunk/; revision=39285
2011-10-05Add a dummy version of geoip_db_lookup_ipv6(). Should fix compilation onGerald Combs1-0/+5
a few of the build slaves. svn path=/trunk/; revision=39284
2011-10-05Fix GeoIP-sans-IPv6 compilation.Gerald Combs1-1/+1
svn path=/trunk/; revision=39281
2011-10-05Add GeoIP IPv6 database support. Tested with GeoIP 1.4.7, but olderGerald Combs1-5/+136
versions *should* be supported. svn path=/trunk/; revision=39280
2011-09-21Fix ex "modeline" so it works;Bill Meier1-161/+161
See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5748 Convert "4 space tabs" to spaces; Use consistent indentation. svn path=/trunk/; revision=39079
2011-09-20From Dirk via bug 6361:Stig Bjørlykke1-2/+2
Use File/Directory Dialog as a field type for UAT preferences. svn path=/trunk/; revision=39059
2011-05-17Make some routines static that aren't used outside the source file inGuy Harris1-1/+1
which they're defined. svn path=/trunk/; revision=37226
2011-01-22Close dir opened by ws_dir_open().Stig Bjørlykke1-0/+1
svn path=/trunk/; revision=35619
2011-01-06GEOIP_COUNTRY_EDITION_V6 isn't guaranteed to be defined.Gerald Combs1-0/+2
svn path=/trunk/; revision=35402
2010-12-29Add GEOIP_COUNTRY_EDITION_V6 to geoip_type_name_vals[].Chris Maynard1-0/+1
svn path=/trunk/; revision=35302
2010-10-29Make the third argument to a UAT copy callback a size_t (not that any ofGuy Harris1-1/+1
the callbacks we have use that argument - is it really needed?). svn path=/trunk/; revision=34694
2010-03-04From LEGO via bug 3459:Stig Bjørlykke1-0/+1
Add a callback to UAT to be called after the table has being updated, use it to renew the snmp_ue_cache. svn path=/trunk/; revision=32112