+void
+print_rtmsg(rtm, msglen)
+ register struct rt_msghdr *rtm;
+ int msglen;
+{
+ if (verbose == 0)
+ return;
+ if (rtm->rtm_version != RTM_VERSION) {
+ (void) printf("routing message version %d not understood\n",
+ rtm->rtm_version);
+ return;
+ }
+ (void) printf("%s\npid: %d, len %d, seq %d, errno %d, flags:",
+ msgtypes[rtm->rtm_type], rtm->rtm_pid, rtm->rtm_msglen,
+ rtm->rtm_seq, rtm->rtm_errno);
+ bprintf(stdout, rtm->rtm_flags, routeflags);
+ pmsg_common(rtm);
+}
+
+void
+print_getmsg(rtm, msglen)
+ register struct rt_msghdr *rtm;
+ int msglen;
+{
+ if (rtm->rtm_version != RTM_VERSION) {
+ (void)printf("routing message version %d not understood\n",
+ rtm->rtm_version);
+ return;
+ }
+ if (rtm->rtm_msglen > msglen) {
+ (void)printf("get length mismatch, in packet %d, returned %d\n",
+ rtm->rtm_msglen, msglen);
+ }
+ (void) printf("RTM_GET: errno %d, flags:", rtm->rtm_errno);
+ bprintf(stdout, rtm->rtm_flags, routeflags);
+ (void) printf("\nmetric values:\n ");
+#define metric(f, e)\
+ printf("%s: %d%s", __STRING(f), rtm->rtm_rmx.__CONCAT(rmx_,f), e)
+ metric(recvpipe, ", ");
+ metric(sendpipe, ", ");
+ metric(ssthresh, ", ");
+ metric(rtt, "\n ");
+ metric(rttvar, ", ");
+ metric(hopcount, ", ");
+ metric(mtu, ", ");
+ metric(expire, "\n");
+#undef metric
+ pmsg_common(rtm);
+}
+
+void
+pmsg_common(rtm)
+ register struct rt_msghdr *rtm;