summaryrefslogtreecommitdiffstats
path: root/lib/prefix.h
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-19 19:44:43 +0000
committerhasso <hasso>2004-10-19 19:44:43 +0000
commitb1ef841a33839c8169570b18995c1f11847b7a00 (patch)
tree99bb1bcff310939d9128fc89154b63dfbd8753fb /lib/prefix.h
parent00b65ae1f8e2d8f3f54b54b0a84ff55d33aff077 (diff)
downloadquagga-b1ef841a33839c8169570b18995c1f11847b7a00.tar.bz2
quagga-b1ef841a33839c8169570b18995c1f11847b7a00.tar.xz
OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd,
ripd might need some more testing though.
Diffstat (limited to 'lib/prefix.h')
-rw-r--r--lib/prefix.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/prefix.h b/lib/prefix.h
index e4f17ab0..0546095b 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -153,6 +153,14 @@ void apply_classful_mask_ipv4 (struct prefix_ipv4 *);
u_char ip_masklen (struct in_addr);
void masklen2ip (int, struct in_addr *);
+/* returns the network portion of the host address */
+in_addr_t ipv4_network_addr (in_addr_t hostaddr, int masklen);
+/* given the address of a host on a network and the network mask length,
+ * calculate the broadcast address for that network;
+ * special treatment for /31: returns the address of the other host
+ * on the network by flipping the host bit */
+in_addr_t ipv4_broadcast_addr (in_addr_t hostaddr, int masklen);
+
int netmask_str2prefix_str (const char *, const char *, char *);
#ifdef HAVE_IPV6