◆ getHeaderCount()
static int getHeaderCount | ( | ) |
Method to obtain the number of unique headers.
- Returns
- the number of unique headers
\r\n
#define | VMODFOD_MSG_FORMAT "vmod_fiftyonedegrees: %s\n"
Error message format.
|
#define | VMODFOD_PROP_NO_VALUES_MSG_FORMAT "vmod_fiftyonedegrees: Property %s has no values (Reason: %s)\n"
Property has no values message format.
|
#define | VMODFOD_UNRECOGNIZED_PERF_PROFILE_MSG_FORMAT "vmod_fiftyonedegrees: Cannot recognize the performance profile %s. Revert to DEFAULT\n"
Performance profile is not recognized.
|
void | privResourceFree (void *ptr)
Method used on shutdown to free the 51Degrees ResourceManager and ConfigHash. More...
|
int | init_function (const struct vrt_ctx *ctx, struct vmod_priv *priv, enum vcl_event_e e)
VMOD init Initialise the 51Degrees ResourceManager and ConfigHash by allocating memory ready to be allocated. More...
|
static unsigned | getString (const int32_t offset, char *buffer, unsigned bufferSize)
Method used to get string from the strings collection of the 51Degrees dataset. More...
|
VCL_STRING | vmod_get_dataset_name (const struct vrt_ctx *ctx)
VMOD function Get the name of the dataset. More...
|
VCL_STRING | vmod_get_dataset_format (const struct vrt_ctx *ctx)
VMOD function Get the format of the dataset. More...
|
VCL_STRING | vmod_get_dataset_published_date (const struct vrt_ctx *ctx)
VMOD function Get the published date of the dataset. More...
|
void | vmod_set_properties (const struct vrt_ctx *ctx, VCL_STRING properties)
VMOD Function Set the properties which should be initialised in the dataset. More...
|
void | vmod_set_delimiter (const struct vrt_ctx *ctx, VCL_STRING delimiter)
VMOD Function Set the delimiter to use when returning values for multiple properties. More...
|
void | vmod_set_performance_profile (const struct vrt_ctx *ctx, VCL_STRING performanceProfile)
VMOD Function Set the performance profile which dictates how Device Detection allocates memory and manage data. More...
|
void | vmod_set_drift (const struct vrt_ctx *ctx, VCL_INT drift)
VMOD Function Set the drift value to allow substrings to be matched at a wider range. More...
|
void | vmod_set_difference (const struct vrt_ctx *ctx, VCL_INT difference)
VMOD Function Set the difference value to allow User-Agents where characters are slightly different from what is expected. More...
|
void | vmod_set_allow_unmatched (const struct vrt_ctx *ctx, VCL_STRING allowUnmatched)
VMOD Function Set whether unmatched result should be allowed. More...
|
void | vmod_set_use_performance_graph (const struct vrt_ctx *ctx, VCL_STRING usePerformanceGraph)
VMOD Function Set whether performance optimized graph should be used. More...
|
void | vmod_set_use_predictive_graph (const struct vrt_ctx *ctx, VCL_STRING usePredictiveGraph)
VMOD Function Set whether predictive optimized graph should be used. More...
|
void | vmod_set_max_concurrency (const struct vrt_ctx *ctx, VCL_INT concurrency)
VMOD Function Set the maximum number of expected concurrent requests. More...
|
static void | logExceptionMessage (Exception *exception)
Method used to log the exception message to the standard error. More...
|
static void | loadFileError (const char *filePath)
Method to print appropriate error message. More...
|
static void | loadFileErrorAbort (const char *filePath)
Method to print appropriate error message and then terminate. More...
|
static void | initConfig ()
Method used to init a ConfigHash object.
|
void | vmod_start (const struct vrt_ctx *ctx, VCL_STRING filePath)
VMOD Function Start the 51Degrees module using the data file provided. More...
|
void | vmod_reload (const struct vrt_ctx *ctx, struct vmod_reload_arg *a)
VMOD Function Reload resource manager using the input file path. More...
|
static int32_t | getSeparatorCount (const char *input)
Get the number of separators contained in a string. More...
|
static void | stringToArray (char *propertiesString, char **propertiesArray, int propertiesCount)
Populate an array of strings from a comma separated string. More...
|
static int | getRequiredPropertyCount (ResultsHash *results)
Method used to get the number of required properties. More...
|
static const char * | getRequiredPropertyName (ResultsHash *results, int index)
Method used to get the name of the required property at the given index. More...
|
static unsigned | writeValue (ResultsHash *results, int requiredPropertyIndex, char *p, unsigned u)
Method used to obtain the required property value by using its' index. More...
|
unsigned | getValue (ResultsHash *results, char *requiredPropertyName, char *p, unsigned u)
Write the values for the required property to the workspace memory. More...
|
static unsigned | printValuesToWorkspace (char *p, unsigned u, ResultsHash *results, char **propertiesArray, int propertiesCount)
Write the values for all the requested properties to the workspace memory. More...
|
VCL_STRING | vmod_match_single (const struct vrt_ctx *ctx, VCL_STRING userAgent, VCL_STRING propertyInputString)
VMOD Function Match the User-Agent provided, and return the values for the properties requested for the matched device. More...
|
static int | getHeaderCount ()
Method to obtain the number of unique headers. More...
|
static const char * | getHeaderName (int headerIndex)
Method to obtain header name at a given index. More...
|
static char * | searchHeaders (const struct vrt_ctx *ctx, const char *headerName)
Get the value of the header for the request context. More...
|
static void | setImportantHeaders (const struct vrt_ctx *ctx, EvidenceKeyValuePairArray *evidence)
Method to fill evidence with all available HTTP request header. More...
|
ResultsHash * | obtainResultsFromAvailableHeaders (const struct vrt_ctx *ctx, Exception *exception)
Obtain the results from the available headers. More...
|
VCL_STRING | vmod_match_all (const struct vrt_ctx *ctx, VCL_STRING propertyInputString)
VMOD Function Match the HTTP request headers, and return the values for the properties requests for the matched device. More...
|
vmodfod_global | global = VMODFOD_DEFAULTGLOBAL
Global structure available to the module.
|
static int getHeaderCount | ( | ) |
Method to obtain the number of unique headers.
static const char* getHeaderName | ( | int | headerIndex | ) |
Method to obtain header name at a given index.
static int getRequiredPropertyCount | ( | ResultsHash * | results | ) |
Method used to get the number of required properties.
static const char* getRequiredPropertyName | ( | ResultsHash * | results, |
int | index | ||
) |
Method used to get the name of the required property at the given index.
static int32_t getSeparatorCount | ( | const char * | input | ) |
Get the number of separators contained in a string.
Separators include ',', '|', ' ', and '\t'.
static unsigned getString | ( | const int32_t | offset, |
char * | buffer, | ||
unsigned | bufferSize | ||
) |
Method used to get string from the strings collection of the 51Degrees dataset.
unsigned getValue | ( | ResultsHash * | results, |
char * | requiredPropertyName, | ||
char * | p, | ||
unsigned | u | ||
) |
Write the values for the required property to the workspace memory.
int init_function | ( | const struct vrt_ctx * | ctx, |
struct vmod_priv * | priv, | ||
enum vcl_event_e | e | ||
) |
VMOD init Initialise the 51Degrees ResourceManager and ConfigHash by allocating memory ready to be allocated.
static void loadFileError | ( | const char * | filePath | ) |
Method to print appropriate error message.
static void loadFileErrorAbort | ( | const char * | filePath | ) |
Method to print appropriate error message and then terminate.
static void logExceptionMessage | ( | Exception * | exception | ) |
Method used to log the exception message to the standard error.
ResultsHash* obtainResultsFromAvailableHeaders | ( | const struct vrt_ctx * | ctx, |
Exception * | exception | ||
) |
Obtain the results from the available headers.
The results should be freed by ResultsHashFree to prevent memory leak
static unsigned printValuesToWorkspace | ( | char * | p, |
unsigned | u, | ||
ResultsHash * | results, | ||
char ** | propertiesArray, | ||
int | propertiesCount | ||
) |
Write the values for all the requested properties to the workspace memory.
void privResourceFree | ( | void * | ptr | ) |
Method used on shutdown to free the 51Degrees ResourceManager and ConfigHash.
static char* searchHeaders | ( | const struct vrt_ctx * | ctx, |
const char * | headerName | ||
) |
Get the value of the header for the request context.
static void setImportantHeaders | ( | const struct vrt_ctx * | ctx, |
EvidenceKeyValuePairArray * | evidence | ||
) |
Method to fill evidence with all available HTTP request header.
static void stringToArray | ( | char * | propertiesString, |
char ** | propertiesArray, | ||
int | propertiesCount | ||
) |
Populate an array of strings from a comma separated string.
The comma characters are replaced with null terminators to allow the array elements to point to the strings directly.
VCL_STRING vmod_get_dataset_format | ( | const struct vrt_ctx * | ctx | ) |
VMOD function Get the format of the dataset.
VCL_STRING vmod_get_dataset_name | ( | const struct vrt_ctx * | ctx | ) |
VMOD function Get the name of the dataset.
VCL_STRING vmod_get_dataset_published_date | ( | const struct vrt_ctx * | ctx | ) |
VMOD function Get the published date of the dataset.
VCL_STRING vmod_match_all | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | propertyInputString | ||
) |
VMOD Function Match the HTTP request headers, and return the values for the properties requests for the matched device.
VCL_STRING vmod_match_single | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | userAgent, | ||
VCL_STRING | propertyInputString | ||
) |
VMOD Function Match the User-Agent provided, and return the values for the properties requested for the matched device.
void vmod_reload | ( | const struct vrt_ctx * | ctx, |
struct vmod_reload_arg * | a | ||
) |
VMOD Function Reload resource manager using the input file path.
If no file path is given, the original data file will be used.
void vmod_set_allow_unmatched | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | allowUnmatched | ||
) |
VMOD Function Set whether unmatched result should be allowed.
void vmod_set_delimiter | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | delimiter | ||
) |
VMOD Function Set the delimiter to use when returning values for multiple properties.
void vmod_set_difference | ( | const struct vrt_ctx * | ctx, |
VCL_INT | difference | ||
) |
VMOD Function Set the difference value to allow User-Agents where characters are slightly different from what is expected.
void vmod_set_drift | ( | const struct vrt_ctx * | ctx, |
VCL_INT | drift | ||
) |
VMOD Function Set the drift value to allow substrings to be matched at a wider range.
void vmod_set_max_concurrency | ( | const struct vrt_ctx * | ctx, |
VCL_INT | concurrency | ||
) |
VMOD Function Set the maximum number of expected concurrent requests.
void vmod_set_performance_profile | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | performanceProfile | ||
) |
VMOD Function Set the performance profile which dictates how Device Detection allocates memory and manage data.
void vmod_set_properties | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | properties | ||
) |
VMOD Function Set the properties which should be initialised in the dataset.
void vmod_set_use_performance_graph | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | usePerformanceGraph | ||
) |
VMOD Function Set whether performance optimized graph should be used.
void vmod_set_use_predictive_graph | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | usePredictiveGraph | ||
) |
VMOD Function Set whether predictive optimized graph should be used.
void vmod_start | ( | const struct vrt_ctx * | ctx, |
VCL_STRING | filePath | ||
) |
VMOD Function Start the 51Degrees module using the data file provided.
static unsigned writeValue | ( | ResultsHash * | results, |
int | requiredPropertyIndex, | ||
char * | p, | ||
unsigned | u | ||
) |
Method used to obtain the required property value by using its' index.