forked from osmocom/wireshark
sharkd: support for MaxMindDB.
Call maxmind_db_lookup_process() [via host_name_lookup_process()] before processing request. It's still buggy, webshark needs a refresh to show endpoint or conversation ipmap, but it's better than nothing. It seems to need refresh, cause maxmind_db_lookup_ipv[46] works only for cached entries. Also cause mmdbresolve is pipe-based, every sharkd need to have it own mmdbresolve process. Change-Id: I3d588d1fa9e9ba645cc3d0bff3d276b202159d21 Reviewed-on: https://code.wireshark.org/review/27335 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>pespin/amr
parent
a834d3794d
commit
5cdff26107
7
sharkd.c
7
sharkd.c
|
@ -52,6 +52,7 @@
|
|||
#include "epan/register.h"
|
||||
#include <epan/epan_dissect.h>
|
||||
#include <epan/tap.h>
|
||||
#include <epan/uat-int.h>
|
||||
|
||||
#include <codecs/codecs.h>
|
||||
|
||||
|
@ -195,6 +196,12 @@ main(int argc, char *argv[])
|
|||
/* Build the column format array */
|
||||
build_column_format_array(&cfile.cinfo, prefs_p->num_cols, TRUE);
|
||||
|
||||
#ifdef HAVE_MAXMINDDB
|
||||
/* mmdbresolve is started from mmdb_resolve_start(), which is called from epan_load_settings via: read_prefs -> (...) uat_load_all -> maxmind_db_post_update_cb.
|
||||
* Need to stop it, otherwise all sharkd will have same mmdbresolve process, including pipe descriptors to read and write. */
|
||||
uat_clear(uat_get_table_by_name("MaxMind Database Paths"));
|
||||
#endif
|
||||
|
||||
ret = sharkd_loop();
|
||||
clean_exit:
|
||||
col_cleanup(&cfile.cinfo);
|
||||
|
|
|
@ -4003,6 +4003,11 @@ sharkd_session_main(void)
|
|||
|
||||
filter_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, sharkd_session_filter_free);
|
||||
|
||||
#ifdef HAVE_MAXMINDDB
|
||||
/* mmdbresolve was stopped before fork(), force starting it */
|
||||
uat_get_table_by_name("MaxMind Database Paths")->post_update_cb();
|
||||
#endif
|
||||
|
||||
while (fgets(buf, sizeof(buf), stdin))
|
||||
{
|
||||
/* every command is line seperated JSON */
|
||||
|
@ -4033,6 +4038,10 @@ sharkd_session_main(void)
|
|||
return 2;
|
||||
}
|
||||
|
||||
#if defined(HAVE_C_ARES) || defined(HAVE_MAXMINDDB)
|
||||
host_name_lookup_process();
|
||||
#endif
|
||||
|
||||
sharkd_session_process(buf, tokens, ret);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue