From 3fb9cd6ef456959b6eff939d5c316f6785c2dda4 Mon Sep 17 00:00:00 2001 From: hasso Date: Tue, 19 Oct 2004 19:44:43 +0000 Subject: OK. Here it is - PtP patch from Andrew J. Schorr. No problems with ospfd, ripd might need some more testing though. --- lib/prefix.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/prefix.h') 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 -- cgit v1.2.1