diff options
author | Simon Rettberg | 2015-04-28 15:54:45 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-04-28 15:54:45 +0200 |
commit | d611cc597822049b1bd091b6bf2f136e07ae53cf (patch) | |
tree | 6a31137cda1d6727123e668268d891d429b53c9d /types.h | |
parent | "Support" feature query (done by sssd) (diff) | |
download | ldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.tar.gz ldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.tar.xz ldadp-d611cc597822049b1bd091b6bf2f136e07ae53cf.zip |
SSL support when talking to ADS
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -12,21 +12,28 @@ #define BASELEN 250 #define SIDLEN 28 #define MOUNTLEN 100 +#define FINGERPRINTLEN 20 #define REQLEN 4000 #define MAXMSGLEN 100000 #define BOOL uint8_t -#define TRUE 1 -#define FALSE 0 +#define TRUE (1) +#define FALSE (0) typedef struct _server_t_ server_t; +/** + * General epoll struct, to be implemented by every epoll struct. + */ typedef struct { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; } epoll_item_t; +/** + * epoll struct for listening sockets. + */ typedef struct { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; @@ -34,6 +41,9 @@ typedef struct { SSL_CTX *sslContext; // Listening for SSL connections, NULL otherwise } epoll_listen_t; +/** + * epoll struct for a client we're serving. + */ typedef struct { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; @@ -51,22 +61,32 @@ typedef struct { char readBuffer[REQLEN]; // Static, queries > 4000 bytes simply not supported } epoll_client_t; +/** + * epoll struct for a connection to AD. + */ typedef struct { void (*callback)(void *data, int haveIn, int haveOut, int doCleanup); int fd; + // // Send buffer (me to server) size_t sbPos, sbFill, sbLen; + SSL *ssl; // NULL if not encrypted char *sendBuffer; // Dynamically allocated, might or might not get huge // Recv buffer (server's response) size_t rbPos; char readBuffer[MAXMSGLEN]; - BOOL bound; + BOOL bound; // Already bound to server? BOOL dynamic; - //unsigned long messageId; // ID of message currently being received + BOOL sslConnected; + BOOL kill; // Should the connection be killed? + BOOL writeBlocked; // An SSL_write returned WANT_*, so we must not reallocate the current send buffer time_t lastActive; server_t *serverData; } epoll_server_t; +/** + * Configuration data for an ADS we're proxying. + */ struct _server_t_ { size_t baseLen; char ip[4]; @@ -77,6 +97,9 @@ struct _server_t_ { char base[BASELEN]; char sid[SIDLEN]; char homeTemplate[MOUNTLEN]; + unsigned char fingerprint[FINGERPRINTLEN]; + uint16_t port; + SSL_CTX *sslContext; epoll_server_t con; }; |