12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #include <sys/types.h>
- #include <netinet/in.h>
- #include <openssl/ssl.h>
- typedef enum {
- file, std, sock
- } dstype;
- typedef struct {
- int fd;
- dstype tp;
- int ipv6;
- int server;
- struct sockaddr_storage peer;
- } *ds, s_ds;
- #define DEFAULT_LISTENNING_QUEUE 5
- typedef struct{
- int fd;
- int ipv6;
- } *nethandler, s_nethandler;
- typedef struct {
- dstype tp;
- void *original;
- SSL *s;
- } *tlsDs, s_tlsDs;
- nethandler getIPv4Port(const int port);
- nethandler getPort(const int port);
- ds createFromFile(int);
- ds createFromFileName(const char*);
- ds createFromHandler(nethandler);
- ds createToIPv4Host(const unsigned long, const int);
- ds createToIPv6Host(const unsigned char[16], const int);
- tlsDs startSockTls(ds, const char*, const char*, const char*);
- int getPeer(ds, unsigned long*, unsigned char[16], int*);
- int closeDs(ds);
- void closeHandler(nethandler);
- ds closeTls(tlsDs);
- int sendDs(ds, const char[const], const int);
- int recvDs(ds, 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);
- int getFd(ds);
- int getTlsFd(tlsDs);
- void closeFd(int);
|