summaryrefslogtreecommitdiff
path: root/lib/if.h
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-19 19:44:43 +0000
committerhasso <hasso>2004-10-19 19:44:43 +0000
commit3fb9cd6ef456959b6eff939d5c316f6785c2dda4 (patch)
treee350cb3ef7b20b8bbccfb1aa9309152311e845bd /lib/if.h
parent5ae35f45f1292dce3a01f241accafeb2e59b10cc (diff)
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/if.h')
-rw-r--r--lib/if.h13
1 files changed, 12 insertions, 1 deletions
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