summaryrefslogtreecommitdiffstats
path: root/mroute.h
diff options
context:
space:
mode:
Diffstat (limited to 'mroute.h')
-rw-r--r--mroute.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/mroute.h b/mroute.h
index fb7bee7..16d2add 100644
--- a/mroute.h
+++ b/mroute.h
@@ -163,5 +163,14 @@ mroute_extract_in_addr_t (struct mroute_addr *dest, const in_addr_t src)
*(in_addr_t*)dest->addr = htonl (src);
}
+static inline in_addr_t
+in_addr_t_from_mroute_addr (const struct mroute_addr *addr)
+{
+ if (addr->type == MR_ADDR_IPV4 && addr->netbits == 0 && addr->len == 4)
+ return ntohl(*(in_addr_t*)addr->addr);
+ else
+ return 0;
+}
+
#endif /* P2MP_SERVER */
#endif /* MROUTE_H */