Browse Source

Plan 9 from Bell Labs 2003-04-23

David du Colombier 17 years ago
parent
commit
c262c9fbe4

+ 7 - 7
dist/replica/plan9.db

@@ -260,7 +260,7 @@
 386/bin/ip/httpd/save - 775 sys sys 1045538021 130989
 386/bin/ip/httpd/wikipost - 775 sys sys 1045538021 111347
 386/bin/ip/imap4d - 775 sys sys 1048799694 233020
-386/bin/ip/ipconfig - 775 sys sys 1050868852 102454
+386/bin/ip/ipconfig - 775 sys sys 1051028319 103751
 386/bin/ip/ping - 775 sys sys 1039758569 74005
 386/bin/ip/ppp - 775 sys sys 1050419687 215306
 386/bin/ip/pppoe - 775 sys sys 1050419688 75481
@@ -2675,7 +2675,7 @@ lib/kana - 664 sys sys 944943772 1061
 lib/katakana - 664 sys sys 944943772 982
 lib/keyboard - 664 sys sys 984694514 25842
 lib/mammals - 664 sys sys 944943772 27760
-lib/namespace - 664 sys sys 1048777128 590
+lib/namespace - 664 sys sys 1051022248 606
 lib/namespace.ftp - 664 sys sys 1020313578 373
 lib/namespace.httpd - 664 sys sys 984695868 1209
 lib/ndb - 20000000775 sys sys 959260770 0
@@ -2988,7 +2988,7 @@ rc/bin/termrc - 775 sys sys 1038278927 2637
 rc/bin/tlsclienttunnel - 775 sys sys 1024375633 153
 rc/bin/tlssrvtunnel - 775 sys sys 1024375634 175
 rc/bin/troff2gif - 775 sys sys 1045504085 178
-rc/bin/ups - 775 sys sys 1042567965 989
+rc/bin/ups - 775 sys sys 1051028686 889
 rc/bin/usbstart - 775 sys sys 1044894155 81
 rc/bin/usps - 775 sys sys 1016826030 450
 rc/bin/vwhois - 775 sys sys 953999875 294
@@ -3290,7 +3290,7 @@ sys/include/libc.h - 664 sys sys 1049426002 18829
 sys/include/libsec.h - 664 sys sys 1048616895 8914
 sys/include/mach.h - 664 sys sys 1032058231 8101
 sys/include/memdraw.h - 664 sys sys 1039752978 5616
-sys/include/memlayer.h - 664 sys sys 1014929065 1810
+sys/include/memlayer.h - 664 sys sys 1051031022 1851
 sys/include/mouse.h - 664 sys sys 1035232010 1003
 sys/include/mp.h - 664 sys sys 1014929065 4610
 sys/include/ndb.h - 664 sys sys 1032058245 3781
@@ -9051,7 +9051,7 @@ sys/src/cmd/ip/imap4d/nodes.c - 664 sys sys 1015013077 3173
 sys/src/cmd/ip/imap4d/search.c - 664 sys sys 1015013077 4520
 sys/src/cmd/ip/imap4d/store.c - 664 sys sys 1015013077 1910
 sys/src/cmd/ip/imap4d/utils.c - 664 sys sys 1015013077 2481
-sys/src/cmd/ip/ipconfig.c - 664 sys sys 1050714671 27099
+sys/src/cmd/ip/ipconfig.c - 664 sys sys 1051023520 27439
 sys/src/cmd/ip/measure.c - 664 sys sys 944961011 3733
 sys/src/cmd/ip/mkfile - 664 sys sys 1038443023 1222
 sys/src/cmd/ip/ping.c - 664 sys sys 1032059854 5046
@@ -11532,7 +11532,7 @@ sys/src/libmemdraw/unload.c - 664 sys sys 944961742 435
 sys/src/libmemdraw/write.c - 664 sys sys 1014930217 4375
 sys/src/libmemlayer - 20000000775 sys sys 984710301 0
 sys/src/libmemlayer/draw.c - 664 sys sys 1045933975 4082
-sys/src/libmemlayer/lalloc.c - 664 sys sys 1039752979 1760
+sys/src/libmemlayer/lalloc.c - 664 sys sys 1051031021 1781
 sys/src/libmemlayer/layerop.c - 664 sys sys 1039752979 2641
 sys/src/libmemlayer/ldelete.c - 664 sys sys 1039752979 1183
 sys/src/libmemlayer/lhide.c - 664 sys sys 1039752980 1693
