Teach route(8) about RTF_LOCAL.diff -r1.53 -r1.54 src/sbin/route/route.8
(roy)
--- src/sbin/route/route.8 2014/12/01 20:30:27 1.53
+++ src/sbin/route/route.8 2015/02/26 09:56:11 1.54
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: route.8,v 1.53 2014/12/01 20:30:27 christos Exp $ | 1 | .\" $NetBSD: route.8,v 1.54 2015/02/26 09:56:11 roy Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 1983, 1991, 1993 | 3 | .\" Copyright (c) 1983, 1991, 1993 | |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Redistribution and use in source and binary forms, with or without | |
7 | .\" modification, are permitted provided that the following conditions | 7 | .\" modification, are permitted provided that the following conditions | |
8 | .\" are met: | 8 | .\" are met: | |
9 | .\" 1. Redistributions of source code must retain the above copyright | 9 | .\" 1. Redistributions of source code must retain the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer. | 10 | .\" notice, this list of conditions and the following disclaimer. | |
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | 11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
12 | .\" notice, this list of conditions and the following disclaimer in the | 12 | .\" notice, this list of conditions and the following disclaimer in the | |
13 | .\" documentation and/or other materials provided with the distribution. | 13 | .\" documentation and/or other materials provided with the distribution. | |
14 | .\" 3. Neither the name of the University nor the names of its contributors | 14 | .\" 3. Neither the name of the University nor the names of its contributors | |
@@ -19,27 +19,27 @@ | @@ -19,27 +19,27 @@ | |||
19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 19 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 20 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 21 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 22 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 23 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 24 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 25 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 26 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 27 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
28 | .\" SUCH DAMAGE. | 28 | .\" SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .\" @(#)route.8 8.4 (Berkeley) 6/1/94 | 30 | .\" @(#)route.8 8.4 (Berkeley) 6/1/94 | |
31 | .\" | 31 | .\" | |
32 | .Dd December 1, 2014 | 32 | .Dd February 26, 2015 | |
33 | .Dt ROUTE 8 | 33 | .Dt ROUTE 8 | |
34 | .Os | 34 | .Os | |
35 | .Sh NAME | 35 | .Sh NAME | |
36 | .Nm route | 36 | .Nm route | |
37 | .Nd manually manipulate the routing tables | 37 | .Nd manually manipulate the routing tables | |
38 | .Sh SYNOPSIS | 38 | .Sh SYNOPSIS | |
39 | .Nm | 39 | .Nm | |
40 | .Op Fl dfLnqSsTtv | 40 | .Op Fl dfLnqSsTtv | |
41 | .Ar command | 41 | .Ar command | |
42 | .Oo | 42 | .Oo | |
43 | .Op Ar modifiers | 43 | .Op Ar modifiers | |
44 | .Ar args | 44 | .Ar args | |
45 | .Oc | 45 | .Oc | |
@@ -294,26 +294,27 @@ by indicating the following correspondin | @@ -294,26 +294,27 @@ by indicating the following correspondin | |||
294 | .It Li " " Ta -iface Ta ~RTF_GATEWAY Ta destination is directly reachable | 294 | .It Li " " Ta -iface Ta ~RTF_GATEWAY Ta destination is directly reachable | |
295 | .It Li 1 Ta -proto1 Ta " RTF_PROTO1" Ta set protocol specific flag #1 | 295 | .It Li 1 Ta -proto1 Ta " RTF_PROTO1" Ta set protocol specific flag #1 | |
296 | .It Li 2 Ta -proto2 Ta " RTF_PROTO2" Ta set protocol specific flag #2 | 296 | .It Li 2 Ta -proto2 Ta " RTF_PROTO2" Ta set protocol specific flag #2 | |
297 | .It Li B Ta -blackhole Ta " RTF_BLACKHOLE" Ta discard pkts (during updates) | 297 | .It Li B Ta -blackhole Ta " RTF_BLACKHOLE" Ta discard pkts (during updates) | |
298 | .It Li " " Ta -noblackhole Ta ~RTF_BLACKHOLE Ta clear blackhole flag | 298 | .It Li " " Ta -noblackhole Ta ~RTF_BLACKHOLE Ta clear blackhole flag | |
299 | .It Li C Ta -cloning Ta " RTF_CLONING" Ta generates a new route on use | 299 | .It Li C Ta -cloning Ta " RTF_CLONING" Ta generates a new route on use | |
300 | .It Li " " Ta -nocloning Ta ~RTF_CLONING Ta stop generating new routes on use | 300 | .It Li " " Ta -nocloning Ta ~RTF_CLONING Ta stop generating new routes on use | |
301 | .It Li c Ta -cloned Ta " RTF_CLONED" Ta route generated by RTF_CLONING | 301 | .It Li c Ta -cloned Ta " RTF_CLONED" Ta route generated by RTF_CLONING | |
302 | .It Li " " Ta -nocloned Ta ~RTF_CLONED Ta deny removal with RTF_CLONING | 302 | .It Li " " Ta -nocloned Ta ~RTF_CLONED Ta deny removal with RTF_CLONING | |
303 | .It Li D Ta "" Ta " RTF_DYNAMIC" Ta created dynamically (redirect) | 303 | .It Li D Ta "" Ta " RTF_DYNAMIC" Ta created dynamically (redirect) | |
304 | .It Li G Ta "" Ta " RTF_GATEWAY" Ta forwarded to dest by intermediary | 304 | .It Li G Ta "" Ta " RTF_GATEWAY" Ta forwarded to dest by intermediary | |
305 | .It Li H Ta "" Ta " RTF_HOST" Ta host entry (net otherwise) | 305 | .It Li H Ta "" Ta " RTF_HOST" Ta host entry (net otherwise) | |
306 | .It Li L Ta -llinfo Ta " RTF_LLINFO" Ta translate proto to link addr | 306 | .It Li L Ta -llinfo Ta " RTF_LLINFO" Ta translate proto to link addr | |
307 | .It Li l Ta "" Ta " RTF_LOCAL" Ta Route represents a local address | |||
307 | .It Li M Ta "" Ta " RTF_MODIFIED" Ta modified dynamically (redirect) | 308 | .It Li M Ta "" Ta " RTF_MODIFIED" Ta modified dynamically (redirect) | |
308 | .It Li p Ta -proxy Ta " RTF_ANNOUNCE" Ta make entry a link level proxy | 309 | .It Li p Ta -proxy Ta " RTF_ANNOUNCE" Ta make entry a link level proxy | |
309 | .It Li R Ta -reject Ta " RTF_REJECT" Ta send ICMP unreachable on match | 310 | .It Li R Ta -reject Ta " RTF_REJECT" Ta send ICMP unreachable on match | |
310 | .It Li " " Ta -noreject Ta ~RTF_REJECT Ta clear reject flag | 311 | .It Li " " Ta -noreject Ta ~RTF_REJECT Ta clear reject flag | |
311 | .It Li S Ta -static Ta " RTF_STATIC" Ta manually added route | 312 | .It Li S Ta -static Ta " RTF_STATIC" Ta manually added route | |
312 | .It Li " " Ta -nostatic Ta ~RTF_STATIC Ta pretend route added automatically | 313 | .It Li " " Ta -nostatic Ta ~RTF_STATIC Ta pretend route added automatically | |
313 | .It Li U Ta "" Ta " RTF_UP" Ta route usable | 314 | .It Li U Ta "" Ta " RTF_UP" Ta route usable | |
314 | .It Li X Ta -xresolve Ta " RTF_XRESOLVE" Ta emit mesg on use (for ext lookup) | 315 | .It Li X Ta -xresolve Ta " RTF_XRESOLVE" Ta emit mesg on use (for ext lookup) | |
315 | .El | 316 | .El | |
316 | .Pp | 317 | .Pp | |
317 | The optional modifiers | 318 | The optional modifiers | |
318 | .Fl rtt , | 319 | .Fl rtt , | |
319 | .Fl rttvar , | 320 | .Fl rttvar , |
--- src/sbin/route/route.c 2014/12/20 13:15:48 1.149
+++ src/sbin/route/route.c 2015/02/26 09:56:11 1.150
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: route.c,v 1.149 2014/12/20 13:15:48 prlw1 Exp $ */ | 1 | /* $NetBSD: route.c,v 1.150 2015/02/26 09:56:11 roy Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1983, 1989, 1991, 1993 | 4 | * Copyright (c) 1983, 1989, 1991, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -29,27 +29,27 @@ | @@ -29,27 +29,27 @@ | |||
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1991, 1993\ | 34 | __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1991, 1993\ | |
35 | The Regents of the University of California. All rights reserved."); | 35 | The Regents of the University of California. All rights reserved."); | |
36 | #endif /* not lint */ | 36 | #endif /* not lint */ | |
37 | 37 | |||
38 | #ifndef lint | 38 | #ifndef lint | |
39 | #if 0 | 39 | #if 0 | |
40 | static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; | 40 | static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95"; | |
41 | #else | 41 | #else | |
42 | __RCSID("$NetBSD: route.c,v 1.149 2014/12/20 13:15:48 prlw1 Exp $"); | 42 | __RCSID("$NetBSD: route.c,v 1.150 2015/02/26 09:56:11 roy Exp $"); | |
43 | #endif | 43 | #endif | |
44 | #endif /* not lint */ | 44 | #endif /* not lint */ | |
45 | 45 | |||
46 | #include <sys/param.h> | 46 | #include <sys/param.h> | |
47 | #include <sys/file.h> | 47 | #include <sys/file.h> | |
48 | #include <sys/socket.h> | 48 | #include <sys/socket.h> | |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> | |
50 | #include <sys/mbuf.h> | 50 | #include <sys/mbuf.h> | |
51 | #include <sys/sysctl.h> | 51 | #include <sys/sysctl.h> | |
52 | 52 | |||
53 | #include <net/if.h> | 53 | #include <net/if.h> | |
54 | #include <net/route.h> | 54 | #include <net/route.h> | |
55 | #include <net/if_dl.h> | 55 | #include <net/if_dl.h> | |
@@ -1282,27 +1282,27 @@ const char * const msgtypes[] = { | @@ -1282,27 +1282,27 @@ const char * const msgtypes[] = { | |||
1282 | [RTM_NEWADDR] = "RTM_NEWADDR: address being added to iface", | 1282 | [RTM_NEWADDR] = "RTM_NEWADDR: address being added to iface", | |
1283 | [RTM_DELADDR] = "RTM_DELADDR: address being removed from iface", | 1283 | [RTM_DELADDR] = "RTM_DELADDR: address being removed from iface", | |
1284 | [RTM_OOIFINFO] = "RTM_OOIFINFO: iface status change (pre-1.5)", | 1284 | [RTM_OOIFINFO] = "RTM_OOIFINFO: iface status change (pre-1.5)", | |
1285 | [RTM_OIFINFO] = "RTM_OIFINFO: iface status change (pre-64bit time)", | 1285 | [RTM_OIFINFO] = "RTM_OIFINFO: iface status change (pre-64bit time)", | |
1286 | [RTM_IFANNOUNCE] = "RTM_IFANNOUNCE: iface arrival/departure", | 1286 | [RTM_IFANNOUNCE] = "RTM_IFANNOUNCE: iface arrival/departure", | |
1287 | [RTM_IEEE80211] = "RTM_IEEE80211: IEEE80211 wireless event", | 1287 | [RTM_IEEE80211] = "RTM_IEEE80211: IEEE80211 wireless event", | |
1288 | [RTM_IFINFO] = "RTM_IFINFO: iface status change", | 1288 | [RTM_IFINFO] = "RTM_IFINFO: iface status change", | |
1289 | [RTM_CHGADDR] = "RTM_CHGADDR: address being changed on iface", | 1289 | [RTM_CHGADDR] = "RTM_CHGADDR: address being changed on iface", | |
1290 | }; | 1290 | }; | |
1291 | 1291 | |||
1292 | const char metricnames[] = | 1292 | const char metricnames[] = | |
1293 | "\011pksent\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire\2hopcount\1mtu"; | 1293 | "\011pksent\010rttvar\7rtt\6ssthresh\5sendpipe\4recvpipe\3expire\2hopcount\1mtu"; | |
1294 | const char routeflags[] = | 1294 | const char routeflags[] = | |
1295 | "\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE\010MASK_PRESENT\011CLONING\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE\016CLONED\017PROTO2\020PROTO1"; | 1295 | "\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE\010MASK_PRESENT\011CLONING\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE\016CLONED\017PROTO2\020PROTO1\023LOCAL"; | |
1296 | const char ifnetflags[] = | 1296 | const char ifnetflags[] = | |
1297 | "\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6NOTRAILERS\7RUNNING\010NOARP\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1\017LINK2\020MULTICAST"; | 1297 | "\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6NOTRAILERS\7RUNNING\010NOARP\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1\017LINK2\020MULTICAST"; | |
1298 | const char addrnames[] = | 1298 | const char addrnames[] = | |
1299 | "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD\011TAG"; | 1299 | "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD\011TAG"; | |
1300 | 1300 | |||
1301 | 1301 | |||
1302 | #ifndef SMALL | 1302 | #ifndef SMALL | |
1303 | static const char * | 1303 | static const char * | |
1304 | linkstate(struct if_msghdr *ifm) | 1304 | linkstate(struct if_msghdr *ifm) | |
1305 | { | 1305 | { | |
1306 | static char buf[64]; | 1306 | static char buf[64]; | |
1307 | 1307 | |||
1308 | switch (ifm->ifm_data.ifi_link_state) { | 1308 | switch (ifm->ifm_data.ifi_link_state) { |
--- src/sbin/route/rtutil.c 2015/01/07 22:38:32 1.4
+++ src/sbin/route/rtutil.c 2015/02/26 09:56:11 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: rtutil.c,v 1.4 2015/01/07 22:38:32 christos Exp $ */ | 1 | /* $NetBSD: rtutil.c,v 1.5 2015/02/26 09:56:11 roy Exp $ */ | |
2 | /* $OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $ */ | 2 | /* $OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (c) 1983, 1988, 1993 | 5 | * Copyright (c) 1983, 1988, 1993 | |
6 | * The Regents of the University of California. All rights reserved. | 6 | * The Regents of the University of California. All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -82,26 +82,27 @@ static const struct bits bits[] = { | @@ -82,26 +82,27 @@ static const struct bits bits[] = { | |||
82 | { RTF_MODIFIED, 'M' }, | 82 | { RTF_MODIFIED, 'M' }, | |
83 | { RTF_DONE, 'd' }, /* Completed -- for routing messages only */ | 83 | { RTF_DONE, 'd' }, /* Completed -- for routing messages only */ | |
84 | { RTF_MASK, 'm' }, /* Mask Present -- for routing messages only */ | 84 | { RTF_MASK, 'm' }, /* Mask Present -- for routing messages only */ | |
85 | { RTF_CLONING, 'C' }, | 85 | { RTF_CLONING, 'C' }, | |
86 | { RTF_XRESOLVE, 'X' }, | 86 | { RTF_XRESOLVE, 'X' }, | |
87 | { RTF_LLINFO, 'L' }, | 87 | { RTF_LLINFO, 'L' }, | |
88 | { RTF_STATIC, 'S' }, | 88 | { RTF_STATIC, 'S' }, | |
89 | { RTF_PROTO1, '1' }, | 89 | { RTF_PROTO1, '1' }, | |
90 | { RTF_PROTO2, '2' }, | 90 | { RTF_PROTO2, '2' }, | |
91 | /* { RTF_PROTO3, '3' }, */ | 91 | /* { RTF_PROTO3, '3' }, */ | |
92 | { RTF_CLONED, 'c' }, | 92 | { RTF_CLONED, 'c' }, | |
93 | /* { RTF_JUMBO, 'J' }, */ | 93 | /* { RTF_JUMBO, 'J' }, */ | |
94 | { RTF_ANNOUNCE, 'p' }, | 94 | { RTF_ANNOUNCE, 'p' }, | |
95 | { RTF_LOCAL, 'l'}, | |||
95 | { 0, 0 } | 96 | { 0, 0 } | |
96 | }; | 97 | }; | |
97 | 98 | |||
98 | #ifndef SMALL | 99 | #ifndef SMALL | |
99 | static void p_tag(const struct sockaddr *sa); | 100 | static void p_tag(const struct sockaddr *sa); | |
100 | #endif | 101 | #endif | |
101 | static void p_rtentry(struct rt_msghdr *, int, int); | 102 | static void p_rtentry(struct rt_msghdr *, int, int); | |
102 | 103 | |||
103 | /* | 104 | /* | |
104 | * Print routing tables. | 105 | * Print routing tables. | |
105 | */ | 106 | */ | |
106 | void | 107 | void | |
107 | p_rttables(int paf, int flags, int pflags, int interesting) | 108 | p_rttables(int paf, int flags, int pflags, int interesting) |
--- src/sbin/route/show.c 2014/11/06 21:29:32 1.46
+++ src/sbin/route/show.c 2015/02/26 09:56:11 1.47
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: show.c,v 1.46 2014/11/06 21:29:32 christos Exp $ */ | 1 | /* $NetBSD: show.c,v 1.47 2015/02/26 09:56:11 roy Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1983, 1988, 1993 | 4 | * Copyright (c) 1983, 1988, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -24,27 +24,27 @@ | @@ -24,27 +24,27 @@ | |||
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | #ifndef lint | 33 | #ifndef lint | |
34 | #if 0 | 34 | #if 0 | |
35 | static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; | 35 | static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94"; | |
36 | #else | 36 | #else | |
37 | __RCSID("$NetBSD: show.c,v 1.46 2014/11/06 21:29:32 christos Exp $"); | 37 | __RCSID("$NetBSD: show.c,v 1.47 2015/02/26 09:56:11 roy Exp $"); | |
38 | #endif | 38 | #endif | |
39 | #endif /* not lint */ | 39 | #endif /* not lint */ | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/protosw.h> | 42 | #include <sys/protosw.h> | |
43 | #include <sys/socket.h> | 43 | #include <sys/socket.h> | |
44 | #include <sys/mbuf.h> | 44 | #include <sys/mbuf.h> | |
45 | 45 | |||
46 | #include <arpa/inet.h> | 46 | #include <arpa/inet.h> | |
47 | #include <net/if.h> | 47 | #include <net/if.h> | |
48 | #include <net/if_dl.h> | 48 | #include <net/if_dl.h> | |
49 | #include <net/if_types.h> | 49 | #include <net/if_types.h> | |
50 | #include <net/route.h> | 50 | #include <net/route.h> | |
@@ -127,18 +127,18 @@ parse_show_opts(int argc, char * const * | @@ -127,18 +127,18 @@ parse_show_opts(int argc, char * const * | |||
127 | *afnamep = afname; | 127 | *afnamep = afname; | |
128 | *afp = af; | 128 | *afp = af; | |
129 | *flagsp = flags; | 129 | *flagsp = flags; | |
130 | } | 130 | } | |
131 | 131 | |||
132 | /* | 132 | /* | |
133 | * Print routing tables. | 133 | * Print routing tables. | |
134 | */ | 134 | */ | |
135 | void | 135 | void | |
136 | show(int argc, char *const *argv, int flags) | 136 | show(int argc, char *const *argv, int flags) | |
137 | { | 137 | { | |
138 | int af, rflags; | 138 | int af, rflags; | |
139 | static int interesting = RTF_UP | RTF_GATEWAY | RTF_HOST | | 139 | static int interesting = RTF_UP | RTF_GATEWAY | RTF_HOST | | |
140 | RTF_REJECT | RTF_LLINFO; | 140 | RTF_REJECT | RTF_LLINFO | RTF_LOCAL; | |
141 | 141 | |||
142 | parse_show_opts(argc, argv, &af, &rflags, NULL, true); | 142 | parse_show_opts(argc, argv, &af, &rflags, NULL, true); | |
143 | p_rttables(af, flags, rflags, interesting); | 143 | p_rttables(af, flags, rflags, interesting); | |
144 | } | 144 | } |