Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

import FreeBSD-4.7RELEASE

  • Loading branch information...
commit a3c9db9c40d5c5233dc0176822496eed07962268 1 parent b351775
suz authored
View
16 freebsd4/etc/mtree/BSD.include.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.32.2.8 2002/03/25 21:37:31 gshapiro Exp $
+# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.32.2.11 2002/07/22 14:21:43 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -18,6 +18,8 @@
..
usb
..
+ wi
+ ..
..
fs
smbfs
@@ -36,6 +38,8 @@
libmilter
..
machine
+ pc
+ ..
..
msdosfs
..
@@ -44,6 +48,14 @@
netatalk
..
netatm
+ ipatm
+ ..
+ sigpvc
+ ..
+ spans
+ ..
+ uni
+ ..
..
netgraph
..
@@ -87,8 +99,6 @@
..
security
..
- ss
- ..
sys
..
ufs
View
10 freebsd4/etc/mtree/BSD.local.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.55.2.18 2002/03/01 15:56:55 phantom Exp $
+# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.55.2.19 2002/08/17 19:11:15 ache Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -325,6 +325,8 @@
..
fr_FR.ISO8859-15
..
+ hi_IN.ISCII-DEV
+ ..
hr_HR.ISO8859-2
..
hu_HU.ISO8859-2
@@ -341,10 +343,10 @@
..
it_IT.ISO8859-15
..
- ja_JP.eucJP
- ..
ja_JP.SJIS
..
+ ja_JP.eucJP
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -373,6 +375,8 @@
..
pl_PL.ISO8859-2
..
+ pt_BR.ISO8859-1
+ ..
pt_PT.ISO8859-1
..
pt_PT.ISO8859-15
View
2  freebsd4/etc/mtree/BSD.root.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.root.dist,v 1.45.2.3.2.1 2002/06/10 15:34:22 obrien Exp $
+# $FreeBSD: src/etc/mtree/BSD.root.dist,v 1.45.2.4 2002/06/10 15:33:27 obrien Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
View
28 freebsd4/etc/mtree/BSD.usr.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.188.2.37 2002/05/27 12:14:06 dwmalone Exp $
+# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.188.2.39 2002/08/17 19:11:15 ache Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -294,14 +294,6 @@
dialog
..
diskless
- 209.157.86.12
- ..
- HT.DISKLESS
- ..
- HT.STD
- ..
- archive.backplane.com
- ..
..
drivers
..
@@ -333,8 +325,6 @@
..
..
dyn_sysctl
- module
- ..
..
syscall
module
@@ -533,6 +523,8 @@
..
fr_FR.ISO8859-15
..
+ hi_IN.ISCII-DEV
+ ..
hr_HR.ISO8859-2
..
hu_HU.ISO8859-2
@@ -549,10 +541,10 @@
..
it_IT.ISO8859-15
..
- ja_JP.eucJP
- ..
ja_JP.SJIS
..
+ ja_JP.eucJP
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -581,6 +573,8 @@
..
pl_PL.ISO8859-2
..
+ pt_BR.ISO8859-1
+ ..
pt_PT.ISO8859-1
..
pt_PT.ISO8859-15
@@ -849,6 +843,8 @@
..
fr_FR.ISO8859-15
..
+ hi_IN.ISCII-DEV
+ ..
hr_HR.ISO8859-2
..
hu_HU.ISO8859-2
@@ -865,10 +861,10 @@
..
it_IT.ISO8859-15
..
- ja_JP.eucJP
- ..
ja_JP.SJIS
..
+ ja_JP.eucJP
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -897,6 +893,8 @@
..
pl_PL.ISO8859-2
..
+ pt_BR.ISO8859-1
+ ..
pt_PT.ISO8859-1
..
pt_PT.ISO8859-15
View
4 freebsd4/etc/mtree/BSD.var.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.var.dist,v 1.43.2.8 2002/04/28 19:57:43 gshapiro Exp $
+# $FreeBSD: src/etc/mtree/BSD.var.dist,v 1.43.2.9 2002/06/30 17:57:17 des Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -31,6 +31,8 @@
pkg
..
..
+ empty mode=0555 flags=schg
+ ..
/set gname=games mode=0775
games
hackdir mode=0770
View
12 freebsd4/etc/mtree/BSD.x11-4.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.x11-4.dist,v 1.13.2.6 2002/04/15 00:44:15 dougb Exp $
+# $FreeBSD: src/etc/mtree/BSD.x11-4.dist,v 1.13.2.7 2002/09/29 02:49:52 kris Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -90,6 +90,8 @@
..
Speedo
..
+ TTF
+ ..
Type1
..
cyrillic
@@ -120,6 +122,8 @@
..
armscii-8
..
+ common
+ ..
en_US.UTF-8
..
en_US.utf
@@ -204,8 +208,12 @@
..
zh
..
+ zh_CN
+ ..
zh_CN.gbk
..
+ zh_HK.big5
+ ..
zh_HK.big5hkscs
..
zh_TW
@@ -231,6 +239,8 @@
pixmaps
..
..
+ xedit
+ ..
xinit
..
xkb
View
4 freebsd4/etc/mtree/README
@@ -1,4 +1,6 @@
-$FreeBSD: src/etc/mtree/README,v 1.4.2.1 2001/01/11 13:06:22 dougb Exp $
+$FreeBSD: src/etc/mtree/README,v 1.4.2.2 2002/08/08 09:50:20 ru Exp $
+
+Note: If you modify these files, please keep hier(7) updated!
These files are used to create empty file hierarchies for building the
system into. Some notes about working with them are placed here to try
View
23 freebsd4/etc/rc.network6
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD: src/etc/rc.network6,v 1.5.2.22 2002/04/16 18:43:52 ume Exp $
+# $FreeBSD: src/etc/rc.network6,v 1.5.2.23 2002/07/24 18:25:42 ume Exp $
#
# Note that almost all of the user-configurable behavior is not in this
@@ -170,18 +170,19 @@ network6_pass1() {
# setup faith
network6_faith_setup
- case ${ipv6_gateway_enable} in
+ # ipv6_router
+ case ${ipv6_router_enable} in
[Yy][Ee][Ss])
- # ipv6_router
- case ${ipv6_router_enable} in
- [Yy][Ee][Ss])
- if [ -x ${ipv6_router} ]; then
- echo -n " ${ipv6_router}"
- ${ipv6_router} ${ipv6_router_flags}
- fi
- ;;
- esac
+ if [ -x ${ipv6_router} ]; then
+ echo -n " ${ipv6_router}"
+ ${ipv6_router} ${ipv6_router_flags}
+ fi
+ ;;
+ esac
+
+ case ${ipv6_gateway_enable} in
+ [Yy][Ee][Ss])
# rtadvd
# This should enabled with a great care.
# You may want to fine-tune /etc/rtadvd.conf.
View
11 freebsd4/sbin/ifconfig/ifconfig.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94
-.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.27.2.19 2002/05/14 17:42:38 brian Exp $
+.\" $FreeBSD: src/sbin/ifconfig/ifconfig.8,v 1.27.2.21 2002/08/30 14:23:38 sobomax Exp $
.\"
.Dd July 2, 2001
.Dt IFCONFIG 8
@@ -235,6 +235,10 @@ Enable driver dependent debugging code; usually, this turns on
extra console error logging.
.It Fl debug
Disable driver dependent debugging code.
+.It Cm promisc
+Put interface into permanently promiscuous mode.
+.It Fl promisc
+Disable permanently promiscuous mode.
.It Cm delete
Another name for the
.Fl alias
@@ -248,6 +252,11 @@ the system will not attempt to
transmit messages through that interface.
If possible, the interface will be reset to disable reception as well.
This action does not automatically disable routes using the interface.
+.It Cm eui64
+(Inet6 only.)
+Fill interface index
+.Pq lowermost 64bit of an IPv6 address
+automatically.
.\" .It Cm ipdst
.\" This is used to specify an Internet host who is willing to receive
.\" ip packets encapsulating NS packets bound for a remote network.
View
49 freebsd4/sbin/ifconfig/ifconfig.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#endif
static const char rcsid[] =
- "$FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.51.2.16 2002/04/03 11:48:48 ru Exp $";
+ "$FreeBSD: src/sbin/ifconfig/ifconfig.c,v 1.51.2.18 2002/08/30 14:23:38 sobomax Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -98,6 +98,7 @@ static const char rcsid[] =
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <ifaddrs.h>
#include "ifconfig.h"
@@ -175,6 +176,7 @@ c_func setip6flags;
c_func setip6pltime;
c_func setip6vltime;
c_func2 setip6lifetime;
+c_func setip6eui64;
#endif
c_func setifipdst;
c_func setifflags, setifmetric, setifmtu, setifcap;
@@ -200,6 +202,8 @@ struct cmd {
{ "-arp", IFF_NOARP, setifflags },
{ "debug", IFF_DEBUG, setifflags },
{ "-debug", -IFF_DEBUG, setifflags },
+ { "promisc", IFF_PPROMISC, setifflags },
+ { "-promisc", -IFF_PPROMISC, setifflags },
{ "add", IFF_UP, notealias },
{ "alias", IFF_UP, notealias },
{ "-alias", -IFF_UP, notealias },
@@ -222,6 +226,7 @@ struct cmd {
{ "-autoconf", -IN6_IFF_AUTOCONF, setip6flags },
{ "pltime", NEXTARG, setip6pltime },
{ "vltime", NEXTARG, setip6vltime },
+ { "eui64", 0, setip6eui64 },
#endif
{ "range", NEXTARG, setatrange },
{ "phase", NEXTARG, setatphase },
@@ -947,6 +952,43 @@ setip6lifetime(cmd, val, s, afp)
in6_addreq.ifra_lifetime.ia6t_pltime = newval;
}
}
+
+void
+setip6eui64(cmd, dummy, s, afp)
+ const char *cmd;
+ int dummy __unused;
+ int s;
+ const struct afswtch *afp;
+{
+ struct ifaddrs *ifap, *ifa;
+ const struct sockaddr_in6 *sin6 = NULL;
+ const struct in6_addr *lladdr = NULL;
+ struct in6_addr *in6;
+
+ if (afp->af_af != AF_INET6)
+ errx(EXIT_FAILURE, "%s not allowed for the AF", cmd);
+ in6 = (struct in6_addr *)&in6_addreq.ifra_addr.sin6_addr;
+ if (memcmp(&in6addr_any.s6_addr[8], &in6->s6_addr[8], 8) != 0)
+ errx(EXIT_FAILURE, "interface index is already filled");
+ if (getifaddrs(&ifap) != 0)
+ err(EXIT_FAILURE, "getifaddrs");
+ for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (ifa->ifa_addr->sa_family == AF_INET6 &&
+ strcmp(ifa->ifa_name, name) == 0) {
+ sin6 = (const struct sockaddr_in6 *)ifa->ifa_addr;
+ if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) {
+ lladdr = &sin6->sin6_addr;
+ break;
+ }
+ }
+ }
+ if (!lladdr)
+ errx(EXIT_FAILURE, "could not determine link local address");
+
+ memcpy(&in6->s6_addr[8], &lladdr->s6_addr[8], 8);
+
+ freeifaddrs(ifap);
+}
#endif
void
@@ -1028,14 +1070,15 @@ setifflags(vname, value, s, afp)
exit(1);
}
strncpy(my_ifr.ifr_name, name, sizeof (my_ifr.ifr_name));
- flags = my_ifr.ifr_flags;
+ flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16);
if (value < 0) {
value = -value;
flags &= ~value;
} else
flags |= value;
- my_ifr.ifr_flags = flags;
+ my_ifr.ifr_flags = flags & 0xffff;
+ my_ifr.ifr_flagshigh = flags >> 16;
if (ioctl(s, SIOCSIFFLAGS, (caddr_t)&my_ifr) < 0)
Perror(vname);
}
View
8 freebsd4/sbin/route/route.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)route.8 8.3 (Berkeley) 3/19/94
-.\" $FreeBSD: src/sbin/route/route.8,v 1.17.2.7 2001/10/02 10:04:01 ru Exp $
+.\" $FreeBSD: src/sbin/route/route.8,v 1.17.2.8 2002/07/24 12:55:09 ru Exp $
.\"
.Dd June 8, 2001
.Dt ROUTE 8
@@ -73,7 +73,11 @@ to forget this, especially when attempting to repair networking operations).
.It Fl v
(verbose) Print additional details.
.It Fl q
-Suppress all output.
+Suppress all output from the
+.Cm add , delete ,
+and
+.Cm flush
+commands.
.El
.Pp
The
View
105 freebsd4/sbin/route/route.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$FreeBSD: src/sbin/route/route.c,v 1.40.2.7 2002/02/01 11:48:00 ru Exp $";
+ "$FreeBSD: src/sbin/route/route.c,v 1.40.2.9 2002/07/24 12:55:09 ru Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -112,6 +112,9 @@ char *atalk_ntoa __P((struct at_addr));
const char *routename(), *netname();
void flushroutes(), newroute(), monitor(), sockaddr(), sodump(), bprintf();
void print_getmsg(), print_rtmsg(), pmsg_common(), pmsg_addrs(), mask_addr();
+#ifdef INET6
+static int inet6_makenetandmask __P((struct sockaddr_in6 *, char *));
+#endif
int getaddr(), rtmsg(), x25_makemask();
int prefixlen();
extern char *iso_ntoa();
@@ -775,38 +778,39 @@ newroute(argc, argv)
}
if (*cmd == 'g')
exit(0);
- oerrno = errno;
- (void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
- if (*gateway) {
- (void) printf(": gateway %s", gateway);
- if (attempts > 1 && ret == 0 && af == AF_INET)
- (void) printf(" (%s)",
- inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
- }
- if (ret == 0) {
- (void) printf("\n");
- exit(0);
- } else {
- switch (oerrno) {
- case ESRCH:
- err = "not in table";
- break;
- case EBUSY:
- err = "entry in use";
- break;
- case ENOBUFS:
- err = "routing table overflow";
- break;
- case EDQUOT: /* handle recursion avoidance in rt_setgate() */
- err = "gateway uses the same route";
- break;
- default:
- err = strerror(oerrno);
- break;
+ if (!qflag) {
+ oerrno = errno;
+ (void) printf("%s %s %s", cmd, ishost? "host" : "net", dest);
+ if (*gateway) {
+ (void) printf(": gateway %s", gateway);
+ if (attempts > 1 && ret == 0 && af == AF_INET)
+ (void) printf(" (%s)",
+ inet_ntoa(((struct sockaddr_in *)&route.rt_gateway)->sin_addr));
+ }
+ if (ret == 0) {
+ (void) printf("\n");
+ } else {
+ switch (oerrno) {
+ case ESRCH:
+ err = "not in table";
+ break;
+ case EBUSY:
+ err = "entry in use";
+ break;
+ case ENOBUFS:
+ err = "routing table overflow";
+ break;
+ case EDQUOT: /* handle recursion avoidance in rt_setgate() */
+ err = "gateway uses the same route";
+ break;
+ default:
+ err = strerror(oerrno);
+ break;
+ }
+ (void) printf(": %s\n", err);
}
- (void) printf(": %s\n", err);
- exit(1);
}
+ exit(ret != 0);
}
void
@@ -853,6 +857,38 @@ inet_makenetandmask(net, sin, bits)
sin->sin_len = 1 + cp - (char *)sin;
}
+#ifdef INET6
+/*
+ * XXX the function may need more improvement...
+ */
+static int
+inet6_makenetandmask(sin6, plen)
+ struct sockaddr_in6 *sin6;
+ char *plen;
+{
+ struct in6_addr in6;
+
+ if (!plen) {
+ if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr) &&
+ sin6->sin6_scope_id == 0) {
+ plen = "0";
+ } else if ((sin6->sin6_addr.s6_addr[0] & 0xe0) == 0x20) {
+ /* aggregatable global unicast - RFC2374 */
+ memset(&in6, 0, sizeof(in6));
+ if (!memcmp(&sin6->sin6_addr.s6_addr[8],
+ &in6.s6_addr[8], 8))
+ plen = "64";
+ }
+ }
+
+ if (!plen || strcmp(plen, "128") == 0)
+ return 1;
+ rtm_addrs |= RTA_NETMASK;
+ (void)prefixlen(plen);
+ return 0;
+}
+#endif
+
/*
* Interpret an argument as a network address of some kind,
* returning 1 if a host address, 0 if a network address.
@@ -954,6 +990,9 @@ getaddr(which, s, hpp)
{
struct addrinfo hints, *res;
+ q = NULL;
+ if (which == RTA_DST && (q = strchr(s, '/')) != NULL)
+ *q = '\0';
memset(&hints, 0, sizeof(hints));
hints.ai_family = afamily; /*AF_INET6*/
hints.ai_flags = AI_NUMERICHOST;
@@ -975,6 +1014,10 @@ getaddr(which, s, hpp)
}
#endif
freeaddrinfo(res);
+ if (q != NULL)
+ *q++ = '/';
+ if (which == RTA_DST)
+ return (inet6_makenetandmask(&su->sin6, q));
return (0);
}
#endif /* INET6 */
View
6 freebsd4/usr.bin/netstat/mroute6.c
@@ -64,7 +64,7 @@
* SUCH DAMAGE.
*
* @(#)mroute.c 8.2 (Berkeley) 4/28/95
- * $FreeBSD: src/usr.bin/netstat/mroute6.c,v 1.1.2.8 2001/09/17 14:53:17 ru Exp $
+ * $FreeBSD: src/usr.bin/netstat/mroute6.c,v 1.1.2.9 2002/07/09 04:05:20 suz Exp $
*/
#ifdef INET6
@@ -214,7 +214,7 @@ mrt6_stats(u_long mstaddr)
p(mrt6s_mfc_lookups, "\t%llu multicast forwarding cache lookup%s\n");
p2(mrt6s_mfc_misses, "\t%llu multicast forwarding cache miss%s\n");
p(mrt6s_upcalls, "\t%llu upcall%s to mrouted\n");
- p(mrt6s_upq_ovflw, "\t%llu upcall llueue overflow%s\n");
+ p(mrt6s_upq_ovflw, "\t%llu upcall queue overflow%s\n");
p(mrt6s_upq_sockfull,
"\t%llu upcall%s dropped due to full socket buffer\n");
p(mrt6s_cache_cleanups, "\t%llu cache cleanup%s\n");
@@ -224,7 +224,7 @@ mrt6_stats(u_long mstaddr)
p(mrt6s_wrong_if, "\t%llu datagram%s arrived on wrong interface\n");
p(mrt6s_drop_sel, "\t%llu datagram%s selectively dropped\n");
p(mrt6s_q_overflow,
- "\t%llu datagram%s dropped due to llueue overflow\n");
+ "\t%llu datagram%s dropped due to queue overflow\n");
p(mrt6s_pkt2large, "\t%llu datagram%s dropped for being too large\n");
#undef p2
View
267 freebsd4/usr.bin/netstat/route.c
@@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/route.c,v 1.41.2.12 2002/04/08 08:01:51 ru Exp $";
+ "$FreeBSD: src/usr.bin/netstat/route.c,v 1.41.2.14 2002/07/17 02:22:22 kbyanc Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -126,12 +126,18 @@ struct radix_node_head *rt_tables[AF_MAX+1];
int NewTree = 0;
static struct sockaddr *kgetsa (struct sockaddr *);
+static void size_cols (int ef, struct radix_node *rn);
+static void size_cols_tree (struct radix_node *rn);
+static void size_cols_rtentry (struct rtentry *rt);
static void p_tree (struct radix_node *);
static void p_rtnode (void);
static void ntreestuff (void);
static void np_rtentry (struct rt_msghdr *);
static void p_sockaddr (struct sockaddr *, struct sockaddr *, int, int);
+static const char *fmt_sockaddr (struct sockaddr *sa, struct sockaddr *mask,
+ int flags);
static void p_flags (int, char *);
+static const char *fmt_flags(int f);
static void p_rtentry (struct rtentry *);
static u_long forgemask (u_long);
static void domask (char *, u_long, u_long);
@@ -166,6 +172,7 @@ routepr(u_long rtree)
p_tree(head.rnh_treetop);
}
} else if (af == AF_UNSPEC || af == i) {
+ size_cols(i, head.rnh_treetop);
pr_family(i);
do_rtent = 1;
pr_rthdr(i);
@@ -224,17 +231,134 @@ pr_family(int af)
/* column widths; each followed by one space */
#ifndef INET6
-#define WID_DST(af) 18 /* width of destination column */
-#define WID_GW(af) 18 /* width of gateway column */
-#define WID_IF(af) 6 /* width of netif column */
+#define WID_DST_DEFAULT(af) 18 /* width of destination column */
+#define WID_GW_DEFAULT(af) 18 /* width of gateway column */
+#define WID_IF_DEFAULT(af) 6 /* width of netif column */
#else
-#define WID_DST(af) \
- ((af) == AF_INET6 ? (Wflag ? 39 : (numeric_addr ? 33: 18)) : 18)
-#define WID_GW(af) \
- ((af) == AF_INET6 ? (Wflag ? 31 : (numeric_addr ? 29 : 18)) : 18)
-#define WID_IF(af) ((af) == AF_INET6 ? 8 : 6)
+#define WID_DST_DEFAULT(af) \
+ ((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18)
+#define WID_GW_DEFAULT(af) \
+ ((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18)
+#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : 6)
#endif /*INET6*/
+static int wid_dst;
+static int wid_gw;
+static int wid_flags;
+static int wid_refs;
+static int wid_use;
+static int wid_mtu;
+static int wid_if;
+static int wid_expire;
+
+static void
+size_cols(int ef, struct radix_node *rn)
+{
+ wid_dst = WID_DST_DEFAULT(ef);
+ wid_gw = WID_GW_DEFAULT(ef);
+ wid_flags = 6;
+ wid_refs = 6;
+ wid_use = 8;
+ wid_mtu = 6;
+ wid_if = WID_IF_DEFAULT(ef);
+ wid_expire = 6;
+
+ if (Wflag)
+ size_cols_tree(rn);
+}
+
+static void
+size_cols_tree(struct radix_node *rn)
+{
+again:
+ kget(rn, rnode);
+ if (rnode.rn_bit < 0) {
+ if ((rnode.rn_flags & RNF_ROOT) == 0) {
+ kget(rn, rtentry);
+ size_cols_rtentry(&rtentry);
+ }
+ if ((rn = rnode.rn_dupedkey))
+ goto again;
+ } else {
+ rn = rnode.rn_right;
+ size_cols_tree(rnode.rn_left);
+ size_cols_tree(rn);
+ }
+}
+
+static void
+size_cols_rtentry(struct rtentry *rt)
+{
+ static struct ifnet ifnet, *lastif;
+ struct rtentry parent;
+ static char buffer[100];
+ const char *bp;
+ struct sockaddr *sa;
+ sa_u addr, mask;
+ int len;
+
+ /*
+ * Don't print protocol-cloned routes unless -a.
+ */
+ if (rt->rt_flags & RTF_WASCLONED && !aflag) {
+ kget(rt->rt_parent, parent);
+ if (parent.rt_flags & RTF_PRCLONING)
+ return;
+ }
+
+ bzero(&addr, sizeof(addr));
+ if ((sa = kgetsa(rt_key(rt))))
+ bcopy(sa, &addr, sa->sa_len);
+ bzero(&mask, sizeof(mask));
+ if (rt_mask(rt) && (sa = kgetsa(rt_mask(rt))))
+ bcopy(sa, &mask, sa->sa_len);
+ bp = fmt_sockaddr(&addr.u_sa, &mask.u_sa, rt->rt_flags);
+ len = strlen(bp);
+ wid_dst = MAX(len, wid_dst);
+
+ bp = fmt_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST);
+ len = strlen(bp);
+ wid_gw = MAX(len, wid_gw);
+
+ bp = fmt_flags(rt->rt_flags);
+ len = strlen(bp);
+ wid_flags = MAX(len, wid_flags);
+
+ if (addr.u_sa.sa_family == AF_INET || Wflag) {
+ len = snprintf(buffer, sizeof(buffer), "%ld", rt->rt_refcnt);
+ wid_refs = MAX(len, wid_refs);
+ len = snprintf(buffer, sizeof(buffer), "%lu", rt->rt_use);
+ wid_use = MAX(len, wid_use);
+ if (Wflag && rt->rt_rmx.rmx_mtu != 0) {
+ len = snprintf(buffer, sizeof(buffer),
+ "%lu", rt->rt_rmx.rmx_mtu);
+ wid_mtu = MAX(len, wid_mtu);
+ }
+ }
+ if (rt->rt_ifp) {
+ if (rt->rt_ifp != lastif) {
+ len = snprintf(buffer, sizeof(buffer), "%d",
+ ifnet.if_unit);
+ kget(rt->rt_ifp, ifnet);
+ kread((u_long)ifnet.if_name, buffer, sizeof(buffer));
+ lastif = rt->rt_ifp;
+ len += strlen(buffer);
+ wid_if = MAX(len, wid_if);
+ }
+ if (rt->rt_rmx.rmx_expire) {
+ time_t expire_time;
+
+ if ((expire_time =
+ rt->rt_rmx.rmx_expire - time(NULL)) > 0) {
+ snprintf(buffer, sizeof(buffer), "%d",
+ (int)expire_time);
+ wid_expire = MAX(len, wid_expire);
+ }
+ }
+ }
+}
+
+
/*
* Print header for routing table columns.
*/
@@ -244,24 +368,35 @@ pr_rthdr(int af)
if (Aflag)
printf("%-8.8s ","Address");
- if (af == AF_INET || Wflag)
- if (Wflag)
- printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %6.6s %*.*s %6s\n",
- WID_DST(af), WID_DST(af), "Destination",
- WID_GW(af), WID_GW(af), "Gateway",
- "Flags", "Refs", "Use", "Mtu",
- WID_IF(af), WID_IF(af), "Netif", "Expire");
- else
- printf("%-*.*s %-*.*s %-6.6s %6.6s %8.8s %*.*s %6s\n",
- WID_DST(af), WID_DST(af), "Destination",
- WID_GW(af), WID_GW(af), "Gateway",
- "Flags", "Refs", "Use",
- WID_IF(af), WID_IF(af), "Netif", "Expire");
- else
- printf("%-*.*s %-*.*s %-6.6s %8.8s %6s\n",
- WID_DST(af), WID_DST(af), "Destination",
- WID_GW(af), WID_GW(af), "Gateway",
- "Flags", "Netif", "Expire");
+ if (af == AF_INET || Wflag) {
+ if (Wflag) {
+ printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*.*s %*s\n",
+ wid_dst, wid_dst, "Destination",
+ wid_gw, wid_gw, "Gateway",
+ wid_flags, wid_flags, "Flags",
+ wid_refs, wid_refs, "Refs",
+ wid_use, wid_use, "Use",
+ wid_mtu, wid_mtu, "Mtu",
+ wid_if, wid_if, "Netif",
+ wid_expire, "Expire");
+ } else {
+ printf("%-*.*s %-*.*s %-*.*s %*.*s %*.*s %*.*s %*s\n",
+ wid_dst, wid_dst, "Destination",
+ wid_gw, wid_gw, "Gateway",
+ wid_flags, wid_flags, "Flags",
+ wid_refs, wid_refs, "Refs",
+ wid_use, wid_use, "Use",
+ wid_if, wid_if, "Netif",
+ wid_expire, "Expire");
+ }
+ } else {
+ printf("%-*.*s %-*.*s %-*.*s %*.*s %*s\n",
+ wid_dst, wid_dst, "Destination",
+ wid_gw, wid_gw, "Gateway",
+ wid_flags, wid_flags, "Flags",
+ wid_if, wid_if, "Netif",
+ wid_expire, "Expire");
+ }
}
static struct sockaddr *
@@ -422,8 +557,26 @@ np_rtentry(struct rt_msghdr *rtm)
static void
p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
{
- char workbuf[128], *cplim;
- register char *cp = workbuf;
+ const char *cp;
+
+ cp = fmt_sockaddr(sa, mask, flags);
+
+ if (width < 0 )
+ printf("%s ", cp);
+ else {
+ if (numeric_addr)
+ printf("%-*s ", width, cp);
+ else
+ printf("%-*.*s ", width, width, cp);
+ }
+}
+
+static const char *
+fmt_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags)
+{
+ static char workbuf[128];
+ char *cplim;
+ char *cp = workbuf;
switch(sa->sa_family) {
case AF_INET:
@@ -516,7 +669,7 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
case IFT_ETHER:
if (sdl->sdl_alen == ETHER_ADDR_LEN) {
cp = ether_ntoa((struct ether_addr *)
- sdl->sdl_data + sdl->sdl_nlen);
+ (sdl->sdl_data + sdl->sdl_nlen));
break;
}
/* FALLTHROUGH */
@@ -542,27 +695,28 @@ p_sockaddr(struct sockaddr *sa, struct sockaddr *mask, int flags, int width)
cp = workbuf;
}
}
- if (width < 0 )
- printf("%s ", cp);
- else {
- if (numeric_addr)
- printf("%-*s ", width, cp);
- else
- printf("%-*.*s ", width, width, cp);
- }
+
+ return (cp);
}
static void
p_flags(int f, char *format)
{
- char name[33], *flags;
- register struct bits *p = bits;
+ printf(format, fmt_flags(f));
+}
+
+static const char *
+fmt_flags(int f)
+{
+ static char name[33];
+ char *flags;
+ struct bits *p = bits;
for (flags = name; p->b_mask; p++)
if (p->b_mask & f)
*flags++ = p->b_val;
*flags = '\0';
- printf(format, name);
+ return (name);
}
static void
@@ -570,8 +724,8 @@ p_rtentry(struct rtentry *rt)
{
static struct ifnet ifnet, *lastif;
struct rtentry parent;
- static char name[16];
- static char prettyname[9];
+ static char buffer[128];
+ static char prettyname[128];
struct sockaddr *sa;
sa_u addr, mask;
@@ -590,36 +744,35 @@ p_rtentry(struct rtentry *rt)
bzero(&mask, sizeof(mask));
if (rt_mask(rt) && (sa = kgetsa(rt_mask(rt))))
bcopy(sa, &mask, sa->sa_len);
- p_sockaddr(&addr.u_sa, &mask.u_sa, rt->rt_flags,
- WID_DST(addr.u_sa.sa_family));
- p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST,
- WID_GW(addr.u_sa.sa_family));
- p_flags(rt->rt_flags, "%-6.6s ");
+ p_sockaddr(&addr.u_sa, &mask.u_sa, rt->rt_flags, wid_dst);
+ p_sockaddr(kgetsa(rt->rt_gateway), NULL, RTF_HOST, wid_gw);
+ snprintf(buffer, sizeof(buffer), "%%-%d.%ds ", wid_flags, wid_flags);
+ p_flags(rt->rt_flags, buffer);
if (addr.u_sa.sa_family == AF_INET || Wflag) {
- printf("%6ld %8ld ", rt->rt_refcnt, rt->rt_use);
+ printf("%*ld %*lu ", wid_refs, rt->rt_refcnt,
+ wid_use, rt->rt_use);
if (Wflag) {
if (rt->rt_rmx.rmx_mtu != 0)
- printf("%6lu ", rt->rt_rmx.rmx_mtu);
+ printf("%*lu ", wid_mtu, rt->rt_rmx.rmx_mtu);
else
- printf("%6s ", "");
+ printf("%*s ", wid_mtu, "");
}
}
if (rt->rt_ifp) {
if (rt->rt_ifp != lastif) {
kget(rt->rt_ifp, ifnet);
- kread((u_long)ifnet.if_name, name, 16);
+ kread((u_long)ifnet.if_name, buffer, sizeof(buffer));
lastif = rt->rt_ifp;
- snprintf(prettyname, sizeof prettyname,
- "%s%d", name, ifnet.if_unit);
+ snprintf(prettyname, sizeof(prettyname),
+ "%s%d", buffer, ifnet.if_unit);
}
- printf("%*.*s", WID_IF(addr.u_sa.sa_family),
- WID_IF(addr.u_sa.sa_family), prettyname);
+ printf("%*.*s", wid_if, wid_if, prettyname);
if (rt->rt_rmx.rmx_expire) {
time_t expire_time;
if ((expire_time =
rt->rt_rmx.rmx_expire - time((time_t *)0)) > 0)
- printf(" %6d", (int)expire_time);
+ printf(" %*d", wid_expire, (int)expire_time);
}
if (rt->rt_nodes[0].rn_dupedkey)
printf(" =>");
View
7 freebsd4/usr.bin/tftp/tftp.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)tftp.1 8.2 (Berkeley) 4/18/94
-.\" $FreeBSD: src/usr.bin/tftp/tftp.1,v 1.4.2.6 2002/04/26 17:22:43 ume Exp $
+.\" $FreeBSD: src/usr.bin/tftp/tftp.1,v 1.4.2.7 2002/06/21 15:29:33 charnier Exp $
.\"
.Dd April 18, 1994
.Dt TFTP 1
@@ -42,8 +42,9 @@
.Nm
.Op Ar host
.Sh DESCRIPTION
-.Nm Tftp
-is the user interface to the Internet
+The
+.Nm
+utility is the user interface to the Internet
.Tn TFTP
(Trivial File Transfer Protocol),
which allows users to transfer files to and from a remote machine.
View
10 freebsd4/usr.bin/wall/wall.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)wall.1 8.1 (Berkeley) 6/6/93
-.\" $FreeBSD: src/usr.bin/wall/wall.1,v 1.3.2.3 2001/10/05 15:21:42 ru Exp $
+.\" $FreeBSD: src/usr.bin/wall/wall.1,v 1.3.2.5 2002/07/15 08:14:59 keramida Exp $
.\"
.Dd June 6, 1993
.Dt WALL 1
@@ -43,8 +43,9 @@
.Op Fl g Ar group
.Op Ar file
.Sh DESCRIPTION
-.Nm Wall
-displays the contents of
+The
+.Nm
+utility displays the contents of
.Ar file
or, by default, its standard input, on the terminals of all
currently logged in users.
@@ -67,5 +68,4 @@ receive the message.
.Sh HISTORY
A
.Nm
-command appeared in
-.At v7 .
+command appeared in PWB UNIX.
Please sign in to comment.
Something went wrong with that request. Please try again.