aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/networking/host.h
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2014-10-28 18:14:29 +0100
committerTobias Brunner <tobias@strongswan.org>2014-10-30 12:32:45 +0100
commit82be444eb99b51f42e717bf883a981ae9cd7d77e (patch)
tree8049f39c02d2866b585d02914acf1efd3a443798 /src/libstrongswan/networking/host.h
parentbbe3070aa207afaa8c61867157fd097ef09b2ac4 (diff)
downloadstrongswan-82be444eb99b51f42e717bf883a981ae9cd7d77e.tar.bz2
strongswan-82be444eb99b51f42e717bf883a981ae9cd7d77e.tar.xz
host: Add function to create two hosts from a range definition
Diffstat (limited to 'src/libstrongswan/networking/host.h')
-rw-r--r--src/libstrongswan/networking/host.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstrongswan/networking/host.h b/src/libstrongswan/networking/host.h
index 9c9b5035f..3670768c4 100644
--- a/src/libstrongswan/networking/host.h
+++ b/src/libstrongswan/networking/host.h
@@ -181,6 +181,19 @@ host_t *host_create_from_chunk(int family, chunk_t address, u_int16_t port);
host_t *host_create_from_sockaddr(sockaddr_t *sockaddr);
/**
+ * Parse a range definition (1.2.3.0-1.2.3.5), return the two hosts.
+ *
+ * The two hosts are not ordered, from is simply the first, to is the second,
+ * from is not necessarily smaller.
+ *
+ * @param string string to parse
+ * @param from returns the first address (out)
+ * @param to returns the second address (out)
+ * @return TRUE if parsed successfully, FALSE otherwise
+ */
+bool host_create_from_range(char *string, host_t **from, host_t **to);
+
+/**
* Create a host from a CIDR subnet definition (1.2.3.0/24), return bits.
*
* @param string string to parse