ike-cfg: Add helper function to determine address family of IP addresses

All configured static addresses (hostnames, ranges or subnets are not
considered) must be of the same family, otherwise AF_UNSPEC is returned.
This commit is contained in:
Tobias Brunner
2015-07-27 11:59:37 +02:00
parent 65579569ad
commit 6bfa660693
2 changed files with 59 additions and 1 deletions
+12 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Tobias Brunner
* Copyright (C) 2012-2015 Tobias Brunner
* Copyright (C) 2005-2007 Martin Willi
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
@@ -254,4 +254,15 @@ ike_cfg_t *ike_cfg_create(ike_version_t version, bool certreq, bool force_encap,
char *other, u_int16_t other_port,
fragmentation_t fragmentation, u_int8_t dscp);
/**
* Determine the address family of the local or remtoe address(es). If multiple
* families are configured AF_UNSPEC is returned. %any is ignored (%any4|6 are
* not though).
*
* @param local TRUE to check local addresses, FALSE for remote
* @return address family of address(es) if distinct
*/
int ike_cfg_get_family(ike_cfg_t *this, bool local);
#endif /** IKE_CFG_H_ @}*/