PSPSDK 2024-12-16
Loading...
Searching...
No Matches
psphttp.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * psphttp.h - Interface to the http library.
7 *
8 * Copyright (c) 2008 David Perry (InsertWittyName)
9 * Copyright (c) 2008 moonlight
10 *
11 */
12
13#ifndef __PSPHTTP_H__
14#define __PSPHTTP_H__
15
16#include <pspkerneltypes.h>
17
18#if defined(__cplusplus)
19extern "C" {
20#endif
21
27
35
41
42
48
54
55/* Memory function types */
56typedef void *(*PspHttpMallocFunction)(SceSize size);
57typedef void *(*PspHttpReallocFunction)(void *p, SceSize size);
58typedef void (*PspHttpFreeFunction)(void *p);
59
61 int request,
63 const unsigned char *realm,
64 unsigned char *username,
65 unsigned char *password,
67 unsigned char **entity_body,
69 SceBool *save);
70
77int sceHttpInit(unsigned int unknown1);
78
84int sceHttpEnd(void);
85
95
103
114int sceHttpCreateConnection(int templateid, char *host, char *unknown1, unsigned short port, int unknown2);
115
125
133
144
155
163
172int sceHttpSendRequest(int requestid, void *data, unsigned int datasize);
173
181
190int sceHttpReadData(int requestid, void *data, unsigned int datasize);
191
200
209
217int sceHttpSetResolveTimeOut(int id, unsigned int timeout);
218
226int sceHttpSetResolveRetry(int id, int count);
227
235int sceHttpSetConnectTimeOut(int id, unsigned int timeout);
236
244int sceHttpSetSendTimeOut(int id, unsigned int timeout);
245
253int sceHttpSetRecvTimeOut(int id, unsigned int timeout);
254
262
270
278
286
294
302
309
316
326int sceHttpAddExtraHeader(int id, char *name, char *value, int unknown1);
327
335int sceHttpDeleteHeader(int id, const char *name);
336
348
354int sceHttpsEnd(void);
355
364
366
368
370
372
374
375int sceHttpGetAllHeader(int request, unsigned char **header, unsigned int *header_size);
376
378
379int sceHttpGetProxy(int id, int *activate_flag, int *mode, unsigned char *proxy_host, SceSize len, unsigned short *proxy_port);
380
382
384
385int sceHttpSetProxy(int id, int activate_flag, int mode, const unsigned char *new_proxy_host, unsigned short new_proxy_port);
386
387int sceHttpSetResHeaderMaxSize(int id, unsigned int header_size);
388
390
391#if defined(__cplusplus)
392};
393#endif
394
395#endif
int sceHttpDeleteConnection(int connectionid)
Delete a http connection.
PspHttpAddHeaderMode
Definition psphttp.h:50
@ PSP_HTTP_HEADER_OVERWRITE
Definition psphttp.h:51
@ PSP_HTTP_HEADER_ADD
Definition psphttp.h:52
PspHttpHttpVersion
Definition psphttp.h:23
@ PSP_HTTP_VERSION_1_1
Definition psphttp.h:25
@ PSP_HTTP_VERSION_1_0
Definition psphttp.h:24
int sceHttpDisableAuth(int id)
int sceHttpDeleteTemplate(int templateid)
Delete a http template.
int sceHttpSetProxy(int id, int activate_flag, int mode, const unsigned char *new_proxy_host, unsigned short new_proxy_port)
int sceHttpCreateConnectionWithURL(int templateid, const char *url, int unknown1)
Create a http connection to a url.
PspHttpMethod
Definition psphttp.h:29
@ PSP_HTTP_METHOD_HEAD
Definition psphttp.h:32
@ PSP_HTTP_METHOD_GET
Definition psphttp.h:30
@ PSP_HTTP_METHOD_POST
Definition psphttp.h:31
int sceHttpSaveSystemCookie(void)
Save cookie.
int sceHttpDisableCache(int id)
int sceHttpSetRecvTimeOut(int id, unsigned int timeout)
Set receive timeout.
int sceHttpGetStatusCode(int requestid, int *statuscode)
Get http request status code.
int sceHttpSendRequest(int requestid, void *data, unsigned int datasize)
Send a http request.
int sceHttpSetSendTimeOut(int id, unsigned int timeout)
Set send timeout.
int sceHttpGetNetworkErrno(int request, int *err_num)
int sceHttpSetAuthInfoCB(int id, PspHttpPasswordCB cbfunc)
int sceHttpAbortRequest(int requestid)
Abort a http request.
int sceHttpLoadSystemCookie(void)
Load cookie.
void *(* PspHttpMallocFunction)(SceSize size)
Definition psphttp.h:56
int sceHttpGetContentLength(int requestid, SceULong64 *contentlength)
Get http request response length.
int sceHttpEnableKeepAlive(int id)
Enable keep alive.
int sceHttpEndCache(void)
int sceHttpReadData(int requestid, void *data, unsigned int datasize)
Read a http request response.
int sceHttpCreateRequest(int connectionid, PspHttpMethod method, char *path, SceULong64 contentlength)
Create a http request.
int sceHttpDisableKeepAlive(int id)
Disable keep alive.
int sceHttpDisableCookie(int id)
Disable cookie.
int(* PspHttpPasswordCB)(int request, PspHttpAuthType auth_type, const unsigned char *realm, unsigned char *username, unsigned char *password, SceBool need_entity, unsigned char **entity_body, SceSize *entity_size, SceBool *save)
Definition psphttp.h:60
void *(* PspHttpReallocFunction)(void *p, SceSize size)
Definition psphttp.h:57
int sceHttpEnableRedirect(int id)
Enable redirect.
int sceHttpGetProxy(int id, int *activate_flag, int *mode, unsigned char *proxy_host, SceSize len, unsigned short *proxy_port)
int sceHttpAddExtraHeader(int id, char *name, char *value, int unknown1)
Add content header.
int sceHttpCreateRequestWithURL(int connectionid, PspHttpMethod method, char *url, SceULong64 contentlength)
Create a http request with url.
int sceHttpEnableAuth(int id)
int sceHttpCreateTemplate(char *agent, int unknown1, int unknown2)
Create a http template.
int sceHttpsEnd(void)
Terminate the https library.
int sceHttpSetResolveRetry(int id, int count)
Set resolver retry.
int sceHttpDeleteRequest(int requestid)
Delete a http request.
int sceHttpInit(unsigned int unknown1)
Init the http library.
int sceHttpEnableCache(int id)
int sceHttpEnableCookie(int id)
Enable cookie.
int sceHttpSetResolveTimeOut(int id, unsigned int timeout)
Set resolver timeout.
int sceHttpsInit(int unknown1, int unknown2, int unknown3, int unknown4)
Init the https library.
int sceHttpDisableRedirect(int id)
Disable redirect.
int sceHttpSetConnectTimeOut(int id, unsigned int timeout)
Set connect timeout.
int sceHttpGetAllHeader(int request, unsigned char **header, unsigned int *header_size)
PspHttpAuthType
Definition psphttp.h:37
@ PSP_HTTP_AUTH_DIGEST
Definition psphttp.h:39
@ PSP_HTTP_AUTH_BASIC
Definition psphttp.h:38
int sceHttpDeleteHeader(int id, const char *name)
Delete content header.
int sceHttpSetResHeaderMaxSize(int id, unsigned int header_size)
void(* PspHttpFreeFunction)(void *p)
Definition psphttp.h:58
int sceHttpsLoadDefaultCert(int unknown1, int unknown2)
Load default certificate.
int sceHttpCreateConnection(int templateid, char *host, char *unknown1, unsigned short port, int unknown2)
Create a http connection.
PspHttpProxyMode
Definition psphttp.h:44
@ PSP_HTTP_PROXY_MANUAL
Definition psphttp.h:46
@ PSP_HTTP_PROXY_AUTO
Definition psphttp.h:45
int sceHttpInitCache(SceSize max_size)
int sceHttpEnd(void)
Terminate the http library.
int sceHttpSetMallocFunction(PspHttpMallocFunction malloc_func, PspHttpFreeFunction free_func, PspHttpReallocFunction realloc_func)
unsigned int SceSize
Definition pspkerneltypes.h:27
unsigned int unknown1
Definition psploadcore.h:5
unsigned int unknown4[4]
Definition psploadcore.h:13
unsigned int unknown2
Definition psploadcore.h:6
unsigned int unknown3[4]
Definition psploadcore.h:8
char * name
Definition pspsysmem_kernel.h:4
unsigned char size
Definition pspsysmem_kernel.h:6
int SceBool
Definition psptypes.h:98
float x
Definition psptypes.h:0
uint64_t SceULong64
Definition psptypes.h:82