first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Reader } from '@jsonjoy.com/buffers/lib/Reader';
import { XdrDecoder } from '../../../xdr/XdrDecoder';
import { MountProc } from './constants';
import * as msg from './messages';
export declare class MountDecoder {
protected readonly xdr: XdrDecoder;
constructor(reader?: Reader);
decodeMessage(reader: Reader, proc: MountProc, isRequest: boolean): msg.MountMessage | undefined;
private decodeRequest;
private decodeResponse;
private readFhandle3;
private readDirpath;
private readMountBody;
private readGroupNode;
private readExportNode;
private decodeMntRequest;
private decodeMntResponse;
private decodeDumpResponse;
private decodeUmntRequest;
private decodeExportResponse;
}
+135
View File
@@ -0,0 +1,135 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MountDecoder = void 0;
const tslib_1 = require("tslib");
const Reader_1 = require("@jsonjoy.com/buffers/lib/Reader");
const XdrDecoder_1 = require("../../../xdr/XdrDecoder");
const errors_1 = require("../errors");
const msg = tslib_1.__importStar(require("./messages"));
const structs = tslib_1.__importStar(require("./structs"));
class MountDecoder {
constructor(reader = new Reader_1.Reader()) {
this.xdr = new XdrDecoder_1.XdrDecoder(reader);
}
decodeMessage(reader, proc, isRequest) {
this.xdr.reader = reader;
const startPos = reader.x;
try {
if (isRequest) {
return this.decodeRequest(proc);
}
else {
return this.decodeResponse(proc);
}
}
catch (err) {
if (err instanceof RangeError) {
reader.x = startPos;
return undefined;
}
throw err;
}
}
decodeRequest(proc) {
switch (proc) {
case 0:
return undefined;
case 1:
return this.decodeMntRequest();
case 2:
return new msg.MountDumpRequest();
case 3:
return this.decodeUmntRequest();
case 4:
return new msg.MountUmntallRequest();
case 5:
return new msg.MountExportRequest();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown MOUNT procedure: ${proc}`);
}
}
decodeResponse(proc) {
switch (proc) {
case 0:
return undefined;
case 1:
return this.decodeMntResponse();
case 2:
return this.decodeDumpResponse();
case 3:
return undefined;
case 4:
return undefined;
case 5:
return this.decodeExportResponse();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown MOUNT procedure: ${proc}`);
}
}
readFhandle3() {
const data = this.xdr.readVarlenOpaque();
return new structs.MountFhandle3(new Reader_1.Reader(data));
}
readDirpath() {
return this.xdr.readString();
}
readMountBody() {
const valueFollows = this.xdr.readBoolean();
if (!valueFollows)
return undefined;
const hostname = this.xdr.readString();
const directory = this.readDirpath();
const next = this.readMountBody();
return new structs.MountBody(hostname, directory, next);
}
readGroupNode() {
const valueFollows = this.xdr.readBoolean();
if (!valueFollows)
return undefined;
const name = this.xdr.readString();
const next = this.readGroupNode();
return new structs.MountGroupNode(name, next);
}
readExportNode() {
const valueFollows = this.xdr.readBoolean();
if (!valueFollows)
return undefined;
const dir = this.readDirpath();
const groups = this.readGroupNode();
const next = this.readExportNode();
return new structs.MountExportNode(dir, groups, next);
}
decodeMntRequest() {
const dirpath = this.readDirpath();
return new msg.MountMntRequest(dirpath);
}
decodeMntResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
if (status !== 0) {
return new msg.MountMntResponse(status);
}
const fhandle = this.readFhandle3();
const authFlavorsCount = xdr.readUnsignedInt();
const authFlavors = [];
for (let i = 0; i < authFlavorsCount; i++) {
authFlavors.push(xdr.readUnsignedInt());
}
const mountinfo = new msg.MountMntResOk(fhandle, authFlavors);
return new msg.MountMntResponse(status, mountinfo);
}
decodeDumpResponse() {
const mountlist = this.readMountBody();
return new msg.MountDumpResponse(mountlist);
}
decodeUmntRequest() {
const dirpath = this.readDirpath();
return new msg.MountUmntRequest(dirpath);
}
decodeExportResponse() {
const exports = this.readExportNode();
return new msg.MountExportResponse(exports);
}
}
exports.MountDecoder = MountDecoder;
//# sourceMappingURL=MountDecoder.js.map
@@ -0,0 +1 @@
{"version":3,"file":"MountDecoder.js","sourceRoot":"","sources":["../../../../src/nfs/v3/mount/MountDecoder.ts"],"names":[],"mappings":";;;;AAAA,4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IAAI,GAAG,CAAC,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QAC9D,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;IAEO,kBAAkB;QACxB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,OAAO,IAAI,GAAG,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;IAC9C,CAAC;IAEO,iBAAiB;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACnC,OAAO,IAAI,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEO,oBAAoB;QAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,OAAO,IAAI,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF;AArID,oCAqIC"}
+23
View File
@@ -0,0 +1,23 @@
import { XdrEncoder } from '../../../xdr/XdrEncoder';
import { MountProc } from './constants';
import * as msg from './messages';
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
export declare class MountEncoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
readonly writer: W;
protected readonly xdr: XdrEncoder;
constructor(writer?: W);
encodeMessage(message: msg.MountMessage, proc: MountProc, isRequest: boolean): Uint8Array;
writeMessage(message: msg.MountMessage, proc: MountProc, isRequest: boolean): void;
private writeRequest;
private writeResponse;
private writeFhandle3;
private writeDirpath;
private writeMountBody;
private writeGroupNode;
private writeExportNode;
private writeMntRequest;
private writeMntResponse;
private writeDumpResponse;
private writeUmntRequest;
private writeExportResponse;
}
+125
View File
@@ -0,0 +1,125 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MountEncoder = void 0;
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
const XdrEncoder_1 = require("../../../xdr/XdrEncoder");
const errors_1 = require("../errors");
class MountEncoder {
constructor(writer = new Writer_1.Writer()) {
this.writer = writer;
this.xdr = new XdrEncoder_1.XdrEncoder(writer);
}
encodeMessage(message, proc, isRequest) {
if (isRequest)
this.writeRequest(message, proc);
else
this.writeResponse(message, proc);
return this.writer.flush();
}
writeMessage(message, proc, isRequest) {
if (isRequest)
this.writeRequest(message, proc);
else
this.writeResponse(message, proc);
}
writeRequest(request, proc) {
switch (proc) {
case 0:
return;
case 1:
return this.writeMntRequest(request);
case 2:
return;
case 3:
return this.writeUmntRequest(request);
case 4:
return;
case 5:
return;
default:
throw new errors_1.Nfsv3EncodingError(`Unknown MOUNT procedure: ${proc}`);
}
}
writeResponse(response, proc) {
switch (proc) {
case 0:
return;
case 1:
return this.writeMntResponse(response);
case 2:
return this.writeDumpResponse(response);
case 3:
return;
case 4:
return;
case 5:
return this.writeExportResponse(response);
default:
throw new errors_1.Nfsv3EncodingError(`Unknown MOUNT procedure: ${proc}`);
}
}
writeFhandle3(fh) {
const data = fh.data.uint8;
this.xdr.writeVarlenOpaque(data);
}
writeDirpath(path) {
this.xdr.writeStr(path);
}
writeMountBody(body) {
const xdr = this.xdr;
if (!body) {
xdr.writeBoolean(false);
return;
}
xdr.writeBoolean(true);
xdr.writeStr(body.hostname);
this.writeDirpath(body.directory);
this.writeMountBody(body.next);
}
writeGroupNode(group) {
const xdr = this.xdr;
if (!group) {
xdr.writeBoolean(false);
return;
}
xdr.writeBoolean(true);
xdr.writeStr(group.name);
this.writeGroupNode(group.next);
}
writeExportNode(exportNode) {
const xdr = this.xdr;
if (!exportNode) {
xdr.writeBoolean(false);
return;
}
xdr.writeBoolean(true);
this.writeDirpath(exportNode.dir);
this.writeGroupNode(exportNode.groups);
this.writeExportNode(exportNode.next);
}
writeMntRequest(req) {
this.writeDirpath(req.dirpath);
}
writeMntResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.mountinfo) {
this.writeFhandle3(res.mountinfo.fhandle);
xdr.writeUnsignedInt(res.mountinfo.authFlavors.length);
for (const flavor of res.mountinfo.authFlavors) {
xdr.writeUnsignedInt(flavor);
}
}
}
writeDumpResponse(res) {
this.writeMountBody(res.mountlist);
}
writeUmntRequest(req) {
this.writeDirpath(req.dirpath);
}
writeExportResponse(res) {
this.writeExportNode(res.exports);
}
}
exports.MountEncoder = MountEncoder;
//# sourceMappingURL=MountEncoder.js.map
@@ -0,0 +1 @@
{"version":3,"file":"MountEncoder.js","sourceRoot":"","sources":["../../../../src/nfs/v3/mount/MountEncoder.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,wDAAmD;AAEnD,sCAA6C;AAK7C,MAAa,YAAY;IAGvB,YAA4B,SAAY,IAAI,eAAM,EAAS;QAA/B,WAAM,GAAN,MAAM,CAAyB;QACzD,IAAI,CAAC,GAAG,GAAG,IAAI,uBAAU,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAEM,aAAa,CAAC,OAAyB,EAAE,IAAe,EAAE,SAAkB;QACjF,IAAI,SAAS;YAAE,IAAI,CAAC,YAAY,CAAC,OAA2B,EAAE,IAAI,CAAC,CAAC;;YAC/D,IAAI,CAAC,aAAa,CAAC,OAA4B,EAAE,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,YAAY,CAAC,OAAyB,EAAE,IAAe,EAAE,SAAkB;QAChF,IAAI,SAAS;YAAE,IAAI,CAAC,YAAY,CAAC,OAA2B,EAAE,IAAI,CAAC,CAAC;;YAC/D,IAAI,CAAC,aAAa,CAAC,OAA4B,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAEO,YAAY,CAAC,OAAyB,EAAE,IAAe;QAC7D,QAAQ,IAAI,EAAE,CAAC;YACb;gBACE,OAAO;YACT;gBACE,OAAO,IAAI,CAAC,eAAe,CAAC,OAA8B,CAAC,CAAC;YAC9D;gBACE,OAAO;YACT;gBACE,OAAO,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AAG,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACvD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;gBAC/C,GAAG,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;IACH,CAAC;IAEO,iBAAiB,CAAC,GAA0B;QAClD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAEO,gBAAgB,CAAC,GAAyB;QAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAEO,mBAAmB,CAAC,GAA4B;QACtD,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;CACF;AA/HD,oCA+HC"}
+27
View File
@@ -0,0 +1,27 @@
export declare const enum MountConst {
PROGRAM = 100005,
VERSION = 3,
MNTPATHLEN = 1024,
MNTNAMLEN = 255,
FHSIZE3 = 64
}
export declare const enum MountProc {
NULL = 0,
MNT = 1,
DUMP = 2,
UMNT = 3,
UMNTALL = 4,
EXPORT = 5
}
export declare const enum MountStat {
MNT3_OK = 0,
MNT3ERR_PERM = 1,
MNT3ERR_NOENT = 2,
MNT3ERR_IO = 5,
MNT3ERR_ACCES = 13,
MNT3ERR_NOTDIR = 20,
MNT3ERR_INVAL = 22,
MNT3ERR_NAMETOOLONG = 63,
MNT3ERR_NOTSUPP = 10004,
MNT3ERR_SERVERFAULT = 10006
}
+3
View File
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/nfs/v3/mount/constants.ts"],"names":[],"mappings":""}
+37
View File
@@ -0,0 +1,37 @@
import { MountStat } from './constants';
import type * as stucts from './structs';
export type MountMessage = MountRequest | MountResponse;
export type MountRequest = MountMntRequest | MountUmntRequest | MountDumpRequest | MountUmntallRequest | MountExportRequest;
export type MountResponse = MountMntResponse | MountDumpResponse | MountExportResponse;
export declare class MountMntRequest {
readonly dirpath: string;
constructor(dirpath: string);
}
export declare class MountMntResOk {
readonly fhandle: stucts.MountFhandle3;
readonly authFlavors: number[];
constructor(fhandle: stucts.MountFhandle3, authFlavors: number[]);
}
export declare class MountMntResponse {
readonly status: MountStat;
readonly mountinfo?: MountMntResOk | undefined;
constructor(status: MountStat, mountinfo?: MountMntResOk | undefined);
}
export declare class MountDumpRequest {
}
export declare class MountDumpResponse {
readonly mountlist?: stucts.MountBody | undefined;
constructor(mountlist?: stucts.MountBody | undefined);
}
export declare class MountUmntRequest {
readonly dirpath: string;
constructor(dirpath: string);
}
export declare class MountUmntallRequest {
}
export declare class MountExportRequest {
}
export declare class MountExportResponse {
readonly exports?: stucts.MountExportNode | undefined;
constructor(exports?: stucts.MountExportNode | undefined);
}
+51
View File
@@ -0,0 +1,51 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MountExportResponse = exports.MountExportRequest = exports.MountUmntallRequest = exports.MountUmntRequest = exports.MountDumpResponse = exports.MountDumpRequest = exports.MountMntResponse = exports.MountMntResOk = exports.MountMntRequest = void 0;
class MountMntRequest {
constructor(dirpath) {
this.dirpath = dirpath;
}
}
exports.MountMntRequest = MountMntRequest;
class MountMntResOk {
constructor(fhandle, authFlavors) {
this.fhandle = fhandle;
this.authFlavors = authFlavors;
}
}
exports.MountMntResOk = MountMntResOk;
class MountMntResponse {
constructor(status, mountinfo) {
this.status = status;
this.mountinfo = mountinfo;
}
}
exports.MountMntResponse = MountMntResponse;
class MountDumpRequest {
}
exports.MountDumpRequest = MountDumpRequest;
class MountDumpResponse {
constructor(mountlist) {
this.mountlist = mountlist;
}
}
exports.MountDumpResponse = MountDumpResponse;
class MountUmntRequest {
constructor(dirpath) {
this.dirpath = dirpath;
}
}
exports.MountUmntRequest = MountUmntRequest;
class MountUmntallRequest {
}
exports.MountUmntallRequest = MountUmntallRequest;
class MountExportRequest {
}
exports.MountExportRequest = MountExportRequest;
class MountExportResponse {
constructor(exports) {
this.exports = exports;
}
}
exports.MountExportResponse = MountExportResponse;
//# sourceMappingURL=messages.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/nfs/v3/mount/messages.ts"],"names":[],"mappings":";;;AAqBA,MAAa,eAAe;IAC1B,YAA4B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;CAChD;AAFD,0CAEC;AAKD,MAAa,aAAa;IACxB,YACkB,OAA6B,EAC7B,WAAqB;QADrB,YAAO,GAAP,OAAO,CAAsB;QAC7B,gBAAW,GAAX,WAAW,CAAU;IACpC,CAAC;CACL;AALD,sCAKC;AAKD,MAAa,gBAAgB;IAC3B,YACkB,MAAiB,EACjB,SAAyB;QADzB,WAAM,GAAN,MAAM,CAAW;QACjB,cAAS,GAAT,SAAS,CAAgB;IACxC,CAAC;CACL;AALD,4CAKC;AAKD,MAAa,gBAAgB;CAAG;AAAhC,4CAAgC;AAKhC,MAAa,iBAAiB;IAC5B,YAA4B,SAA4B;QAA5B,cAAS,GAAT,SAAS,CAAmB;IAAG,CAAC;CAC7D;AAFD,8CAEC;AAKD,MAAa,gBAAgB;IAC3B,YAA4B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;CAChD;AAFD,4CAEC;AAKD,MAAa,mBAAmB;CAAG;AAAnC,kDAAmC;AAKnC,MAAa,kBAAkB;CAAG;AAAlC,gDAAkC;AAKlC,MAAa,mBAAmB;IAC9B,YAA4B,OAAgC;QAAhC,YAAO,GAAP,OAAO,CAAyB;IAAG,CAAC;CACjE;AAFD,kDAEC"}
+22
View File
@@ -0,0 +1,22 @@
import type { Reader } from '@jsonjoy.com/buffers/lib/Reader';
export declare class MountFhandle3 {
readonly data: Reader;
constructor(data: Reader);
}
export declare class MountBody {
readonly hostname: string;
readonly directory: string;
readonly next?: MountBody | undefined;
constructor(hostname: string, directory: string, next?: MountBody | undefined);
}
export declare class MountGroupNode {
readonly name: string;
readonly next?: MountGroupNode | undefined;
constructor(name: string, next?: MountGroupNode | undefined);
}
export declare class MountExportNode {
readonly dir: string;
readonly groups?: MountGroupNode | undefined;
readonly next?: MountExportNode | undefined;
constructor(dir: string, groups?: MountGroupNode | undefined, next?: MountExportNode | undefined);
}
+33
View File
@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MountExportNode = exports.MountGroupNode = exports.MountBody = exports.MountFhandle3 = void 0;
class MountFhandle3 {
constructor(data) {
this.data = data;
}
}
exports.MountFhandle3 = MountFhandle3;
class MountBody {
constructor(hostname, directory, next) {
this.hostname = hostname;
this.directory = directory;
this.next = next;
}
}
exports.MountBody = MountBody;
class MountGroupNode {
constructor(name, next) {
this.name = name;
this.next = next;
}
}
exports.MountGroupNode = MountGroupNode;
class MountExportNode {
constructor(dir, groups, next) {
this.dir = dir;
this.groups = groups;
this.next = next;
}
}
exports.MountExportNode = MountExportNode;
//# sourceMappingURL=structs.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../src/nfs/v3/mount/structs.ts"],"names":[],"mappings":";;;AASA,MAAa,aAAa;IACxB,YAA4B,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;CAC7C;AAFD,sCAEC;AAKD,MAAa,SAAS;IACpB,YACkB,QAAgB,EAChB,SAAiB,EACjB,IAAgB;QAFhB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,cAAS,GAAT,SAAS,CAAQ;QACjB,SAAI,GAAJ,IAAI,CAAY;IAC/B,CAAC;CACL;AAND,8BAMC;AAKD,MAAa,cAAc;IACzB,YACkB,IAAY,EACZ,IAAqB;QADrB,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAiB;IACpC,CAAC;CACL;AALD,wCAKC;AAKD,MAAa,eAAe;IAC1B,YACkB,GAAW,EACX,MAAuB,EACvB,IAAsB;QAFtB,QAAG,GAAH,GAAG,CAAQ;QACX,WAAM,GAAN,MAAM,CAAiB;QACvB,SAAI,GAAJ,IAAI,CAAkB;IACrC,CAAC;CACL;AAND,0CAMC"}