Enumerations | Functions | Variables

psphttp.h File Reference

Go to the source code of this file.

Enumerations

enum  PspHttpMethod { PSP_HTTP_METHOD_GET, PSP_HTTP_METHOD_POST, PSP_HTTP_METHOD_HEAD }

Functions

int sceHttpInit (unsigned int unknown1)
 Init the http library.
int sceHttpEnd (void)
 Terminate the http library.
int sceHttpCreateTemplate (char *agent, int unknown1, int unknown2)
 Create a http template.
int sceHttpDeleteTemplate (int templateid)
 Delete a http template.
int sceHttpCreateConnection (int templateid, char *host, char *unknown1, unsigned short port, int unknown2)
 Create a http connection.
int sceHttpCreateConnectionWithURL (int templateid, const char *url, int unknown1)
 Create a http connection to a url.
int sceHttpDeleteConnection (int connectionid)
 Delete a http connection.
int sceHttpCreateRequest (int connectionid, PspHttpMethod method, char *path, SceULong64 contentlength)
 Create a http request.
int sceHttpCreateRequestWithURL (int connectionid, PspHttpMethod method, char *url, SceULong64 contentlength)
 Create a http request with url.
int sceHttpDeleteRequest (int requestid)
 Delete a http request.
int sceHttpSendRequest (int requestid, void *data, unsigned int datasize)
 Send a http request.
int sceHttpAbortRequest (int requestid)
 Abort a http request.
int sceHttpReadData (int requestid, void *data, unsigned int datasize)
 Read a http request response.
int sceHttpGetContentLength (int requestid, SceULong64 *contentlength)
 Get http request response length.
int sceHttpGetStatusCode (int requestid, int *statuscode)
 Get http request status code.
int sceHttpSetResolveTimeOut (int id, unsigned int timeout)
 Set resolver timeout.
int sceHttpSetResolveRetry (int id, int count)
 Set resolver retry.
int sceHttpSetConnectTimeOut (int id, unsigned int timeout)
 Set connect timeout.
int sceHttpSetSendTimeOut (int id, unsigned int timeout)
 Set send timeout.
int sceHttpSetRecvTimeOut (int id, unsigned int timeout)
 Set receive timeout.
int sceHttpEnableKeepAlive (int id)
 Enable keep alive.
int sceHttpDisableKeepAlive (int id)
 Disable keep alive.
int sceHttpEnableRedirect (int id)
 Enable redirect.
int sceHttpDisableRedirect (int id)
 Disable redirect.
int sceHttpEnableCookie (int id)
 Enable cookie.
int sceHttpDisableCookie (int id)
 Disable cookie.
int sceHttpSaveSystemCookie (void)
 Save cookie.
int sceHttpLoadSystemCookie (void)
 Load cookie.
int sceHttpAddExtraHeader (int id, char *name, char *value, int unknown1)
 Add content header.
int sceHttpDeleteHeader (int id, const char *name)
 Delete content header.
int sceHttpsInit (int unknown1, int unknown2, int unknown3, int unknown4)
 Init the https library.
int sceHttpsEnd (void)
 Terminate the https library.
int sceHttpsLoadDefaultCert (int unknown1, int unknown2)
 Load default certificate.

Variables

typedef __attribute__
 USB device descriptor.

Enumeration Type Documentation

Enumerator:
PSP_HTTP_METHOD_GET 
PSP_HTTP_METHOD_POST 
PSP_HTTP_METHOD_HEAD 

Function Documentation

int sceHttpAbortRequest ( int  requestid  ) 

Abort a http request.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
Returns:
0 on success, < 0 on error.
int sceHttpAddExtraHeader ( int  id,
char *  name,
char *  value,
int  unknown1 
)

Add content header.

Parameters:
id - ID of the template, connection or request
name - Name of the content
value - Value of the content
unknown1 - Pass 0
Returns:
0 on success, < 0 on error.
int sceHttpCreateConnection ( int  templateid,
char *  host,
char *  unknown1,
unsigned short  port,
int  unknown2 
)

Create a http connection.

Parameters:
templateid - ID of the template created by sceHttpCreateTemplate
host - Host to connect to
unknown1 - Pass "http"
port - Port to connect on
unknown2 - Pass 0
Returns:
A connection ID on success, < 0 on error.
int sceHttpCreateConnectionWithURL ( int  templateid,
const char *  url,
int  unknown1 
)

Create a http connection to a url.

Parameters:
templateid - ID of the template created by sceHttpCreateTemplate
url - url to connect to
unknown1 - Pass 0
Returns:
A connection ID on success, < 0 on error.
int sceHttpCreateRequest ( int  connectionid,
PspHttpMethod  method,
char *  path,
SceULong64  contentlength 
)

Create a http request.

Parameters:
connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
method - One of PspHttpMethod
path - Path to access
contentlength - Length of the content (POST method only)
Returns:
A request ID on success, < 0 on error.
int sceHttpCreateRequestWithURL ( int  connectionid,
PspHttpMethod  method,
char *  url,
SceULong64  contentlength 
)

Create a http request with url.

Parameters:
connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
method - One of PspHttpMethod
url - url to access
contentlength - Length of the content (POST method only)
Returns:
A request ID on success, < 0 on error.
int sceHttpCreateTemplate ( char *  agent,
int  unknown1,
int  unknown2 
)

