rem: flushroutes(argc, argv) int argc; char *argv[];
add: void flushroutes(int argc, char *argv[])
context: flushroutes(argc, argv)	int argc;	char *argv[];{	size_t needed;	int mib[6], rlen, seqno;	char *buf = NULL, *next, *lim = NULL;	struct rt_msghdr *rtm;	struct sockaddr *sa;	if (uid) {		errno = EACCES;		quit("must be root to alter routing table");	}	shutdown(s, 0); /* Don't want to read back our messages */	if (argc > 1) {		argv++;		if (argc == 2 && **argv == '-')		    switch (keyword(*argv + 1)) {			case K_INET:				af = AF_INET;				break;#ifdef INET6			case K_INET6:				af = AF_INET6;				break;#endif			case K_LINK:				af = AF_LINK;				break;			default:				goto bad;		} elsebad:			usage(*argv);	}	mib[0] = PF_ROUTE;	mib[1] = 0;		/* protocol */	mib[2] = 0;		/* wildcard address family */	mib[3] = NET_RT_DUMP;	mib[4] = 0;		/* no flags */	if (sysctl(mib, 5, NULL, &needed, NULL, 0) < 0)		quit("route-sysctl-estimate");	if (needed) {		if ((buf = malloc(needed)) == NULL)			quit("malloc");		if (sysctl(mib, 5, buf, &needed, NULL, 0) < 0)			quit("actual retrieval of routing table");		lim = buf + needed;	}	if (verbose) {		(void) printf("Examining routing table from sysctl\n");		 if (af)			printf("(address family %s)\n", (*argv + 1));	}	if (buf == NULL)		return;	seqno = 0;		/* ??? */	for (next = buf; next < lim; next += rtm->rtm_msglen) {		rtm = (struct rt_msghdr *)next;		if (verbose)			print_rtmsg(rtm, rtm->rtm_msglen);		if ((rtm->rtm_flags & (RTF_GATEWAY|RTF_STATIC|RTF_LLINFO)) == 0)			continue;		sa = (struct sockaddr *)(rtm + 1);		if (af) {			if (sa->sa_family != af)				continue;		}		if (debugonly)			continue;		rtm->rtm_type = RTM_DELETE;		rtm->rtm_seq = seqno;		rlen = write(s, next, rtm->rtm_msglen);printf("write gave %d\n", rlen);		if (rlen < (int)rtm->rtm_msglen) {			(void) fprintf(stderr,			    "route: write to routing socket: %s\n",			    strerror(errno));			(void) printf("got only %d for rlen\n", rlen);			break;		}		seqno++;		if (qflag)			continue;		if (verbose)			print_rtmsg(rtm, rlen);		else {			struct sockaddr *sa = (struct sockaddr *)(rtm + 1);			(void) printf("%-20.20s ", rtm->rtm_flags & RTF_HOST ?			    routename(sa) : netname(sa));			sa = (struct sockaddr *)(ROUNDUP(sa->sa_len) + (char *)sa);			(void) printf("%-20.20s ", routename(sa));			(void) printf("done\n");		}	}	free(buf);}