@@ -11540,7 +11540,7 @@ sys/src/libmemlayer/line.c - 664 sys sys 1039752980 2587
 sys/src/libmemlayer/load.c - 664 sys sys 1039752980 1032
 sys/src/libmemlayer/lorigin.c - 664 sys sys 1039752981 2507
 sys/src/libmemlayer/lsetrefresh.c - 664 sys sys 944961743 703
-sys/src/libmemlayer/ltofront.c - 664 sys sys 952290597 1170
+sys/src/libmemlayer/ltofront.c - 664 sys sys 1051031021 1307
 sys/src/libmemlayer/ltorear.c - 664 sys sys 944961743 1062
 sys/src/libmemlayer/makefile - 664 sys sys 944961743 821
 sys/src/libmemlayer/mkfile - 664 sys sys 1039752977 365

+ 8 - 0
dist/replica/plan9.log

@@ -19201,3 +19201,11 @@
 1050868866 22 c 386/lib/libip.a - 664 sys sys 1050868861 32560
 1050868866 23 c 386/lib/libndb.a - 664 sys sys 1050868862 52836
 1050868866 24 c 386/lib/libsunrpc.a - 664 sys sys 1050868863 357292
+1051023538 0 c lib/namespace - 664 sys sys 1051022248 606
+1051023538 1 c sys/src/cmd/ip/ipconfig.c - 664 sys sys 1051023520 27439
+1051025465 0 c 386/bin/ip/ipconfig - 775 sys sys 1051024784 102973
+1051029069 0 c 386/bin/ip/ipconfig - 775 sys sys 1051028319 103751
+1051029069 1 c rc/bin/ups - 775 sys sys 1051028686 889
+1051032672 0 c sys/include/memlayer.h - 664 sys sys 1051031022 1851
+1051032672 1 c sys/src/libmemlayer/lalloc.c - 664 sys sys 1051031021 1781
+1051032672 2 c sys/src/libmemlayer/ltofront.c - 664 sys sys 1051031021 1307

+ 1 - 0
lib/namespace

@@ -10,6 +10,7 @@ bind -c #e /env
 bind #p /proc
 bind -c #s /srv
 bind -a #¤ /dev
+bind -a #S /dev
 
 # mount points
 mount /srv/slashn /n

+ 17 - 12
rc/bin/ups

@@ -1,9 +1,9 @@
 #!/bin/rc
 
 # lucent web proxy caches the page; defeat it
