warnx("RTM_GET: %s (errno %d)\n",
warnx("RTM_GET: %s (errno %d)",
print_getmsg(struct rt_msghdr *rtm, int msglen){	struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL;	struct sockaddr_dl *ifp = NULL;	struct sockaddr_rtlabel *sa_rl = NULL;	struct sockaddr *sa;	char *cp;	int i;	(void) printf("   route to: %s\n", routename(&so_dst.sa));	if (rtm->rtm_version != RTM_VERSION) {		warnx("routing message version %d not understood",		    rtm->rtm_version);		return;	}	if (rtm->rtm_msglen > msglen) {		warnx("message length mismatch, in packet %d, returned %d",		    rtm->rtm_msglen, msglen);	}	if (rtm->rtm_errno)  {		warnx("RTM_GET: %s (errno %d)\n",		    strerror(rtm->rtm_errno), rtm->rtm_errno);		return;	}	cp = ((char *)(rtm + 1));	if (rtm->rtm_addrs)		for (i = 1; i; i <<= 1)			if (i & rtm->rtm_addrs) {				sa = (struct sockaddr *)cp;				switch (i) {				case RTA_DST:					dst = sa;					break;				case RTA_GATEWAY:					gate = sa;					break;				case RTA_NETMASK:					mask = sa;					break;				case RTA_IFP:					if (sa->sa_family == AF_LINK &&					   ((struct sockaddr_dl *)sa)->sdl_nlen)						ifp = (struct sockaddr_dl *)sa;					break;				case RTA_LABEL:					sa_rl = (struct sockaddr_rtlabel *)sa;					break;				}				ADVANCE(cp, sa);			}	if (dst && mask)		mask->sa_family = dst->sa_family;	/* XXX */	if (dst)		(void)printf("destination: %s\n", routename(dst));	if (mask) {		int savenflag = nflag;		nflag = 1;		(void)printf("       mask: %s\n", routename(mask));		nflag = savenflag;	}	if (gate && rtm->rtm_flags & RTF_GATEWAY)		(void)printf("    gateway: %s\n", routename(gate));	if (ifp)		(void)printf("  interface: %.*s\n",		    ifp->sdl_nlen, ifp->sdl_data);	(void)printf("      flags: ");	bprintf(stdout, rtm->rtm_flags, routeflags);	printf("\n");	if (sa_rl != NULL)		printf("      label: %s\n", sa_rl->sr_label);#define lock(f)	((rtm->rtm_rmx.rmx_locks & __CONCAT(RTV_,f)) ? 'L' : ' ')#define msec(u)	(((u) + 500) / 1000)		/* usec to msec */	(void) printf("%s\n", "\ recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire");	printf("%8d%c ", (int)rtm->rtm_rmx.rmx_recvpipe, lock(RPIPE));	printf("%8d%c ", (int)rtm->rtm_rmx.rmx_sendpipe, lock(SPIPE));	printf("%8d%c ", (int)rtm->rtm_rmx.rmx_ssthresh, lock(SSTHRESH));	printf("%8d%c ", (int)msec(rtm->rtm_rmx.rmx_rtt), lock(RTT));	printf("%8d%c ", (int)msec(rtm->rtm_rmx.rmx_rttvar), lock(RTTVAR));	printf("%8d%c ", (int)rtm->rtm_rmx.rmx_hopcount, lock(HOPCOUNT));	printf("%8d%c ", (int)rtm->rtm_rmx.rmx_mtu, lock(MTU));	if (rtm->rtm_rmx.rmx_expire)		rtm->rtm_rmx.rmx_expire -= time(0);	printf("%8d%c\n", (int)rtm->rtm_rmx.rmx_expire, lock(EXPIRE));#undef lock#undef msec#define	RTA_IGN	(RTA_DST|RTA_GATEWAY|RTA_NETMASK|RTA_IFP|RTA_IFA|RTA_BRD)	if (verbose)		pmsg_common(rtm);	else if (rtm->rtm_addrs &~ RTA_IGN) {		(void) printf("sockaddrs: ");		bprintf(stdout, rtm->rtm_addrs, addrnames);		putchar('\n');	}#undef	RTA_IGN}