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/if.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/if.h') diff --git a/lib/if.h b/lib/if.h index 218f1026..7afb2ae9 100644 --- a/lib/if.h +++ b/lib/if.h @@ -148,12 +148,23 @@ struct connected /* Address of connected network. */ struct prefix *address; - struct prefix *destination; + struct prefix *destination; /* broadcast or peer address; may be NULL */ /* Label for Linux 2.2.X and upper. */ char *label; }; +/* Given an IPV4 struct connected, this macro determines whether a /32 + peer address has been supplied (i.e. there is no subnet assigned) */ +#define CONNECTED_DEST_HOST(C) \ + ((C)->destination && ((C)->address->prefixlen == IPV4_MAX_PREFIXLEN)) + +/* Given an IPV4 struct connected, this macro determins whether it is + a point-to-point link with a /32 peer address (i.e. there + is no dedicated subnet for the PtP link) */ +#define CONNECTED_POINTOPOINT_HOST(C) \ + (((C)->ifp->flags & IFF_POINTOPOINT) && CONNECTED_DEST_HOST(C)) + /* Interface hook sort. */ #define IF_NEW_HOOK 0 #define IF_DELETE_HOOK 1 -- cgit v1.2.1