-# rfork n
-# if(! test -d /net.alt/tcp) import achille /net.alt
-# bind /net.alt /net
+#LU rfork n
+#LU if(! test -d /net.alt/tcp) import achille /net.alt
+#LU bind /net.alt /net
 
 
 if(! ~ $#* 1) {
@@ -22,16 +22,21 @@ x=$"x
 x=`{echo $x | sed 's/ /\&/g'}
 x=$"x
 x=$x^'&tdts1.x=19&tdts1.y=7'
-hget -p $x http://wwwapps.ups.com/etracking/tracking.cgi | htmlfmt >/tmp/ups.2
+hget -p $x http://wwwapps.ups.com/etracking/tracking.cgi >/tmp/ups.2
 
-# to first blank line, output is a simple two-column table, followed by a blank line
-# after that it's a five column table followed by a blank line
-# after that it's UPS stuff starting 'Tracking results'
-sam -d /tmp/ups.2 >[2] /dev/null <<'!'
-/^Tracking results.*\n/p
-!echo
+sed 's/<[Tt][Dd]>/& «TD»/g; s/<[Tt][Rr]>/&<td> «TR» /g' /tmp/ups.2 |
+	htmlfmt >/tmp/ups.3
+sam -d /tmp/ups.3 >[2] /dev/null <<'!'
+/^Tracking results.*/p
 .,$d
-1,/^$/ s/:\n/: /g
-/^PACKAGE/,$y/(Activity|SCAN|RECEIVED|DELIVERED|DELIVERY)\n/ g/./ s/\n/ /g
+/View Details/d
+1,.d
+,s/\n/ /g
+,s/«TR»/\n/g
+,s/«TD»/	/g
+,s/ *	 */	/g
+,s/^[ 	]*//g
+,s/[ 	]*$//g
+,s/\n\n+/\n\n/g
 ,p
 !

+ 1 - 0
sys/include/memlayer.h

@@ -40,6 +40,7 @@ void			memldelete(Memimage*);
 void			memlfree(Memimage*);
 void			memltofront(Memimage*);
 void			memltofrontn(Memimage**, int);
+void			_memltofrontfill(Memimage*, int);
 void			memltorear(Memimage*);
 void			memltorearn(Memimage**, int);
 int			memlsetrefresh(Memimage*, Refreshfn, void*);

+ 16 - 2
sys/src/cmd/ip/ipconfig.c

@@ -11,6 +11,7 @@ int	myifc = -1;
 int	plan9 = 1;
 int	beprimary;
 int	nodhcpwatch;
+int	sendhostname;
 
 Ipifc	*ifc;
 
@@ -21,6 +22,7 @@ enum
 	Vremove,
 	Vunbind,
 	Vether,
+	Vloopback,
 };
 
 struct {
@@ -186,6 +188,7 @@ main(int argc, char **argv)
 		if(p == nil)
 			usage();
 		snprint(conf.hostname, sizeof(conf.hostname), "%s", p);
+		sendhostname = 1;
 		break;
 	case 'n':
 		noconfig = 1;
@@ -210,6 +213,15 @@ main(int argc, char **argv)
 		break;
 	} ARGEND;
 
+	// default to any host name we already have
+	if(*conf.hostname == 0){
+		p = getenv("sysname");
+		if(p == nil || *p == 0)
+			p = sysname();
+		if(p != nil)
+			strncpy(conf.hostname, p, sizeof(conf.hostname)-1);
+	}		
+
 	// default
 	conf.type = "ether";
 	conf.dev = "/net/ether0";
@@ -225,6 +237,7 @@ main(int argc, char **argv)
 			action = verb;
 			break;
 		case Vether:
+		case Vloopback:
 			conf.type = argv[0];
 			if(argc > 1){
 				conf.dev = argv[1];
@@ -755,7 +768,7 @@ dhcpsend(int type)
 		sysfatal("dhcpsend: unknown message type: %d", type);
 	case Discover:
 		ipmove(up->raddr, IPv4bcast);	// broadcast
-		if(*conf.hostname)
+		if(*conf.hostname && sendhostname)
 			p = optaddstr(p, OBhostname, conf.hostname);
 		if(plan9){
 			n = snprint((char*)vendor, sizeof(vendor), "plan9_%s", conf.cputype);
@@ -787,7 +800,7 @@ dhcpsend(int type)
 			p = optaddvec(p, ODvendorclass, vendor, n);
 		}
 		p = optaddvec(p, ODparams, requested, sizeof(requested));
-		if(*conf.hostname)
+		if(*conf.hostname && sendhostname)
 			p = optaddstr(p, OBhostname, conf.hostname);
 		break;	
 	case Release:
@@ -1402,6 +1415,7 @@ char *verbs[] = {
 [Vremove]	"remove",
 [Vunbind]	"unbind",
 [Vether]	"ether",
+[Vloopback]	"loopback",
 };
 
 // look for an action

+ 1 - 1
sys/src/libmemlayer/lalloc.c

@@ -63,7 +63,7 @@ memlalloc(Memscreen *s, Rectangle screenr, Refreshfn refreshfn, void *refreshptr
 	l->clear = 0;
 
 	/* now pull new window to front */
-	memltofront(n);
+	_memltofrontfill(n, val != DNofill);
 	l->refreshptr = refreshptr;
 
 	/*

+ 11 - 4
sys/src/libmemlayer/ltofront.c

@@ -10,7 +10,7 @@
 */
 static
 void
-_memltofront(Memimage *i, Memimage *front)
+_memltofront(Memimage *i, Memimage *front, int fill)
 {
 	Memlayer *l;
 	Memscreen *s;
@@ -43,15 +43,22 @@ _memltofront(Memimage *i, Memimage *front)
 		l->rear = f;
 		f->layer->front = i;
 		f->layer->rear = rr;
-		if(overlap)
+		if(overlap && fill)
 			memlexpose(i, x);
 	}
 }
 
+void
+_memltofrontfill(Memimage *i, int fill)
+{
+	_memltofront(i, nil, fill);
+	_memlsetclear(i->layer->screen);
+}
+
 void
 memltofront(Memimage *i)
 {
-	_memltofront(i, nil);
+	_memltofront(i, nil, 1);
 	_memlsetclear(i->layer->screen);
 }
 
@@ -66,7 +73,7 @@ memltofrontn(Memimage **ip, int n)
 	front = nil;
 	while(--n >= 0){
 		i = *ip++;
-		_memltofront(i, front);
+		_memltofront(i, front, 1);
 		front = i;
 	}
 	s = front->layer->screen;