7 #ifndef _PSP2_NET_HTTP_H_
8 #define _PSP2_NET_HTTP_H_
17 #define SCE_HTTP_DEFAULT_RESOLVER_TIMEOUT (1 * 1000 * 1000U)
18 #define SCE_HTTP_DEFAULT_RESOLVER_RETRY (5U)
19 #define SCE_HTTP_DEFAULT_CONNECT_TIMEOUT (30* 1000 * 1000U)
20 #define SCE_HTTP_DEFAULT_SEND_TIMEOUT (120* 1000 * 1000U)
21 #define SCE_HTTP_DEFAULT_RECV_TIMEOUT (120* 1000 * 1000U)
22 #define SCE_HTTP_DEFAULT_RECV_BLOCK_SIZE (1500U)
23 #define SCE_HTTP_DEFAULT_RESPONSE_HEADER_MAX (5000U)
24 #define SCE_HTTP_DEFAULT_REDIRECT_MAX (6U)
25 #define SCE_HTTP_DEFAULT_TRY_AUTH_MAX (6U)
27 #define SCE_HTTP_INVALID_ID 0
91 #define SCE_HTTP_ENABLE (1)
92 #define SCE_HTTP_DISABLE (0)
94 #define SCE_HTTP_USERNAME_MAX_SIZE 256
95 #define SCE_HTTP_PASSWORD_MAX_SIZE 256
97 typedef enum SceHttpStatusCode {
203 typedef enum SceHttpVersion {
254 unsigned char **entityBody,
255 unsigned int *entitySize,
263 const char *location,
267 unsigned int verifyEsrr,
268 void *
const sslCert[],
275 const char *cookieHeader,
276 unsigned int headerLen,
282 const char *cookieHeader,
313 int sceHttpParseResponseHeader(
const char *header,
unsigned int headerLen,
const char *fieldStr,
const char **fieldValue,
unsigned int *valueLen);
314 int sceHttpParseStatusLine(
const char *statusLine,
unsigned int lineLen,
int *httpMajorVer,
int *httpMinorVer,
int *responseCode,
const char **reasonPhrase,
unsigned int *phraseLen);
318 int sceHttpCreateConnection(
int tmplId,
const char *serverName,
const char *scheme,
unsigned short port,
int enableKeepalive);
328 int sceHttpUriEscape(
char *out,
unsigned int *require,
unsigned int prepare,
const char *in);
332 int sceHttpUriMerge(
char *mergedUrl,
const char *url,
const char *relativeUrl,
unsigned int *require,
unsigned int prepare,
unsigned int option);
360 int sceHttpGetCookie(
const char *url,
char *cookie,
unsigned int *cookieLength,
unsigned int prepare,
int secure);
int sceHttpAbortRequest(int reqId)
VITASDK_BUILD_ASSERT_EQ(0x10, SceHttpMemoryPoolStats)
int sceHttpDeleteTemplate(int tmplId)
char * path
Definition: http.h:195
int sceHttpGetCookie(const char *url, char *cookie, unsigned int *cookieLength, unsigned int prepare, int secure)
int sceHttpSendRequest(int reqId, const void *postData, unsigned int size)
SceHttpsFlag
Definition: http.h:159
int sceHttpsLoadCert(int caCertNum, const SceHttpsData **caList, const SceHttpsData *cert, const SceHttpsData *privKey)
Register RootCA certificate for HTTPS authentication.
void ** caCerts
Definition: http.h:240
int sceHttpSetCookieSendCallback(int id, SceHttpCookieSendCallback cbfunc, void *userArg)
int sceHttpGetResponseContentLength(int reqId, unsigned long long int *contentLength)
int reserved
Definition: http.h:174
char * query
Definition: http.h:196
int sceHttpSetResolveRetry(int id, int retry)
int sceHttpSetAutoRedirect(int id, int enable)
char * password
Definition: http.h:193
unsigned int currentInuseSize
Definition: http.h:173
int sceHttpSetConnectTimeOut(int id, unsigned int usec)
int sceHttpGetAutoRedirect(int id, int *enable)
SceHttpUriBuildType
Definition: http.h:147
SceHttpStatuscode
Definition: http.h:97
int sceHttpSetResolveTimeOut(int id, unsigned int usec)
int sceHttpDeleteRequest(int reqId)
int sceHttpCreateConnectionWithURL(int tmplId, const char *url, int enableKeepalive)
int sceHttpInit(unsigned int poolSize)
int sceHttpParseResponseHeader(const char *header, unsigned int headerLen, const char *fieldStr, const char **fieldValue, unsigned int *valueLen)
int sceHttpsGetCaList(SceHttpsCaList *caList)
unsigned int size
Definition: http.h:235
int(* SceHttpAuthInfoCallback)(int request, SceHttpAuthType authType, const char *realm, char *username, char *password, int needEntity, unsigned char **entityBody, unsigned int *entitySize, int *save, void *userArg)
Definition: http.h:247
int sceHttpCreateRequestWithURL(int connId, int method, const char *url, unsigned long long int contentLength)
SceHttpProxyMode
Definition: http.h:208
char * ptr
Definition: http.h:234
int sceHttpGetStatusCode(int reqId, int *statusCode)
unsigned int maxInuseSize
Definition: http.h:172
int sceHttpSetAuthInfoCallback(int id, SceHttpAuthInfoCallback cbfunc, void *userArg)
int sceHttpUriParse(SceHttpUriElement *out, const char *srcUrl, void *pool, unsigned int *require, unsigned int prepare)
int opaque
Definition: http.h:190
int caNum
Definition: http.h:241
SceHttpSslVersion
Definition: http.h:226
int sceHttpAddCookie(const char *url, const char *cookie, unsigned int cookieLength)
int sceHttpGetCookieEnabled(int id, int *enable)
int sceHttpAddRequestHeader(int id, const char *name, const char *value, unsigned int mode)
int sceHttpSetRequestContentLength(int id, unsigned long long int contentLength)
int sceHttpUriEscape(char *out, unsigned int *require, unsigned int prepare, const char *in)
int sceHttpsFreeCaList(SceHttpsCaList *caList)
int sceHttpCreateConnection(int tmplId, const char *serverName, const char *scheme, unsigned short port, int enableKeepalive)
int sceHttpsSetSslCallback(int id, SceHttpsCallback cbfunc, void *userArg)
unsigned int poolSize
Definition: http.h:171
int sceHttpSetCookieRecvCallback(int id, SceHttpCookieRecvCallback cbfunc, void *userArg)
int sceHttpsUnloadCert(void)
SceHttpErrorCode
Definition: http.h:29
int sceHttpSetSendTimeOut(int id, unsigned int usec)
int sceHttpParseStatusLine(const char *statusLine, unsigned int lineLen, int *httpMajorVer, int *httpMinorVer, int *responseCode, const char **reasonPhrase, unsigned int *phraseLen)
int sceHttpGetAllResponseHeaders(int reqId, char **header, unsigned int *headerSize)
char * fragment
Definition: http.h:197
int sceHttpDeleteConnection(int connId)
int sceHttpsDisableOption(unsigned int sslFlags)
SceHttpsErrorCode
Definition: http.h:74
int sceHttpSetRecvTimeOut(int id, unsigned int usec)
int sceHttpGetMemoryPoolStats(SceHttpMemoryPoolStats *currentStat)
int sceHttpSetResponseHeaderMaxSize(int id, unsigned int headerSize)
int sceHttpsEnableOption(unsigned int sslFlags)
int(* SceHttpRedirectCallback)(int request, int statusCode, int *method, const char *location, void *userArg)
Definition: http.h:259
int sceHttpSetCookieEnabled(int id, int enable)
int sceHttpUriBuild(char *out, unsigned int *require, unsigned int prepare, const SceHttpUriElement *srcElement, unsigned int option)
int(* SceHttpsCallback)(unsigned int verifyEsrr, void *const sslCert[], int certNum, void *userArg)
Definition: http.h:266
char * hostname
Definition: http.h:194
int sceHttpReadData(int reqId, void *data, unsigned int size)
int sceHttpsGetSslError(int id, int *errNum, unsigned int *detail)
SceHttpsSslErrorCode
Definition: http.h:82
int(* SceHttpCookieSendCallback)(int request, const char *url, const char *cookieHeader, void *userArg)
Definition: http.h:279
SceHttpHttpVersion
Definition: http.h:203
int sceHttpCreateRequest(int connId, int method, const char *path, unsigned long long int contentLength)
int sceHttpUriSweepPath(char *dst, const char *src, unsigned int srcSize)
int sceHttpGetAuthEnabled(int id, int *enable)
SceHttpMethods
Definition: http.h:178
int sceHttpSetRedirectCallback(int id, SceHttpRedirectCallback cbfunc, void *userArg)
int sceHttpSetAuthEnabled(int id, int enable)
SceHttpAuthType
Definition: http.h:218
int sceHttpRemoveRequestHeader(int id, const char *name)
unsigned short port
Definition: http.h:198
unsigned char reserved[10]
Definition: http.h:199
int sceHttpUriUnescape(char *out, unsigned int *require, unsigned int prepare, const char *in)
char * scheme
Definition: http.h:191
int(* SceHttpCookieRecvCallback)(int request, const char *url, const char *cookieHeader, unsigned int headerLen, void *userArg)
Definition: http.h:272
char * username
Definition: http.h:192
int sceHttpCreateTemplate(const char *userAgent, int httpVer, int autoProxyConf)
int sceHttpUriMerge(char *mergedUrl, const char *url, const char *relativeUrl, unsigned int *require, unsigned int prepare, unsigned int option)
SceHttpAddHeaderMode
Definition: http.h:213
@ SCE_HTTPS_FLAG_KNOWN_CA_CHECK
Definition: http.h:165
@ SCE_HTTPS_FLAG_NOT_BEFORE_CHECK
Definition: http.h:164
@ SCE_HTTPS_FLAG_CLIENT_VERIFY
Definition: http.h:161
@ SCE_HTTPS_FLAG_NOT_AFTER_CHECK
Definition: http.h:163
@ SCE_HTTPS_FLAG_CN_CHECK
Definition: http.h:162
@ SCE_HTTPS_FLAG_SERVER_VERIFY
Definition: http.h:160
@ SCE_HTTP_URI_BUILD_WITH_PASSWORD
Definition: http.h:153
@ SCE_HTTP_URI_BUILD_WITH_FRAGMENT
Definition: http.h:155
@ SCE_HTTP_URI_BUILD_WITH_PATH
Definition: http.h:151
@ SCE_HTTP_URI_BUILD_WITH_USERNAME
Definition: http.h:152
@ SCE_HTTP_URI_BUILD_WITH_QUERY
Definition: http.h:154
@ SCE_HTTP_URI_BUILD_WITH_SCHEME
Definition: http.h:148
@ SCE_HTTP_URI_BUILD_WITH_HOSTNAME
Definition: http.h:149
@ SCE_HTTP_URI_BUILD_WITH_ALL
Definition: http.h:156
@ SCE_HTTP_URI_BUILD_WITH_PORT
Definition: http.h:150
@ SCE_HTTP_STATUS_CODE_HTTP_VERSION_NOT_SUPPORTED
Definition: http.h:143
@ SCE_HTTP_STATUS_CODE_ACCEPTED
Definition: http.h:103
@ SCE_HTTP_STATUS_CODE_METHOD_NOT_ALLOWED
Definition: http.h:121
@ SCE_HTTP_STATUS_CODE_CONFLICT
Definition: http.h:125
@ SCE_HTTP_STATUS_CODE_BAD_GATEWAY
Definition: http.h:140
@ SCE_HTTP_STATUS_CODE_NOT_ACCEPTABLE
Definition: http.h:122
@ SCE_HTTP_STATUS_CODE_SERVICE_UNAVAILABLE
Definition: http.h:141
@ SCE_HTTP_STATUS_CODE_FORBIDDDEN
Definition: http.h:119
@ SCE_HTTP_STATUS_CODE_RESET_CONTENT
Definition: http.h:106
@ SCE_HTTP_STATUS_CODE_CONTINUE
Definition: http.h:98
@ SCE_HTTP_STATUS_CODE_UPGRADE_REQUIRED
Definition: http.h:137
@ SCE_HTTP_STATUS_CODE_LOCKED
Definition: http.h:135
@ SCE_HTTP_STATUS_CODE_PRECONDITION_FAILED
Definition: http.h:128
@ SCE_HTTP_STATUS_CODE_USE_PROXY
Definition: http.h:114
@ SCE_HTTP_STATUS_CODE_UNSUPPORTED_MEDIA_TYPE
Definition: http.h:131
@ SCE_HTTP_STATUS_CODE_PARTIAL_CONTENT
Definition: http.h:107
@ SCE_HTTP_STATUS_CODE_NOT_MODIFIED
Definition: http.h:113
@ SCE_HTTP_STATUS_CODE_NOT_FOUND
Definition: http.h:120
@ SCE_HTTP_STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED
Definition: http.h:123
@ SCE_HTTP_STATUS_CODE_PROCESSING
Definition: http.h:100
@ SCE_HTTP_STATUS_CODE_EXPECTATION_FAILED
Definition: http.h:133
@ SCE_HTTP_STATUS_CODE_BAD_REQUEST
Definition: http.h:116
@ SCE_HTTP_STATUS_CODE_INTERNAL_SERVER_ERROR
Definition: http.h:138
@ SCE_HTTP_STATUS_CODE_GATEWAY_TIME_OUT
Definition: http.h:142
@ SCE_HTTP_STATUS_CODE_PAYMENT_REQUIRED
Definition: http.h:118
@ SCE_HTTP_STATUS_CODE_SEE_OTHER
Definition: http.h:112
@ SCE_HTTP_STATUS_CODE_UNAUTHORIZED
Definition: http.h:117
@ SCE_HTTP_STATUS_CODE_NO_CONTENT
Definition: http.h:105
@ SCE_HTTP_STATUS_CODE_MULTI_STATUS
Definition: http.h:108
@ SCE_HTTP_STATUS_CODE_TEMPORARY_REDIRECT
Definition: http.h:115
@ SCE_HTTP_STATUS_CODE_MULTIPLE_CHOICES
Definition: http.h:109
@ SCE_HTTP_STATUS_CODE_FAILED_DEPENDENCY
Definition: http.h:136
@ SCE_HTTP_STATUS_CODE_OK
Definition: http.h:101
@ SCE_HTTP_STATUS_CODE_SWITCHING_PROTOCOLS
Definition: http.h:99
@ SCE_HTTP_STATUS_CODE_GONE
Definition: http.h:126
@ SCE_HTTP_STATUS_CODE_FOUND
Definition: http.h:111
@ SCE_HTTP_STATUS_CODE_UNPROCESSABLE_ENTITY
Definition: http.h:134
@ SCE_HTTP_STATUS_CODE_NON_AUTHORITATIVE_INFORMATION
Definition: http.h:104
@ SCE_HTTP_STATUS_CODE_CREATED
Definition: http.h:102
@ SCE_HTTP_STATUS_CODE_REQUEST_RANGE_NOT_SATISFIBLE
Definition: http.h:132
@ SCE_HTTP_STATUS_CODE_LENGTH_REQUIRED
Definition: http.h:127
@ SCE_HTTP_STATUS_CODE_MOVED_PERMANENTLY
Definition: http.h:110
@ SCE_HTTP_STATUS_CODE_NOT_IMPLEMENTED
Definition: http.h:139
@ SCE_HTTP_STATUS_CODE_INSUFFICIENT_STORAGE
Definition: http.h:144
@ SCE_HTTP_STATUS_CODE_REQUEST_TIME_OUT
Definition: http.h:124
@ SCE_HTTP_STATUS_CODE_REQUEST_URI_TOO_LARGE
Definition: http.h:130
@ SCE_HTTP_STATUS_CODE_REQUEST_ENTITY_TOO_LARGE
Definition: http.h:129
@ SCE_HTTP_PROXY_AUTO
Definition: http.h:209
@ SCE_HTTP_PROXY_MANUAL
Definition: http.h:210
@ SCE_HTTPS_SSLV3
Definition: http.h:229
@ SCE_HTTPS_SSLV2
Definition: http.h:228
@ SCE_HTTPS_SSLV23
Definition: http.h:227
@ SCE_HTTPS_TLSV1
Definition: http.h:230
@ SCE_HTTP_ERROR_PARSE_HTTP_NOT_FOUND
Definition: http.h:58
@ SCE_HTTP_ERROR_BUSY
Definition: http.h:32
@ SCE_HTTP_ERROR_NO_CONTENT_LENGTH
Definition: http.h:51
@ SCE_HTTP_ERROR_INVALID_URL
Definition: http.h:40
@ SCE_HTTP_ERROR_RESOLVER_ENODNS
Definition: http.h:63
@ SCE_HTTP_ERROR_TOO_LARGE_RESPONSE_HEADER
Definition: http.h:53
@ SCE_HTTP_ERROR_ALREADY_INITED
Definition: http.h:31
@ SCE_HTTP_ERROR_RESOLVER_ENORECORD
Definition: http.h:71
@ SCE_HTTP_ERROR_RESOLVER_EPACKET
Definition: http.h:62
@ SCE_HTTP_ERROR_OUT_OF_MEMORY
Definition: http.h:33
@ SCE_HTTP_ERROR_PARSE_HTTP_INVALID_VALUE
Definition: http.h:60
@ SCE_HTTP_ERROR_BEFORE_SEND
Definition: http.h:44
@ SCE_HTTP_ERROR_BEFORE_INIT
Definition: http.h:30
@ SCE_HTTP_ERROR_RESOLVER_ESERVERREFUSED
Definition: http.h:70
@ SCE_HTTP_ERROR_RESOLVER_EFORMAT
Definition: http.h:66
@ SCE_HTTP_ERROR_RESOLVER_ENOSUPPORT
Definition: http.h:65
@ SCE_HTTP_ERROR_RESOLVER_ENOTIMPLEMENTED
Definition: http.h:69
@ SCE_HTTP_ERROR_RESOLVER_ESERVERFAILURE
Definition: http.h:67
@ SCE_HTTP_ERROR_OUT_OF_SIZE
Definition: http.h:37
@ SCE_HTTP_ERROR_UNKOWN_AUTH_TYPE
Definition: http.h:47
@ SCE_HTTP_ERROR_NOT_FOUND
Definition: http.h:34
@ SCE_HTTP_ERROR_READ_BY_HEAD_METHOD
Definition: http.h:49
@ SCE_HTTP_ERROR_TIMEOUT
Definition: http.h:46
@ SCE_HTTP_ERROR_BAD_RESPONSE
Definition: http.h:43
@ SCE_HTTP_ERROR_INVALID_ID
Definition: http.h:36
@ SCE_HTTP_ERROR_SSL
Definition: http.h:54
@ SCE_HTTP_ERROR_INVALID_VALUE
Definition: http.h:38
@ SCE_HTTP_ERROR_AFTER_SEND
Definition: http.h:45
@ SCE_HTTP_ERROR_ABORTED
Definition: http.h:55
@ SCE_HTTP_ERROR_NOT_IN_COM
Definition: http.h:50
@ SCE_HTTP_ERROR_RESOLVER_ETIMEDOUT
Definition: http.h:64
@ SCE_HTTP_ERROR_RESOLVER_ENOHOST
Definition: http.h:68
@ SCE_HTTP_ERROR_UNKNOWN_METHOD
Definition: http.h:48
@ SCE_HTTP_ERROR_INVALID_VERSION
Definition: http.h:35
@ SCE_HTTP_ERROR_PARSE_HTTP_INVALID_RESPONSE
Definition: http.h:59
@ SCE_HTTP_ERROR_UNKNOWN
Definition: http.h:56
@ SCE_HTTP_ERROR_UNKNOWN_SCHEME
Definition: http.h:41
@ SCE_HTTP_ERROR_CHUNK_ENC
Definition: http.h:52
@ SCE_HTTP_ERROR_NETWORK
Definition: http.h:42
@ SCE_HTTPS_ERROR_INTERNAL
Definition: http.h:78
@ SCE_HTTPS_ERROR_HANDSHAKE
Definition: http.h:76
@ SCE_HTTPS_ERROR_PROXY
Definition: http.h:79
@ SCE_HTTPS_ERROR_CERT
Definition: http.h:75
@ SCE_HTTPS_ERROR_IO
Definition: http.h:77
@ SCE_HTTPS_ERROR_SSL_INVALID_CERT
Definition: http.h:84
@ SCE_HTTPS_ERROR_SSL_UNKNOWN_CA
Definition: http.h:88
@ SCE_HTTPS_ERROR_SSL_CN_CHECK
Definition: http.h:85
@ SCE_HTTPS_ERROR_SSL_NOT_AFTER_CHECK
Definition: http.h:86
@ SCE_HTTPS_ERROR_SSL_INTERNAL
Definition: http.h:83
@ SCE_HTTPS_ERROR_SSL_NOT_BEFORE_CHECK
Definition: http.h:87
@ SCE_HTTP_VERSION_1_1
Definition: http.h:205
@ SCE_HTTP_VERSION_1_0
Definition: http.h:204
@ SCE_HTTP_METHOD_DELETE
Definition: http.h:184
@ SCE_HTTP_METHOD_GET
Definition: http.h:179
@ SCE_HTTP_METHOD_PUT
Definition: http.h:183
@ SCE_HTTP_METHOD_TRACE
Definition: http.h:185
@ SCE_HTTP_METHOD_HEAD
Definition: http.h:181
@ SCE_HTTP_METHOD_OPTIONS
Definition: http.h:182
@ SCE_HTTP_METHOD_POST
Definition: http.h:180
@ SCE_HTTP_METHOD_CONNECT
Definition: http.h:186
@ SCE_HTTP_AUTH_RESERVED0
Definition: http.h:221
@ SCE_HTTP_AUTH_BASIC
Definition: http.h:219
@ SCE_HTTP_AUTH_RESERVED2
Definition: http.h:223
@ SCE_HTTP_AUTH_DIGEST
Definition: http.h:220
@ SCE_HTTP_AUTH_RESERVED1
Definition: http.h:222
@ SCE_HTTP_HEADER_ADD
Definition: http.h:215
@ SCE_HTTP_HEADER_OVERWRITE
Definition: http.h:214
SceSize size
struct size(variable size)
Definition: debug.h:0