-/* $OpenBSD: route.c,v 1.258 2021/08/30 18:49:19 kn Exp $ */
+/* $OpenBSD: route.c,v 1.259 2021/10/23 09:28:48 kn Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
if (cp)
warnx("botched keyword: %s", cp);
fprintf(stderr,
+#ifndef SMALL
"usage: %s [-dnqtv] [-T rtable] command [[modifiers] args]\n",
+#else
+ "usage: %s [-dnqtv] command [[modifiers] args]\n",
+#endif
__progname);
exit(1);
}
int ch;
int rval = 0;
int kw;
- int Terr = 0;
int af = AF_UNSPEC;
+#ifndef SMALL
+ int Terr = 0;
u_int rtable_any = RTABLE_ANY;
+#endif
if (argc < 2)
usage(NULL);
+#ifndef SMALL
tableid = getrtable();
+#endif
while ((ch = getopt(argc, argv, "dnqtT:v")) != -1)
switch (ch) {
case 'n':
case 't':
tflag = 1;
break;
+#ifndef SMALL
case 'T':
Terr = gettable(optarg);
Tflag = 1;
break;
+#endif
case 'd':
debugonly = 1;
break;
usage(NULL);
kw = keyword(*argv);
+#ifndef SMALL
if (Tflag && Terr != 0 && kw != K_ADD) {
errno = Terr;
err(1, "routing table %u", tableid);
}
if (kw == K_EXEC)
exit(rdomain(argc - 1, argv + 1));
+#endif
if (kw == K_MONITOR) {
while (--argc > 0) {
err(1, "setsockopt(ROUTE_MSGFILTER)");
}
+#ifndef SMALL
if (!tflag) {
/* force socket onto table user requested */
if (Tflag == 1 && Terr == 0) {
err(1, "setsockopt(ROUTE_TABLEFILTER)");
}
}
+#endif
if (pledge("stdio dns route", NULL) == -1)
err(1, "pledge");
rtm_addrs |= RTA_LABEL;
}
+#ifndef SMALL
int
gettable(const char *s)
{
warn("%s", argv[0]);
return (errno == ENOENT ? 127 : 126);
}
+#endif /* SMALL */
/*
* Print RTM_PROPOSAL DNS server addresses.