diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 40 | ||||
-rw-r--r-- | sbin/route/keywords.h | 10 | ||||
-rw-r--r-- | sbin/route/keywords.sh | 4 | ||||
-rw-r--r-- | sbin/route/route.c | 19 | ||||
-rw-r--r-- | sbin/route/show.c | 3 |
5 files changed, 50 insertions, 26 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 75db06c5a37..9902f6902cd 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.70 2005/01/19 13:40:47 mpf Exp $ */ +/* $OpenBSD: ping.c,v 1.71 2005/05/27 04:55:27 mcbride Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -43,7 +43,7 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; #else -static const char rcsid[] = "$OpenBSD: ping.c,v 1.70 2005/01/19 13:40:47 mpf Exp $"; +static const char rcsid[] = "$OpenBSD: ping.c,v 1.71 2005/05/27 04:55:27 mcbride Exp $"; #endif #endif /* not lint */ @@ -107,18 +107,19 @@ struct tvi { /* various options */ int options; -#define F_FLOOD 0x001 -#define F_INTERVAL 0x002 -#define F_NUMERIC 0x004 -#define F_PINGFILLED 0x008 -#define F_QUIET 0x010 -#define F_RROUTE 0x020 -#define F_SO_DEBUG 0x040 -#define F_SO_DONTROUTE 0x080 -#define F_VERBOSE 0x100 -#define F_SADDR 0x200 -#define F_HDRINCL 0x400 -#define F_TTL 0x800 +#define F_FLOOD 0x0001 +#define F_INTERVAL 0x0002 +#define F_NUMERIC 0x0004 +#define F_PINGFILLED 0x0008 +#define F_QUIET 0x0010 +#define F_RROUTE 0x0020 +#define F_SO_DEBUG 0x0040 +#define F_SO_DONTROUTE 0x0080 +#define F_VERBOSE 0x0100 +#define F_SADDR 0x0200 +#define F_HDRINCL 0x0400 +#define F_TTL 0x0800 +#define F_SO_JUMBO 0x1000 /* multicast options */ int moptions; @@ -210,7 +211,8 @@ main(int argc, char *argv[]) preload = 0; datap = &outpack[8 + sizeof(struct tvi)]; - while ((ch = getopt(argc, argv, "DI:LRS:c:dfi:l:np:qrs:T:t:vw:")) != -1) + while ((ch = getopt(argc, argv, + "DI:LRS:c:dfi:jl:np:qrs:T:t:vw:")) != -1) switch(ch) { case 'c': npackets = strtonum(optarg, 1, INT_MAX, &errstr); @@ -258,6 +260,9 @@ main(int argc, char *argv[]) options |= F_INTERVAL; break; + case 'j': + options |= F_SO_JUMBO; + break; case 'L': moptions |= MULTICAST_NOLOOP; loop = 0; @@ -380,6 +385,9 @@ main(int argc, char *argv[]) if (options & F_SO_DONTROUTE) (void)setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *)&hold, sizeof(hold)); + if (options & F_SO_JUMBO) + (void)setsockopt(s, SOL_SOCKET, SO_JUMBO, (char *)&hold, + sizeof(hold)); if (options & F_TTL) { if (IN_MULTICAST(ntohl(to->sin_addr.s_addr))) @@ -1336,7 +1344,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: ping [-DdfLnqRrv] [-c count] [-I ifaddr] [-i wait]\n" + "usage: ping [-DdfjLnqRrv] [-c count] [-I ifaddr] [-i wait]\n" "\t[-l preload] [-p pattern] [-s packetsize] [-T tos] [-t ttl]\n" "\t[-w maxwait] host\n"); exit(1); diff --git a/sbin/route/keywords.h b/sbin/route/keywords.h index 5f065485cba..3c80f2693f8 100644 --- a/sbin/route/keywords.h +++ b/sbin/route/keywords.h @@ -1,10 +1,10 @@ -/* $OpenBSD: keywords.h,v 1.17 2005/03/30 08:04:16 henning Exp $ */ +/* $OpenBSD: keywords.h,v 1.18 2005/05/27 04:55:27 mcbride Exp $ */ /* WARNING! This file was generated by keywords.sh */ struct keytab { - char *kt_cp; - int kt_i; + char *kt_cp; + int kt_i; }; enum { @@ -29,6 +29,7 @@ enum { K_INET, K_INET6, K_IPX, + K_JUMBO, K_LABEL, K_LINK, K_LLINFO, @@ -39,6 +40,7 @@ enum { K_MTU, K_NET, K_NETMASK, + K_NOJUMBO, K_NOSTATIC, K_PREFIXLEN, K_PROTO1, @@ -76,6 +78,7 @@ struct keytab keywords[] = { { "inet", K_INET }, { "inet6", K_INET6 }, { "ipx", K_IPX }, + { "jumbo", K_JUMBO }, { "label", K_LABEL }, { "link", K_LINK }, { "llinfo", K_LLINFO }, @@ -86,6 +89,7 @@ struct keytab keywords[] = { { "mtu", K_MTU }, { "net", K_NET }, { "netmask", K_NETMASK }, + { "nojumbo", K_NOJUMBO }, { "nostatic", K_NOSTATIC }, { "prefixlen", K_PREFIXLEN }, { "proto1", K_PROTO1 }, diff --git a/sbin/route/keywords.sh b/sbin/route/keywords.sh index 348940ee660..e0544f9ce55 100644 --- a/sbin/route/keywords.sh +++ b/sbin/route/keywords.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: keywords.sh,v 1.16 2005/03/30 08:02:34 deraadt Exp $ +# $OpenBSD: keywords.sh,v 1.17 2005/05/27 04:55:27 mcbride Exp $ # $NetBSD: keywords.sh,v 1.2 1996/11/15 18:57:21 gwr Exp $ # @(#)keywords 8.2 (Berkeley) 3/19/94 # @@ -29,6 +29,7 @@ ifp inet inet6 ipx +jumbo label link llinfo @@ -39,6 +40,7 @@ mpath mtu net netmask +nojumbo nostatic prefixlen proto1 diff --git a/sbin/route/route.c b/sbin/route/route.c index 8eb3c9b9116..e190f028a77 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.87 2005/03/30 07:59:03 henning Exp $ */ +/* $OpenBSD: route.c,v 1.88 2005/05/27 04:55:27 mcbride Exp $ */ /* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */ /* @@ -96,7 +96,7 @@ void bprintf(FILE *, int, char *); void mask_addr(union sockunion *, union sockunion *, int); int inet6_makenetandmask(struct sockaddr_in6 *); int getaddr(int, char *, struct hostent **); -int rtmsg(int, int); +int rtmsg(int, int, int); __dead void usage(char *); void set_metric(char *, int); void inet_makenetandmask(u_int32_t, struct sockaddr_in *, int); @@ -348,7 +348,7 @@ int newroute(int argc, char **argv) { char *cmd, *dest = "", *gateway = "", *error; - int ishost = 0, ret = 0, attempts, oerrno, flags = RTF_STATIC; + int ishost = 0, ret = 0, attempts, oerrno, flags = RTF_STATIC, use = 0; int key; struct hostent *hp = NULL; @@ -468,6 +468,14 @@ newroute(int argc, char **argv) case K_MPATH: flags |= RTF_MPATH; break; + case K_JUMBO: + flags |= RTF_JUMBO; + use |= RTF_JUMBO; + break; + case K_NOJUMBO: + flags &= ~RTF_JUMBO; + use |= RTF_JUMBO; + break; case K_MTU: case K_HOPCOUNT: case K_EXPIRE: @@ -528,7 +536,7 @@ newroute(int argc, char **argv) flags |= RTF_GATEWAY; for (attempts = 1; ; attempts++) { errno = 0; - if ((ret = rtmsg(*cmd, flags)) == 0) + if ((ret = rtmsg(*cmd, flags, use)) == 0) break; if (errno != ENETUNREACH && errno != ESRCH) break; @@ -938,7 +946,7 @@ struct { } m_rtmsg; int -rtmsg(int cmd, int flags) +rtmsg(int cmd, int flags, int use) { static int seq; char *cp = m_rtmsg.m_space; @@ -971,6 +979,7 @@ rtmsg(int cmd, int flags) #define rtm m_rtmsg.m_rtm rtm.rtm_type = cmd; rtm.rtm_flags = flags; + rtm.rtm_use = use; rtm.rtm_version = RTM_VERSION; rtm.rtm_seq = ++seq; rtm.rtm_addrs = rtm_addrs; diff --git a/sbin/route/show.c b/sbin/route/show.c index d82943384aa..a215921b540 100644 --- a/sbin/route/show.c +++ b/sbin/route/show.c @@ -1,4 +1,4 @@ -/* $OpenBSD: show.c,v 1.42 2005/03/30 05:40:55 henning Exp $ */ +/* $OpenBSD: show.c,v 1.43 2005/05/27 04:55:27 mcbride Exp $ */ /* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */ /* @@ -93,6 +93,7 @@ static const struct bits bits[] = { { RTF_PROTO2, '2' }, { RTF_PROTO3, '3' }, { RTF_CLONED, 'c' }, + { RTF_JUMBO, 'J' }, { 0 } }; |