summaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-01-15 10:50:50 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-01-15 10:50:50 +0000
commit39478f79073f77fb4e937a8dfdef4b72ef67e281 (patch)
treefdc61db54f7f8b0e78658482a18ef48a8de0dddf /sbin/route/route.c
parenta3652952c54dd6a0f5556a07b4ff01a282561feb (diff)
print RTM_IFANNOUNCE message; netbsd; ok itojun@, henning@
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r--sbin/route/route.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 09bc3b1d82c..a6e5d0b98bf 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.61 2004/01/09 10:01:57 deraadt Exp $ */
+/* $OpenBSD: route.c,v 1.62 2004/01/15 10:50:49 markus Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static const char rcsid[] = "$OpenBSD: route.c,v 1.61 2004/01/09 10:01:57 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: route.c,v 1.62 2004/01/15 10:50:49 markus Exp $";
#endif
#endif /* not lint */
@@ -1456,6 +1456,7 @@ char *msgtypes[] = {
"RTM_NEWADDR: address being added to iface",
"RTM_DELADDR: address being removed from iface",
"RTM_IFINFO: iface status change",
+ "RTM_IFANNOUNCE: iface arrival/departure",
0,
};
@@ -1473,6 +1474,7 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
{
struct if_msghdr *ifm;
struct ifa_msghdr *ifam;
+ struct if_announcemsghdr *ifan;
if (verbose == 0)
return;
@@ -1496,6 +1498,23 @@ print_rtmsg(struct rt_msghdr *rtm, int msglen)
bprintf(stdout, ifam->ifam_flags, routeflags);
pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs);
break;
+ case RTM_IFANNOUNCE:
+ ifan = (struct if_announcemsghdr *)rtm;
+ (void) printf("if# %d, name %s, what: ",
+ ifan->ifan_index, ifan->ifan_name);
+ switch (ifan->ifan_what) {
+ case IFAN_ARRIVAL:
+ printf("arrival");
+ break;
+ case IFAN_DEPARTURE:
+ printf("departure");
+ break;
+ default:
+ printf("#%d", ifan->ifan_what);
+ break;
+ }
+ printf("\n");
+ break;
default:
(void) printf("pid: %ld, seq %d, errno %d, flags:",
(long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);