diff options
Diffstat (limited to 'src/assuan-socket.c')
-rw-r--r-- | src/assuan-socket.c | 65 |
1 files changed, 57 insertions, 8 deletions
diff --git a/src/assuan-socket.c b/src/assuan-socket.c index ed6a488..7bca0ae 100644 --- a/src/assuan-socket.c +++ b/src/assuan-socket.c @@ -1,5 +1,6 @@ -/* assuan-socket.c +/* assuan-socket.c - Socket wrapper Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2001-2015 g10 Code GmbH This file is part of Assuan. @@ -78,6 +79,13 @@ + strlen ((ptr)->sun_path)) #endif +/* In the future, we can allow access to sock_ctx, if that context's + hook functions need to be overridden. There can only be one global + assuan_sock_* user (one library or one application) with this + convenience interface, if non-standard hook functions are + needed. */ +static assuan_context_t sock_ctx; + #ifdef HAVE_W32_SYSTEM @@ -375,6 +383,42 @@ _assuan_sock_new (assuan_context_t ctx, int domain, int type, int proto) int +_assuan_sock_set_flag (assuan_context_t ctx, assuan_fd_t sockfd, + const char *name, int value) +{ + if (0) + { + } + else + { + gpg_err_set_errno (EINVAL); + return -1; + } + + return 0; +} + + +int +_assuan_sock_get_flag (assuan_context_t ctx, assuan_fd_t sockfd, + const char *name, int *r_value) +{ + (void)ctx; + + if (0) + { + } + else + { + gpg_err_set_errno (EINVAL); + return -1; + } + + return 0; +} + + +int _assuan_sock_connect (assuan_context_t ctx, assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { @@ -695,13 +739,6 @@ _assuan_sock_check_nonce (assuan_context_t ctx, assuan_fd_t fd, /* Public API. */ -/* In the future, we can allow access to sock_ctx, if that context's - hook functions need to be overridden. There can only be one global - assuan_sock_* user (one library or one application) with this - convenience interface, if non-standard hook functions are - needed. */ -static assuan_context_t sock_ctx; - gpg_error_t assuan_sock_init () { @@ -752,6 +789,18 @@ assuan_sock_new (int domain, int type, int proto) } int +assuan_sock_set_flag (assuan_fd_t sockfd, const char *name, int value) +{ + return _assuan_sock_set_flag (sock_ctx, sockfd, name, value); +} + +int +assuan_sock_get_flag (assuan_fd_t sockfd, const char *name, int *r_value) +{ + return _assuan_sock_get_flag (sock_ctx, sockfd, name, r_value); +} + +int assuan_sock_connect (assuan_fd_t sockfd, struct sockaddr *addr, int addrlen) { return _assuan_sock_connect (sock_ctx, sockfd, addr, addrlen); |