aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/network/host.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/charon/network/host.h')
-rw-r--r--Source/charon/network/host.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/charon/network/host.h b/Source/charon/network/host.h
index 3cf0c6397..c5293bcdf 100644
--- a/Source/charon/network/host.h
+++ b/Source/charon/network/host.h
@@ -45,6 +45,7 @@ typedef struct host_t host_t;
* @b Constructors:
* - host_create()
* - host_create_from_chunk()
+ * - host_create_from_sockaddr()
*
* @todo Add IPv6 support
*
@@ -166,7 +167,7 @@ struct host_t {
};
/**
- * @brief Constructor to create a host_t object
+ * @brief Constructor to create a host_t object from an address string
*
* Currently supports only IPv4!
*
@@ -182,7 +183,7 @@ struct host_t {
host_t *host_create(int family, char *address, u_int16_t port);
/**
- * @brief Constructor to create a host_t object
+ * @brief Constructor to create a host_t object from an address chunk
*
* Currently supports only IPv4!
*
@@ -197,5 +198,19 @@ host_t *host_create(int family, char *address, u_int16_t port);
*/
host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port);
+/**
+ * @brief Constructor to create a host_t object from a sockaddr struct
+ *
+ * Currently supports only IPv4!
+ *
+ * @param sockaddr sockaddr struct which contains family, address and port
+ * @return
+ * - host_t object
+ * - NULL, if family not supported.
+ *
+ * @ingroup network
+ */
+host_t *host_create_from_sockaddr(sockaddr_t *sockaddr);
+
#endif /*HOST_H_*/