Create a http template.

Parameters:
agent - User agent
unknown1 - Pass 1
unknown2 - Pass 0
Returns:
A template ID on success, < 0 on error.
int sceHttpDeleteConnection ( int  connectionid  ) 

Delete a http connection.

Parameters:
connectionid - ID of the connection created by sceHttpCreateConnection or sceHttpCreateConnectionWithURL
Returns:
0 on success, < 0 on error.
int sceHttpDeleteHeader ( int  id,
const char *  name 
)

Delete content header.

Parameters:
id - ID of the template, connection or request
name - Name of the content
Returns:
0 on success, < 0 on error.
int sceHttpDeleteRequest ( int  requestid  ) 

Delete a http request.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
Returns:
0 on success, < 0 on error.
int sceHttpDeleteTemplate ( int  templateid  ) 

Delete a http template.

Parameters:
templateid - ID of the template created by sceHttpCreateTemplate
Returns:
0 on success, < 0 on error.
int sceHttpDisableCookie ( int  id  ) 

Disable cookie.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpDisableKeepAlive ( int  id  ) 

Disable keep alive.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpDisableRedirect ( int  id  ) 

Disable redirect.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpEnableCookie ( int  id  ) 

Enable cookie.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpEnableKeepAlive ( int  id  ) 

Enable keep alive.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpEnableRedirect ( int  id  ) 

Enable redirect.

Parameters:
id - ID of the template or connection
Returns:
0 on success, < 0 on error.
int sceHttpEnd ( void   ) 

Terminate the http library.

Returns:
0 on success, < 0 on error.
int sceHttpGetContentLength ( int  requestid,
SceULong64 contentlength 
)

Get http request response length.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
contentlength - The size of the content
Returns:
0 on success, < 0 on error.
int sceHttpGetStatusCode ( int  requestid,
int *  statuscode 
)

Get http request status code.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
statuscode - The status code from the host (200 is ok, 404 is not found etc)
Returns:
0 on success, < 0 on error.
int sceHttpInit ( unsigned int  unknown1  ) 

Init the http library.

Parameters:
unknown1 - Memory pool size? Pass 20000
Returns:
0 on success, < 0 on error.
int sceHttpLoadSystemCookie ( void   ) 

Load cookie.

Returns:
0 on success, < 0 on error.
int sceHttpReadData ( int  requestid,
void *  data,
unsigned int  datasize 
)

Read a http request response.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
data - Buffer for the response data to be stored
datasize - Size of the buffer
Returns:
The size read into the data buffer, 0 if there is no more data, < 0 on error.
int sceHttpSaveSystemCookie ( void   ) 

Save cookie.

Returns:
0 on success, < 0 on error.
int sceHttpsEnd ( void   ) 

Terminate the https library.

Returns:
0 on success, < 0 on error.
int sceHttpSendRequest ( int  requestid,
void *  data,
unsigned int  datasize 
)

Send a http request.

Parameters:
requestid - ID of the request created by sceHttpCreateRequest or sceHttpCreateRequestWithURL
data - For POST methods specify a pointer to the post data, otherwise pass NULL
datasize - For POST methods specify the size of the post data, otherwise pass 0
Returns:
0 on success, < 0 on error.
int sceHttpSetConnectTimeOut ( int  id,
unsigned int  timeout 
)

Set connect timeout.

Parameters:
id - ID of the template, connection or request
timeout - Timeout value in microseconds
Returns:
0 on success, < 0 on error.
int sceHttpSetRecvTimeOut ( int  id,
unsigned int  timeout 
)

Set receive timeout.

Parameters:
id - ID of the template or connection
timeout - Timeout value in microseconds
Returns:
0 on success, < 0 on error.
int sceHttpSetResolveRetry ( int  id,
int  count 
)

Set resolver retry.

Parameters:
id - ID of the template or connection
count - Number of retries
Returns:
0 on success, < 0 on error.
int sceHttpSetResolveTimeOut ( int  id,
unsigned int  timeout 
)

Set resolver timeout.

Parameters:
id - ID of the template or connection
timeout - Timeout value in microseconds
Returns:
0 on success, < 0 on error.
int sceHttpSetSendTimeOut ( int  id,
unsigned int  timeout 
)

Set send timeout.

Parameters:
id - ID of the template, connection or request
timeout - Timeout value in microseconds
Returns:
0 on success, < 0 on error.
int sceHttpsInit ( int  unknown1,
int  unknown2,
int  unknown3,
int  unknown4 
)

Init the https library.

Parameters:
unknown1 - Pass 0
unknown2 - Pass 0
unknown3 - Pass 0
unknown4 - Pass 0
Returns:
0 on success, < 0 on error.
int sceHttpsLoadDefaultCert ( int  unknown1,
int  unknown2 
)

Load default certificate.

Parameters:
unknown1 - Pass 0
unknown2 - Pass 0
Returns:
0 on success, < 0 on error.

Variable Documentation

struct SfoEntry __attribute__ [new]

USB device descriptor.

USB driver structure used by sceUsbbdRegisterDriver and sceUsbbdUnregisterDriver.

USB EP0 Device Request.

Padded data structure, padding is required otherwise the USB hardware crashes.

USB endpoint descriptor.

USB Interface descriptor.

USB configuration descriptor.