-
Notifications
You must be signed in to change notification settings - Fork 1
/
IP2Country.h
executable file
·32 lines (24 loc) · 1.23 KB
/
IP2Country.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#ifndef IP2CountryH
#define IP2CountryH
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
class clsIpP2Country {
private:
uint32_t ui32Size, ui32IPv6Size;
uint32_t * ui32RangeFrom, * ui32RangeTo;
uint8_t * ui8RangeCI, * ui8IPv6RangeCI;
uint8_t * ui128IPv6RangeFrom, * ui128IPv6RangeTo;
void LoadIPv4();
void LoadIPv6();
public:
static clsIpP2Country * mPtr;
uint32_t ui32Count, ui32IPv6Count;
clsIpP2Country();
~clsIpP2Country();
const char * Find(const uint8_t * ui128IpHash, const bool &bCountryName);
uint8_t Find(const uint8_t * ui128IpHash);
static const char * GetCountry(const uint8_t &ui8dx, const bool &bCountryName);
void Reload();
};
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#endif