◆ FIFTYONE_DEGREES_HEADERS_MEMBERS
#define FIFTYONE_DEGREES_HEADERS_MEMBERS |
Count of the number of pseudo headers.
\r\n
Common form of evidence in 51Degrees engines.
HTTP headers are a common form of evidence, so required headers have their own structure and methods. By storing the unique id of headers, storing duplicates of the same header can be avoided. Duplicates can occur as a result of different cases or prefixes e.g. User-Agent
, user-agent
and HTTP_user-agent
are all the same header.
A header structure is created using the fiftyoneDegreesHeadersCreate method. This takes a state and a method used to extract the unique headers from the state. See the method description for more details.
A header can be fetched using it's unique id with the fiftyoneDegreesHeadersGetHeaderFromUniqueId method.
The index of a header in the unique headers structure can also be fetched using the fiftyoneDegreesHeaderGetIndex method.
Once a headers structure is finished with, it is released using the fiftyoneDegreesHeadersFree method.
struct | fiftyoneDegreesHeaderSegment
Null or PSEUDO_HEADER_SEP terminated string segment within a header. More...
|
struct | fiftyoneDegreesHeaderSegmentArray
Array of items of type fiftyoneDegreesHeaderSegment used to easily access and track the size of the array. More...
|
struct | fiftyoneDegreesHeader
Header structure to identify a header that either comes directly from the data set, or one that forms a pseudo header. More...
|
struct | fiftyoneDegreesHeaderArray
Array of items of type fiftyoneDegreesHeader used to easily access and track the size of the array. More...
|
#define | FIFTYONE_DEGREES_HEADERS_MEMBERS
Count of the number of pseudo headers. More...
|
size_t | fiftyoneDegreesHeadersSize (int count)
Returns the number of bytes that will be allocated for a headers structure created using the fiftyoneDegreesHeadersCreate method. More...
|
bool | fiftyoneDegreesHeadersIsPseudo (const char *headerName)
Check if a header is a pseudo header. More...
|
fiftyoneDegreesHeaders * | fiftyoneDegreesHeadersCreate (bool useUpperPrefixedHeaders, void *state, fiftyoneDegreesHeadersGetMethod get)
Creates a new headers instance configured with the unique HTTP names needed from evidence. More...
|
int | fiftyoneDegreesHeaderGetIndex (fiftyoneDegreesHeaders *headers, const char *httpHeaderName, size_t length)
Provides the integer index of the HTTP header name. More...
|
fiftyoneDegreesHeader * | fiftyoneDegreesHeadersGetHeaderFromUniqueId (fiftyoneDegreesHeaders *headers, fiftyoneDegreesHeaderID uniqueId)
Gets a pointer to the header in the headers structure with a unique id matching the one provided. More...
|
void | fiftyoneDegreesHeadersFree (fiftyoneDegreesHeaders *headers)
Frees the memory allocated by the fiftyoneDegreesHeadersCreate method. More...
|
bool | fiftyoneDegreesHeadersIsHttp (void *state, fiftyoneDegreesEvidenceKeyValuePair *pair)
Determines if the key of an evidence pair is an HTTP header. More...
|
#define FIFTYONE_DEGREES_HEADERS_MEMBERS |
Count of the number of pseudo headers.
typedef long(* fiftyoneDegreesHeadersGetMethod) (void *state, uint32_t index, fiftyoneDegreesCollectionItem *nameItem) |
Gets the unique id and name of the header at the requested index.
int fiftyoneDegreesHeaderGetIndex | ( | fiftyoneDegreesHeaders * | headers, |
const char * | httpHeaderName, | ||
size_t | length | ||
) |
Provides the integer index of the HTTP header name.
fiftyoneDegreesHeaders* fiftyoneDegreesHeadersCreate | ( | bool | useUpperPrefixedHeaders, |
void * | state, | ||
fiftyoneDegreesHeadersGetMethod | get | ||
) |
Creates a new headers instance configured with the unique HTTP names needed from evidence.
If the useUpperPrefixedHeaders flag is true then checks for the presence of HTTP headers will also include checking for HTTP_ as a prefix to the header key. If header is a pseudo header, the indices of actual headers that form this header will be constructed.
void fiftyoneDegreesHeadersFree | ( | fiftyoneDegreesHeaders * | headers | ) |
Frees the memory allocated by the fiftyoneDegreesHeadersCreate method.
fiftyoneDegreesHeader* fiftyoneDegreesHeadersGetHeaderFromUniqueId | ( | fiftyoneDegreesHeaders * | headers, |
fiftyoneDegreesHeaderID | uniqueId | ||
) |
Gets a pointer to the header in the headers structure with a unique id matching the one provided.
If the headers structure does not contain a header with the unique id, NULL will be returned. This method assumes that the headers in the structure are unique, if they are not, then the first matching header will be returned.
bool fiftyoneDegreesHeadersIsHttp | ( | void * | state, |
fiftyoneDegreesEvidenceKeyValuePair * | pair | ||
) |
Determines if the key of an evidence pair is an HTTP header.
bool fiftyoneDegreesHeadersIsPseudo | ( | const char * | headerName | ) |
Check if a header is a pseudo header.
size_t fiftyoneDegreesHeadersSize | ( | int | count | ) |
Returns the number of bytes that will be allocated for a headers structure created using the fiftyoneDegreesHeadersCreate method.