aboutsummaryrefslogtreecommitdiffstats
path: root/epan/maxmind_db.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-10 09:18:03 -0800
committerGerald Combs <gerald@wireshark.org>2018-03-10 19:21:42 +0000
commit6a819d9950e41244b742073f0962e2c5a80eb735 (patch)
treed2e4c12c68b61f0dfcd13f4c788a4f6898226c8c /epan/maxmind_db.c
parent5564c222e27740166ec36f0cc1e858bcb429f68c (diff)
MaxMindDB: Add country ISO codes.
Add and dissect country ISO codes. Prefer them when printing summary information. Change-Id: I3ce2bde88fa5ca2604c8bb745c42f239660252ff Reviewed-on: https://code.wireshark.org/review/26415 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan/maxmind_db.c')
-rw-r--r--epan/maxmind_db.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/maxmind_db.c b/epan/maxmind_db.c
index 9e8b67a41d..93b5a15ce0 100644
--- a/epan/maxmind_db.c
+++ b/epan/maxmind_db.c
@@ -93,7 +93,7 @@ static void mmdb_resolve_stop(void);
// Hopefully scanning a few lines asynchronously has less overhead than
// reading in a child thread.
#define RES_STATUS_ERROR "mmdbresolve.status: false"
-#define RES_COUNTRY_ISO_CODE "country.iso_code" // Unused.
+#define RES_COUNTRY_ISO_CODE "country.iso_code"
#define RES_COUNTRY_NAMES_EN "country.names.en"
#define RES_CITY_NAMES_EN "city.names.en"
#define RES_ASN_ORG "autonomous_system_organization"
@@ -162,6 +162,9 @@ process_mmdbr_stdout(void) {
cur_addr[0] = '\0';
memset(&cur_lookup, 0, sizeof(cur_lookup));
mmdb_resolve_stop();
+ } else if (val_start && g_str_has_prefix(line, RES_COUNTRY_ISO_CODE)) {
+ cur_lookup.found = TRUE;
+ cur_lookup.country_iso = chunkify_string(val_start);
} else if (val_start && g_str_has_prefix(line, RES_COUNTRY_NAMES_EN)) {
cur_lookup.found = TRUE;
cur_lookup.country = chunkify_string(val_start);