MHEG5  15.3.0
source/http/inc/http_interface.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2010 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  * 
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  * 
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00025 #ifndef _HTTP_INTERFACE_H
00026 #define _HTTP_INTERFACE_H
00027 
00028 
00029 /*---includes for this file--------------------------------------------------*/
00030 #include <techtype.h>
00031 #include "httptype.h"
00032 
00033 /*---Constant and macro definitions for public use---------------------------*/
00034 
00035 /*---Enumerations for public use---------------------------------------------*/
00036 
00037 /*---Global type defs for public use-----------------------------------------*/
00038 typedef struct
00039 {
00040    E_HttpStatus status;
00041    S32BIT code;
00042    U8BIT *data;
00043    U32BIT data_len;
00044 } HttpResponse_t;
00045 
00046 typedef struct
00047 {
00048    void (*parse)(void *data, U32BIT data_len, char *url);
00049    U8BIT *(*generate_header)(U8BIT * url);
00050    void (*ack_header)(U8BIT *header);
00051 } HttpCookieManager_t;
00052 
00053 
00054 /* Used to reference a request within the http interface component from
00055  * the core module
00056  */
00057 typedef struct HttpRequest_tag *HttpRequest_t;
00058 
00059 typedef BOOLEAN (*HttpCallback_t)(void *userdata, U32BIT request_id,
00060    HttpResponse_t *response);
00061 
00062 /*---Global variable declarations for public use-----------------------------*/
00063 
00064 /*---Global Function prototypes for public use-------------------------------*/
00065 
00072 E_HttpErr httpOpen(U32BIT task_priority);
00073 
00074 
00080 void httpSetCookieManager(HttpCookieManager_t *manager);
00081 
00082 
00088 void httpSetUserAgent(U8BIT *user_agent);
00089 
00090 
00095 void httpClearTlsCertStore(void);
00096 
00097 
00102 void httpAddTlsCertToStore(U8BIT *certData, U32BIT certLen);
00103 
00104 
00109 U32BIT httpGetTlsCertStoreCount(void);
00110 
00111 
00124 HttpRequest_t httpCreateGetRequest(U8BIT *url, U8BIT cachePriority,
00125    HttpCallback_t callback,
00126    U32BIT request_id, void *userdata);
00127 
00128 
00138 HttpRequest_t httpCreateHeadRequest(U8BIT *url, HttpCallback_t callback,
00139    U32BIT request_id, void *userdata);
00140 
00141 
00153 HttpRequest_t httpCreatePostRequest(U8BIT *url, U8BIT *data,
00154    HttpCallback_t callback,
00155    U32BIT request_id, void *userdata);
00156 
00157 
00169 HttpRequest_t httpCreateStreamRequest(U8BIT *url, U8BIT *range,
00170    HttpCallback_t header_callback,
00171    HttpCallback_t callback,
00172    U32BIT request_id, void *userdata);
00173 
00174 
00181 void httpStartRequest(HttpRequest_t request);
00182 
00183 
00190 U8BIT* httpGetRequestRedirect(HttpRequest_t request);
00191 
00192 
00201 void httpResumeRequest(HttpRequest_t request);
00202 
00203 
00210 void httpStopRequest(HttpRequest_t request);
00211 
00212 
00217 void httpDestroyRequest(HttpRequest_t request);
00218 
00219 
00224 void httpClose(void);
00225 
00226 
00227 #endif /*_HTTP_INTERFACE_H*/
 All Data Structures Files Functions Variables Typedefs Defines