summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2013-06-01 23:43:17 -0700
committerDaniil Baturin <daniil@baturin.org>2013-06-01 23:43:17 -0700
commit9bf61e12c10d58be44b1b5ba95a56abcbc571cf6 (patch)
treef8485b80f8dff9ab2fa313e008ad0dd6f853e5b4 /src
parent042b7e2ce387cc18f0c06bb9fe333dacc10ef724 (diff)
downloadipaddrcheck-9bf61e12c10d58be44b1b5ba95a56abcbc571cf6.tar.gz
ipaddrcheck-9bf61e12c10d58be44b1b5ba95a56abcbc571cf6.zip
Remove has_mask(), it will be replaced with better is_cidr()
and is_single() functions.
Diffstat (limited to 'src')
-rw-r--r--src/ipaddrcheck.c6
-rw-r--r--src/ipaddrcheck_functions.c18
-rw-r--r--src/ipaddrcheck_functions.h1
3 files changed, 0 insertions, 25 deletions
diff --git a/src/ipaddrcheck.c b/src/ipaddrcheck.c
index 588889e..80551e0 100644
--- a/src/ipaddrcheck.c
+++ b/src/ipaddrcheck.c
@@ -44,13 +44,11 @@
#define IS_IPV6_UNICAST 180
#define IS_IPV6_MULTICAST 190
#define IS_IPV6_LINKLOCAL 200
-#define HAS_MASK 210
#define IS_VALID_INTF_ADDR 220
static const struct option options[] =
{
{ "is-valid", no_argument, NULL, 'a' },
- { "has-mask", no_argument, NULL, 'b' },
{ "is-ipv4", no_argument, NULL, 'c' },
{ "is-ipv4-cidr", no_argument, NULL, 'd' },
{ "is-ipv4-single", no_argument, NULL, 'e' },
@@ -107,7 +105,6 @@ int main(int argc, char* argv[])
action = IS_VALID;
break;
case 'b':
- action = HAS_MASK;
break;
case 'c':
action = IS_IPV4;
@@ -208,9 +205,6 @@ int main(int argc, char* argv[])
case IS_VALID:
result = is_valid_address(address);
break;
- case HAS_MASK:
- result = has_mask(address_str);
- break;
case IS_IPV4:
result = is_ipv4(address);
break;
diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c
index 2ba8de2..bb86ee7 100644
--- a/src/ipaddrcheck_functions.c
+++ b/src/ipaddrcheck_functions.c
@@ -37,24 +37,6 @@
* the format was.
*/
-/* Does it have mask? */
-int has_mask(char* address_str)
-{
- int result;
- char *hasslash = strchr(address_str, '/');
-
- if( hasslash != NULL )
- {
- result = RESULT_SUCCESS;
- }
- else
- {
- result = RESULT_FAILURE;
- }
-
- return(result);
-}
-
/* Does it look like IPv4 CIDR (e.g. 192.0.2.1/24)? */
int is_ipv4_cidr(char* address_str)
{
diff --git a/src/ipaddrcheck_functions.h b/src/ipaddrcheck_functions.h
index e81c03c..74a0372 100644
--- a/src/ipaddrcheck_functions.h
+++ b/src/ipaddrcheck_functions.h
@@ -43,7 +43,6 @@
#define IPV6_MULTICAST "ff00::/8"
#define IPV6_LINKLOCAL "fe80::/64"
-int has_mask(char* address_str);
int is_ipv4_cidr(char* address_str);
int is_ipv4_single(char* address_str);
int is_ipv6_cidr(char* address_str);