diff options
author | Martin Willi <martin@revosec.ch> | 2010-02-24 10:58:23 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2010-02-26 11:44:34 +0100 |
commit | 9ed1bb4842af89b09c3617f1d1f25718b891209a (patch) | |
tree | c42a0589ff111dba99f4d13d5f40cebdcfe8ac6b /src/charon/plugins/socket_dynamic/socket_dynamic_socket.h | |
parent | 40706b6027b6e1f074c57fb18bef560063d6402a (diff) | |
download | strongswan-9ed1bb4842af89b09c3617f1d1f25718b891209a.tar.bz2 strongswan-9ed1bb4842af89b09c3617f1d1f25718b891209a.tar.xz |
Added an initiator-only socket implementation which binds ports on demand
Diffstat (limited to 'src/charon/plugins/socket_dynamic/socket_dynamic_socket.h')
-rw-r--r-- | src/charon/plugins/socket_dynamic/socket_dynamic_socket.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/charon/plugins/socket_dynamic/socket_dynamic_socket.h b/src/charon/plugins/socket_dynamic/socket_dynamic_socket.h new file mode 100644 index 000000000..72551e545 --- /dev/null +++ b/src/charon/plugins/socket_dynamic/socket_dynamic_socket.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2010 Martin Willi + * Copyright (C) 2010 revosec AG + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +/** + * @defgroup socket_dynamic_socket socket_dynamic_socket + * @{ @ingroup socket_dynamic + */ + +#ifndef SOCKET_DYNAMIC_SOCKET_H_ +#define SOCKET_DYNAMIC_SOCKET_H_ + +typedef struct socket_dynamic_socket_t socket_dynamic_socket_t; + +#include <network/socket.h> + +/** + * A socket implementation binding to ports on demand as required. + */ +struct socket_dynamic_socket_t { + + /** + * Implements the socket_t interface. + */ + socket_t socket; + + /** + * Destroy a socket_dynamic_socket_t. + */ + void (*destroy)(socket_dynamic_socket_t *this); +}; + +/** + * Create a socket_dynamic_socket instance. + */ +socket_dynamic_socket_t *socket_dynamic_socket_create(); + +#endif /** SOCKET_DYNAMIC_SOCKET_H_ @}*/ |