summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-07-29 20:34:10 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-07-29 20:34:10 +0200
commit3a7f5493619d20e7087536edbe694f9f2761ace5 (patch)
treec58b4a7ee55348c04d029333452c3973310619e9 /lib
parentlib: Re-add partial IPV4 matching support (diff)
downloadfrr-3a7f5493619d20e7087536edbe694f9f2761ace5.tar.xz
frr-3a7f5493619d20e7087536edbe694f9f2761ace5.zip
lib: Retab command_match.c
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/command_match.c102
1 files changed, 51 insertions, 51 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index 984813d0d..f02b7c821 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -379,38 +379,38 @@ match_ipv4 (const char *str)
memset (buf, 0, sizeof (buf));
sp = str;
while (*str != '\0')
- {
- if (*str == '.')
- {
- if (dots >= 3)
- return no_match;
+ {
+ if (*str == '.')
+ {
+ if (dots >= 3)
+ return no_match;
- if (*(str + 1) == '.')
- return no_match;
+ if (*(str + 1) == '.')
+ return no_match;
- if (*(str + 1) == '\0')
- return partly_match;
+ if (*(str + 1) == '\0')
+ return partly_match;
- dots++;
- break;
- }
- if (!isdigit ((int) *str))
- return no_match;
+ dots++;
+ break;
+ }
+ if (!isdigit ((int) *str))
+ return no_match;
- str++;
- }
+ str++;
+ }
if (str - sp > 3)
- return no_match;
+ return no_match;
strncpy (buf, sp, str - sp);
if (atoi (buf) > 255)
- return no_match;
+ return no_match;
nums++;
if (*str == '\0')
- break;
+ break;
str++;
}
@@ -436,51 +436,51 @@ match_ipv4_prefix (const char *str)
memset (buf, 0, sizeof (buf));
sp = str;
while (*str != '\0' && *str != '/')
- {
- if (*str == '.')
- {
- if (dots == 3)
- return no_match;
+ {
+ if (*str == '.')
+ {
+ if (dots == 3)
+ return no_match;
- if (*(str + 1) == '.' || *(str + 1) == '/')
- return no_match;
+ if (*(str + 1) == '.' || *(str + 1) == '/')
+ return no_match;
- if (*(str + 1) == '\0')
- return partly_match;
+ if (*(str + 1) == '\0')
+ return partly_match;
- dots++;
- break;
- }
+ dots++;
+ break;
+ }
- if (!isdigit ((int) *str))
- return no_match;
+ if (!isdigit ((int) *str))
+ return no_match;
- str++;
- }
+ str++;
+ }
if (str - sp > 3)
- return no_match;
+ return no_match;
strncpy (buf, sp, str - sp);
if (atoi (buf) > 255)
- return no_match;
+ return no_match;
if (dots == 3)
- {
- if (*str == '/')
- {
- if (*(str + 1) == '\0')
- return partly_match;
-
- str++;
- break;
- }
- else if (*str == '\0')
- return partly_match;
- }
+ {
+ if (*str == '/')
+ {
+ if (*(str + 1) == '\0')
+ return partly_match;
+
+ str++;
+ break;
+ }
+ else if (*str == '\0')
+ return partly_match;
+ }
if (*str == '\0')
- return partly_match;
+ return partly_match;
str++;
}
@@ -489,7 +489,7 @@ match_ipv4_prefix (const char *str)
while (*str != '\0')
{
if (!isdigit ((int) *str))
- return no_match;
+ return no_match;
str++;
}