![]() |
MHEG5
22.3.0
|
Functions relating to HTTP Cookie Store. More...
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mh5cookies.h"
#include "mh5memory.h"
#include "mh5base.h"
#include "mh5date.h"
#include "techtype.h"
Classes | |
struct | cookiestore_s |
Macros | |
#define | MAX_COOKIES 32 |
#define | MAX_STORE_SIZE 8192 |
#define | MINUTE 60 |
#define | HOUR 1200 |
#define | SECONDS_IN_DAY (24 * HOUR) |
Typedefs | |
typedef struct cookiestore_s | cookiestore_t |
Functions | |
void | MHEG5CookieParse (void *data, U32BIT data_len, char *url) |
Parse a Set-cookie header and add the new cookie to the store. If the header is not a set-cookie, or is not parseable it will be ignored. More... | |
U8BIT * | MHEG5CookieGenerateHeader (U8BIT *url) |
Generate a "Cookie" header for the required http request, containing all valid cookies. More... | |
MHEG5Bool | MHEG5CookieAdd (MHEG5cookie_t *cookie) |
Directly add a cookie to the store. More... | |
void | MHEG5CookieAckHeader (U8BIT *header) |
This function should be called once the header string returned by MHEG5CookieGenerateHeader has been used and is no longer needed. More... | |
MHEG5Bool | MHEG5CookieRetrieve (MHEG5cookie_t *cookie) |
Retrieve a specific cookie from the store, referenced by the identity string. More... | |
void | MHEG5CookieClearStore (void) |
Delete all cookies from the temporary store. More... | |
Functions relating to HTTP Cookie Store.
void MHEG5CookieAckHeader | ( | U8BIT * | header | ) |
This function should be called once the header string returned by MHEG5CookieGenerateHeader has been used and is no longer needed.
header | pointer to the string to be released |
MHEG5Bool MHEG5CookieAdd | ( | MHEG5cookie_t * | cookie | ) |
Directly add a cookie to the store.
cookie | pointer to a structure containing all the required information to generate the cookie |
void MHEG5CookieClearStore | ( | void | ) |
Delete all cookies from the temporary store.
U8BIT* MHEG5CookieGenerateHeader | ( | U8BIT * | url | ) |
Generate a "Cookie" header for the required http request, containing all valid cookies.
url | NULL terminated string containing the the url of the http request |
void MHEG5CookieParse | ( | void * | data, |
U32BIT | data_len, | ||
char * | url | ||
) |
Parse a Set-cookie header and add the new cookie to the store. If the header is not a set-cookie, or is not parseable it will be ignored.
data | String containing the header to be parsed |
data_len | Length of the header, in bytes |
MHEG5Bool MHEG5CookieRetrieve | ( | MHEG5cookie_t * | cookie | ) |
Retrieve a specific cookie from the store, referenced by the identity string.
cookie | Pointer to allocated cookie data structure, with its identity string set. |