Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
maxmind_db.h
Go to the documentation of this file.
1
13#ifndef __MAXMIND_DB_H__
14#define __MAXMIND_DB_H__
15
16#include <epan/prefs.h>
17#include <wsutil/inet_addr.h>
18#include "ws_symbol_export.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif /* __cplusplus */
23
24typedef struct _mmdb_lookup_t {
25 bool found;
26 const char *country;
27 const char *country_iso;
28 const char *city;
29 uint32_t as_number;
30 const char *as_org;
31 double latitude;
32 double longitude;
33 uint16_t accuracy;
35
39WS_DLL_LOCAL void maxmind_db_pref_init(module_t *nameres);
40
44WS_DLL_LOCAL void maxmind_db_pref_cleanup(void);
45
46WS_DLL_LOCAL void maxmind_db_pref_apply(void);
47
55WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t *maxmind_db_lookup_ipv4(const ws_in4_addr *addr);
56
64WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t *maxmind_db_lookup_ipv6(const ws_in6_addr *addr);
65
72WS_DLL_PUBLIC char *maxmind_db_get_paths(void);
73
79WS_DLL_LOCAL bool maxmind_db_lookup_process(void);
80
84static inline bool maxmind_db_has_coords(const mmdb_lookup_t *result)
85{
86 return result && result->found &&
87 result->longitude != DBL_MAX && result->latitude != DBL_MAX;
88}
89
100WS_DLL_PUBLIC void maxmind_db_set_synchrony(bool synchronous);
101
102#ifdef __cplusplus
103}
104#endif /* __cplusplus */
105
106#endif /* __MAXMIND_DB_H__ */
107
108/*
109 * Editor modelines
110 *
111 * Local Variables:
112 * c-basic-offset: 4
113 * tab-width: 8
114 * indent-tabs-mode: nil
115 * End:
116 *
117 * ex: set shiftwidth=4 tabstop=8 expandtab:
118 * :indentSize=4:tabSize=8:noTabs=true:
119 */
WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t * maxmind_db_lookup_ipv6(const ws_in6_addr *addr)
WS_DLL_LOCAL void maxmind_db_pref_init(module_t *nameres)
WS_DLL_PUBLIC WS_RETNONNULL const mmdb_lookup_t * maxmind_db_lookup_ipv4(const ws_in4_addr *addr)
WS_DLL_LOCAL void maxmind_db_pref_cleanup(void)
Definition maxmind_db.c:827
WS_DLL_LOCAL bool maxmind_db_lookup_process(void)
Definition maxmind_db.c:833
WS_DLL_PUBLIC void maxmind_db_set_synchrony(bool synchronous)
Definition maxmind_db.c:854
WS_DLL_PUBLIC char * maxmind_db_get_paths(void)
Definition maxmind_db.c:849
Definition maxmind_db.h:24
Definition inet_addr.h:21
Definition prefs-int.h:27