From: David van Moolenbroek Date: Tue, 14 Feb 2017 17:19:12 +0000 (+0000) Subject: Retire MINIX pr_routes(8) X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch08.html?a=commitdiff_plain;h=50c98e1f41fa8300ac0b62c0bf8636fcc1b59f00;p=minix.git Retire MINIX pr_routes(8) Change-Id: Ic7494d097f9d19185b7173edb7590044baee5abc --- diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index 3ca481413..67c8d0c43 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -474,7 +474,7 @@ ./usr/bin/playwave minix-base ./usr/bin/postinstall minix-base obsolete ./usr/bin/pr minix-base -./usr/bin/pr_routes minix-base +./usr/bin/pr_routes minix-base obsolete ./usr/bin/prep minix-base ./usr/bin/printenv minix-base ./usr/bin/printf minix-base diff --git a/distrib/sets/lists/minix-debug/mi b/distrib/sets/lists/minix-debug/mi index da130e996..d6eed1c28 100644 --- a/distrib/sets/lists/minix-debug/mi +++ b/distrib/sets/lists/minix-debug/mi @@ -374,7 +374,7 @@ ./usr/libdata/debug/usr/bin/pathchk.debug minix-debug debug ./usr/libdata/debug/usr/bin/playwave.debug minix-debug debug ./usr/libdata/debug/usr/bin/pr.debug minix-debug debug -./usr/libdata/debug/usr/bin/pr_routes.debug minix-debug debug +./usr/libdata/debug/usr/bin/pr_routes.debug minix-debug debug,obsolete ./usr/libdata/debug/usr/bin/prep.debug minix-debug debug ./usr/libdata/debug/usr/bin/printenv.debug minix-debug debug ./usr/libdata/debug/usr/bin/printf.debug minix-debug debug diff --git a/distrib/sets/lists/minix-man/mi b/distrib/sets/lists/minix-man/mi index abd958732..78ef9f05d 100644 --- a/distrib/sets/lists/minix-man/mi +++ b/distrib/sets/lists/minix-man/mi @@ -3428,7 +3428,7 @@ ./usr/man/man8/ping.8 minix-man ./usr/man/man8/postinstall.8 minix-man ./usr/man/man8/poweroff.8 minix-man -./usr/man/man8/pr_routes.8 minix-man +./usr/man/man8/pr_routes.8 minix-man obsolete ./usr/man/man8/printroot.8 minix-man ./usr/man/man8/pwd_mkdb.8 minix-man ./usr/man/man8/pwdauth.8 minix-man obsolete diff --git a/minix/commands/Makefile b/minix/commands/Makefile index c7b023871..d38e5d5b9 100644 --- a/minix/commands/Makefile +++ b/minix/commands/Makefile @@ -18,7 +18,7 @@ SUBDIR= arp at backup \ minix-service mount mt netconf \ nonamed \ prep printroot \ - profile progressbar pr_routes \ + profile progressbar \ ramdisk rarpd rawspeed readclock \ remsync rget rlogin \ rotate setup \ diff --git a/minix/commands/pr_routes/Makefile b/minix/commands/pr_routes/Makefile deleted file mode 100644 index 87cddaa2b..000000000 --- a/minix/commands/pr_routes/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -PROG= pr_routes -MAN= pr_routes.8 - -.include diff --git a/minix/commands/pr_routes/pr_routes.8 b/minix/commands/pr_routes/pr_routes.8 deleted file mode 100644 index d01ffaa4f..000000000 --- a/minix/commands/pr_routes/pr_routes.8 +++ /dev/null @@ -1,26 +0,0 @@ -.TH PR_ROUTE 8 -.SH NAME -pr_routes \- show IP routing. -.SH SYNOPSIS -.B pr_routes -.RB [ \-i -.RI "ip device]" -.SH DESCRIPTION -.de SP -.if t .sp 0.4 -.if n .sp -.. -.B Pr_routes -displays the IP routing table. -.SH OPTIONS -.TP -.B \-i -.I "ip device" -specifies the ip device. -.SH "SEE ALSO" -.BR add_route (8), -.BR irdp (8). -.SH AUTHOR -.I Pr_routes.c -was written by Philip Homburg. -This manual page by A. S. Woodhull, last revised 13.02.96. diff --git a/minix/commands/pr_routes/pr_routes.c b/minix/commands/pr_routes/pr_routes.c deleted file mode 100644 index 864c16e3c..000000000 --- a/minix/commands/pr_routes/pr_routes.c +++ /dev/null @@ -1,309 +0,0 @@ -/* -vmd/cmd/simple/pr_routes.c -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#define N_IF 64 /* More than enough? */ - -char *prog_name; -int all_devices; -char *ifname; -ipaddr_t iftab[N_IF]; - -static void print_header(void); -static void print_route(nwio_route_t *route); -static void fill_iftab(void); -static char *get_ifname(ipaddr_t addr); -static void fatal(char *fmt, ...); -static void usage(void); - -int main(int argc, char *argv[]) -{ - int nr_routes, i; - nwio_route_t route; - nwio_ipconf_t ip_conf; - unsigned long ioctl_cmd; - int ip_fd; - int result; - int c; - char *ip_device, *cp; - int a_flag, i_flag, o_flag; - char *I_arg; - - prog_name= argv[0]; - - a_flag= 0; - i_flag= 0; - o_flag= 0; - I_arg= NULL; - while ((c =getopt(argc, argv, "?aI:io")) != -1) - { - switch(c) - { - case '?': - usage(); - case 'a': - if (a_flag) - usage(); - a_flag= 1; - break; - case 'I': - if (I_arg) - usage(); - I_arg= optarg; - break; - case 'i': - if (i_flag || o_flag) - usage(); - i_flag= 1; - break; - case 'o': - if (i_flag || o_flag) - usage(); - o_flag= 1; - break; - default: - fprintf(stderr, "%s: getopt failed: '%c'\n", - prog_name, c); - exit(1); - } - } - if (optind != argc) - usage(); - - ip_device= I_arg; - all_devices= a_flag; - - if (i_flag) - ioctl_cmd= NWIOGIPIROUTE; - else - ioctl_cmd= NWIOGIPOROUTE; - - if (ip_device == NULL) - ip_device= getenv("IP_DEVICE"); - ifname= ip_device; - if (ip_device == NULL) - ip_device= IP_DEVICE; - - ip_fd= open(ip_device, O_RDONLY); - if (ip_fd == -1) - { - fprintf(stderr, "%s: unable to open %s: %s\n", prog_name, - ip_device, strerror(errno)); - exit(1); - } - - if (!all_devices && ifname) - { - cp= strrchr(ip_device, '/'); - if (cp) - ifname= cp+1; - } - else - { - ifname= NULL; - fill_iftab(); - } - - result= ioctl(ip_fd, NWIOGIPCONF, &ip_conf); - if (result == -1) - { - fprintf(stderr, "%s: unable to NWIOIPGCONF: %s\n", - prog_name, strerror(errno)); - exit(1); - } - - route.nwr_ent_no= 0; - result= ioctl(ip_fd, ioctl_cmd, &route); - if (result == -1) - { - fprintf(stderr, "%s: unable to NWIOGIPxROUTE: %s\n", - prog_name, strerror(errno)); - exit(1); - } - print_header(); - nr_routes= route.nwr_ent_count; - for (i= 0; i= 0; n--) - { - if (mask == htonl(testmask)) - break; - testmask= (testmask << 1) & 0xFFFFFFFF; - } - - sprintf(result, "%s/%-2d", inet_ntoa(*(struct in_addr *)&addr), n); - if (n == -1) - strcpy(strchr(result, '/')+1, - inet_ntoa(*(struct in_addr *)&mask)); - return result; -} - -static void print_route(nwio_route_t *route) -{ - if (!(route->nwr_flags & NWRF_INUSE)) - return; - - printf("%*lu ", ent_width, (unsigned long) route->nwr_ent_no); - printf("%*s ", if_width, - ifname ? ifname : get_ifname(route->nwr_ifaddr)); - printf("%*s ", dest_width, cidr2a(route->nwr_dest, route->nwr_netmask)); - printf("%*s ", gateway_width, - inet_ntoa(*(struct in_addr *)&route->nwr_gateway)); - printf("%*lu ", dist_width, (unsigned long) route->nwr_dist); - printf("%*ld ", pref_width, (long) route->nwr_pref); - printf("%*lu", mtu_width, (long) route->nwr_mtu); - if (route->nwr_flags & NWRF_STATIC) - printf(" static"); - if (route->nwr_flags & NWRF_UNREACHABLE) - printf(" dead"); - printf("\n"); -} - -static void fill_iftab(void) -{ - int i, j, r, fd; - nwio_ipconf_t ip_conf; - char dev_name[12]; /* /dev/ipXXXX */ - - for (i= 0; i ]\n", - prog_name); - exit(1); -} - -/* - * $PchId: pr_routes.c,v 1.8 2002/04/11 10:58:58 philip Exp $ - */