wiz
3fa42aac82
Whitespace nit.
2011-07-03 09:15:20 +00:00
kefren
008758606b
Mention -mpls and -tag and xref mpls(4)
...
bin/45071
2011-07-03 07:20:37 +00:00
joerg
017dd250ef
Fix memset usage.
2011-07-01 02:46:24 +00:00
kefren
2715676450
don't compile tag functions if SMALL is defined. Should fix the build
2011-06-22 04:57:28 +00:00
kefren
0c463ade62
Alloc dynamically sockunions in sou.
...
Teach route(8) about multiple tags. E.G.: -tag 100,20,33
XXX: needs documentation
2011-06-21 14:33:14 +00:00
yamt
26f4e9f9b1
xref link_addr for -link.
2011-06-16 23:35:35 +00:00
martin
82fe9809af
Use RT_ROUNDUP() and friends from sys/route.h instead of homegrown
...
variants.
2011-02-04 14:31:23 +00:00
matt
4d5d6d9aa5
Add a new AF/PF_ROUTE which is 64-bit clean which makes the routing socket
...
interface (and its associated sysctls) act identically for both 32 and 64 bit
programs. The old unclean one remains for backward compatibility.
2011-02-01 01:39:19 +00:00
pooka
e8de1d91d0
be a happy crunch build
2010-12-13 19:19:10 +00:00
pooka
e3d9b779d8
Convert from RUMP_ACTION to RUMPPRG.
2010-12-13 17:39:47 +00:00
roy
50de1251a3
Support the new RTM_IFINFO and RTM_CHGADDR messages.
2010-11-12 16:32:18 +00:00
pooka
7d1c54af24
adapt to new rumpclient_init() signature
2010-11-05 13:52:41 +00:00
pooka
b10965b180
#ifdef variable correctly
2010-11-04 23:38:18 +00:00
pooka
243f716534
be consistent in what to leave outside of SMALL
2010-11-04 23:37:27 +00:00
pooka
ddce2e059a
Support RUMP_ACTION to compile a rump kernel client.
2010-11-04 23:36:10 +00:00
kefren
a7449c28c6
add MPLS clue - mpls and tag keywords
2010-06-26 14:29:36 +00:00
kefren
c890d3f5e0
Update also keywords.{c,h} generator in order to reflect latest changes.
2010-05-12 19:26:33 +00:00
christos
c69676936c
PR/40455: Mihai Chelaru: Add noreject noblackhole options
2010-05-12 17:56:13 +00:00
is
000fbf6b41
Add AF_APPLETALK support to getnameinfo(); make "route show" use it.
...
Doesn't print "ranges" yet (should it be done here?); only numeric
output.
2010-01-26 21:27:54 +00:00
snj
550147bd6a
Remove 3rd and 4th clauses in christos' license. OK christos.
2009-10-21 01:07:44 +00:00
lukem
be0c43535f
fix sign-compare issues
2009-03-17 00:52:47 +00:00
christos
b09dc428f4
parse unsigned long with strtoul not atoi
2008-12-28 20:12:31 +00:00
dyoung
6a9236b124
Get the socket addresses for dst/gateway/netmask/interface/ifaddr
...
out of the global namespace.
2008-09-10 01:56:22 +00:00
dyoung
5e93382467
Don't cast a sockunion * to sockaddr *. Instead, reference the
...
sockaddr inside of the sockunion.
2008-09-10 01:14:59 +00:00
dyoung
0a77d3df40
Delete superfluous casts to void *.
2008-09-10 01:08:39 +00:00
dyoung
f791b67f11
Constify.
2008-09-10 01:06:58 +00:00
dyoung
cfe9ef5ba6
Constify.
2008-09-10 01:00:02 +00:00
dyoung
36aee9b2c9
Constify.
...
For clarity's sake, do not assign a new value to inet_makenetandmask()'s
argument, `inet'.
2008-09-10 00:57:57 +00:00
dyoung
f65fccd290
Extract subroutine extract_addrs() for reuse, later.
...
Replace the anonymous constant, 0, with AF_UNSPEC.
2008-09-09 19:58:46 +00:00
dyoung
081a2b518e
Constify.
2008-09-09 16:55:28 +00:00
dyoung
51731102ff
Shorten a staircase. Remove superfluous parentheses from return
...
statements. Constify.
2008-09-09 16:50:52 +00:00
dyoung
acf567a730
Use EXIT_FAILURE instead of anonymous constant '1'.
2008-09-09 16:35:15 +00:00
dyoung
c08d63b5ad
Use a union and sizeof() to avoid a cast and an anonymous constant
...
buffer length, respectively.
2008-09-09 16:23:33 +00:00
dyoung
a26d1ce8fc
Use bool.
2008-09-09 16:18:17 +00:00
lukem
6543a91fea
Remove the \n and tabs from the __COPYRIGHT() strings.
...
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
hubertf
6eb43c8c6d
TSEL() is const char* now
2007-02-18 01:48:37 +00:00
apb
e81d0de4e0
Fix a bug that caused 0.0.0.0/0 to be treated like 0.0.0.0/32.
...
foo << 32 is undefined per section 6.5.7 of the C99 standard
if foo is (or is promoted to) a 32-bit type.
2006-11-11 21:50:19 +00:00
christos
9b005038ce
add missing initializer
2006-10-16 02:55:10 +00:00
pooka
4df78a97d5
print the L flag for routes with llinfo. makes you not wonder why
...
non-llinfo routes are being printed for route show -llinfo
2006-09-23 23:01:01 +00:00
dyoung
6333e1495e
Let us qualify 'route flush' and 'route show' commands with -llinfo
...
and -host flags, which is useful for displaying/flushing ARP entries:
# route -n show -inet -llinfo -host
Routing table
Internet:
Destination Gateway Flags
169.254.1.119 link#1 UH
169.254.230.110 00:02:6f:21:e6:6e UH
# route -n flush -inet -llinfo -host
169.254.1.119 done
169.254.230.110 0.2.6f.21.e6.6e done
169.254.237.70 done
# route -n show -inet -llinfo -host
Routing table
#
This will help me address bin/11079, "dhclient may require arp and sed".
Extract common code from flushroutes() and show(), creating
parse_show_opts().
While I'm here, make small cosmetic changes to flushroutes().
2006-09-23 22:41:25 +00:00
dyoung
29655a0cbb
Move the #ifndef SMALL code together.
2006-09-23 21:55:47 +00:00
dyoung
07474a8f36
Use the symbol AF_UNSPEC instead of 0 as appropriate.
2006-09-23 21:51:05 +00:00
dyoung
bf71bcc951
Remove dead code.
2006-09-23 21:11:53 +00:00
dogcow
f2d329dca0
remove more vestiges of CCITT, LLC, HDLC, NS, and NSIP.
2006-09-07 02:40:31 +00:00
matt
e6ff03ce6f
Remove XNS and CCITT/X25 bits.
2006-08-26 15:26:02 +00:00
wiz
8d3619d115
Bump date for previous.
2006-08-06 23:38:13 +00:00
dyoung
9dde08c82f
Document -nocloning, -nocloned flags. Shift a couple of columns
...
right by a character width, to make room for the new flags.
2006-08-06 21:47:35 +00:00
dyoung
2bc777d5d0
KNF err(3), errx(3) usage, indentation, braces.
2006-08-06 17:47:17 +00:00
dyoung
61dbc26298
Add route keywords -nocloned, -nocloning.
2006-08-06 17:44:56 +00:00
wiz
cc07c6e988
Use default option order (AaBbCc...).
2006-01-29 22:11:10 +00:00
is
d155cb6cd4
Print the INET netmask if it is non-contiguous.
2006-01-26 11:35:09 +00:00
christos
81a178c561
PR/32632: Yves-Emmanuel JUTARD: Improvment suggestion in 'route' display.
...
Add a new -S flag that prints a space for missing flags.
2006-01-25 16:29:10 +00:00
christos
b7f3395036
PR/32629: Yves-Emmanuel JUTARD: Type errors in sbin/route/route.c, another
...
u_char/char conflict.
2006-01-25 16:19:50 +00:00
ginsbach
031f929a6c
Add full IPv6 syntax support when route is built with -DSMALL and -DINET6.
...
Fixes PR/23937. Adapted from supplied patch.
2005-08-31 02:58:30 +00:00
ginsbach
ba49deed2a
Clean up some minor nits:
...
+ style (KNF).
. don't cast NULL
. white space clean up
+ use consistent format for error messages.
+ plug memory leaks and avoid malloc(0).
+ verbose message should display even when routing table is empty
(flushroutes).
2005-08-30 19:01:25 +00:00
ginsbach
6e420616a8
Make sure that a netmask socket address value prints appropriately when the
...
family is unset. Either the destination or interface address socket address
family value is used. This change prevents the following sort of output:
RTM_NEWADDR: address being added to iface: len 60, metric 0, flags:<UP>
sockaddrs: <NETMASK,IFA,BRD>
(0) 00.00.ff.00.00 127.0.0.1 127.0.0.1
With this change the last line becomes:
255.0.0.0 127.0.0.1 127.0.0.1
Also make sure that when using a generated inet netmask the address family
is set. With this change a generated netmask will print appropriately
when using the verbose (-v) option.
2005-08-15 19:28:08 +00:00
ginsbach
9992d68aff
Make sure the get command always exits non-zero on error. This makes things
...
like the following work as expected.
#!/bin/sh
if ! route -sn get default >/dev/null 2>&1; then
echo default gateway not set
exit 1
fi
echo default gateway set
Handle routing socket write(2) errors when they occur. This produces
better diagnostics by allowing for handling of the special route errno
values ESRCH, EBUSY, and ENOBUFS even with the quiet (-q) option or
when doing a get command.
2005-08-12 21:23:06 +00:00
ginsbach
9c8def382d
Trim the local domain name in routename() for INET6 lookups; similar to
...
INET lookups.
2005-08-12 16:29:06 +00:00
he
8974f21b75
Make this build for __GNUC__ <= 2 (i.e. for vax). The cast to
...
caddr_t removes a const qualifier. Instead, cast the first element
of the subtraction to "struct sockaddr *" to work around the problem.
2005-08-10 11:48:17 +00:00
ginsbach
08af90d648
Accept protocol flags, i.e. -inet, -inet6, with the show command.
...
[From OpenBSD via DragonFly BSD]
2005-08-09 21:25:42 +00:00
ginsbach
2cff02da42
Fix the default case in sodump(). Printing the address of the "which"
...
string isn't really that useful. Instead print the string and the value
of sa_family.
2005-08-09 20:33:06 +00:00
ginsbach
3997584e62
More style nits (KNF); casts and sizeof's are not followed by a space.
2005-08-09 19:43:24 +00:00
ginsbach
89cdec0594
switch is not a function, so add a space; sort switch elements
...
alphabetically (KNF).
2005-07-20 21:12:40 +00:00
ginsbach
d313757b82
* Exit non-zero error code when flushroute() fails operating on the
...
routing socket, e.g. running route flush as non-root.
* When quiet (-q) don't append error string to a non-existent
diagnostic output (stdout). The error diagnostic is still written
to stderr. [from FreeBSD]
* Use warn(3) in place of perror(3).
2005-07-15 21:29:54 +00:00
christos
dea4bd707c
const poisoning.
2005-06-26 21:28:15 +00:00
dyoung
256aff6693
Teach route(8) to print the messages generated by net80211.
2005-06-25 06:38:35 +00:00
ginsbach
4d1075a78b
Convert prefixlen() to ANSI function declaration. Missed by earlier
...
conversion.
2005-05-19 15:46:02 +00:00
ginsbach
0cb468118d
Due to a limitation in inet_addr(3) it was not possible to specify a
...
netmask value of 0xffffffff (INADDR_NONE). Fix by using inet_aton(3).
Note it was possible to specify the same mask as the dotted quad
255.255.255.255 because of a later call to gethostbyname(3).
[From FreeBSD]
2005-05-19 15:05:11 +00:00
ginsbach
d96d2a6f15
Adjust field width for route -n show similar to netstat -rn when displaying
...
INET6 route entries.
2005-05-13 14:58:47 +00:00
ginsbach
bb3f166314
Fix botched prior commit. Additional debugging error messages mistakenly
...
committed.
2005-05-13 01:59:47 +00:00
ginsbach
22f8a99e92
* Honor -net when using CIDR (net/mask) notation. This differs
...
from the default CIDR (host/mask) interpretation. As discussed on
tech-net.
* Use errx() in place of fprintf() and exit(). Make the error message
formats consistent.
2005-05-12 21:10:49 +00:00
ginsbach
a43fb90cb0
Fix macro NEXTADDR so that the names, like so_dst, are printed
...
rather than u. The preprocessor doesn't do replacement within
strings, so the # string creation operator must be used.
2005-05-10 18:12:22 +00:00
xtraeme
69cbd40c14
Kill __P(), use ANSI function declarations.
2005-02-05 14:05:23 +00:00
lukem
7157011597
Only compile in IPv6 support if ${USE_INET6} != "no"
...
MKINET6 is for providing IPv6 infrastructure.
USE_INET6 is for compiling IPv6 support into the programs (needs MKINET6).
2005-01-10 02:58:58 +00:00
itojun
b95181fc9b
NI_WITHSCOPEID was not picked up by IETF standardization process.
2004-11-16 05:59:32 +00:00
itojun
ba67da06a5
bump buffer size for any_ntoa(), for huge sa_len
2004-05-15 14:13:36 +00:00
itojun
7340ad20ce
2-byte read overrun for unknown sockaddr. from openbsd
...
XXX out[64], is it safe? what if sa_len > 23?
2004-05-15 13:41:09 +00:00
jmmv
b635f565e7
Homogenize usage messages: make the 'usage' word all lowercase, as this seems
...
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
lukem
f85d2d1c14
Use ${HOST_SH} instead of `sh'.
...
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00
itojun
d3e55680aa
correct typo. PR misc/22944
2003-10-02 00:09:06 +00:00
itojun
83ddaf1cbf
print prefixlen on -show
2003-10-01 06:24:19 +00:00
cube
5041ba1a4c
Remove a comment that referred to a non-committed part of the patch I
...
submitted for bin/17613. Ok'd by mrg@.
2003-09-16 09:34:48 +00:00
agc
276d62f603
Move UCB-licensed code from 4-clause to 3-clause licence.
...
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
wiz
7539e84445
Bump date for flushall description.
2003-08-07 09:46:17 +00:00
jrf
ce22377a7e
This is an updated submitted patch originally written by Jim Rees
...
and sent in by Greg Hudson as seen in PR misc/3227. Basically what it
does is adds a flushall option which deletes all but localhost routes.
This is done by andoring in a flag called doall (1 means do all routes
including gateway, 0 means do a regular flush). I have seen some
platforms that do this. I tested it out on ipv4 only, it works as
advertised. Commit was approved by christos@.
2003-07-19 01:36:47 +00:00
christos
072bca2c13
PR/21856: Robert Elz: Changes to route(8) to allow /n instead of -prefixlen
...
for INET6
2003-06-11 15:45:20 +00:00
itojun
627957eb53
permit foo/bar notation, like "route add 10.0.0.0/8 127.0.0.1".
...
originally by provos
2003-06-03 04:41:42 +00:00
itojun
9cbeabfe77
strlcpy [a few mistakes found]
2003-05-17 23:02:28 +00:00
jrf
6867af7aad
This addresses PR 17613 when certain methods of adding routes would
...
muck up the routing tables. The patch was submitted by Quentin Garnier
<netbsd@quatriemek.com> and tweaked a little after it was reviewed
by Christos Zoulas <christos@netbsd.org>. Final change/commit approved
by Christos.
2003-04-21 13:42:50 +00:00
jrf
dee179a37f
Made a note in the code about the -d and -d options brought up in
...
PR 18674. Thanks to Chris Jones for pointing it out.
2003-04-03 02:39:50 +00:00
wiz
a9f7f104b6
Split .Nm with other macro arguments on two lines.
2003-02-25 07:53:39 +00:00
itojun
e33246f5c7
correct prefixlen handling for IPv4.
2002-10-18 00:21:23 +00:00
itojun
3c30f46849
Make prefixlen check to make sure its argument is present before deref
...
from openbsd
2002-10-18 00:16:25 +00:00
wiz
09cbac4e7f
New sentence, new line. From Robert Elz.
2002-10-03 15:41:44 +00:00
grant
6742cb1812
sweep of errx/warnx, remove unnecessary trailing \n
2002-07-20 08:36:17 +00:00
itojun
d24b68cd4f
permit DNS names to address portion. they will be considered as RTF_HOST
...
if specified as destination (as there's no getnetbyname in IPv6).
2002-06-10 21:18:53 +00:00
itojun
a1662dac72
if we're unsure about prefixlen, don't say "128".
2002-06-05 22:11:28 +00:00
itojun
65829ef6aa
more correct ion to RTF_HOST handling.
2002-06-05 22:10:44 +00:00
itojun
fff7bbceef
do not have -prefixlen 128 on RTF_HOST.
...
From: Dawid Szymanski <dawszy@arhea.net>
2002-06-04 22:20:00 +00:00
itojun
e534b69c1d
raise RTF_HOST if destination is a host (/128). from ume
2002-05-20 23:01:32 +00:00