diff options
Diffstat (limited to 'src/libstrongswan/selectors/traffic_selector.c')
-rw-r--r-- | src/libstrongswan/selectors/traffic_selector.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/libstrongswan/selectors/traffic_selector.c b/src/libstrongswan/selectors/traffic_selector.c index b19b962e6..87e57095c 100644 --- a/src/libstrongswan/selectors/traffic_selector.c +++ b/src/libstrongswan/selectors/traffic_selector.c @@ -22,9 +22,9 @@ #include "traffic_selector.h" -#include <utils/linked_list.h> +#include <collections/linked_list.h> #include <utils/identification.h> -#include <debug.h> +#include <utils/debug.h> #define NON_SUBNET_ADDRESS_RANGE 255 @@ -818,6 +818,23 @@ traffic_selector_t *traffic_selector_create_from_string( /* * see header */ +traffic_selector_t *traffic_selector_create_from_cidr(char *string, + u_int8_t protocol, u_int16_t port) +{ + host_t *net; + int bits; + + net = host_create_from_subnet(string, &bits); + if (net) + { + return traffic_selector_create_from_subnet(net, bits, protocol, port); + } + return NULL; +} + +/* + * see header + */ traffic_selector_t *traffic_selector_create_dynamic(u_int8_t protocol, u_int16_t from_port, u_int16_t to_port) { |