MHEG5  15.3.0
source/http/inc/http_interface.h File Reference

Manages the interface between MHEG5 Engine and the HTTP component. More...

#include <techtype.h>
#include "httptype.h"

Go to the source code of this file.

Data Structures

struct  HttpResponse_t
struct  HttpCookieManager_t

Typedefs

typedef struct HttpRequest_tag * HttpRequest_t
typedef BOOLEAN(* HttpCallback_t )(void *userdata, U32BIT request_id, HttpResponse_t *response)

Functions

E_HttpErr httpOpen (U32BIT task_priority)
 Open the HTTP interface.
void httpSetCookieManager (HttpCookieManager_t *manager)
 Set cookie manager for HTTP connections.
void httpSetUserAgent (U8BIT *user_agent)
 Set User Agent for HTTP connections.
void httpClearTlsCertStore (void)
 Clear TLS certificate store.
void httpAddTlsCertToStore (U8BIT *certData, U32BIT certLen)
 Add TLS certificate to store.
U32BIT httpGetTlsCertStoreCount (void)
 Return number of TLS certificate in the certificate store.
HttpRequest_t httpCreateGetRequest (U8BIT *url, U8BIT cachePriority, HttpCallback_t callback, U32BIT request_id, void *userdata)
 Create an HTTP GET request.
HttpRequest_t httpCreateHeadRequest (U8BIT *url, HttpCallback_t callback, U32BIT request_id, void *userdata)
 Create an HTTP HEAD request.
HttpRequest_t httpCreatePostRequest (U8BIT *url, U8BIT *data, HttpCallback_t callback, U32BIT request_id, void *userdata)
 Create an HTTP POST request.
HttpRequest_t httpCreateStreamRequest (U8BIT *url, U8BIT *range, HttpCallback_t header_callback, HttpCallback_t callback, U32BIT request_id, void *userdata)
 Create an HTTP request for stream media.
void httpStartRequest (HttpRequest_t request)
 Start an HTTP request. Everything related to the request is passed through the callback that was registered when the request was created.
U8BIT * httpGetRequestRedirect (HttpRequest_t request)
 Return the URL that the request is redirected to (valid only for response codes of 3xx).
void httpResumeRequest (HttpRequest_t request)
 Resume an HTTP request. A request can be paused by returning FALSE from the content callback to tell the HTTP client that the data was not processed. Once the request is paused, it will not be resumed automatically - this function has to be called explicitly.
void httpStopRequest (HttpRequest_t request)
 Stop an HTTP request. This function does not destroy the request; this is done using httpDestroyRequest.
void httpDestroyRequest (HttpRequest_t request)
 Destroy an HTTP request.
void httpClose (void)
 Close the HTTP interface.

Detailed Description

Manages the interface between MHEG5 Engine and the HTTP component.

Date:
22/2/2010
Author:
Omri Barel

Function Documentation

void httpAddTlsCertToStore ( U8BIT *  certData,
U32BIT  certLen 
)

Add TLS certificate to store.

Returns:
Nothing
void httpClearTlsCertStore ( void  )

Clear TLS certificate store.

Returns:
Nothing
void httpClose ( void  )

Close the HTTP interface.

Returns:
Nothing
HttpRequest_t httpCreateGetRequest ( U8BIT *  url,
U8BIT  cachePriority,
HttpCallback_t  callback,
U32BIT  request_id,
void *  userdata 
)

Create an HTTP GET request.

Parameters:
urlURL for the request. The URL must be percent-encoded according to IETF RFC 1738.
cachePrioritycache priority for content. The meaning is according to section 17.5 of the D-Book. However, 0 is always no-cache.
callbackcallback for information and data
request_idrequest ID provided by the client
userdatauser data which is passed to the callback
Returns:
Request handle, or NULL if request cannot be created
HttpRequest_t httpCreateHeadRequest ( U8BIT *  url,
HttpCallback_t  callback,
U32BIT  request_id,
void *  userdata 
)

Create an HTTP HEAD request.

Parameters:
urlURL for the request. The URL must be percent-encoded according to IETF RFC 1738.
callbackcallback for information and data
request_idrequest ID provided by the client
userdatauser data which is passed to the callback
Returns:
Request handle, or NULL if request cannot be created
HttpRequest_t httpCreatePostRequest ( U8BIT *  url,
U8BIT *  data,
HttpCallback_t  callback,
U32BIT  request_id,
void *  userdata 
)

Create an HTTP POST request.

Parameters:
urlURL for the request. The URL must be percent-encoded according to IETF RFC 1738.
dataPOST data. The data must be percent-encoded according to HTTP 4.01 and IETF RFC 3986.
callbackcallback for information and data
request_idrequest ID provided by the client
userdatauser data which is passed to the callback
Returns:
Request handle, or NULL if request cannot be created
HttpRequest_t httpCreateStreamRequest ( U8BIT *  url,
U8BIT *  range,
HttpCallback_t  header_callback,
HttpCallback_t  callback,
U32BIT  request_id,
void *  userdata 
)

Create an HTTP request for stream media.

Parameters:
urlURL for the request. The URL must be percent-encoded according to IETF RFC 1738.
rangerange of data to retrieve "X-Y"
header_cbcallback for header information and data
callbackcallback for information and data
request_idrequest ID provided by the client
userdatauser data which is passed to the callback
Returns:
Request handle, or NULL if request cannot be created
void httpDestroyRequest ( HttpRequest_t  request)

Destroy an HTTP request.

Returns:
Nothing
U8BIT* httpGetRequestRedirect ( HttpRequest_t  request)

Return the URL that the request is redirected to (valid only for response codes of 3xx).

Parameters:
requestrequest handle
Returns:
Pointer to redirection URL
U32BIT httpGetTlsCertStoreCount ( void  )

Return number of TLS certificate in the certificate store.

Returns:
Nothing
E_HttpErr httpOpen ( U32BIT  task_priority)

Open the HTTP interface.

Parameters:
task_priorityHTTP task priority
Returns:
HTTP_OK if the interface is opened HTTP_ERR_INTERNAL if the interface cannot be opened
void httpResumeRequest ( HttpRequest_t  request)

Resume an HTTP request. A request can be paused by returning FALSE from the content callback to tell the HTTP client that the data was not processed. Once the request is paused, it will not be resumed automatically - this function has to be called explicitly.

Parameters:
requestrequest handle
Returns:
Nothing

Set cookie manager for HTTP connections.

Parameters:
managerCookie manager
Returns:
Nothing
void httpSetUserAgent ( U8BIT *  user_agent)

Set User Agent for HTTP connections.

Parameters:
user_agentUser Agent string
Returns:
Nothing
void httpStartRequest ( HttpRequest_t  request)

Start an HTTP request. Everything related to the request is passed through the callback that was registered when the request was created.

Parameters:
requestrequest handle
Returns:
Nothing
void httpStopRequest ( HttpRequest_t  request)

Stop an HTTP request. This function does not destroy the request; this is done using httpDestroyRequest.

Parameters:
requestrequest handle
Returns:
Nothing
 All Data Structures Files Functions Variables Typedefs Defines