MHEG5  18.9.0
MHEG5 Documentation
Classes | Macros | Typedefs | Functions
mh5cookies.c File Reference

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"

Go to the source code of this file.

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...
 
U8BITMHEG5CookieGenerateHeader (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...
 

Detailed Description

Functions relating to HTTP Cookie Store.

Date
22/02/2010
Author
Omri Barel

Definition in file mh5cookies.c.

Macro Definition Documentation

#define HOUR   1200

Definition at line 42 of file mh5cookies.c.

#define MAX_COOKIES   32

Definition at line 39 of file mh5cookies.c.

#define MAX_STORE_SIZE   8192

Definition at line 40 of file mh5cookies.c.

#define MINUTE   60

Definition at line 41 of file mh5cookies.c.

#define SECONDS_IN_DAY   (24 * HOUR)

Definition at line 43 of file mh5cookies.c.

Typedef Documentation

typedef struct cookiestore_s cookiestore_t

Function Documentation

void MHEG5CookieAckHeader ( U8BIT header)

This function should be called once the header string returned by MHEG5CookieGenerateHeader has been used and is no longer needed.

Parameters
headerpointer to the string to be released
Returns
nothing

Definition at line 354 of file mh5cookies.c.

MHEG5Bool MHEG5CookieAdd ( MHEG5cookie_t cookie)

Directly add a cookie to the store.

Parameters
cookiepointer to a structure containing all the required information to generate the cookie
Returns
MHEG5TRUE on success, MHEG5FALSE otherwise

Definition at line 317 of file mh5cookies.c.

void MHEG5CookieClearStore ( void  )

Delete all cookies from the temporary store.

Returns
nothing

Definition at line 405 of file mh5cookies.c.

U8BIT* MHEG5CookieGenerateHeader ( U8BIT url)

Generate a "Cookie" header for the required http request, containing all valid cookies.

Parameters
urlNULL terminated string containing the the url of the http request
Returns
Pointer to a NULL terminated string containing the Cookie header to be included in the http request. NULL if no cookies exist for the url.

Definition at line 243 of file mh5cookies.c.

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.

Parameters
dataString containing the header to be parsed
data_lenLength of the header, in bytes
Returns
Nothing

Definition at line 102 of file mh5cookies.c.

MHEG5Bool MHEG5CookieRetrieve ( MHEG5cookie_t cookie)

Retrieve a specific cookie from the store, referenced by the identity string.

Parameters
cookiePointer to allocated cookie data structure, with its identity string set.
Returns
MHEG5TRUE if successful MHEG5FALSE otherwise

Definition at line 368 of file mh5cookies.c.