NetBurner 3.5.6
PDF Version
CryptoServer.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
5#ifndef _CRYPTO_SERVER_H_
6#define _CRYPTO_SERVER_H_
7
8#include <predef.h>
9#if defined(NB_SSL_SUPPORTED) || defined(NB_SSH_SUPPORTED)
10
11#include <crypto/NetBurner/CryptoSocket.h>
12
13
14enum CryptoServerErrors : int16_t
15{
16 eCryptoServerErrorInvalidSocketType = -1
17};
18
19enum CryptoQueueAction : unsigned char
20{
21 eCryptoQueueActionError = 1,
22 eCryptoQueueActionTcpRead = 2,
23 eCryptoQueueActionTcpClose = 3,
24 eCryptoQueueActionExtraFdClose = 4
25};
26
27int ioReturnCode(int n, int tcpFd, SocketType_t sockType);
28
29void InitCryptoServer();
30void PostCryptoQueueData(CryptoSocket *sck, CryptoQueueAction action);
31
32void CryptoReadNotify(int fd);
33void CryptoWriteNotify(int fd);
34
35int WolfCryptoCbIoRecv(int tcp, char *buf, int len, void *ctx, SocketType_t sckType);
36int WolfCryptoCbIoSend(int tcp, char *buf, int len, void *ctx, SocketType_t sckType);
37
38int WolfCryptoExtraFdRead(int fd, char *buf, int nbytes);
39int WolfCryptoExtraFdWrite(int fd, const char *buf, int nbytes);
40int WolfCryptoExtraFdClose(int extra_fd);
41
42#endif // NB_SSL_SUPPORTED || NB_SSH_SUPPORTED
43#endif //_CRYPTO_SERVER_H_