diff options
author | Michael Steinert <mike.steinert@gmail.com> | 2012-05-10 13:28:17 -0600 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2013-04-09 15:18:39 -0700 |
commit | 795c1240c9fb09c42bcdc45d5a8d44e6a406ee9c (patch) | |
tree | ce8b060d7ee08435a6c7b668f56ccf5b7b460b69 /librabbitmq/amqp_private.h | |
parent | 21b124e2fd2f1c343fb37b708f393d1b9580cfad (diff) | |
download | rabbitmq-c-github-ask-795c1240c9fb09c42bcdc45d5a8d44e6a406ee9c.tar.gz |
Add plumbing for SSL/TLS support
This change abstracts out the networking functions so that the
user can provide an SSL/TLS implementation.
Callback functions replace `writev()`, `send()`, and `recv()` (there
is also a callback for error reporting). The default interface remains
unchanged. If the user wants to create a SSL/TLS connection they first
negotiate the connection and then use the new function
`amqp_set_sockfd_full()` to provide the networking implementation for
their SSL/TLS library. The user may provide an optional pointer to data
that is passed through to the networking functions.
Signed-off-by: Michael Steinert <mike.steinert@gmail.com>
Diffstat (limited to 'librabbitmq/amqp_private.h')
-rw-r--r-- | librabbitmq/amqp_private.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index 68239d1..b28d7bb 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -43,6 +43,7 @@ #include "amqp.h" #include "amqp_framing.h" +#include <arpa/inet.h> #include <string.h> /* Error numbering: Because of differences in error numbering on @@ -71,8 +72,11 @@ #if __GNUC__ > 2 | (__GNUC__ == 2 && __GNUC_MINOR__ > 4) #define AMQP_NORETURN \ __attribute__ ((__noreturn__)) +#define AMQP_UNUSED \ + __attribute__ ((__unused__)) #else #define AMQP_NORETURN +#define AMQP_UNUSED #endif #if __GNUC__ >= 4 @@ -144,6 +148,13 @@ struct amqp_connection_state_t_ { amqp_bytes_t outbound_buffer; int sockfd; + amqp_socket_writev_fn writev; + amqp_socket_send_fn send; + amqp_socket_recv_fn recv; + amqp_socket_close_fn close; + amqp_socket_error_fn error; + void *user_data; + amqp_bytes_t sock_inbound_buffer; size_t sock_inbound_offset; size_t sock_inbound_limit; |