summaryrefslogtreecommitdiff
path: root/src/ipaddrcheck_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipaddrcheck_functions.c')
-rw-r--r--src/ipaddrcheck_functions.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c
index bb86ee7..dfcdcfb 100644
--- a/src/ipaddrcheck_functions.c
+++ b/src/ipaddrcheck_functions.c
@@ -145,6 +145,42 @@ int is_ipv6_single(char* address_str)
return(result);
}
+/* Is it a CIDR-formatted IPv4 or IPv6 address? */
+int is_any_cidr(char* address_str)
+{
+ int result;
+
+ if( (is_ipv4_cidr(address_str) == RESULT_SUCCESS) ||
+ (is_ipv6_cidr(address_str) == RESULT_SUCCESS) )
+ {
+ result = RESULT_SUCCESS;
+ }
+ else
+ {
+ result = RESULT_FAILURE;
+ }
+
+ return(result);
+}
+
+/* Is it a single IPv4 or IPv6 address? */
+int is_any_single(char* address_str)
+{
+ int result;
+
+ if( (is_ipv4_single(address_str) == RESULT_SUCCESS) ||
+ (is_ipv6_single(address_str) == RESULT_SUCCESS) )
+ {
+ result = RESULT_SUCCESS;
+ }
+ else
+ {
+ result = RESULT_FAILURE;
+ }
+
+ return(result);
+}
+
/*
* Address checking functions that rely on libcidr
*/