A device detection library that is used natively or by 51Degrees products

hash.h

1/* *********************************************************************
2 * This Original Work is copyright of 51 Degrees Mobile Experts Limited.
3 * Copyright 2026 51 Degrees Mobile Experts Limited, Davidson House,
4 * Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
5 *
6 * This Original Work is the subject of the following patents and patent
7 * applications, owned by 51 Degrees Mobile Experts Limited of 5 Charlotte
8 * Close, Caversham, Reading, Berkshire, United Kingdom RG4 7BY:
9 * European Patent No. 3438848; and
10 * United States Patent No. 10,482,175.
11 *
12 * This Original Work is licensed under the European Union Public Licence
13 * (EUPL) v.1.2 and is subject to its terms as set out below.
14 *
15 * If a copy of the EUPL was not distributed with this file, You can obtain
16 * one at https://opensource.org/licenses/EUPL-1.2.
17 *
18 * The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
19 * amended by the European Commission) shall be deemed incompatible for
20 * the purposes of the Work and the provisions of the compatibility
21 * clause in Article 5 of the EUPL shall not apply.
22 *
23 * If using the Work as, or as part of, a network application, by
24 * including the attribution notice(s) required under Article 5 of the EUPL
25 * in the end user terms of the application under an appropriate heading,
26 * such notice(s) shall fulfill the requirements of that article.
27 * ********************************************************************* */
28
29#ifndef FIFTYONE_DEGREES_HASH_INCLUDED
30#define FIFTYONE_DEGREES_HASH_INCLUDED
31
39
40#if !defined(DEBUG) && !defined(_DEBUG) && !defined(NDEBUG)
41#define NDEBUG
42#endif
43
44#include <stdlib.h>
45#include <stdio.h>
46#include <string.h>
47#include <limits.h>
48#include <math.h>
49#include <time.h>
50#include <ctype.h>
51#include <assert.h>
52#ifdef _MSC_VER
53#pragma warning(push)
54#pragma warning(disable : 5105)
55#include <windows.h>
56#pragma warning(pop)
57#endif
58#include "../../common/common.h"
59#include "../../common/data.h"
60#include "../../common/exceptions.h"
61#include "../../common/threading.h"
62#include "../../common/file.h"
63#include "../../common/collection.h"
64#include "../../common/evidence.h"
65#include "../../common/list.h"
66#include "../../common/resource.h"
67#include "../../common/properties.h"
68#include "../../common/status.h"
69#include "../../common/date.h"
70#include "../../common/pool.h"
71#include "../../common/component.h"
72#include "../../common/property.h"
73#include "../../common/value.h"
74#include "../../common/profile.h"
75#include "../../common/overrides.h"
76#include "../../common/json.h"
77
78#include "../config-dd.h"
79#include "../dataset-dd.h"
80#include "../results-dd.h"
81#include "graph.h"
82
87#ifndef FIFTYONE_DEGREES_CACHE_CONCURRENCY
88#ifndef FIFTYONE_DEGREES_NO_THREADING
89#define FIFTYONE_DEGREES_CACHE_CONCURRENCY 0
90#else
91#define FIFTYONE_DEGREES_CACHE_CONCURRENCY 1
92#endif
93#endif
94
98#ifndef FIFTYONE_DEGREES_EVIDENCE_HIGH_ENTROPY_VALUES
99#define FIFTYONE_DEGREES_EVIDENCE_HIGH_ENTROPY_VALUES \
100 (FIFTYONE_DEGREES_COMMON_COOKIE_PREFIX \
101 "gethighentropyvalues")
102#endif
103
107#ifndef FIFTYONE_DEGREES_EVIDENCE_STRUCTURED_USER_AGENT
108#define FIFTYONE_DEGREES_EVIDENCE_STRUCTURED_USER_AGENT \
109 (FIFTYONE_DEGREES_COMMON_COOKIE_PREFIX \
110 "structureduseragent")
111#endif
112
116#ifndef FIFTYONE_DEGREES_EVIDENCE_DEVICE_ID
117#define FIFTYONE_DEGREES_EVIDENCE_DEVICE_ID \
118 (FIFTYONE_DEGREES_COMMON_COOKIE_PREFIX \
119 "deviceId")
120#endif
121
125
130typedef enum e_fiftyone_degrees_hash_match_method {
131 FIFTYONE_DEGREES_HASH_MATCH_METHOD_NONE,
132 FIFTYONE_DEGREES_HASH_MATCH_METHOD_PERFORMANCE,
133 FIFTYONE_DEGREES_HASH_MATCH_METHOD_COMBINED,
134 FIFTYONE_DEGREES_HASH_MATCH_METHOD_PREDICTIVE,
137
139#pragma pack(push, 1)
140typedef struct fiftyoneDegrees_hash_dataset_header_t {
141 const int32_t versionMajor;
142 const int32_t versionMinor;
143 const int32_t versionBuild;
144 const int32_t versionRevision;
146 const byte tag[16];
147 const byte exportTag[16];
148 const int32_t copyrightOffset;
150 const int16_t age;
151 const int32_t minUserAgentCount;
153 const int32_t nameOffset;
155 const int32_t formatOffset;
183#pragma pack(pop)
184
190typedef struct fiftyone_degrees_config_hash_t {
205 int32_t difference;
209 int32_t drift;
237
242typedef struct fiftyone_degrees_hash_rootnodes_t {
248
262typedef struct fiftyone_degrees_hash_value_profiles_t {
264 uint32_t keysCount;
265 uint32_t profilesCount;
266 const char **names;
268 uint32_t *propertyIndexes;
273 uint32_t *firstKeys;
275 uint32_t *starts;
277 uint32_t *profiles;
279
289typedef struct fiftyone_degrees_dataset_hash_t {
297 fiftyoneDegreesHeaderPtrs** componentHeaders;
318
320typedef struct fiftyone_degrees_result_hash_t fiftyoneDegreesResultHash;
322
328typedef struct fiftyone_degrees_result_hash_t {
330 uint32_t *profileOffsets;
337 int32_t iterations;
339 int32_t difference;
341 int32_t drift;
343 int32_t matchedNodes;
354
358#define FIFTYONE_DEGREES_RESULTS_HASH_MEMBERS \
359 fiftyoneDegreesResultsDeviceDetection b; \
360 fiftyoneDegreesCollectionItem propertyItem; \
362 fiftyoneDegreesList values; \
364 fiftyoneDegreesEvidenceKeyValuePairArray *evidence; \
375 size_t evidenceBytes; \
376 int evidencePrefixes; \
378 bool profileIdsOverridden;
381
385
386
397
401
410
425
438
453
463
474
478
499 const char *fileName,
500 fiftyoneDegreesException *exception);
501
526 const char *fileName,
527 fiftyoneDegreesException *exception);
528
559 const char *fileName,
560 const char **indexedProperties,
561 int indexedPropertiesCount,
562 fiftyoneDegreesException *exception);
563
587 void *memory,
588 long size,
589 fiftyoneDegreesException *exception);
590
616 void *memory,
617 long size,
618 fiftyoneDegreesException *exception);
619
650 void *memory,
651 long size,
652 const char **indexedProperties,
653 int indexedPropertiesCount,
654 fiftyoneDegreesException *exception);
655
701 fiftyoneDegreesException *exception);
702
722 const char* userAgent,
723 size_t userAgentLength,
724 fiftyoneDegreesException *exception);
740 const char* deviceId,
741 size_t deviceIdLength,
742 fiftyoneDegreesException *exception);
743
765 uint32_t userAgentCapacity,
766 uint32_t overridesCapacity);
767
776
798 int requiredPropertyIndex,
799 fiftyoneDegreesException *exception);
800
823 int requiredPropertyIndex,
824 fiftyoneDegreesException *exception);
825
833
858 int requiredPropertyIndex,
859 fiftyoneDegreesException *exception);
875 const char *propertyName,
876 char* const buffer,
877 size_t const length,
878 char* const separator,
879 fiftyoneDegreesException *exception);
880
901 const char *body,
902 char *buffer,
903 size_t length);
904
921 char* const buffer,
922 size_t const length,
923 fiftyoneDegreesException* exception);
924
940EXTERNAL size_t
943 const int requiredPropertyIndex,
944 char* const buffer,
945 size_t const length,
946 char* const separator,
947 fiftyoneDegreesException *exception);
948
965 char* const buffer,
966 size_t const length,
967 char* const separator,
968 fiftyoneDegreesException* exception);
969
996 int32_t *difference,
997 int32_t *drift,
998 int32_t *iterations,
999 int32_t *matchedNodes,
1000 fiftyoneDegreesException *exception);
1001
1023 uint32_t resultIndex,
1025 int32_t *difference,
1026 int32_t *drift,
1027 int32_t *iterations,
1028 int32_t *matchedNodes,
1029 fiftyoneDegreesException *exception);
1030
1048 uint32_t resultIndex,
1049 fiftyoneDegreesException *exception);
1050
1071 fiftyoneDegreesException *exception);
1072
1094 const char *fileName,
1095 fiftyoneDegreesException *exception);
1096
1120 void *source,
1121 long length,
1122 fiftyoneDegreesException *exception);
1123
1136
1145
1180 char *buffer,
1181 size_t length,
1182 const char *separator);
1183
1195 fiftyoneDegreesDate *date);
1196
1209 fiftyoneDegreesDate *date);
1210
1211
1236 const char *propertyName,
1237 const char *valueName,
1238 void *state,
1240 fiftyoneDegreesException *exception);
1241
1260 const char *propertyName,
1261 const char *valueName,
1262 uint32_t *profileIds,
1263 uint32_t length,
1264 fiftyoneDegreesException *exception);
1265
1282 char* const buffer,
1283 size_t const length,
1285
1299 char* const buffer,
1300 size_t const length,
1301 fiftyoneDegreesException *exception);
1302
1317
1323EXTERNAL uint32_t fiftyoneDegreesHashGetPropertyCount(
1340 const char *propertyName,
1341 fiftyoneDegreesException *exception);
1342
1369EXTERNAL bool fiftyoneDegreesHashGetProperty(
1371 uint32_t propertyIndex,
1372 uint8_t *valueType,
1373 uint8_t *componentId,
1374 uint8_t *displayOrder,
1375 bool *isMandatory,
1376 bool *isList,
1377 bool *isObsolete,
1378 bool *show,
1379 bool *showValues,
1380 uint32_t *mapCount,
1381 bool *isAvailable,
1382 int *requiredPropertyIndex,
1383 fiftyoneDegreesException *exception);
1384
1403 uint32_t propertyIndex,
1404 uint32_t *firstValueIndex,
1405 uint32_t *valueCount,
1406 long *defaultValueIndex,
1407 fiftyoneDegreesException *exception);
1423 uint32_t propertyIndex,
1425 char *buffer,
1426 size_t bufferLength,
1427 fiftyoneDegreesException *exception);
1428
1446 uint32_t propertyIndex,
1447 uint32_t mapIndex,
1448 char *buffer,
1449 size_t bufferLength,
1450 fiftyoneDegreesException *exception);
1451
1455
1459
1460#endif
#define FIFTYONE_DEGREES_ARRAY_TYPE(t, m)
Simple array structure definition macro used for generic types.
Definition array.h:55
size_t fiftyoneDegreesResultsHashGetValuesJson(fiftyoneDegreesResultsHash *results, char *const buffer, size_t const length, fiftyoneDegreesException *exception)
Sets the buffer to a JSON string that represents all the available properties and values in the resul...
fiftyoneDegreesResultsNoValueReason fiftyoneDegreesResultsHashGetNoValueReason(fiftyoneDegreesResultsHash *results, int requiredPropertyIndex, fiftyoneDegreesException *exception)
Gets the reason why a results does not contain valid values for a given property.
char * fiftyoneDegreesHashGetDeviceIdFromResult(fiftyoneDegreesDataSetHash *dataSet, fiftyoneDegreesResultHash *result, char *const buffer, size_t const length, fiftyoneDegreesException *exception)
Get the device id string from the single result provided.
#define FIFTYONE_DEGREES_RESULTS_HASH_MEMBERS
Macro defining the common members of a Hash result.
Definition hash.h:358
size_t fiftyoneDegreesResultsHashGetValuesString(fiftyoneDegreesResultsHash *results, const char *propertyName, char *const buffer, size_t const length, char *const separator, fiftyoneDegreesException *exception)
Sets the buffer the values associated in the results for the property name.
uint32_t fiftyoneDegreesHashGetProfileIdsForPropertyAndValue(fiftyoneDegreesResourceManager *manager, const char *propertyName, const char *valueName, uint32_t *profileIds, uint32_t length, fiftyoneDegreesException *exception)
Gets the ids of the profiles that contain the property and value provided.
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashDefaultConfig
Default detection configuration.
Definition hash.h:460
const char * fiftyoneDegreesResultsHashGetMatchedUserAgent(fiftyoneDegreesResultsHash *results, uint32_t resultIndex, fiftyoneDegreesException *exception)
Gets the matched User-Agent of one result, being the evidence value its component was matched from,...
fiftyoneDegreesStatusCode fiftyoneDegreesHashReloadManagerFromFile(fiftyoneDegreesResourceManager *manager, const char *fileName, fiftyoneDegreesException *exception)
Reload the data set being used by the resource manager using the data file location specified.
bool fiftyoneDegreesHashGetPublished(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesDate *date)
Gets the date the data file in use was published, from its header.
fiftyoneDegreesResultHashArray fiftyoneDegreesResultsHash
Array of Hash results used to easily access and track the size of the array.
Definition hash.h:383
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashInMemoryConfig
DETECTION CONFIGURATIONS.
Definition hash.h:396
bool fiftyoneDegreesHashGetNextUpdate(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesDate *date)
Gets the date 51Degrees expect to publish the next data file, from the header of the data file in use...
fiftyoneDegreesStatusCode fiftyoneDegreesHashInitManagerFromFileWithIndexedProperties(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, const char *fileName, const char **indexedProperties, int indexedPropertiesCount, fiftyoneDegreesException *exception)
Initialises the resource manager as fiftyoneDegreesHashInitManagerFromFile does, and indexes the prof...
bool fiftyoneDegreesHashGetPropertyValueIndexes(fiftyoneDegreesDataSetHash *dataSet, uint32_t propertyIndex, uint32_t *firstValueIndex, uint32_t *valueCount, long *defaultValueIndex, fiftyoneDegreesException *exception)
Gets where the property's values are in the values collection, and which of them is its default.
size_t fiftyoneDegreesResultsHashGetValuesStringAllProperties(fiftyoneDegreesResultsHash *results, char *const buffer, size_t const length, char *const separator, fiftyoneDegreesException *exception)
Sets the buffer to the values in the results of every required property index, one line for each inde...
void fiftyoneDegreesResultsHashGetMatchMetrics(fiftyoneDegreesResultsHash *results, fiftyoneDegreesHashMatchMethod *method, int32_t *difference, int32_t *drift, int32_t *iterations, int32_t *matchedNodes, fiftyoneDegreesException *exception)
Gets the match metrics of the results, taken across every result.
fiftyoneDegreesDataSetHash * fiftyoneDegreesDataSetHashGet(fiftyoneDegreesResourceManager *manager)
Gets a safe reference to the Hash data set from the resource manager.
fiftyoneDegreesStatusCode fiftyoneDegreesHashInitManagerFromMemoryWithIndexedProperties(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, void *memory, long size, const char **indexedProperties, int indexedPropertiesCount, fiftyoneDegreesException *exception)
Initialises the resource manager as fiftyoneDegreesHashInitManagerFromMemory does,...
fiftyoneDegreesHashMatchMethod
DATA STRUCTURES.
Definition hash.h:130
void fiftyoneDegreesDataSetHashRelease(fiftyoneDegreesDataSetHash *dataSet)
Release the reference to a data set returned by the fiftyoneDegreesDataSetHashGet method.
const char * fiftyoneDegreesResultsHashGetNoValueReasonMessage(fiftyoneDegreesResultsNoValueReason reason)
Gets a fuller description of the reason why a value is missing.
char * fiftyoneDegreesHashGetDeviceIdFromResults(fiftyoneDegreesResultsHash *results, char *const buffer, size_t const length, fiftyoneDegreesException *exception)
Get the device id string from the results provided.
fiftyoneDegreesStatusCode fiftyoneDegreesHashReloadManagerFromOriginalFile(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesException *exception)
Reload the data set being used by the resource manager using the data file location which was used wh...
int fiftyoneDegreesHashGetPropertyIndex(fiftyoneDegreesDataSetHash *dataSet, const char *propertyName, fiftyoneDegreesException *exception)
Gets the index of the property with the name provided, which must match exactly.
bool fiftyoneDegreesResultsHashGetHasValues(fiftyoneDegreesResultsHash *results, int requiredPropertyIndex, fiftyoneDegreesException *exception)
Gets whether or not the results provided contain valid values for the property index provided.
uint32_t fiftyoneDegreesHashGetPropertyCount(fiftyoneDegreesDataSetHash *dataSet)
Gets the number of properties the data file defines.
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashLowMemoryConfig
Low memory configuration.
Definition hash.h:424
fiftyoneDegreesResultsHash * fiftyoneDegreesResultsHashCreate(fiftyoneDegreesResourceManager *manager, uint32_t userAgentCapacity, uint32_t overridesCapacity)
Allocates a results structure containing a reference to the Hash data set managed by the resource man...
char * fiftyoneDegreesHashGetPropertyMapText(fiftyoneDegreesDataSetHash *dataSet, uint32_t propertyIndex, uint32_t mapIndex, char *buffer, size_t bufferLength, fiftyoneDegreesException *exception)
Gets the name of one of the maps the property is in, as fiftyoneDegreesPropertyGetMapText gives it.
void fiftyoneDegreesResultsHashFree(fiftyoneDegreesResultsHash *results)
Frees the results structure created by the fiftyoneDegreesResultsHashCreate method.
size_t fiftyoneDegreesHashSizeManagerFromFile(fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, const char *fileName, fiftyoneDegreesException *exception)
EXTERNAL METHODS.
int fiftyoneDegreesResultsHashFromDeviceId(fiftyoneDegreesResultsHash *results, const char *deviceId, size_t deviceIdLength, fiftyoneDegreesException *exception)
Process a single Device Id and populate the device offsets in the results structure.
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashBalancedTempConfig
Balanced configuration modified to create a temporary file copy of the source data file to avoid lock...
Definition hash.h:449
fiftyoneDegreesStatusCode fiftyoneDegreesHashInitManagerFromMemory(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, void *memory, long size, fiftyoneDegreesException *exception)
Initialises the resource manager with a Hash data set resource populated from the Hash data set point...
void fiftyoneDegreesResultsHashFromEvidence(fiftyoneDegreesResultsHash *results, fiftyoneDegreesEvidenceKeyValuePairArray *evidence, fiftyoneDegreesException *exception)
Processes the evidence value pairs in the evidence collection and populates the result in the results...
uint32_t fiftyoneDegreesHashIterateProfilesForPropertyAndValue(fiftyoneDegreesResourceManager *manager, const char *propertyName, const char *valueName, void *state, fiftyoneDegreesProfileIterateMethod callback, fiftyoneDegreesException *exception)
Iterates over the profiles in the data set calling the callback method for any profiles that contain ...
size_t fiftyoneDegreesHashSizeManagerFromMemory(fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, void *memory, long size, fiftyoneDegreesException *exception)
Gets the total size in bytes which will be allocated when intialising a Hash resource and associated ...
fiftyoneDegreesStatusCode fiftyoneDegreesHashReloadManagerFromMemory(fiftyoneDegreesResourceManager *manager, void *source, long length, fiftyoneDegreesException *exception)
Reload the data set being used by the resource manager using a data file loaded into contiguous memor...
void fiftyoneDegreesResultsHashFromUserAgent(fiftyoneDegreesResultsHash *results, const char *userAgent, size_t userAgentLength, fiftyoneDegreesException *exception)
Process a single User-Agent and populate the device offsets in the results structure.
fiftyoneDegreesStatusCode fiftyoneDegreesHashInitManagerFromFile(fiftyoneDegreesResourceManager *manager, fiftyoneDegreesConfigHash *config, fiftyoneDegreesPropertiesRequired *properties, const char *fileName, fiftyoneDegreesException *exception)
Initialises the resource manager with a Hash data set resource populated from the Hash data file refe...
bool fiftyoneDegreesHashGetProperty(fiftyoneDegreesDataSetHash *dataSet, uint32_t propertyIndex, uint8_t *valueType, uint8_t *componentId, uint8_t *displayOrder, bool *isMandatory, bool *isList, bool *isObsolete, bool *show, bool *showValues, uint32_t *mapCount, bool *isAvailable, int *requiredPropertyIndex, fiftyoneDegreesException *exception)
Gets the fields of the property that are not text.
size_t fiftyoneDegreesResultsHashGetValuesStringByRequiredPropertyIndex(fiftyoneDegreesResultsHash *results, const int requiredPropertyIndex, char *const buffer, size_t const length, char *const separator, fiftyoneDegreesException *exception)
Sets the buffer the values associated in the results for the property name.
size_t fiftyoneDegreesHashGetEvidenceKeys(fiftyoneDegreesDataSetHash *dataSet, char *buffer, size_t length, const char *separator)
Writes the evidence keys the data set accepts, each with its prefix, with the separator between them.
bool fiftyoneDegreesResultsHashGetMatchMetricsForResult(fiftyoneDegreesResultsHash *results, uint32_t resultIndex, fiftyoneDegreesHashMatchMethod *method, int32_t *difference, int32_t *drift, int32_t *iterations, int32_t *matchedNodes, fiftyoneDegreesException *exception)
Gets the match metrics of one result, being those fiftyoneDegreesResultsHashGetMatchMetrics takes acr...
size_t fiftyoneDegreesHashGetHardwareProfileScript(const char *body, char *buffer, size_t length)
Writes the script the client runs for a value of the JavascriptHardwareProfile property.
fiftyoneDegreesCollectionItem * fiftyoneDegreesResultsHashGetValues(fiftyoneDegreesResultsHash *results, int requiredPropertyIndex, fiftyoneDegreesException *exception)
Populates the list of values in the results instance with value structure instances associated with t...
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashHighPerformanceConfig
Highest performance configuration.
Definition hash.h:411
char * fiftyoneDegreesHashGetPropertyText(fiftyoneDegreesDataSetHash *dataSet, uint32_t propertyIndex, fiftyoneDegreesPropertyText text, char *buffer, size_t bufferLength, fiftyoneDegreesException *exception)
Gets a text of the property, as fiftyoneDegreesPropertyGetText gives it.
EXTERNAL_VAR fiftyoneDegreesConfigHash fiftyoneDegreesHashBalancedConfig
Uses caching to balance memory usage and performance.
Definition hash.h:439
@ FIFTYONE_DEGREES_HASH_MATCH_METHODS_LENGTH
The length of the enum.
Definition hash.h:135
bool(* fiftyoneDegreesProfileIterateMethod)(void *state, fiftyoneDegreesCollectionItem *item)
Definition of a callback function which is passed an item of a type determined by the iteration metho...
Definition profile.h:163
fiftyoneDegreesPropertyText
The text of a property that fiftyoneDegreesPropertyGetText gives.
Definition property.h:262
fiftyoneDegreesResultsNoValueReason
Enum containing reasons which cause a value to not be present or valid.
Definition results.h:95
fiftyoneDegreesStatusCode
Status returned from the initialisation of a resource.
Definition status.h:81
Definition GettingStarted.c:67
Collection configuration structure which defines how the collection should be created by the create m...
Definition collection.h:296
Collection header structure which defines the size and location of the collection data.
Definition collection.h:283
All the shared methods and fields required by file, memory and cached collections.
Definition collection.h:410
Used to store a handle to the underlying item that could be used to release the item when it's finish...
Definition collection.h:317
Device detection configuration structure containing device detection specific configuration options,...
Definition config-dd.h:52
Hash specific configuration structure.
Definition hash.h:190
fiftyoneDegreesCollectionConfig maps
Maps collection config.
Definition hash.h:195
bool usePerformanceGraph
True if the performance optimized graph should be used for processing.
Definition hash.h:212
fiftyoneDegreesCollectionConfig rootNodes
Root nodes collection config.
Definition hash.h:200
bool usePredictiveGraph
True if the predictive optimized graph should be used for processing.
Definition hash.h:214
fiftyoneDegreesCollectionConfig properties
Properties collection config.
Definition hash.h:196
fiftyoneDegreesCollectionConfig nodes
Nodes collection config.
Definition hash.h:202
fiftyoneDegreesCollectionConfig values
Values collection config.
Definition hash.h:198
fiftyoneDegreesConfigDeviceDetection b
Base configuration.
Definition hash.h:191
fiftyoneDegreesCollectionConfig strings
Strings collection config.
Definition hash.h:192
int32_t drift
The maximum drift to allow when matching hashes.
Definition hash.h:209
bool loadRequiredPropertiesOnly
When true, and the required properties are some but not all of the properties in the data file,...
Definition hash.h:235
bool traceRoute
True if the route through each graph should be traced during processing.
Definition hash.h:216
int32_t difference
The maximum difference to allow when matching hashes.
Definition hash.h:205
fiftyoneDegreesCollectionConfig profiles
Profiles collection config.
Definition hash.h:199
fiftyoneDegreesCollectionConfig components
Components collection config.
Definition hash.h:193
fiftyoneDegreesCollectionConfig profileOffsets
Profile offsets collection config.
Definition hash.h:203
Device detection data set structure which contains the 'must have's for all device detection data set...
Definition dataset-dd.h:52
Dataset header containing information about the dataset.
Definition hash.h:140
const fiftyoneDegreesDate nextUpdate
Date when the next data file will be available.
Definition hash.h:159
const int16_t age
Age of the data set format.
Definition hash.h:150
const int32_t copyrightOffset
Offset of the copyright string in the strings collection.
Definition hash.h:148
const int32_t versionMajor
Major version of the data file loaded.
Definition hash.h:141
const int32_t formatOffset
Offset of the data file format in the strings collection.
Definition hash.h:155
const int32_t versionBuild
Build version of the data file loaded.
Definition hash.h:143
const fiftyoneDegreesCollectionHeader profileOffsets
Size and location of the profile offsets collection.
Definition hash.h:178
const fiftyoneDegreesCollectionHeader rootNodes
Root nodes which point to the start of each graph used in detection.
Definition hash.h:173
const fiftyoneDegreesDate published
Date when the data file was published.
Definition hash.h:157
const int32_t nameOffset
Offset of the data file name in the strings collection.
Definition hash.h:153
const fiftyoneDegreesCollectionHeader properties
Size and location of the properties collection.
Definition hash.h:167
const byte tag[16]
Unique data file tag.
Definition hash.h:146
const fiftyoneDegreesCollectionHeader nodes
Size and location of the nodes collection.
Definition hash.h:176
const fiftyoneDegreesCollectionHeader values
Size and location of the values collection.
Definition hash.h:169
const int32_t versionRevision
Revision version of the data file loaded.
Definition hash.h:144
const int32_t versionMinor
Minor version of the data file loaded.
Definition hash.h:142
const fiftyoneDegreesCollectionHeader components
Size and location of the components collection.
Definition hash.h:163
const byte exportTag[16]
Tag identifying the data file export.
Definition hash.h:147
const int32_t minUserAgentCount
Minimum count for a User-Agent to be included in the data file export.
Definition hash.h:151
const fiftyoneDegreesCollectionHeader maps
Size and location of the maps collection.
Definition hash.h:165
const fiftyoneDegreesCollectionHeader strings
Size and location of the strings collection.
Definition hash.h:161
const fiftyoneDegreesCollectionHeader profiles
Size and location of the profiles collection.
Definition hash.h:171
Data set structure containing all the components used for detections.
Definition hash.h:289
fiftyoneDegreesCollection * profiles
Collection of all profiles.
Definition hash.h:307
uint32_t componentsAvailableCount
Number of components with properties.
Definition hash.h:302
fiftyoneDegreesHeaderPtrs ** componentHeaders
Array of headers for each component index.
Definition hash.h:297
const fiftyoneDegreesDataSetHashHeader header
Dataset header.
Definition hash.h:291
fiftyoneDegreesDataSetDeviceDetection b
Base data set.
Definition hash.h:290
fiftyoneDegreesList componentsList
List of component items from the components collection.
Definition hash.h:295
fiftyoneDegreesCollection * maps
Collection data file maps.
Definition hash.h:304
bool * componentsAvailable
Array of flags indicating if there are any properties available for the component with the matching i...
Definition hash.h:299
fiftyoneDegreesCollection * nodes
Collection of all hash nodes.
Definition hash.h:309
fiftyoneDegreesCollection * components
Collection of all components.
Definition hash.h:294
fiftyoneDegreesCollection * strings
Collection of all strings.
Definition hash.h:293
const fiftyoneDegreesConfigHash config
Copy of the configuration.
Definition hash.h:292
fiftyoneDegreesCollection * rootNodes
Collection of all root nodes.
Definition hash.h:308
fiftyoneDegreesCollection * profileOffsets
Collection of all offsets to profiles in the profiles collection.
Definition hash.h:310
fiftyoneDegreesCollection * properties
Collection of all properties.
Definition hash.h:305
fiftyoneDegreesCollection * values
Collection of all values.
Definition hash.h:306
fiftyoneDegreesHashValueProfiles * valueProfiles
Profiles holding each value of the properties named to index, or NULL when none were named.
Definition hash.h:313
Used to store the date when the dataset was produced and next date 51Degrees expect to provide a new ...
Definition date.h:63
Array of evidence key value pairs and a pointer to the next array if present or NULL of not present.
Definition evidence.h:195
Structure used to represent a 51Degrees exception and passed into methods that might generate excepti...
Definition exceptions.h:115
Trace node structure used to trace the route taken when evaluating a graph.
Definition graph.h:159
Data structure containing the root nodes for the combination of an evidence item and a component.
Definition hash.h:242
uint32_t predictiveNodeOffset
Offset in the nodes collection of the root node for the predictive graph.
Definition hash.h:245
uint32_t performanceNodeOffset
Offset in the nodes collection of the root node for the performance graph.
Definition hash.h:243
Index from each value of the properties named when the data set is initialised to the profiles holdin...
Definition hash.h:262
uint32_t propertiesCount
Number of properties named.
Definition hash.h:263
uint32_t * starts
Position in profiles of the first profile of each key, then profilesCount.
Definition hash.h:275
uint32_t keysCount
Number of values with a key.
Definition hash.h:264
uint32_t * profiles
Positions in the profile offsets collection.
Definition hash.h:277
uint32_t * propertyIndexes
Index in the properties collection of each property, or UINT32_MAX when the data file has no property...
Definition hash.h:268
uint32_t * firstKeys
Key of the first value of each property, then keysCount.
Definition hash.h:273
uint32_t * firstValueIndexes
Index in the values collection of the first value of each property.
Definition hash.h:271
uint32_t profilesCount
Number of entries in profiles.
Definition hash.h:265
const char ** names
Copy of each name the caller gave, in the order given, without nulls or repeats.
Definition hash.h:266
List structure which contains a list of collection items.
Definition list.h:116
Defines a set of properties which are required by a caller.
Definition properties.h:240
Manager structure used to provide access to a shared and changing resource.
Definition resource.h:177
Array of items of type fiftyoneDegreesResultHash used to easily access and track the size of the arra...
Definition hash.h:371
Singular User-Agent result returned by a Hash process method.
Definition hash.h:328
byte componentIndex
Index of the component the result was taken for when the results were populated, or UINT8_MAX if none...
Definition hash.h:344
fiftyoneDegreesResultUserAgent b
Base User-Agent result.
Definition hash.h:329
int32_t iterations
Number of iterations required to get the device offset.
Definition hash.h:337
int32_t matchedNodes
The number of hashes matched in the User-Agent.
Definition hash.h:343
int32_t drift
The maximum drift for a matched substring from the character position where it was expected to be fou...
Definition hash.h:341
uint32_t * profileOffsets
Array of profile offsets where the index is the component index.
Definition hash.h:330
int32_t difference
The total difference in hash code values between the matched substring and the actual substring.
Definition hash.h:339
fiftyoneDegreesGraphTraceNode * trace
The graph trace constructed during processing if the option was enabled (and the executable was compi...
Definition hash.h:347
fiftyoneDegreesHashMatchMethod method
The method used to provide the match result.
Definition hash.h:335
bool * profileIsOverriden
Array of boolean flags indicating whether the result profile offset at the same index is one which ha...
Definition hash.h:332
Singular User-Agent result returned by a device detection process method.
Definition results-dd.h:49