wut/include/nsysnet/nssl.h
James Benton 8c1943cdd7 nsysnet: Fix NSSL context / connection types.
NSSLCreateContext returns negative number on failure so must be a handle
rather than a pointer.
2018-06-18 12:17:16 +01:00

72 lines
1.4 KiB
C

#pragma once
#include <wut.h>
/**
* \defgroup nsysnet_nssl Nintendo SSL
* \ingroup nsysnet
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef int32_t NSSLContextHandle;
typedef int32_t NSSLConnectionHandle;
typedef enum NSSLServerCertId
{
NSSL_SERVER_CERT_GROUP_0_FIRST = 100,
NSSL_SERVER_CERT_GROUP_0_LAST = 105,
NSSL_SERVER_CERT_GROUP_1_FIRST = 1001,
NSSL_SERVER_CERT_GROUP_1_LAST = 1033,
} NSSLServerCertId;
int32_t
NSSLInit();
int32_t
NSSLFinish();
NSSLContextHandle
NSSLCreateContext(int32_t unk);
int32_t
NSSLDestroyContext(NSSLContextHandle context);
int32_t
NSSLAddServerPKIExternal(NSSLContextHandle context,
const void *cert,
int32_t length,
int32_t unk);
int32_t
NSSLAddServerPKI(NSSLContextHandle context,
NSSLServerCertId pki);
NSSLConnectionHandle
NSSLCreateConnection(NSSLContextHandle context,
const char *host,
int32_t hostLength,
int32_t options,
int32_t socket,
int32_t block);
int32_t
NSSLRead(NSSLConnectionHandle connection,
const void *buffer,
int32_t length,
int32_t *outBytesRead);
int32_t
NSSLWrite(NSSLConnectionHandle connection,
const void *buffer,
int32_t length,
int32_t *outBytesWritten);
#ifdef __cplusplus
}
#endif
/** @} */