1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <openssl/ssl.h>
- typedef struct {
- int s;
- int ipv6;
- int server;
- struct sockaddr_storage peer;
- } *sockDs, s_sockDs;
- typedef struct {
- int f;
- } *fileDs, s_fileDs;
- #define DEFAULT_LISTENNING_QUEUE 5
- typedef struct{
- int s;
- int ipv6;
- } *nethandler, s_nethandler;
- typedef enum {
- file, sock
- } dstype;
- typedef struct {
- dstype tp;
- void *original;
- SSL *s;
- } *tlsDs, s_tlsDs;
- nethandler getIPv4Port(const int port);
- nethandler getPort(const int port);
- fileDs createFromFile(int);
- fileDs createFromFileName(const char*);
- sockDs createFromHandler(nethandler);
- sockDs createToIPv4Host(const unsigned long, const int);
- sockDs createToIPv6Host(const unsigned char[16], const int);
- tlsDs startSockTls(sockDs, const char*, const char*);
- int getPeer(sockDs, unsigned long*, unsigned char[16], int*);
- void closeSockDs(sockDs);
- void closeFileDs(fileDs);
- void closeHandler(nethandler);
- void closeTlsDs(tlsDs);
- int fileDsSend(fileDs, const char[const], const int);
- int fileDsRecv(fileDs, char[], const int);
- int sockDsSend(sockDs, const char[const], const int);
- int sockDsRecv(sockDs, char[], const int);
- int tlsDsSend(tlsDs, const char[const], const int);
- int tlsDsRecv(tlsDs, char[], const int);
- int stdDsSend(const char[const], const int);
- int stdDsRecv(char[], const int);
|