summaryrefslogtreecommitdiff
path: root/pimd/pim_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_util.c')
-rw-r--r--pimd/pim_util.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/pimd/pim_util.c b/pimd/pim_util.c
index daee941f8b..f5255a241d 100644
--- a/pimd/pim_util.c
+++ b/pimd/pim_util.c
@@ -22,6 +22,7 @@
#include <zebra.h>
#include "log.h"
+#include "prefix.h"
#include "pim_util.h"
@@ -104,3 +105,20 @@ void pim_pkt_dump(const char *label, const uint8_t *buf, int size)
size);
zlog_hexdump(buf, size);
}
+
+int
+pim_is_group_224_4 (struct in_addr group_addr)
+{
+ static int first = 1;
+ static struct prefix group_all;
+ struct prefix group;
+
+ if (first)
+ str2prefix ("224.0.0.0/4", &group_all);
+
+ group.family = AF_INET;
+ group.u.prefix4 = group_addr;
+ group.prefixlen = 32;
+
+ return prefix_match (&group_all, &group);
+}