MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
http_interface.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2010 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 #ifndef _HTTP_INTERFACE_H
26 #define _HTTP_INTERFACE_H
27 
28 
29 /*---includes for this file--------------------------------------------------*/
30 #include <techtype.h>
31 #include "httptype.h"
32 
33 /*---Constant and macro definitions for public use---------------------------*/
34 
35 /*---Enumerations for public use---------------------------------------------*/
36 
37 /*---Global type defs for public use-----------------------------------------*/
38 typedef struct
39 {
40  E_HttpStatus status;
41  S32BIT code;
42  U8BIT *data;
43  U32BIT data_len;
45 
46 typedef struct
47 {
48  void (*parse)(void *data, U32BIT data_len, char *url);
49  U8BIT *(*generate_header)(U8BIT * url);
50  void (*ack_header)(U8BIT *header);
52 
53 
54 /* Used to reference a request within the http interface component from
55  * the core module
56  */
57 typedef struct HttpRequest_tag *HttpRequest_t;
58 
59 typedef BOOLEAN (*HttpCallback_t)(void *userdata, U32BIT request_id,
60  HttpResponse_t *response);
61 
62 /*---Global variable declarations for public use-----------------------------*/
63 
64 /*---Global Function prototypes for public use-------------------------------*/
65 
72 E_HttpErr httpOpen(U32BIT task_priority);
73 
74 
81 
82 
88 void httpSetUserAgent(U8BIT *user_agent);
89 
90 
95 void httpClearTlsCertStore(void);
96 
97 
102 void httpAddTlsCertToStore(U8BIT *certData, U32BIT certLen);
103 
104 
109 U32BIT httpGetTlsCertStoreCount(void);
110 
111 
124 HttpRequest_t httpCreateGetRequest(U8BIT *url, U8BIT cachePriority,
125  HttpCallback_t callback,
126  U32BIT request_id, void *userdata);
127 
128 
138 HttpRequest_t httpCreateHeadRequest(U8BIT *url, HttpCallback_t callback,
139  U32BIT request_id, void *userdata);
140 
141 
153 HttpRequest_t httpCreatePostRequest(U8BIT *url, U8BIT *data,
154  HttpCallback_t callback,
155  U32BIT request_id, void *userdata);
156 
157 
169 HttpRequest_t httpCreateStreamRequest(U8BIT *url, U8BIT *range,
170  HttpCallback_t header_callback,
171  HttpCallback_t callback,
172  U32BIT request_id, void *userdata);
173 
174 
181 void httpStartRequest(HttpRequest_t request);
182 
183 
190 U8BIT* httpGetRequestRedirect(HttpRequest_t request);
191 
192 
201 void httpResumeRequest(HttpRequest_t request);
202 
203 
210 void httpStopRequest(HttpRequest_t request);
211 
212 
217 void httpDestroyRequest(HttpRequest_t request);
218 
219 
224 void httpClose(void);
225 
226 
227 #endif /*_HTTP_INTERFACE_H*/
void httpSetCookieManager(HttpCookieManager_t *manager)
Set cookie manager for HTTP connections.
void httpStartRequest(HttpRequest_t request)
Start an HTTP request. Everything related to the request is passed through the callback that was regi...
HttpRequest_t httpCreateHeadRequest(U8BIT *url, HttpCallback_t callback, U32BIT request_id, void *userdata)
Create an HTTP HEAD request.
E_HttpErr httpOpen(U32BIT task_priority)
Open the HTTP interface.
U8BIT * httpGetRequestRedirect(HttpRequest_t request)
Return the URL that the request is redirected to (valid only for response codes of 3xx)...
HttpRequest_t httpCreatePostRequest(U8BIT *url, U8BIT *data, HttpCallback_t callback, U32BIT request_id, void *userdata)
Create an HTTP POST request.
void httpStopRequest(HttpRequest_t request)
Stop an HTTP request. This function does not destroy the request; this is done using httpDestroyReque...
void httpClearTlsCertStore(void)
Clear TLS certificate store.
System Wide Global Technical Data Type Definitions.
void httpResumeRequest(HttpRequest_t request)
Resume an HTTP request. A request can be paused by returning FALSE from the content callback to tell ...
void httpDestroyRequest(HttpRequest_t request)
Destroy an HTTP request.
void httpSetUserAgent(U8BIT *user_agent)
Set User Agent for HTTP connections.
void httpClose(void)
Close the HTTP interface.
Definition: http_interface.h:38
HTTP types.
void httpAddTlsCertToStore(U8BIT *certData, U32BIT certLen)
Add TLS certificate to store.
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.
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.