Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
maxmind_db.h
1 /* maxmind_db.h
2  * Maxmind database support
3  *
4  * Copyright 2018, Gerald Combs <gerald@wireshark.org>
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * SPDX-License-Identifier: GPL-2.0-or-later
11  */
12 
13 #ifndef __MAXMIND_DB_H__
14 #define __MAXMIND_DB_H__
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
20 #include <epan/ipv6.h>
21 #include <epan/prefs.h>
22 #include "ws_symbol_export.h"
23 
24 typedef struct _mmdb_lookup_t {
25  gboolean found;
26  const char *country;
27  const char *country_iso;
28  const char *city;
29  guint32 as_number;
30  const char *as_org;
31  double latitude;
32  double longitude;
34 
38 WS_DLL_LOCAL void maxmind_db_pref_init(module_t *nameres);
39 
43 WS_DLL_LOCAL void maxmind_db_pref_cleanup(void);
44 
52 WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t *maxmind_db_lookup_ipv4(guint32 addr);
53 
61 WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t *maxmind_db_lookup_ipv6(const ws_in6_addr *addr);
62 
68 WS_DLL_PUBLIC gchar *maxmind_db_get_paths(void);
69 
75 WS_DLL_LOCAL gboolean maxmind_db_lookup_process(void);
76 
77 #ifdef __cplusplus
78 }
79 #endif /* __cplusplus */
80 
81 #endif /* __MAXMIND_DB_H__ */
82 
83 /*
84  * Editor modelines
85  *
86  * Local Variables:
87  * c-basic-offset: 4
88  * tab-width: 8
89  * indent-tabs-mode: nil
90  * End:
91  *
92  * ex: set shiftwidth=4 tabstop=8 expandtab:
93  * :indentSize=4:tabSize=8:noTabs=true:
94  */
Definition: inet_ipv6.h:20
Definition: prefs-int.h:27
Definition: maxmind_db.h:24