aboutsummaryrefslogtreecommitdiffstats
path: root/epan/maxmind_db.h
diff options
context:
space:
mode:
authorDavid Perry <boolean263@protonmail.com>2021-01-07 16:21:42 -0500
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-04-02 06:48:42 +0000
commitc0abaa06f717a38ba15c24f10ee19fcc69b21537 (patch)
tree79e01e7dd752f0e0584e4ff7aa1ad06d0cb2d283 /epan/maxmind_db.h
parentb13065cdc08898298cb05a4aa5f297a81438c83a (diff)
maxmind: add optional synchronous lookups
When tshark enables synchronous resolution of IP addresses to names, forces calls to maxmind_db_lookup_ipv4()/_ipv6() to block-wait for the maxmind response. Proposed fix for #14691.
Diffstat (limited to 'epan/maxmind_db.h')
-rw-r--r--epan/maxmind_db.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/maxmind_db.h b/epan/maxmind_db.h
index 1328b2a583..94e492d109 100644
--- a/epan/maxmind_db.h
+++ b/epan/maxmind_db.h
@@ -85,6 +85,18 @@ static inline gboolean maxmind_db_has_coords(const mmdb_lookup_t *result)
result->longitude != DBL_MAX && result->latitude != DBL_MAX;
}
+/**
+ * Select whether lookups should be performed synchronously.
+ * Default is asynchronous lookups.
+ *
+ * @param synchronous Whether maxmind lookups should be synchronous.
+ *
+ * XXX - if we ever have per-session host name etc. information, we
+ * should probably have the "resolve synchronously or asynchronously"
+ * flag be per-session, set with an epan API.
+ */
+WS_DLL_PUBLIC void maxmind_db_set_synchrony(gboolean synchronous);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */