MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
http_platform.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 _PM_HTTP_H
26 #define _PM_HTTP_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 
39 /* HTTP request type */
40 typedef enum
41 {
42  HTTP_REQUEST_GET,
43  HTTP_REQUEST_HEAD,
44  HTTP_REQUEST_POST,
45  HTTP_REQUEST_STREAM
46 } E_HttpRequestType;
47 
48 /*---Global variable declarations for public use-----------------------------*/
49 
50 /*---Global Function prototypes for public use-------------------------------*/
51 
57 E_HttpErr HP_Initialise(void);
58 
59 
67 E_HttpErr HP_SetUserAgent(U8BIT *user_agent);
68 
69 
82 E_HttpErr HP_SetTimeout(U16BIT timeout);
83 
84 
98 E_HttpErr HP_CreateRequest(U8BIT *url, E_HttpRequestType type,
99  void **handle);
100 
101 
109 E_HttpErr HP_StartRequest(void *handle);
110 
111 
119 E_HttpErr HP_ResumeRequest(void *handle);
120 
121 
129 E_HttpErr HP_StopRequest(void *handle);
130 
131 
139 E_HttpErr HP_DestroyRequest(void *handle);
140 
141 
150 E_HttpErr HP_SetUserData(void *handle, void *userdata);
151 
152 
161 E_HttpErr HP_AddHeader(void *handle, U8BIT *header);
162 
163 
172 E_HttpErr HP_SetPostData(void *handle, U8BIT *postdata);
173 
174 
183 E_HttpErr HP_SetRange(void *handle, U8BIT *range);
184 
185 
194 E_HttpErr HP_GetRedirectUrl(void *handle, U8BIT **url);
195 
196 
205 E_HttpErr HP_AddTlsCertificate(U8BIT *cert, U32BIT len);
206 
207 
213 E_HttpErr HP_ClearTlsCertificates(void);
214 
215 
224 E_HttpErr HP_WaitForAction(void);
225 
226 
235 E_HttpErr HP_Process(U16BIT *active_count);
236 
237 
247 void HP_HeaderCallback(void *userdata, S32BIT response_code,
248  U8BIT *data, U32BIT len);
249 
250 
262 BOOLEAN HP_ContentCallback(void *userdata, U8BIT *data, U32BIT len);
263 
264 
272 void HP_EndCallback(void *userdata, E_HttpStatus status);
273 
274 
280 E_HttpErr HP_Terminate(void);
281 
282 
283 #endif /*_PM_HTTP_H*/
E_HttpErr HP_Terminate(void)
Terminate the HTTP interface.
Definition: curlInterface.c:856
E_HttpErr HP_ResumeRequest(void *handle)
Resume an HTTP request.
Definition: curlInterface.c:345
E_HttpErr HP_Process(U16BIT *active_count)
Process HTTP requests. This may cause request callbacks to be called.
Definition: curlInterface.c:769
E_HttpErr HP_DestroyRequest(void *handle)
Destroy an HTTP request.
Definition: curlInterface.c:420
E_HttpErr HP_Initialise(void)
Initialise the HTTP interface.
Definition: curlInterface.c:111
E_HttpErr HP_SetUserAgent(U8BIT *user_agent)
Set user agent for HTTP client.
Definition: curlInterface.c:140
E_HttpErr HP_StopRequest(void *handle)
Stop an HTTP request.
Definition: curlInterface.c:386
E_HttpErr HP_GetRedirectUrl(void *handle, U8BIT **url)
Get redirection URL for HTTP request.
Definition: curlInterface.c:605
E_HttpErr HP_AddHeader(void *handle, U8BIT *header)
Add HTTP header to HTTP request.
Definition: curlInterface.c:499
E_HttpErr HP_SetPostData(void *handle, U8BIT *postdata)
Set POST data for an HTTP request.
Definition: curlInterface.c:535
E_HttpErr HP_CreateRequest(U8BIT *url, E_HttpRequestType type, void **handle)
Create an HTTP request. The URL is provided, and is guaranteed to be either "http://..." or "https://..." The request type is also provided. Streaming request is the same as a GET request, except that a "Range:" header is also allowed for it.
Definition: curlInterface.c:187
E_HttpErr HP_StartRequest(void *handle)
Start an HTTP request.
Definition: curlInterface.c:285
E_HttpErr HP_ClearTlsCertificates(void)
Clear TLS certificates.
Definition: curlInterface.c:694
E_HttpErr HP_SetUserData(void *handle, void *userdata)
Set user data associated with an HTTP request.
Definition: curlInterface.c:464
E_HttpErr HP_WaitForAction(void)
Wait until there is some activity on one (or more) of the HTTP requests, or until some other conditio...
Definition: curlInterface.c:724
System Wide Global Technical Data Type Definitions.
BOOLEAN HP_ContentCallback(void *userdata, U8BIT *data, U32BIT len)
Callback for HTTP content data. This function is called by the HTTP client. The callback must return ...
void HP_HeaderCallback(void *userdata, S32BIT response_code, U8BIT *data, U32BIT len)
Callback for HTTP header data. This function is called by the HTTP client.
E_HttpErr HP_SetRange(void *handle, U8BIT *range)
Set "Range:" header for an HTTP request.
Definition: curlInterface.c:574
HTTP types.
E_HttpErr HP_SetTimeout(U16BIT timeout)
Set timeout (in seconds) for HTTP requests. The timeout applies to connections (i.e. the time it takes to connect to the server) as well as response time (i.e the time it takes to download the content). Between sending the request and receiving the first byte of the the response there is no timeout.
Definition: curlInterface.c:163
void HP_EndCallback(void *userdata, E_HttpStatus status)
Callback for HTTP request end. This function is called by the HTTP client.
E_HttpErr HP_AddTlsCertificate(U8BIT *cert, U32BIT len)
Add a certificate for TLS connections.
Definition: curlInterface.c:642