changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > ventivac / changeset: forgot venti.m

changeset 117: 7286b24028ff
parent 116: acd72dbb39ff
child 118: bd3834e3d91a
author: Mechiel Lukkien <mechiel@ueber.net>
date: Fri, 17 Aug 2007 22:15:46 +0200
files: module/mkfile module/venti.m
description: forgot venti.m
     1.1--- a/module/mkfile	Fri Aug 17 22:01:33 2007 +0200
     1.2+++ b/module/mkfile	Fri Aug 17 22:15:46 2007 +0200
     1.3@@ -9,4 +9,4 @@
     1.4 	
     1.5 clean:QV:
     1.6 	
     1.7-install:V:	$MODDIR/vac.m $MODDIR/rabin.m
     1.8+install:V:	$MODDIR/vac.m $MODDIR/venti.m $MODDIR/rabin.m
     2.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2+++ b/module/venti.m	Fri Aug 17 22:15:46 2007 +0200
     2.3@@ -0,0 +1,159 @@
     2.4+Venti: module {
     2.5+	PATH:	con "/dis/lib/venti.dis";
     2.6+	Scoresize:		con 20;
     2.7+	Maxstringsize:	con 1000;
     2.8+	Authsize:		con  1024;  	# size of auth group - in bits - must be multiple of 8	
     2.9+	Maxfragsize:	con 9*1024;
    2.10+
    2.11+	Cryptostrengthnone,
    2.12+	Cryptostrengthauth,
    2.13+	Cryptostrengthweak,
    2.14+	Cryptostrengthstrong:	con iota;
    2.15+
    2.16+	Cryptonone,
    2.17+	CryptoSSL3,
    2.18+	CryptoTLS1,
    2.19+	Cryptomax:	con iota;
    2.20+
    2.21+	Codecnone,
    2.22+	Codecdeflate,
    2.23+	CodecThwack,
    2.24+	Codecmax:	con iota;
    2.25+
    2.26+	Terror,		# not used
    2.27+	Rerror,
    2.28+	Tping,
    2.29+	Rping,
    2.30+	Thello,
    2.31+	Rhello,
    2.32+	Tgoodbye,
    2.33+	Rgoodbye,	# not used
    2.34+	Tauth0,
    2.35+	Rauth0,
    2.36+	Tauth1,
    2.37+	Rauth1,
    2.38+	Tread,
    2.39+	Rread,
    2.40+	Twrite,
    2.41+	Rwrite,
    2.42+	Tsync,
    2.43+	Rsync,
    2.44+	Tmax:		con iota;
    2.45+
    2.46+	# versions
    2.47+	Version01,
    2.48+	Version02:	con iota + 1;
    2.49+
    2.50+	# Lump Types
    2.51+	Errtype,		# illegal
    2.52+
    2.53+	Roottype,
    2.54+	Dirtype,
    2.55+	Pointertype0,
    2.56+	Pointertype1,
    2.57+	Pointertype2,
    2.58+	Pointertype3,
    2.59+	Pointertype4,
    2.60+	Pointertype5,
    2.61+	Pointertype6,
    2.62+	Pointertype7,		# not used
    2.63+	Pointertype8,		# not used
    2.64+	Pointertype9,		# not used
    2.65+	Datatype,
    2.66+
    2.67+	Maxtype:		con iota;
    2.68+
    2.69+	# Dir Entry flags
    2.70+	Entryactive:	con (1<<0);			# entry is in use
    2.71+	Entrydir:		con (1<<1);			# a directory
    2.72+	Entrydepthshift: con 2;				# shift for pointer depth
    2.73+	Entrydepthmask: con (16r7<<2);		# mask for pointer depth
    2.74+	Entrylocal: con (1<<5);				# used for local storage: should not be set for venti blocks
    2.75+
    2.76+	Maxlumpsize:	con 56 * 1024;
    2.77+	Pointerdepth:	con 7;
    2.78+	Entrysize:		con 40;
    2.79+	Rootsize:		con 300;
    2.80+	Rootversion:	con 2;
    2.81+
    2.82+	Maxfilesize:	con (big 1 << 48) - big 1;
    2.83+
    2.84+	Vmsg: adt {
    2.85+		istmsg:	int;
    2.86+		tid:		int;
    2.87+		pick {
    2.88+		Thello =>
    2.89+			version:	string;
    2.90+			uid:		string;
    2.91+			cryptostrength:	int;
    2.92+			cryptos:	array of byte;
    2.93+			codecs:	array of byte;
    2.94+		Rhello =>
    2.95+			sid:		string;
    2.96+			crypto:	int;
    2.97+			codec:	int;
    2.98+		Tping =>
    2.99+		Rping =>
   2.100+		Tread =>
   2.101+			score:	Score;
   2.102+			etype:	int;
   2.103+			n:		int;
   2.104+		Rread =>
   2.105+			data:		array of byte;
   2.106+		Twrite =>
   2.107+			etype:	int;
   2.108+			data:		array of byte;
   2.109+		Rwrite =>
   2.110+			score:	Score;
   2.111+		Tsync =>
   2.112+		Rsync =>
   2.113+		Tgoodbye =>
   2.114+		Rerror =>
   2.115+			e:		string;
   2.116+		}
   2.117+		read:			fn(fd: ref Sys->FD): (ref Vmsg, string);
   2.118+		unpack:		fn(a: array of byte): (int, ref Vmsg);
   2.119+		pack:		fn(nil: self ref Vmsg): array of byte;
   2.120+		packedsize:	fn(nil: self ref Vmsg): int;
   2.121+		text:			fn(nil: self ref Vmsg): string;
   2.122+	};
   2.123+
   2.124+	Root: adt {
   2.125+		version:	int;
   2.126+		name:	string;
   2.127+		rtype:	string;
   2.128+		score:	Venti->Score;		# to a Dir block
   2.129+		blocksize:	int;				# maximum block size
   2.130+		prev:		Venti->Score;		# last root block
   2.131+	};
   2.132+
   2.133+	Entry: adt {
   2.134+		gen:		int;		# generation number (XXX should be unsigned)
   2.135+		psize:	int;		# pointer block size
   2.136+		dsize:	int;		# data block size
   2.137+		depth:	int;		# unpacked from flags
   2.138+		flags:	int;
   2.139+		size:		big;		# (XXX should be unsigned)
   2.140+		score:	Venti->Score;
   2.141+	};
   2.142+	Score: adt {
   2.143+		a: array of byte;
   2.144+		eq:		fn(a: self Score, b: Score): int;
   2.145+		text:		fn(a: self Score): string;
   2.146+		parse:	fn(s: string): (int, Score);
   2.147+		zero:		fn(): Score;
   2.148+	};
   2.149+	Session: adt {
   2.150+		fd:		ref Sys->FD;
   2.151+		version:	string;
   2.152+
   2.153+		new:		fn(fd: ref Sys->FD): ref Session;
   2.154+		read:		fn(s: self ref Session, score: Venti->Score, etype: int, maxn: int): array of byte;
   2.155+		write:	fn(s: self ref Session, etype: int, buf: array of byte): (int, Venti->Score);
   2.156+		sync:	fn(s: self ref Session): int;
   2.157+		rpc:		fn(s: self ref Session, m: ref Vmsg): (ref Vmsg, string);
   2.158+	};
   2.159+	unpackentry:	fn(d: array of byte): ref Entry;
   2.160+	unpackroot:	fn(d: array of byte): ref Root;
   2.161+	init:	fn();
   2.162+};