summaryrefslogtreecommitdiff
path: root/eigrpd/eigrp_dump.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-11-22 08:17:27 -0500
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-11-22 08:36:29 -0500
commitd2d3d394150f04a512d4ad4a3de0d84b0c1a31d5 (patch)
tree04267146b7118df4a43824ab05af19e98fa43912 /eigrpd/eigrp_dump.h
parent152e64e3013d67125accb15cf37f723b886e367b (diff)
eigrpd: Cleanup address dump functions to be a bit smarter
The address dump functionality needed to be written a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_dump.h')
-rw-r--r--eigrpd/eigrp_dump.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/eigrpd/eigrp_dump.h b/eigrpd/eigrp_dump.h
index 34b55ab419..f141f3cbc6 100644
--- a/eigrpd/eigrp_dump.h
+++ b/eigrpd/eigrp_dump.h
@@ -138,9 +138,21 @@ extern unsigned long term_debug_eigrp_zebra;
/* Prototypes. */
extern const char *eigrp_if_name_string(struct eigrp_interface *);
-extern const char *eigrp_if_ip_string(struct eigrp_interface *);
-extern const char *eigrp_neigh_ip_string(struct eigrp_neighbor *);
-extern const char *eigrp_topology_ip_string(struct eigrp_prefix_entry *);
+static inline const char
+*eigrp_topology_ip_string(struct eigrp_prefix_entry *tn)
+{
+ return inet_ntoa(tn->destination->u.prefix4);
+}
+
+static inline const char *eigrp_if_ip_string(struct eigrp_interface *ei)
+{
+ return ei ? inet_ntoa(ei->address.u.prefix4) : "inactive";
+}
+
+static inline const char *eigrp_neigh_ip_string(struct eigrp_neighbor *nbr)
+{
+ return inet_ntoa(nbr->src);
+}
extern void eigrp_ip_header_dump(struct ip *);
extern void eigrp_header_dump(struct eigrp_header *);