summaryrefslogtreecommitdiffstats
path: root/nest/iface.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-03-28 22:46:18 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2011-03-28 22:46:18 +0200
commit52a43ae3b76f86b697537bc3ad8afdb3b421cf2c (patch)
tree15a006b41f3e166c75f46f1ea45cc4fcb1502f5d /nest/iface.h
parentc454872f4e81e69a8e9950289ab810fcac3fc922 (diff)
downloadbird-52a43ae3b76f86b697537bc3ad8afdb3b421cf2c.tar
bird-52a43ae3b76f86b697537bc3ad8afdb3b421cf2c.zip
Minor changes in addresses.
Mainly changes IA_UNNUMBERED to IA_PEER and adds IA_HOST. Also do not show broadcast addr in show interfaces. Nobody cares for that.
Diffstat (limited to 'nest/iface.h')
-rw-r--r--nest/iface.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/nest/iface.h b/nest/iface.h
index 6b47a62..5906e21 100644
--- a/nest/iface.h
+++ b/nest/iface.h
@@ -51,9 +51,23 @@ struct iface {
#define IA_PRIMARY 0x10000 /* This address is primary */
#define IA_SECONDARY 0x20000 /* This address has been reported as secondary by the kernel */
-#define IA_UNNUMBERED 0x40000 /* This address belongs to an unnumbered device */
+#define IA_PEER 0x40000 /* A peer/ptp address */
+#define IA_HOST 0x80000 /* A host/loopback address */
#define IA_FLAGS 0xff0000
+/*
+ * There are three kinds of addresses in BIRD:
+ * - Standard (prefix-based) addresses, these may define ifa.opposite (for /30 or /31).
+ * - Peer/ptp addresses, without common prefix for ifa.ip and ifa.opposite.
+ * ifa.opposite is defined and ifa.prefix/pxlen == ifa.opposite/32 (for simplicity).
+ * - Host addresses, with ifa.prefix/pxlen == ifa.ip/32 (or /128).
+ * May be considered a special case of standard addresses.
+ *
+ * Peer addresses (AFAIK) do not exist in IPv6. Linux alos supports generalized peer
+ * address (with pxlen < 32 and ifa.ip outside prefix), we do not support that.
+ */
+
+
#define IF_JUST_CREATED 0x10000000 /* Send creation event as soon as possible */
#define IF_TMP_DOWN 0x20000000 /* Temporary shutdown due to interface reconfiguration */
#define IF_UPDATED 0x40000000 /* Touched in last scan */
@@ -85,15 +99,6 @@ struct iface *if_find_by_index(unsigned);
struct iface *if_find_by_name(char *);
void ifa_recalc_all_primary_addresses(void);
-static inline int
-ifa_match_addr(struct ifa *ifa, ip_addr addr)
-{
- if (ifa->flags & IA_UNNUMBERED)
- return ipa_equal(addr, ifa->opposite);
- else
- return ipa_in_net(addr, ifa->prefix, ifa->pxlen);
-}
-
/* The Neighbor Cache */
typedef struct neighbor {