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
+28
View File
@@ -0,0 +1,28 @@
import { Nfsv3Encoder } from './Nfsv3Encoder';
import { RpcMessageEncoder } from '../../rpc/RpcMessageEncoder';
import { RmRecordEncoder } from '../../rm/RmRecordEncoder';
import { Nfsv3Proc } from './constants';
import { RpcOpaqueAuth } from '../../rpc/messages';
import type * as msg from './messages';
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
export declare class FullNfsv3Encoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
program: number;
readonly writer: W;
protected readonly nfsEncoder: Nfsv3Encoder<W>;
protected readonly rpcEncoder: RpcMessageEncoder<W>;
protected readonly rmEncoder: RmRecordEncoder<W>;
constructor(program?: number, writer?: W);
encodeCall(xid: number, proc: Nfsv3Proc, cred: RpcOpaqueAuth, verf: RpcOpaqueAuth, request: msg.Nfsv3Request): Uint8Array;
writeCall(xid: number, proc: Nfsv3Proc, cred: RpcOpaqueAuth, verf: RpcOpaqueAuth, request: msg.Nfsv3Request): void;
encodeAcceptedReply(xid: number, proc: Nfsv3Proc, verf: RpcOpaqueAuth, response: msg.Nfsv3Response): Uint8Array;
writeAcceptedReply(xid: number, proc: Nfsv3Proc, verf: RpcOpaqueAuth, response: msg.Nfsv3Response): void;
encodeRejectedReply(xid: number, rejectStat: number, mismatchInfo?: {
low: number;
high: number;
}, authStat?: number): Uint8Array;
writeRejectedReply(xid: number, rejectStat: number, mismatchInfo?: {
low: number;
high: number;
}, authStat?: number): void;
private writeRmHeader;
}
+73
View File
@@ -0,0 +1,73 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FullNfsv3Encoder = void 0;
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
const Nfsv3Encoder_1 = require("./Nfsv3Encoder");
const RpcMessageEncoder_1 = require("../../rpc/RpcMessageEncoder");
const RmRecordEncoder_1 = require("../../rm/RmRecordEncoder");
const MAX_SINGLE_FRAME_SIZE = 0x7fffffff;
const RM_HEADER_SIZE = 4;
class FullNfsv3Encoder {
constructor(program = 100003, writer = new Writer_1.Writer()) {
this.program = program;
this.writer = writer;
this.nfsEncoder = new Nfsv3Encoder_1.Nfsv3Encoder(writer);
this.rpcEncoder = new RpcMessageEncoder_1.RpcMessageEncoder(writer);
this.rmEncoder = new RmRecordEncoder_1.RmRecordEncoder(writer);
}
encodeCall(xid, proc, cred, verf, request) {
this.writeCall(xid, proc, cred, verf, request);
return this.writer.flush();
}
writeCall(xid, proc, cred, verf, request) {
const writer = this.writer;
const rmHeaderPosition = writer.x;
writer.x += RM_HEADER_SIZE;
this.rpcEncoder.writeCall(xid, 100003, 3, proc, cred, verf);
this.nfsEncoder.writeMessage(request, proc, true);
this.writeRmHeader(rmHeaderPosition, writer.x);
}
encodeAcceptedReply(xid, proc, verf, response) {
this.writeAcceptedReply(xid, proc, verf, response);
return this.writer.flush();
}
writeAcceptedReply(xid, proc, verf, response) {
const writer = this.writer;
const rmHeaderPosition = writer.x;
writer.x += RM_HEADER_SIZE;
this.rpcEncoder.writeAcceptedReply(xid, verf, 0);
this.nfsEncoder.writeMessage(response, proc, false);
this.writeRmHeader(rmHeaderPosition, writer.x);
}
encodeRejectedReply(xid, rejectStat, mismatchInfo, authStat) {
this.writeRejectedReply(xid, rejectStat, mismatchInfo, authStat);
return this.writer.flush();
}
writeRejectedReply(xid, rejectStat, mismatchInfo, authStat) {
const writer = this.writer;
const rmHeaderPosition = writer.x;
writer.x += RM_HEADER_SIZE;
this.rpcEncoder.writeRejectedReply(xid, rejectStat, mismatchInfo, authStat);
this.writeRmHeader(rmHeaderPosition, writer.x);
}
writeRmHeader(rmHeaderPosition, endPosition) {
const writer = this.writer;
const rmEncoder = this.rmEncoder;
const totalSize = endPosition - rmHeaderPosition - RM_HEADER_SIZE;
if (totalSize <= MAX_SINGLE_FRAME_SIZE) {
const currentX = writer.x;
writer.x = rmHeaderPosition;
rmEncoder.writeHdr(1, totalSize);
writer.x = currentX;
}
else {
const currentX = writer.x;
writer.x = rmHeaderPosition;
const data = writer.uint8.subarray(rmHeaderPosition + RM_HEADER_SIZE, currentX);
writer.reset();
rmEncoder.writeRecord(data);
}
}
}
exports.FullNfsv3Encoder = FullNfsv3Encoder;
//# sourceMappingURL=FullNfsv3Encoder.js.map
@@ -0,0 +1 @@
{"version":3,"file":"FullNfsv3Encoder.js","sourceRoot":"","sources":["../../../src/nfs/v3/FullNfsv3Encoder.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,iDAA4C;AAC5C,mEAA8D;AAC9D,8DAAyD;AAOzD,MAAM,qBAAqB,GAAG,UAAU,CAAC;AACzC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB,MAAa,gBAAgB;IAK3B,YACS,UAAkB,MAAM,EACf,SAAY,IAAI,eAAM,EAAS;QADxC,YAAO,GAAP,OAAO,CAAiB;QACf,WAAM,GAAN,MAAM,CAAyB;QAE/C,IAAI,CAAC,UAAU,GAAG,IAAI,2BAAY,CAAC,MAAM,CAAC,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAiB,CAAC,MAAM,CAAC,CAAC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAI,iCAAe,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAEM,UAAU,CACf,GAAW,EACX,IAAe,EACf,IAAmB,EACnB,IAAmB,EACnB,OAAyB;QAEzB,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,SAAS,CACd,GAAW,EACX,IAAe,EACf,IAAmB,EACnB,IAAmB,EACnB,OAAyB;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,gBAAgB,GAAG,MAAM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@jsonjoy.com/buffers/lib/Reader';
import { XdrDecoder } from '../../xdr/XdrDecoder';
import { Nfsv3Proc } from './constants';
import * as msg from './messages';
export declare class Nfsv3Decoder {
protected readonly xdr: XdrDecoder;
constructor(reader?: Reader);
decodeMessage(reader: Reader, proc: Nfsv3Proc, isRequest: boolean): msg.Nfsv3Message | undefined;
private decodeRequest;
private decodeResponse;
private readFh;
private readFilename;
private readTime;
private readSpecData;
private readFattr;
private readPostOpAttr;
private readWccAttr;
private readPreOpAttr;
private readWccData;
private readPostOpFh;
private readSetMode;
private readSetUid;
private readSetGid;
private readSetSize;
private readSetAtime;
private readSetMtime;
private readSattr;
private readSattrGuard;
private readDirOpArgs;
private readCreateHow;
private readMknodData;
private readEntry;
private readEntryPlus;
private readDirList;
private readDirListPlus;
private decodeGetattrRequest;
private decodeGetattrResponse;
private decodeSetattrRequest;
private decodeSetattrResponse;
private decodeLookupRequest;
private decodeLookupResponse;
private decodeAccessRequest;
private decodeAccessResponse;
private decodeReadlinkRequest;
private decodeReadlinkResponse;
private decodeReadRequest;
private decodeReadResponse;
private decodeWriteRequest;
private decodeWriteResponse;
private decodeCreateRequest;
private decodeCreateResponse;
private decodeMkdirRequest;
private decodeMkdirResponse;
private decodeSymlinkRequest;
private decodeSymlinkResponse;
private decodeMknodRequest;
private decodeMknodResponse;
private decodeRemoveRequest;
private decodeRemoveResponse;
private decodeRmdirRequest;
private decodeRmdirResponse;
private decodeRenameRequest;
private decodeRenameResponse;
private decodeLinkRequest;
private decodeLinkResponse;
private decodeReaddirRequest;
private decodeReaddirResponse;
private decodeReaddirplusRequest;
private decodeReaddirplusResponse;
private decodeFsstatRequest;
private decodeFsstatResponse;
private decodeFsinfoRequest;
private decodeFsinfoResponse;
private decodePathconfRequest;
private decodePathconfResponse;
private decodeCommitRequest;
private decodeCommitResponse;
}
+757
View File
@@ -0,0 +1,757 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nfsv3Decoder = 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 Nfsv3Decoder {
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 1:
return this.decodeGetattrRequest();
case 2:
return this.decodeSetattrRequest();
case 3:
return this.decodeLookupRequest();
case 4:
return this.decodeAccessRequest();
case 5:
return this.decodeReadlinkRequest();
case 6:
return this.decodeReadRequest();
case 7:
return this.decodeWriteRequest();
case 8:
return this.decodeCreateRequest();
case 9:
return this.decodeMkdirRequest();
case 10:
return this.decodeSymlinkRequest();
case 11:
return this.decodeMknodRequest();
case 12:
return this.decodeRemoveRequest();
case 13:
return this.decodeRmdirRequest();
case 14:
return this.decodeRenameRequest();
case 15:
return this.decodeLinkRequest();
case 16:
return this.decodeReaddirRequest();
case 17:
return this.decodeReaddirplusRequest();
case 18:
return this.decodeFsstatRequest();
case 19:
return this.decodeFsinfoRequest();
case 20:
return this.decodePathconfRequest();
case 21:
return this.decodeCommitRequest();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown procedure: \${proc}`);
}
}
decodeResponse(proc) {
switch (proc) {
case 1:
return this.decodeGetattrResponse();
case 2:
return this.decodeSetattrResponse();
case 3:
return this.decodeLookupResponse();
case 4:
return this.decodeAccessResponse();
case 5:
return this.decodeReadlinkResponse();
case 6:
return this.decodeReadResponse();
case 7:
return this.decodeWriteResponse();
case 8:
return this.decodeCreateResponse();
case 9:
return this.decodeMkdirResponse();
case 10:
return this.decodeSymlinkResponse();
case 11:
return this.decodeMknodResponse();
case 12:
return this.decodeRemoveResponse();
case 13:
return this.decodeRmdirResponse();
case 14:
return this.decodeRenameResponse();
case 15:
return this.decodeLinkResponse();
case 16:
return this.decodeReaddirResponse();
case 17:
return this.decodeReaddirplusResponse();
case 18:
return this.decodeFsstatResponse();
case 19:
return this.decodeFsinfoResponse();
case 20:
return this.decodePathconfResponse();
case 21:
return this.decodeCommitResponse();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown procedure: \${proc}`);
}
}
readFh() {
const data = this.xdr.readVarlenOpaque();
return new structs.Nfsv3Fh(data);
}
readFilename() {
return this.xdr.readString();
}
readTime() {
const xdr = this.xdr;
const seconds = xdr.readUnsignedInt();
const nseconds = xdr.readUnsignedInt();
return new structs.Nfsv3Time(seconds, nseconds);
}
readSpecData() {
const xdr = this.xdr;
const specdata1 = xdr.readUnsignedInt();
const specdata2 = xdr.readUnsignedInt();
return new structs.Nfsv3SpecData(specdata1, specdata2);
}
readFattr() {
const xdr = this.xdr;
const type = xdr.readUnsignedInt();
const mode = xdr.readUnsignedInt();
const nlink = xdr.readUnsignedInt();
const uid = xdr.readUnsignedInt();
const gid = xdr.readUnsignedInt();
const size = xdr.readUnsignedHyper();
const used = xdr.readUnsignedHyper();
const rdev = this.readSpecData();
const fsid = xdr.readUnsignedHyper();
const fileid = xdr.readUnsignedHyper();
const atime = this.readTime();
const mtime = this.readTime();
const ctime = this.readTime();
return new structs.Nfsv3Fattr(type, mode, nlink, uid, gid, size, used, rdev, fsid, fileid, atime, mtime, ctime);
}
readPostOpAttr() {
const attributesFollow = this.xdr.readBoolean();
const attributes = attributesFollow ? this.readFattr() : undefined;
return new structs.Nfsv3PostOpAttr(attributesFollow, attributes);
}
readWccAttr() {
const size = this.xdr.readUnsignedHyper();
const mtime = this.readTime();
const ctime = this.readTime();
return new structs.Nfsv3WccAttr(size, mtime, ctime);
}
readPreOpAttr() {
const attributesFollow = this.xdr.readBoolean();
const attributes = attributesFollow ? this.readWccAttr() : undefined;
return new structs.Nfsv3PreOpAttr(attributesFollow, attributes);
}
readWccData() {
const before = this.readPreOpAttr();
const after = this.readPostOpAttr();
return new structs.Nfsv3WccData(before, after);
}
readPostOpFh() {
const handleFollows = this.xdr.readBoolean();
const handle = handleFollows ? this.readFh() : undefined;
return new structs.Nfsv3PostOpFh(handleFollows, handle);
}
readSetMode() {
const set = this.xdr.readBoolean();
const mode = set ? this.xdr.readUnsignedInt() : undefined;
return new structs.Nfsv3SetMode(set, mode);
}
readSetUid() {
const set = this.xdr.readBoolean();
const uid = set ? this.xdr.readUnsignedInt() : undefined;
return new structs.Nfsv3SetUid(set, uid);
}
readSetGid() {
const set = this.xdr.readBoolean();
const gid = set ? this.xdr.readUnsignedInt() : undefined;
return new structs.Nfsv3SetGid(set, gid);
}
readSetSize() {
const set = this.xdr.readBoolean();
const size = set ? this.xdr.readUnsignedHyper() : undefined;
return new structs.Nfsv3SetSize(set, size);
}
readSetAtime() {
const how = this.xdr.readUnsignedInt();
const atime = how === 2 ? this.readTime() : undefined;
return new structs.Nfsv3SetAtime(how, atime);
}
readSetMtime() {
const how = this.xdr.readUnsignedInt();
const mtime = how === 2 ? this.readTime() : undefined;
return new structs.Nfsv3SetMtime(how, mtime);
}
readSattr() {
const mode = this.readSetMode();
const uid = this.readSetUid();
const gid = this.readSetGid();
const size = this.readSetSize();
const atime = this.readSetAtime();
const mtime = this.readSetMtime();
return new structs.Nfsv3Sattr(mode, uid, gid, size, atime, mtime);
}
readSattrGuard() {
const check = this.xdr.readBoolean();
const objCtime = check ? this.readTime() : undefined;
return new structs.Nfsv3SattrGuard(check, objCtime);
}
readDirOpArgs() {
const dir = this.readFh();
const name = this.readFilename();
return new structs.Nfsv3DirOpArgs(dir, name);
}
readCreateHow() {
const xdr = this.xdr;
const mode = xdr.readUnsignedInt();
let objAttributes;
let verf;
if (mode === 0 || mode === 1) {
objAttributes = this.readSattr();
}
else if (mode === 2) {
const verfData = xdr.readOpaque(8);
verf = verfData;
}
return new structs.Nfsv3CreateHow(mode, objAttributes, verf);
}
readMknodData() {
const type = this.xdr.readUnsignedInt();
let chr;
let blk;
let sock;
let pipe;
switch (type) {
case 4:
chr = new structs.Nfsv3DeviceData(this.readSattr(), this.readSpecData());
break;
case 3:
blk = new structs.Nfsv3DeviceData(this.readSattr(), this.readSpecData());
break;
case 6:
sock = this.readSattr();
break;
case 7:
pipe = this.readSattr();
break;
}
return new structs.Nfsv3MknodData(type, chr, blk, sock, pipe);
}
readEntry() {
const xdr = this.xdr;
const valueFollows = xdr.readBoolean();
if (!valueFollows)
return undefined;
const fileid = xdr.readUnsignedHyper();
const name = this.readFilename();
const cookie = xdr.readUnsignedHyper();
const nextentry = this.readEntry();
return new structs.Nfsv3Entry(fileid, name, cookie, nextentry);
}
readEntryPlus() {
const xdr = this.xdr;
const valueFollows = xdr.readBoolean();
if (!valueFollows)
return undefined;
const fileid = xdr.readUnsignedHyper();
const name = this.readFilename();
const cookie = xdr.readUnsignedHyper();
const nameAttributes = this.readPostOpAttr();
const nameHandle = this.readPostOpFh();
const nextentry = this.readEntryPlus();
return new structs.Nfsv3EntryPlus(fileid, name, cookie, nameAttributes, nameHandle, nextentry);
}
readDirList() {
const entries = this.readEntry();
const eof = this.xdr.readBoolean();
return new structs.Nfsv3DirList(eof, entries);
}
readDirListPlus() {
const entries = this.readEntryPlus();
const eof = this.xdr.readBoolean();
return new structs.Nfsv3DirListPlus(eof, entries);
}
decodeGetattrRequest() {
const object = this.readFh();
return new msg.Nfsv3GetattrRequest(object);
}
decodeGetattrResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
if (status === 0) {
const objAttributes = this.readFattr();
resok = new msg.Nfsv3GetattrResOk(objAttributes);
}
return new msg.Nfsv3GetattrResponse(status, resok);
}
decodeSetattrRequest() {
const object = this.readFh();
const newAttributes = this.readSattr();
const guard = this.readSattrGuard();
return new msg.Nfsv3SetattrRequest(object, newAttributes, guard);
}
decodeSetattrResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const objWcc = this.readWccData();
if (status === 0) {
resok = new msg.Nfsv3SetattrResOk(objWcc);
}
else {
resfail = new msg.Nfsv3SetattrResFail(objWcc);
}
return new msg.Nfsv3SetattrResponse(status, resok, resfail);
}
decodeLookupRequest() {
const what = this.readDirOpArgs();
return new msg.Nfsv3LookupRequest(what);
}
decodeLookupResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
if (status === 0) {
const object = this.readFh();
const objAttributes = this.readPostOpAttr();
const dirAttributes = this.readPostOpAttr();
resok = new msg.Nfsv3LookupResOk(object, objAttributes, dirAttributes);
}
else {
const dirAttributes = this.readPostOpAttr();
resfail = new msg.Nfsv3LookupResFail(dirAttributes);
}
return new msg.Nfsv3LookupResponse(status, resok, resfail);
}
decodeAccessRequest() {
const object = this.readFh();
const access = this.xdr.readUnsignedInt();
return new msg.Nfsv3AccessRequest(object, access);
}
decodeAccessResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const objAttributes = this.readPostOpAttr();
if (status === 0) {
const access = xdr.readUnsignedInt();
resok = new msg.Nfsv3AccessResOk(objAttributes, access);
}
else {
resfail = new msg.Nfsv3AccessResFail(objAttributes);
}
return new msg.Nfsv3AccessResponse(status, resok, resfail);
}
decodeReadlinkRequest() {
const symlink = this.readFh();
return new msg.Nfsv3ReadlinkRequest(symlink);
}
decodeReadlinkResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const symlinkAttributes = this.readPostOpAttr();
if (status === 0) {
const data = this.readFilename();
resok = new msg.Nfsv3ReadlinkResOk(symlinkAttributes, data);
}
else {
resfail = new msg.Nfsv3ReadlinkResFail(symlinkAttributes);
}
return new msg.Nfsv3ReadlinkResponse(status, resok, resfail);
}
decodeReadRequest() {
const file = this.readFh();
const xdr = this.xdr;
const offset = xdr.readUnsignedHyper();
const count = xdr.readUnsignedInt();
return new msg.Nfsv3ReadRequest(file, offset, count);
}
decodeReadResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const fileAttributes = this.readPostOpAttr();
if (status === 0) {
const xdr = this.xdr;
const count = xdr.readUnsignedInt();
const eof = xdr.readBoolean();
const data = xdr.readVarlenOpaque();
resok = new msg.Nfsv3ReadResOk(fileAttributes, count, eof, data);
}
else {
resfail = new msg.Nfsv3ReadResFail(fileAttributes);
}
return new msg.Nfsv3ReadResponse(status, resok, resfail);
}
decodeWriteRequest() {
const file = this.readFh();
const xdr = this.xdr;
const offset = xdr.readUnsignedHyper();
const count = xdr.readUnsignedInt();
const stable = xdr.readUnsignedInt();
const data = xdr.readVarlenOpaque();
return new msg.Nfsv3WriteRequest(file, offset, count, stable, data);
}
decodeWriteResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const fileWcc = this.readWccData();
if (status === 0) {
const count = xdr.readUnsignedInt();
const committed = xdr.readUnsignedInt();
const verf = xdr.readOpaque(8);
resok = new msg.Nfsv3WriteResOk(fileWcc, count, committed, verf);
}
else {
resfail = new msg.Nfsv3WriteResFail(fileWcc);
}
return new msg.Nfsv3WriteResponse(status, resok, resfail);
}
decodeCreateRequest() {
const where = this.readDirOpArgs();
const how = this.readCreateHow();
return new msg.Nfsv3CreateRequest(where, how);
}
decodeCreateResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
if (status === 0) {
const obj = this.readPostOpFh();
const objAttributes = this.readPostOpAttr();
const dirWcc = this.readWccData();
resok = new msg.Nfsv3CreateResOk(obj, objAttributes, dirWcc);
}
else {
const dirWcc = this.readWccData();
resfail = new msg.Nfsv3CreateResFail(dirWcc);
}
return new msg.Nfsv3CreateResponse(status, resok, resfail);
}
decodeMkdirRequest() {
const where = this.readDirOpArgs();
const attributes = this.readSattr();
return new msg.Nfsv3MkdirRequest(where, attributes);
}
decodeMkdirResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
if (status === 0) {
const obj = this.readPostOpFh();
const objAttributes = this.readPostOpAttr();
const dirWcc = this.readWccData();
resok = new msg.Nfsv3MkdirResOk(obj, objAttributes, dirWcc);
}
else {
const dirWcc = this.readWccData();
resfail = new msg.Nfsv3MkdirResFail(dirWcc);
}
return new msg.Nfsv3MkdirResponse(status, resok, resfail);
}
decodeSymlinkRequest() {
const where = this.readDirOpArgs();
const symlinkAttributes = this.readSattr();
const symlinkData = this.readFilename();
return new msg.Nfsv3SymlinkRequest(where, symlinkAttributes, symlinkData);
}
decodeSymlinkResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
if (status === 0) {
const obj = this.readPostOpFh();
const objAttributes = this.readPostOpAttr();
const dirWcc = this.readWccData();
resok = new msg.Nfsv3SymlinkResOk(obj, objAttributes, dirWcc);
}
else {
const dirWcc = this.readWccData();
resfail = new msg.Nfsv3SymlinkResFail(dirWcc);
}
return new msg.Nfsv3SymlinkResponse(status, resok, resfail);
}
decodeMknodRequest() {
const where = this.readDirOpArgs();
const what = this.readMknodData();
return new msg.Nfsv3MknodRequest(where, what);
}
decodeMknodResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
if (status === 0) {
const obj = this.readPostOpFh();
const objAttributes = this.readPostOpAttr();
const dirWcc = this.readWccData();
resok = new msg.Nfsv3MknodResOk(obj, objAttributes, dirWcc);
}
else {
const dirWcc = this.readWccData();
resfail = new msg.Nfsv3MknodResFail(dirWcc);
}
return new msg.Nfsv3MknodResponse(status, resok, resfail);
}
decodeRemoveRequest() {
const object = this.readDirOpArgs();
return new msg.Nfsv3RemoveRequest(object);
}
decodeRemoveResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const dirWcc = this.readWccData();
if (status === 0) {
resok = new msg.Nfsv3RemoveResOk(dirWcc);
}
else {
resfail = new msg.Nfsv3RemoveResFail(dirWcc);
}
return new msg.Nfsv3RemoveResponse(status, resok, resfail);
}
decodeRmdirRequest() {
const object = this.readDirOpArgs();
return new msg.Nfsv3RmdirRequest(object);
}
decodeRmdirResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const dirWcc = this.readWccData();
if (status === 0) {
resok = new msg.Nfsv3RmdirResOk(dirWcc);
}
else {
resfail = new msg.Nfsv3RmdirResFail(dirWcc);
}
return new msg.Nfsv3RmdirResponse(status, resok, resfail);
}
decodeRenameRequest() {
const from = this.readDirOpArgs();
const to = this.readDirOpArgs();
return new msg.Nfsv3RenameRequest(from, to);
}
decodeRenameResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const fromDirWcc = this.readWccData();
const toDirWcc = this.readWccData();
if (status === 0) {
resok = new msg.Nfsv3RenameResOk(fromDirWcc, toDirWcc);
}
else {
resfail = new msg.Nfsv3RenameResFail(fromDirWcc, toDirWcc);
}
return new msg.Nfsv3RenameResponse(status, resok, resfail);
}
decodeLinkRequest() {
const file = this.readFh();
const link = this.readDirOpArgs();
return new msg.Nfsv3LinkRequest(file, link);
}
decodeLinkResponse() {
const status = this.xdr.readUnsignedInt();
let resok;
let resfail;
const fileAttributes = this.readPostOpAttr();
const linkDirWcc = this.readWccData();
if (status === 0) {
resok = new msg.Nfsv3LinkResOk(fileAttributes, linkDirWcc);
}
else {
resfail = new msg.Nfsv3LinkResFail(fileAttributes, linkDirWcc);
}
return new msg.Nfsv3LinkResponse(status, resok, resfail);
}
decodeReaddirRequest() {
const dir = this.readFh();
const xdr = this.xdr;
const cookie = xdr.readUnsignedHyper();
const cookieverf = xdr.readOpaque(8);
const count = xdr.readUnsignedInt();
return new msg.Nfsv3ReaddirRequest(dir, cookie, cookieverf, count);
}
decodeReaddirResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const dirAttributes = this.readPostOpAttr();
if (status === 0) {
const cookieverf = xdr.readOpaque(8);
const reply = this.readDirList();
resok = new msg.Nfsv3ReaddirResOk(dirAttributes, cookieverf, reply);
}
else {
resfail = new msg.Nfsv3ReaddirResFail(dirAttributes);
}
return new msg.Nfsv3ReaddirResponse(status, resok, resfail);
}
decodeReaddirplusRequest() {
const dir = this.readFh();
const xdr = this.xdr;
const cookie = xdr.readUnsignedHyper();
const cookieverf = xdr.readOpaque(8);
const dircount = xdr.readUnsignedInt();
const maxcount = xdr.readUnsignedInt();
return new msg.Nfsv3ReaddirplusRequest(dir, cookie, cookieverf, dircount, maxcount);
}
decodeReaddirplusResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const dirAttributes = this.readPostOpAttr();
if (status === 0) {
const cookieverf = xdr.readOpaque(8);
const reply = this.readDirListPlus();
resok = new msg.Nfsv3ReaddirplusResOk(dirAttributes, cookieverf, reply);
}
else {
resfail = new msg.Nfsv3ReaddirplusResFail(dirAttributes);
}
return new msg.Nfsv3ReaddirplusResponse(status, resok, resfail);
}
decodeFsstatRequest() {
const fsroot = this.readFh();
return new msg.Nfsv3FsstatRequest(fsroot);
}
decodeFsstatResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const objAttributes = this.readPostOpAttr();
if (status === 0) {
const tbytes = xdr.readUnsignedHyper();
const fbytes = xdr.readUnsignedHyper();
const abytes = xdr.readUnsignedHyper();
const tfiles = xdr.readUnsignedHyper();
const ffiles = xdr.readUnsignedHyper();
const afiles = xdr.readUnsignedHyper();
const invarsec = xdr.readUnsignedInt();
resok = new msg.Nfsv3FsstatResOk(objAttributes, tbytes, fbytes, abytes, tfiles, ffiles, afiles, invarsec);
}
else {
resfail = new msg.Nfsv3FsstatResFail(objAttributes);
}
return new msg.Nfsv3FsstatResponse(status, resok, resfail);
}
decodeFsinfoRequest() {
const fsroot = this.readFh();
return new msg.Nfsv3FsinfoRequest(fsroot);
}
decodeFsinfoResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const objAttributes = this.readPostOpAttr();
if (status === 0) {
const rtmax = xdr.readUnsignedInt();
const rtpref = xdr.readUnsignedInt();
const rtmult = xdr.readUnsignedInt();
const wtmax = xdr.readUnsignedInt();
const wtpref = xdr.readUnsignedInt();
const wtmult = xdr.readUnsignedInt();
const dtpref = xdr.readUnsignedInt();
const maxfilesize = xdr.readUnsignedHyper();
const timeDelta = { seconds: xdr.readUnsignedInt(), nseconds: xdr.readUnsignedInt() };
const properties = xdr.readUnsignedInt();
resok = new msg.Nfsv3FsinfoResOk(objAttributes, rtmax, rtpref, rtmult, wtmax, wtpref, wtmult, dtpref, maxfilesize, timeDelta, properties);
}
else {
resfail = new msg.Nfsv3FsinfoResFail(objAttributes);
}
return new msg.Nfsv3FsinfoResponse(status, resok, resfail);
}
decodePathconfRequest() {
const object = this.readFh();
return new msg.Nfsv3PathconfRequest(object);
}
decodePathconfResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const objAttributes = this.readPostOpAttr();
if (status === 0) {
const linkmax = xdr.readUnsignedInt();
const namemax = xdr.readUnsignedInt();
const noTrunc = xdr.readBoolean();
const chownRestricted = xdr.readBoolean();
const caseInsensitive = xdr.readBoolean();
const casePreserving = xdr.readBoolean();
resok = new msg.Nfsv3PathconfResOk(objAttributes, linkmax, namemax, noTrunc, chownRestricted, caseInsensitive, casePreserving);
}
else {
resfail = new msg.Nfsv3PathconfResFail(objAttributes);
}
return new msg.Nfsv3PathconfResponse(status, resok, resfail);
}
decodeCommitRequest() {
const file = this.readFh();
const xdr = this.xdr;
const offset = xdr.readUnsignedHyper();
const count = xdr.readUnsignedInt();
return new msg.Nfsv3CommitRequest(file, offset, count);
}
decodeCommitResponse() {
const xdr = this.xdr;
const status = xdr.readUnsignedInt();
let resok;
let resfail;
const fileWcc = this.readWccData();
if (status === 0) {
const verf = xdr.readOpaque(8);
resok = new msg.Nfsv3CommitResOk(fileWcc, verf);
}
else {
resfail = new msg.Nfsv3CommitResFail(fileWcc);
}
return new msg.Nfsv3CommitResponse(status, resok, resfail);
}
}
exports.Nfsv3Decoder = Nfsv3Decoder;
//# sourceMappingURL=Nfsv3Decoder.js.map
File diff suppressed because one or more lines are too long
+80
View File
@@ -0,0 +1,80 @@
import { XdrEncoder } from '../../xdr/XdrEncoder';
import { Nfsv3Proc } from './constants';
import * as msg from './messages';
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
export declare class Nfsv3Encoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
readonly writer: W;
protected readonly xdr: XdrEncoder;
constructor(writer?: W);
encodeMessage(message: msg.Nfsv3Message, proc: Nfsv3Proc, isRequest: boolean): Uint8Array;
writeMessage(message: msg.Nfsv3Message, proc: Nfsv3Proc, isRequest: boolean): void;
private writeRequest;
private writeResponse;
private writeFh;
private writeFilename;
private writeTime;
private writeSpecData;
private writeFattr;
private writePostOpAttr;
private writeWccAttr;
private writePreOpAttr;
private writeWccData;
private writePostOpFh;
private writeSetMode;
private writeSetUid;
private writeSetGid;
private writeSetSize;
private writeSetAtime;
private writeSetMtime;
private writeSattr;
private writeSattrGuard;
private writeDirOpArgs;
private writeCreateHow;
private writeMknodData;
private writeEntry;
private writeEntryPlus;
private writeDirList;
private writeDirListPlus;
private writeGetattrRequest;
private writeGetattrResponse;
private writeSetattrRequest;
private writeSetattrResponse;
private writeLookupRequest;
private writeLookupResponse;
private writeAccessRequest;
private writeAccessResponse;
private writeReadlinkRequest;
private writeReadlinkResponse;
private writeReadRequest;
private writeReadResponse;
private writeWriteRequest;
private writeWriteResponse;
private writeCreateRequest;
private writeCreateResponse;
private writeMkdirRequest;
private writeMkdirResponse;
private writeSymlinkRequest;
private writeSymlinkResponse;
private writeMknodRequest;
private writeMknodResponse;
private writeRemoveRequest;
private writeRemoveResponse;
private writeRmdirRequest;
private writeRmdirResponse;
private writeRenameRequest;
private writeRenameResponse;
private writeLinkRequest;
private writeLinkResponse;
private writeReaddirRequest;
private writeReaddirResponse;
private writeReaddirplusRequest;
private writeReaddirplusResponse;
private writeFsstatRequest;
private writeFsstatResponse;
private writeFsinfoRequest;
private writeFsinfoResponse;
private writePathconfRequest;
private writePathconfResponse;
private writeCommitRequest;
private writeCommitResponse;
}
+659
View File
@@ -0,0 +1,659 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nfsv3Encoder = void 0;
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
const XdrEncoder_1 = require("../../xdr/XdrEncoder");
const errors_1 = require("./errors");
class Nfsv3Encoder {
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 1:
return this.writeGetattrRequest(request);
case 2:
return this.writeSetattrRequest(request);
case 3:
return this.writeLookupRequest(request);
case 4:
return this.writeAccessRequest(request);
case 5:
return this.writeReadlinkRequest(request);
case 6:
return this.writeReadRequest(request);
case 7:
return this.writeWriteRequest(request);
case 8:
return this.writeCreateRequest(request);
case 9:
return this.writeMkdirRequest(request);
case 10:
return this.writeSymlinkRequest(request);
case 11:
return this.writeMknodRequest(request);
case 12:
return this.writeRemoveRequest(request);
case 13:
return this.writeRmdirRequest(request);
case 14:
return this.writeRenameRequest(request);
case 15:
return this.writeLinkRequest(request);
case 16:
return this.writeReaddirRequest(request);
case 17:
return this.writeReaddirplusRequest(request);
case 18:
return this.writeFsstatRequest(request);
case 19:
return this.writeFsinfoRequest(request);
case 20:
return this.writePathconfRequest(request);
case 21:
return this.writeCommitRequest(request);
default:
throw new errors_1.Nfsv3EncodingError(`Unknown procedure: ${proc}`);
}
}
writeResponse(response, proc) {
switch (proc) {
case 1:
return this.writeGetattrResponse(response);
case 2:
return this.writeSetattrResponse(response);
case 3:
return this.writeLookupResponse(response);
case 4:
return this.writeAccessResponse(response);
case 5:
return this.writeReadlinkResponse(response);
case 6:
return this.writeReadResponse(response);
case 7:
return this.writeWriteResponse(response);
case 8:
return this.writeCreateResponse(response);
case 9:
return this.writeMkdirResponse(response);
case 10:
return this.writeSymlinkResponse(response);
case 11:
return this.writeMknodResponse(response);
case 12:
return this.writeRemoveResponse(response);
case 13:
return this.writeRmdirResponse(response);
case 14:
return this.writeRenameResponse(response);
case 15:
return this.writeLinkResponse(response);
case 16:
return this.writeReaddirResponse(response);
case 17:
return this.writeReaddirplusResponse(response);
case 18:
return this.writeFsstatResponse(response);
case 19:
return this.writeFsinfoResponse(response);
case 20:
return this.writePathconfResponse(response);
case 21:
return this.writeCommitResponse(response);
default:
throw new errors_1.Nfsv3EncodingError(`Unknown procedure: ${proc}`);
}
}
writeFh(fh) {
this.xdr.writeVarlenOpaque(fh.data);
}
writeFilename(filename) {
this.xdr.writeStr(filename);
}
writeTime(time) {
const xdr = this.xdr;
xdr.writeUnsignedInt(time.seconds);
xdr.writeUnsignedInt(time.nseconds);
}
writeSpecData(spec) {
const xdr = this.xdr;
xdr.writeUnsignedInt(spec.specdata1);
xdr.writeUnsignedInt(spec.specdata2);
}
writeFattr(attr) {
const xdr = this.xdr;
xdr.writeUnsignedInt(attr.type);
xdr.writeUnsignedInt(attr.mode);
xdr.writeUnsignedInt(attr.nlink);
xdr.writeUnsignedInt(attr.uid);
xdr.writeUnsignedInt(attr.gid);
xdr.writeUnsignedHyper(attr.size);
xdr.writeUnsignedHyper(attr.used);
this.writeSpecData(attr.rdev);
xdr.writeUnsignedHyper(attr.fsid);
xdr.writeUnsignedHyper(attr.fileid);
this.writeTime(attr.atime);
this.writeTime(attr.mtime);
this.writeTime(attr.ctime);
}
writePostOpAttr(attr) {
this.xdr.writeBoolean(attr.attributesFollow);
if (attr.attributesFollow && attr.attributes) {
this.writeFattr(attr.attributes);
}
}
writeWccAttr(attr) {
this.xdr.writeUnsignedHyper(attr.size);
this.writeTime(attr.mtime);
this.writeTime(attr.ctime);
}
writePreOpAttr(attr) {
this.xdr.writeBoolean(attr.attributesFollow);
if (attr.attributesFollow && attr.attributes) {
this.writeWccAttr(attr.attributes);
}
}
writeWccData(wcc) {
this.writePreOpAttr(wcc.before);
this.writePostOpAttr(wcc.after);
}
writePostOpFh(fh) {
this.xdr.writeBoolean(fh.handleFollows);
if (fh.handleFollows && fh.handle) {
this.writeFh(fh.handle);
}
}
writeSetMode(setMode) {
const xdr = this.xdr;
xdr.writeBoolean(setMode.set);
if (setMode.set && setMode.mode !== undefined) {
xdr.writeUnsignedInt(setMode.mode);
}
}
writeSetUid(setUid) {
const xdr = this.xdr;
xdr.writeBoolean(setUid.set);
if (setUid.set && setUid.uid !== undefined) {
xdr.writeUnsignedInt(setUid.uid);
}
}
writeSetGid(setGid) {
const xdr = this.xdr;
xdr.writeBoolean(setGid.set);
if (setGid.set && setGid.gid !== undefined) {
xdr.writeUnsignedInt(setGid.gid);
}
}
writeSetSize(setSize) {
const xdr = this.xdr;
xdr.writeBoolean(setSize.set);
if (setSize.set && setSize.size !== undefined) {
xdr.writeUnsignedHyper(setSize.size);
}
}
writeSetAtime(setAtime) {
this.xdr.writeUnsignedInt(setAtime.how);
if (setAtime.how === 2 && setAtime.atime) {
this.writeTime(setAtime.atime);
}
}
writeSetMtime(setMtime) {
const xdr = this.xdr;
xdr.writeUnsignedInt(setMtime.how);
if (setMtime.how === 2 && setMtime.mtime) {
this.writeTime(setMtime.mtime);
}
}
writeSattr(sattr) {
this.writeSetMode(sattr.mode);
this.writeSetUid(sattr.uid);
this.writeSetGid(sattr.gid);
this.writeSetSize(sattr.size);
this.writeSetAtime(sattr.atime);
this.writeSetMtime(sattr.mtime);
}
writeSattrGuard(guard) {
const xdr = this.xdr;
xdr.writeBoolean(guard.check);
if (guard.check && guard.objCtime) {
this.writeTime(guard.objCtime);
}
}
writeDirOpArgs(args) {
this.writeFh(args.dir);
this.writeFilename(args.name);
}
writeCreateHow(how) {
const xdr = this.xdr;
xdr.writeUnsignedInt(how.mode);
switch (how.mode) {
case 0:
case 1:
if (how.objAttributes) {
this.writeSattr(how.objAttributes);
}
break;
case 2:
if (how.verf) {
xdr.writeOpaque(how.verf);
}
break;
}
}
writeMknodData(data) {
this.xdr.writeUnsignedInt(data.type);
switch (data.type) {
case 4:
if (data.chr) {
this.writeSattr(data.chr.devAttributes);
this.writeSpecData(data.chr.spec);
}
break;
case 3:
if (data.blk) {
this.writeSattr(data.blk.devAttributes);
this.writeSpecData(data.blk.spec);
}
break;
case 6:
if (data.sock) {
this.writeSattr(data.sock);
}
break;
case 7:
if (data.pipe) {
this.writeSattr(data.pipe);
}
break;
}
}
writeEntry(entry) {
const xdr = this.xdr;
if (!entry) {
xdr.writeBoolean(false);
return;
}
xdr.writeBoolean(true);
xdr.writeUnsignedHyper(entry.fileid);
this.writeFilename(entry.name);
xdr.writeUnsignedHyper(entry.cookie);
this.writeEntry(entry.nextentry);
}
writeEntryPlus(entry) {
const xdr = this.xdr;
if (!entry) {
xdr.writeBoolean(false);
return;
}
xdr.writeBoolean(true);
xdr.writeUnsignedHyper(entry.fileid);
this.writeFilename(entry.name);
xdr.writeUnsignedHyper(entry.cookie);
this.writePostOpAttr(entry.nameAttributes);
this.writePostOpFh(entry.nameHandle);
this.writeEntryPlus(entry.nextentry);
}
writeDirList(dirList) {
this.writeEntry(dirList.entries);
this.xdr.writeBoolean(dirList.eof);
}
writeDirListPlus(dirList) {
this.writeEntryPlus(dirList.entries);
this.xdr.writeBoolean(dirList.eof);
}
writeGetattrRequest(req) {
this.writeFh(req.object);
}
writeGetattrResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeFattr(res.resok.objAttributes);
}
}
writeSetattrRequest(req) {
this.writeFh(req.object);
this.writeSattr(req.newAttributes);
this.writeSattrGuard(req.guard);
}
writeSetattrResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.objWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.objWcc);
}
}
writeLookupRequest(req) {
this.writeDirOpArgs(req.what);
}
writeLookupResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeFh(res.resok.object);
this.writePostOpAttr(res.resok.objAttributes);
this.writePostOpAttr(res.resok.dirAttributes);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.dirAttributes);
}
}
writeAccessRequest(req) {
this.writeFh(req.object);
this.xdr.writeUnsignedInt(req.access);
}
writeAccessResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.objAttributes);
xdr.writeUnsignedInt(res.resok.access);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.objAttributes);
}
}
writeReadlinkRequest(req) {
this.writeFh(req.symlink);
}
writeReadlinkResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.symlinkAttributes);
this.writeFilename(res.resok.data);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.symlinkAttributes);
}
}
writeReadRequest(req) {
this.writeFh(req.file);
const xdr = this.xdr;
xdr.writeUnsignedHyper(req.offset);
xdr.writeUnsignedInt(req.count);
}
writeReadResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.fileAttributes);
xdr.writeUnsignedInt(res.resok.count);
xdr.writeBoolean(res.resok.eof);
xdr.writeVarlenOpaque(res.resok.data);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.fileAttributes);
}
}
writeWriteRequest(req) {
this.writeFh(req.file);
const xdr = this.xdr;
xdr.writeUnsignedHyper(req.offset);
xdr.writeUnsignedInt(req.count);
xdr.writeUnsignedInt(req.stable);
xdr.writeVarlenOpaque(req.data);
}
writeWriteResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.fileWcc);
xdr.writeUnsignedInt(res.resok.count);
xdr.writeUnsignedInt(res.resok.committed);
xdr.writeOpaque(res.resok.verf);
}
else if (res.resfail) {
this.writeWccData(res.resfail.fileWcc);
}
}
writeCreateRequest(req) {
this.writeDirOpArgs(req.where);
this.writeCreateHow(req.how);
}
writeCreateResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpFh(res.resok.obj);
this.writePostOpAttr(res.resok.objAttributes);
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeMkdirRequest(req) {
this.writeDirOpArgs(req.where);
this.writeSattr(req.attributes);
}
writeMkdirResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpFh(res.resok.obj);
this.writePostOpAttr(res.resok.objAttributes);
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeSymlinkRequest(req) {
this.writeDirOpArgs(req.where);
this.writeSattr(req.symlinkAttributes);
this.writeFilename(req.symlinkData);
}
writeSymlinkResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpFh(res.resok.obj);
this.writePostOpAttr(res.resok.objAttributes);
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeMknodRequest(req) {
this.writeDirOpArgs(req.where);
this.writeMknodData(req.what);
}
writeMknodResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpFh(res.resok.obj);
this.writePostOpAttr(res.resok.objAttributes);
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeRemoveRequest(req) {
this.writeDirOpArgs(req.object);
}
writeRemoveResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeRmdirRequest(req) {
this.writeDirOpArgs(req.object);
}
writeRmdirResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.dirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.dirWcc);
}
}
writeRenameRequest(req) {
this.writeDirOpArgs(req.from);
this.writeDirOpArgs(req.to);
}
writeRenameResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.fromDirWcc);
this.writeWccData(res.resok.toDirWcc);
}
else if (res.resfail) {
this.writeWccData(res.resfail.fromDirWcc);
this.writeWccData(res.resfail.toDirWcc);
}
}
writeLinkRequest(req) {
this.writeFh(req.file);
this.writeDirOpArgs(req.link);
}
writeLinkResponse(res) {
this.xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.fileAttributes);
this.writeWccData(res.resok.linkDirWcc);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.fileAttributes);
this.writeWccData(res.resfail.linkDirWcc);
}
}
writeReaddirRequest(req) {
this.writeFh(req.dir);
const xdr = this.xdr;
xdr.writeUnsignedHyper(req.cookie);
xdr.writeOpaque(req.cookieverf);
xdr.writeUnsignedInt(req.count);
}
writeReaddirResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.dirAttributes);
xdr.writeOpaque(res.resok.cookieverf);
this.writeDirList(res.resok.reply);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.dirAttributes);
}
}
writeReaddirplusRequest(req) {
this.writeFh(req.dir);
const xdr = this.xdr;
xdr.writeUnsignedHyper(req.cookie);
xdr.writeOpaque(req.cookieverf);
xdr.writeUnsignedInt(req.dircount);
xdr.writeUnsignedInt(req.maxcount);
}
writeReaddirplusResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.dirAttributes);
xdr.writeOpaque(res.resok.cookieverf);
this.writeDirListPlus(res.resok.reply);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.dirAttributes);
}
}
writeFsstatRequest(req) {
this.writeFh(req.fsroot);
}
writeFsstatResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.objAttributes);
xdr.writeUnsignedHyper(res.resok.tbytes);
xdr.writeUnsignedHyper(res.resok.fbytes);
xdr.writeUnsignedHyper(res.resok.abytes);
xdr.writeUnsignedHyper(res.resok.tfiles);
xdr.writeUnsignedHyper(res.resok.ffiles);
xdr.writeUnsignedHyper(res.resok.afiles);
xdr.writeUnsignedInt(res.resok.invarsec);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.objAttributes);
}
}
writeFsinfoRequest(req) {
this.writeFh(req.fsroot);
}
writeFsinfoResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.objAttributes);
xdr.writeUnsignedInt(res.resok.rtmax);
xdr.writeUnsignedInt(res.resok.rtpref);
xdr.writeUnsignedInt(res.resok.rtmult);
xdr.writeUnsignedInt(res.resok.wtmax);
xdr.writeUnsignedInt(res.resok.wtpref);
xdr.writeUnsignedInt(res.resok.wtmult);
xdr.writeUnsignedInt(res.resok.dtpref);
xdr.writeUnsignedHyper(res.resok.maxfilesize);
xdr.writeUnsignedInt(res.resok.timeDelta.seconds);
xdr.writeUnsignedInt(res.resok.timeDelta.nseconds);
xdr.writeUnsignedInt(res.resok.properties);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.objAttributes);
}
}
writePathconfRequest(req) {
this.writeFh(req.object);
}
writePathconfResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writePostOpAttr(res.resok.objAttributes);
xdr.writeUnsignedInt(res.resok.linkmax);
xdr.writeUnsignedInt(res.resok.namemax);
xdr.writeBoolean(res.resok.noTrunc);
xdr.writeBoolean(res.resok.chownRestricted);
xdr.writeBoolean(res.resok.caseInsensitive);
xdr.writeBoolean(res.resok.casePreserving);
}
else if (res.resfail) {
this.writePostOpAttr(res.resfail.objAttributes);
}
}
writeCommitRequest(req) {
this.writeFh(req.file);
const xdr = this.xdr;
xdr.writeUnsignedHyper(req.offset);
xdr.writeUnsignedInt(req.count);
}
writeCommitResponse(res) {
const xdr = this.xdr;
xdr.writeUnsignedInt(res.status);
if (res.status === 0 && res.resok) {
this.writeWccData(res.resok.fileWcc);
xdr.writeOpaque(res.resok.verf);
}
else if (res.resfail) {
this.writeWccData(res.resfail.fileWcc);
}
}
}
exports.Nfsv3Encoder = Nfsv3Encoder;
//# sourceMappingURL=Nfsv3Encoder.js.map
File diff suppressed because one or more lines are too long
+115
View File
@@ -0,0 +1,115 @@
export declare const enum Nfsv3Const {
PROGRAM = 100003,
VERSION = 3,
FHSIZE = 64,
COOKIEVERFSIZE = 8,
CREATEVERFSIZE = 8,
WRITEVERFSIZE = 8
}
export declare const enum Nfsv3Proc {
NULL = 0,
GETATTR = 1,
SETATTR = 2,
LOOKUP = 3,
ACCESS = 4,
READLINK = 5,
READ = 6,
WRITE = 7,
CREATE = 8,
MKDIR = 9,
SYMLINK = 10,
MKNOD = 11,
REMOVE = 12,
RMDIR = 13,
RENAME = 14,
LINK = 15,
READDIR = 16,
READDIRPLUS = 17,
FSSTAT = 18,
FSINFO = 19,
PATHCONF = 20,
COMMIT = 21
}
export declare const enum Nfsv3Stat {
NFS3_OK = 0,
NFS3ERR_PERM = 1,
NFS3ERR_NOENT = 2,
NFS3ERR_IO = 5,
NFS3ERR_NXIO = 6,
NFS3ERR_ACCES = 13,
NFS3ERR_EXIST = 17,
NFS3ERR_XDEV = 18,
NFS3ERR_NODEV = 19,
NFS3ERR_NOTDIR = 20,
NFS3ERR_ISDIR = 21,
NFS3ERR_INVAL = 22,
NFS3ERR_FBIG = 27,
NFS3ERR_NOSPC = 28,
NFS3ERR_ROFS = 30,
NFS3ERR_MLINK = 31,
NFS3ERR_NAMETOOLONG = 63,
NFS3ERR_NOTEMPTY = 66,
NFS3ERR_DQUOT = 69,
NFS3ERR_STALE = 70,
NFS3ERR_REMOTE = 71,
NFS3ERR_BADHANDLE = 10001,
NFS3ERR_NOT_SYNC = 10002,
NFS3ERR_BAD_COOKIE = 10003,
NFS3ERR_NOTSUPP = 10004,
NFS3ERR_TOOSMALL = 10005,
NFS3ERR_SERVERFAULT = 10006,
NFS3ERR_BADTYPE = 10007,
NFS3ERR_JUKEBOX = 10008
}
export declare const enum Nfsv3FType {
NF3REG = 1,
NF3DIR = 2,
NF3BLK = 3,
NF3CHR = 4,
NF3LNK = 5,
NF3SOCK = 6,
NF3FIFO = 7
}
export declare const enum Nfsv3TimeHow {
DONT_CHANGE = 0,
SET_TO_SERVER_TIME = 1,
SET_TO_CLIENT_TIME = 2
}
export declare const enum Nfsv3StableHow {
UNSTABLE = 0,
DATA_SYNC = 1,
FILE_SYNC = 2
}
export declare const enum Nfsv3CreateMode {
UNCHECKED = 0,
GUARDED = 1,
EXCLUSIVE = 2
}
export declare const enum Nfsv3Access {
READ = 1,
LOOKUP = 2,
MODIFY = 4,
EXTEND = 8,
DELETE = 16,
EXECUTE = 32
}
export declare const enum Nfsv3Mode {
SUID = 2048,
SGID = 1024,
SVTX = 512,
RUSR = 256,
WUSR = 128,
XUSR = 64,
RGRP = 32,
WGRP = 16,
XGRP = 8,
ROTH = 4,
WOTH = 2,
XOTH = 1
}
export declare const enum Nfsv3Fsf {
LINK = 1,
SYMLINK = 2,
HOMOGENEOUS = 8,
CANSETTIME = 16
}
+3
View File
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=constants.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/nfs/v3/constants.ts"],"names":[],"mappings":""}
+6
View File
@@ -0,0 +1,6 @@
export declare class Nfsv3DecodingError extends Error {
constructor(message?: string);
}
export declare class Nfsv3EncodingError extends Error {
constructor(message?: string);
}
+16
View File
@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nfsv3EncodingError = exports.Nfsv3DecodingError = void 0;
class Nfsv3DecodingError extends Error {
constructor(message) {
super(message ? 'NFSv3_DECODING: ' + message : 'NFSv3_DECODING');
}
}
exports.Nfsv3DecodingError = Nfsv3DecodingError;
class Nfsv3EncodingError extends Error {
constructor(message) {
super(message ? 'NFSv3_ENCODING: ' + message : 'NFSv3_ENCODING');
}
}
exports.Nfsv3EncodingError = Nfsv3EncodingError;
//# sourceMappingURL=errors.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/nfs/v3/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACnE,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACnE,CAAC;CACF;AAJD,gDAIC"}
+6
View File
@@ -0,0 +1,6 @@
export * from './constants';
export * from './structs';
export * from './messages';
export * from './Nfsv3Decoder';
export * from './Nfsv3Encoder';
export * from './FullNfsv3Encoder';
+10
View File
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./constants"), exports);
tslib_1.__exportStar(require("./structs"), exports);
tslib_1.__exportStar(require("./messages"), exports);
tslib_1.__exportStar(require("./Nfsv3Decoder"), exports);
tslib_1.__exportStar(require("./Nfsv3Encoder"), exports);
tslib_1.__exportStar(require("./FullNfsv3Encoder"), exports);
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nfs/v3/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,oDAA0B;AAC1B,qDAA2B;AAC3B,yDAA+B;AAC/B,yDAA+B;AAC/B,6DAAmC"}
+33
View File
@@ -0,0 +1,33 @@
import { Reader } from '@jsonjoy.com/buffers/lib/Reader';
import { XdrDecoder } from '../../../xdr/XdrDecoder';
import { NlmProc } from './constants';
import * as msg from './messages';
export declare class NlmDecoder {
protected readonly xdr: XdrDecoder;
constructor(reader?: Reader);
decodeMessage(reader: Reader, proc: NlmProc, isRequest: boolean): msg.NlmMessage | undefined;
private decodeRequest;
private decodeResponse;
private readCookie;
private readNetobj;
private readNlm4Holder;
private readNlm4Lock;
private readNlm4Share;
private readTestArgs;
private readLockArgs;
private readCancelArgs;
private readUnlockArgs;
private readShareArgs;
private decodeTestRequest;
private decodeTestResponse;
private decodeLockRequest;
private decodeResponse4;
private decodeCancelRequest;
private decodeUnlockRequest;
private decodeGrantedRequest;
private decodeShareRequest;
private decodeShareResponse;
private decodeUnshareRequest;
private decodeNmLockRequest;
private decodeFreeAllRequest;
}
+209
View File
@@ -0,0 +1,209 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NlmDecoder = 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 NlmDecoder {
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.decodeTestRequest();
case 2:
return this.decodeLockRequest();
case 3:
return this.decodeCancelRequest();
case 4:
return this.decodeUnlockRequest();
case 5:
return this.decodeGrantedRequest();
case 20:
return this.decodeShareRequest();
case 21:
return this.decodeUnshareRequest();
case 22:
return this.decodeNmLockRequest();
case 23:
return this.decodeFreeAllRequest();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown NLM procedure: ${proc}`);
}
}
decodeResponse(proc) {
switch (proc) {
case 0:
return undefined;
case 1:
return this.decodeTestResponse();
case 2:
case 3:
case 4:
case 5:
case 22:
return this.decodeResponse4();
case 20:
case 21:
return this.decodeShareResponse();
default:
throw new errors_1.Nfsv3DecodingError(`Unknown NLM procedure: ${proc}`);
}
}
readCookie() {
const data = this.xdr.readVarlenOpaque();
return new Reader_1.Reader(data);
}
readNetobj() {
const data = this.xdr.readVarlenOpaque();
return new Reader_1.Reader(data);
}
readNlm4Holder() {
const xdr = this.xdr;
const exclusive = xdr.readBoolean();
const svid = xdr.readInt();
const oh = this.readNetobj();
const offset = xdr.readUnsignedHyper();
const length = xdr.readUnsignedHyper();
return new structs.Nlm4Holder(exclusive, svid, oh, offset, length);
}
readNlm4Lock() {
const xdr = this.xdr;
const callerName = xdr.readString();
const fh = this.readNetobj();
const oh = this.readNetobj();
const svid = xdr.readInt();
const offset = xdr.readUnsignedHyper();
const length = xdr.readUnsignedHyper();
return new structs.Nlm4Lock(callerName, fh, oh, svid, offset, length);
}
readNlm4Share() {
const xdr = this.xdr;
const callerName = xdr.readString();
const fh = this.readNetobj();
const oh = this.readNetobj();
const mode = xdr.readUnsignedInt();
const access = xdr.readUnsignedInt();
return new structs.Nlm4Share(callerName, fh, oh, mode, access);
}
readTestArgs() {
const cookie = this.readCookie();
const exclusive = this.xdr.readBoolean();
const lock = this.readNlm4Lock();
return new msg.Nlm4TestArgs(cookie, exclusive, lock);
}
readLockArgs() {
const xdr = this.xdr;
const cookie = this.readCookie();
const block = xdr.readBoolean();
const exclusive = xdr.readBoolean();
const lock = this.readNlm4Lock();
const reclaim = xdr.readBoolean();
const state = xdr.readInt();
return new msg.Nlm4LockArgs(cookie, block, exclusive, lock, reclaim, state);
}
readCancelArgs() {
const xdr = this.xdr;
const cookie = this.readCookie();
const block = xdr.readBoolean();
const exclusive = xdr.readBoolean();
const lock = this.readNlm4Lock();
return new msg.Nlm4CancelArgs(cookie, block, exclusive, lock);
}
readUnlockArgs() {
const cookie = this.readCookie();
const lock = this.readNlm4Lock();
return new msg.Nlm4UnlockArgs(cookie, lock);
}
readShareArgs() {
const cookie = this.readCookie();
const share = this.readNlm4Share();
const reclaim = this.xdr.readBoolean();
return new msg.Nlm4ShareArgs(cookie, share, reclaim);
}
decodeTestRequest() {
const args = this.readTestArgs();
return new msg.Nlm4TestRequest(args);
}
decodeTestResponse() {
const xdr = this.xdr;
const cookie = this.readCookie();
const stat = xdr.readUnsignedInt();
const holder = stat === 1 ? this.readNlm4Holder() : undefined;
return new msg.Nlm4TestResponse(cookie, stat, holder);
}
decodeLockRequest() {
const args = this.readLockArgs();
return new msg.Nlm4LockRequest(args);
}
decodeResponse4() {
const cookie = this.readCookie();
const stat = this.xdr.readUnsignedInt();
return new msg.Nlm4Response(cookie, stat);
}
decodeCancelRequest() {
const args = this.readCancelArgs();
return new msg.Nlm4CancelRequest(args);
}
decodeUnlockRequest() {
const args = this.readUnlockArgs();
return new msg.Nlm4UnlockRequest(args);
}
decodeGrantedRequest() {
const args = this.readTestArgs();
return new msg.Nlm4GrantedRequest(args);
}
decodeShareRequest() {
const args = this.readShareArgs();
return new msg.Nlm4ShareRequest(args);
}
decodeShareResponse() {
const xdr = this.xdr;
const cookie = this.readCookie();
const stat = xdr.readUnsignedInt();
const sequence = xdr.readInt();
return new msg.Nlm4ShareResponse(cookie, stat, sequence);
}
decodeUnshareRequest() {
const args = this.readShareArgs();
return new msg.Nlm4UnshareRequest(args);
}
decodeNmLockRequest() {
const args = this.readLockArgs();
return new msg.Nlm4NmLockRequest(args);
}
decodeFreeAllRequest() {
const xdr = this.xdr;
const name = xdr.readString();
const state = xdr.readInt();
const notify = new structs.Nlm4Notify(name, state);
return new msg.Nlm4FreeAllRequest(notify);
}
}
exports.NlmDecoder = NlmDecoder;
//# sourceMappingURL=NlmDecoder.js.map
File diff suppressed because one or more lines are too long
+35
View File
@@ -0,0 +1,35 @@
import { XdrEncoder } from '../../../xdr/XdrEncoder';
import { NlmProc } from './constants';
import * as msg from './messages';
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
export declare class NlmEncoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
readonly writer: W;
protected readonly xdr: XdrEncoder;
constructor(writer?: W);
encodeMessage(message: msg.NlmMessage, proc: NlmProc, isRequest: boolean): Uint8Array;
writeMessage(message: msg.NlmMessage, proc: NlmProc, isRequest: boolean): void;
private writeRequest;
private writeResponse;
private writeCookie;
private writeNetobj;
private writeNlm4Holder;
private writeNlm4Lock;
private writeNlm4Share;
private writeTestArgs;
private writeLockArgs;
private writeCancelArgs;
private writeUnlockArgs;
private writeShareArgs;
private writeTestRequest;
private writeTestResponse;
private writeLockRequest;
private writeResponse4;
private writeCancelRequest;
private writeUnlockRequest;
private writeGrantedRequest;
private writeShareRequest;
private writeShareResponse;
private writeUnshareRequest;
private writeNmLockRequest;
private writeFreeAllRequest;
}
+182
View File
@@ -0,0 +1,182 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NlmEncoder = void 0;
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
const XdrEncoder_1 = require("../../../xdr/XdrEncoder");
const errors_1 = require("../errors");
class NlmEncoder {
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.writeTestRequest(request);
case 2:
return this.writeLockRequest(request);
case 3:
return this.writeCancelRequest(request);
case 4:
return this.writeUnlockRequest(request);
case 5:
return this.writeGrantedRequest(request);
case 20:
return this.writeShareRequest(request);
case 21:
return this.writeUnshareRequest(request);
case 22:
return this.writeNmLockRequest(request);
case 23:
return this.writeFreeAllRequest(request);
default:
throw new errors_1.Nfsv3EncodingError(`Unknown NLM procedure: ${proc}`);
}
}
writeResponse(response, proc) {
switch (proc) {
case 0:
return;
case 1:
return this.writeTestResponse(response);
case 2:
case 3:
case 4:
case 5:
case 22:
return this.writeResponse4(response);
case 20:
case 21:
return this.writeShareResponse(response);
default:
throw new errors_1.Nfsv3EncodingError(`Unknown NLM procedure: ${proc}`);
}
}
writeCookie(cookie) {
const data = cookie.uint8;
this.xdr.writeVarlenOpaque(data);
}
writeNetobj(obj) {
const data = obj.uint8;
this.xdr.writeVarlenOpaque(data);
}
writeNlm4Holder(holder) {
const xdr = this.xdr;
xdr.writeBoolean(holder.exclusive);
xdr.writeInt(holder.svid);
this.writeNetobj(holder.oh);
xdr.writeUnsignedHyper(holder.offset);
xdr.writeUnsignedHyper(holder.length);
}
writeNlm4Lock(lock) {
const xdr = this.xdr;
xdr.writeStr(lock.callerName);
this.writeNetobj(lock.fh);
this.writeNetobj(lock.oh);
xdr.writeInt(lock.svid);
xdr.writeUnsignedHyper(lock.offset);
xdr.writeUnsignedHyper(lock.length);
}
writeNlm4Share(share) {
const xdr = this.xdr;
xdr.writeStr(share.callerName);
this.writeNetobj(share.fh);
this.writeNetobj(share.oh);
xdr.writeUnsignedInt(share.mode);
xdr.writeUnsignedInt(share.access);
}
writeTestArgs(args) {
this.writeCookie(args.cookie);
this.xdr.writeBoolean(args.exclusive);
this.writeNlm4Lock(args.lock);
}
writeLockArgs(args) {
const xdr = this.xdr;
this.writeCookie(args.cookie);
xdr.writeBoolean(args.block);
xdr.writeBoolean(args.exclusive);
this.writeNlm4Lock(args.lock);
xdr.writeBoolean(args.reclaim);
xdr.writeInt(args.state);
}
writeCancelArgs(args) {
const xdr = this.xdr;
this.writeCookie(args.cookie);
xdr.writeBoolean(args.block);
xdr.writeBoolean(args.exclusive);
this.writeNlm4Lock(args.lock);
}
writeUnlockArgs(args) {
this.writeCookie(args.cookie);
this.writeNlm4Lock(args.lock);
}
writeShareArgs(args) {
this.writeCookie(args.cookie);
this.writeNlm4Share(args.share);
this.xdr.writeBoolean(args.reclaim);
}
writeTestRequest(req) {
this.writeTestArgs(req.args);
}
writeTestResponse(res) {
const xdr = this.xdr;
this.writeCookie(res.cookie);
xdr.writeUnsignedInt(res.stat);
if (res.stat === 1 && res.holder) {
this.writeNlm4Holder(res.holder);
}
}
writeLockRequest(req) {
this.writeLockArgs(req.args);
}
writeResponse4(res) {
this.writeCookie(res.cookie);
this.xdr.writeUnsignedInt(res.stat);
}
writeCancelRequest(req) {
this.writeCancelArgs(req.args);
}
writeUnlockRequest(req) {
this.writeUnlockArgs(req.args);
}
writeGrantedRequest(req) {
this.writeTestArgs(req.args);
}
writeShareRequest(req) {
this.writeShareArgs(req.args);
}
writeShareResponse(res) {
const xdr = this.xdr;
this.writeCookie(res.cookie);
xdr.writeUnsignedInt(res.stat);
xdr.writeInt(res.sequence);
}
writeUnshareRequest(req) {
this.writeShareArgs(req.args);
}
writeNmLockRequest(req) {
this.writeLockArgs(req.args);
}
writeFreeAllRequest(req) {
const xdr = this.xdr;
xdr.writeStr(req.notify.name);
xdr.writeInt(req.notify.state);
}
}
exports.NlmEncoder = NlmEncoder;
//# sourceMappingURL=NlmEncoder.js.map
File diff suppressed because one or more lines are too long
+39
View File
@@ -0,0 +1,39 @@
export declare const enum NlmConst {
PROGRAM = 100021,
VERSION = 4,
LM_MAXSTRLEN = 1024
}
export declare const enum NlmProc {
NULL = 0,
TEST = 1,
LOCK = 2,
CANCEL = 3,
UNLOCK = 4,
GRANTED = 5,
TEST_MSG = 6,
LOCK_MSG = 7,
CANCEL_MSG = 8,
UNLOCK_MSG = 9,
GRANTED_MSG = 10,
TEST_RES = 11,
LOCK_RES = 12,
CANCEL_RES = 13,
UNLOCK_RES = 14,
GRANTED_RES = 15,
SHARE = 20,
UNSHARE = 21,
NM_LOCK = 22,
FREE_ALL = 23
}
export declare const enum Nlm4Stat {
NLM4_GRANTED = 0,
NLM4_DENIED = 1,
NLM4_DENIED_NOLOCKS = 2,
NLM4_BLOCKED = 3,
NLM4_DENIED_GRACE_PERIOD = 4,
NLM4_DEADLCK = 5,
NLM4_ROFS = 6,
NLM4_STALE_FH = 7,
NLM4_FBIG = 8,
NLM4_FAILED = 9
}
+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/locks/constants.ts"],"names":[],"mappings":""}
+96
View File
@@ -0,0 +1,96 @@
import { Nlm4Stat } from './constants';
import type { Reader } from '@jsonjoy.com/buffers/lib/Reader';
import type * as stucts from './structs';
export type NlmMessage = NlmRequest | NlmResponse;
export type NlmRequest = Nlm4TestRequest | Nlm4LockRequest | Nlm4CancelRequest | Nlm4UnlockRequest | Nlm4GrantedRequest | Nlm4ShareRequest | Nlm4UnshareRequest | Nlm4NmLockRequest | Nlm4FreeAllRequest;
export type NlmResponse = Nlm4TestResponse | Nlm4Response | Nlm4ShareResponse;
export declare class Nlm4TestArgs {
readonly cookie: Reader;
readonly exclusive: boolean;
readonly lock: stucts.Nlm4Lock;
constructor(cookie: Reader, exclusive: boolean, lock: stucts.Nlm4Lock);
}
export declare class Nlm4TestRequest {
readonly args: Nlm4TestArgs;
constructor(args: Nlm4TestArgs);
}
export declare class Nlm4TestDenied {
readonly holder: stucts.Nlm4Holder;
constructor(holder: stucts.Nlm4Holder);
}
export declare class Nlm4TestResponse {
readonly cookie: Reader;
readonly stat: Nlm4Stat;
readonly holder?: stucts.Nlm4Holder | undefined;
constructor(cookie: Reader, stat: Nlm4Stat, holder?: stucts.Nlm4Holder | undefined);
}
export declare class Nlm4LockArgs {
readonly cookie: Reader;
readonly block: boolean;
readonly exclusive: boolean;
readonly lock: stucts.Nlm4Lock;
readonly reclaim: boolean;
readonly state: number;
constructor(cookie: Reader, block: boolean, exclusive: boolean, lock: stucts.Nlm4Lock, reclaim: boolean, state: number);
}
export declare class Nlm4LockRequest {
readonly args: Nlm4LockArgs;
constructor(args: Nlm4LockArgs);
}
export declare class Nlm4Response {
readonly cookie: Reader;
readonly stat: Nlm4Stat;
constructor(cookie: Reader, stat: Nlm4Stat);
}
export declare class Nlm4CancelArgs {
readonly cookie: Reader;
readonly block: boolean;
readonly exclusive: boolean;
readonly lock: stucts.Nlm4Lock;
constructor(cookie: Reader, block: boolean, exclusive: boolean, lock: stucts.Nlm4Lock);
}
export declare class Nlm4CancelRequest {
readonly args: Nlm4CancelArgs;
constructor(args: Nlm4CancelArgs);
}
export declare class Nlm4UnlockArgs {
readonly cookie: Reader;
readonly lock: stucts.Nlm4Lock;
constructor(cookie: Reader, lock: stucts.Nlm4Lock);
}
export declare class Nlm4UnlockRequest {
readonly args: Nlm4UnlockArgs;
constructor(args: Nlm4UnlockArgs);
}
export declare class Nlm4GrantedRequest {
readonly args: Nlm4TestArgs;
constructor(args: Nlm4TestArgs);
}
export declare class Nlm4ShareArgs {
readonly cookie: Reader;
readonly share: stucts.Nlm4Share;
readonly reclaim: boolean;
constructor(cookie: Reader, share: stucts.Nlm4Share, reclaim: boolean);
}
export declare class Nlm4ShareRequest {
readonly args: Nlm4ShareArgs;
constructor(args: Nlm4ShareArgs);
}
export declare class Nlm4ShareResponse {
readonly cookie: Reader;
readonly stat: Nlm4Stat;
readonly sequence: number;
constructor(cookie: Reader, stat: Nlm4Stat, sequence: number);
}
export declare class Nlm4UnshareRequest {
readonly args: Nlm4ShareArgs;
constructor(args: Nlm4ShareArgs);
}
export declare class Nlm4NmLockRequest {
readonly args: Nlm4LockArgs;
constructor(args: Nlm4LockArgs);
}
export declare class Nlm4FreeAllRequest {
readonly notify: stucts.Nlm4Notify;
constructor(notify: stucts.Nlm4Notify);
}
+130
View File
@@ -0,0 +1,130 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nlm4FreeAllRequest = exports.Nlm4NmLockRequest = exports.Nlm4UnshareRequest = exports.Nlm4ShareResponse = exports.Nlm4ShareRequest = exports.Nlm4ShareArgs = exports.Nlm4GrantedRequest = exports.Nlm4UnlockRequest = exports.Nlm4UnlockArgs = exports.Nlm4CancelRequest = exports.Nlm4CancelArgs = exports.Nlm4Response = exports.Nlm4LockRequest = exports.Nlm4LockArgs = exports.Nlm4TestResponse = exports.Nlm4TestDenied = exports.Nlm4TestRequest = exports.Nlm4TestArgs = void 0;
class Nlm4TestArgs {
constructor(cookie, exclusive, lock) {
this.cookie = cookie;
this.exclusive = exclusive;
this.lock = lock;
}
}
exports.Nlm4TestArgs = Nlm4TestArgs;
class Nlm4TestRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4TestRequest = Nlm4TestRequest;
class Nlm4TestDenied {
constructor(holder) {
this.holder = holder;
}
}
exports.Nlm4TestDenied = Nlm4TestDenied;
class Nlm4TestResponse {
constructor(cookie, stat, holder) {
this.cookie = cookie;
this.stat = stat;
this.holder = holder;
}
}
exports.Nlm4TestResponse = Nlm4TestResponse;
class Nlm4LockArgs {
constructor(cookie, block, exclusive, lock, reclaim, state) {
this.cookie = cookie;
this.block = block;
this.exclusive = exclusive;
this.lock = lock;
this.reclaim = reclaim;
this.state = state;
}
}
exports.Nlm4LockArgs = Nlm4LockArgs;
class Nlm4LockRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4LockRequest = Nlm4LockRequest;
class Nlm4Response {
constructor(cookie, stat) {
this.cookie = cookie;
this.stat = stat;
}
}
exports.Nlm4Response = Nlm4Response;
class Nlm4CancelArgs {
constructor(cookie, block, exclusive, lock) {
this.cookie = cookie;
this.block = block;
this.exclusive = exclusive;
this.lock = lock;
}
}
exports.Nlm4CancelArgs = Nlm4CancelArgs;
class Nlm4CancelRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4CancelRequest = Nlm4CancelRequest;
class Nlm4UnlockArgs {
constructor(cookie, lock) {
this.cookie = cookie;
this.lock = lock;
}
}
exports.Nlm4UnlockArgs = Nlm4UnlockArgs;
class Nlm4UnlockRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4UnlockRequest = Nlm4UnlockRequest;
class Nlm4GrantedRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4GrantedRequest = Nlm4GrantedRequest;
class Nlm4ShareArgs {
constructor(cookie, share, reclaim) {
this.cookie = cookie;
this.share = share;
this.reclaim = reclaim;
}
}
exports.Nlm4ShareArgs = Nlm4ShareArgs;
class Nlm4ShareRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4ShareRequest = Nlm4ShareRequest;
class Nlm4ShareResponse {
constructor(cookie, stat, sequence) {
this.cookie = cookie;
this.stat = stat;
this.sequence = sequence;
}
}
exports.Nlm4ShareResponse = Nlm4ShareResponse;
class Nlm4UnshareRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4UnshareRequest = Nlm4UnshareRequest;
class Nlm4NmLockRequest {
constructor(args) {
this.args = args;
}
}
exports.Nlm4NmLockRequest = Nlm4NmLockRequest;
class Nlm4FreeAllRequest {
constructor(notify) {
this.notify = notify;
}
}
exports.Nlm4FreeAllRequest = Nlm4FreeAllRequest;
//# sourceMappingURL=messages.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../src/nfs/v3/locks/messages.ts"],"names":[],"mappings":";;;AA0BA,MAAa,YAAY;IACvB,YACkB,MAAc,EACd,SAAkB,E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B;IAC7B,YAA4B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;CAC1D;AAFD,gDAEC"}
+31
View File
@@ -0,0 +1,31 @@
import type { Reader } from '@jsonjoy.com/buffers/lib/Reader';
export declare class Nlm4Holder {
readonly exclusive: boolean;
readonly svid: number;
readonly oh: Reader;
readonly offset: bigint;
readonly length: bigint;
constructor(exclusive: boolean, svid: number, oh: Reader, offset: bigint, length: bigint);
}
export declare class Nlm4Lock {
readonly callerName: string;
readonly fh: Reader;
readonly oh: Reader;
readonly svid: number;
readonly offset: bigint;
readonly length: bigint;
constructor(callerName: string, fh: Reader, oh: Reader, svid: number, offset: bigint, length: bigint);
}
export declare class Nlm4Share {
readonly callerName: string;
readonly fh: Reader;
readonly oh: Reader;
readonly mode: number;
readonly access: number;
constructor(callerName: string, fh: Reader, oh: Reader, mode: number, access: number);
}
export declare class Nlm4Notify {
readonly name: string;
readonly state: number;
constructor(name: string, state: number);
}
+42
View File
@@ -0,0 +1,42 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nlm4Notify = exports.Nlm4Share = exports.Nlm4Lock = exports.Nlm4Holder = void 0;
class Nlm4Holder {
constructor(exclusive, svid, oh, offset, length) {
this.exclusive = exclusive;
this.svid = svid;
this.oh = oh;
this.offset = offset;
this.length = length;
}
}
exports.Nlm4Holder = Nlm4Holder;
class Nlm4Lock {
constructor(callerName, fh, oh, svid, offset, length) {
this.callerName = callerName;
this.fh = fh;
this.oh = oh;
this.svid = svid;
this.offset = offset;
this.length = length;
}
}
exports.Nlm4Lock = Nlm4Lock;
class Nlm4Share {
constructor(callerName, fh, oh, mode, access) {
this.callerName = callerName;
this.fh = fh;
this.oh = oh;
this.mode = mode;
this.access = access;
}
}
exports.Nlm4Share = Nlm4Share;
class Nlm4Notify {
constructor(name, state) {
this.name = name;
this.state = state;
}
}
exports.Nlm4Notify = Nlm4Notify;
//# sourceMappingURL=structs.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../src/nfs/v3/locks/structs.ts"],"names":[],"mappings":";;;AASA,MAAa,UAAU;IACrB,YACkB,SAAkB,EAClB,IAAY,EACZ,EAAU,EACV,MAAc,EACd,MAAc;QAJd,cAAS,GAAT,SAAS,CAAS;QAClB,SAAI,GAAJ,IAAI,CAAQ;QACZ,OAAE,GAAF,EAAE,CAAQ;QACV,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;CACL;AARD,gCAQC;AAKD,MAAa,QAAQ;IACnB,YACkB,UAAkB,EAClB,EAAU,EACV,EAAU,EACV,IAAY,EACZ,MAAc,EACd,MAAc;QALd,eAAU,GAAV,UAAU,CAAQ;QAClB,OAAE,GAAF,EAAE,CAAQ;QACV,OAAE,GAAF,EAAE,CAAQ;QACV,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;CACL;AATD,4BASC;AAKD,MAAa,SAAS;IACpB,YACkB,UAAkB,EAClB,EAAU,EACV,EAAU,EACV,IAAY,EACZ,MAAc;QAJd,eAAU,GAAV,UAAU,CAAQ;QAClB,OAAE,GAAF,EAAE,CAAQ;QACV,OAAE,GAAF,EAAE,CAAQ;QACV,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;IAC7B,CAAC;CACL;AARD,8BAQC;AAKD,MAAa,UAAU;IACrB,YACkB,IAAY,EACZ,KAAa;QADb,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAQ;IAC5B,CAAC;CACL;AALD,gCAKC"}
+459
View File
@@ -0,0 +1,459 @@
import type { Nfsv3Stat } from './constants';
import type * as stucts from './structs';
export type Nfsv3Message = Nfsv3Request | Nfsv3Response;
export type Nfsv3Request = Nfsv3GetattrRequest | Nfsv3SetattrRequest | Nfsv3LookupRequest | Nfsv3AccessRequest | Nfsv3ReadlinkRequest | Nfsv3ReadRequest | Nfsv3WriteRequest | Nfsv3CreateRequest | Nfsv3MkdirRequest | Nfsv3SymlinkRequest | Nfsv3MknodRequest | Nfsv3RemoveRequest | Nfsv3RmdirRequest | Nfsv3RenameRequest | Nfsv3LinkRequest | Nfsv3ReaddirRequest | Nfsv3ReaddirplusRequest | Nfsv3FsstatRequest | Nfsv3FsinfoRequest | Nfsv3PathconfRequest | Nfsv3CommitRequest;
export type Nfsv3Response = Nfsv3GetattrResponse | Nfsv3SetattrResponse | Nfsv3LookupResponse | Nfsv3AccessResponse | Nfsv3ReadlinkResponse | Nfsv3ReadResponse | Nfsv3WriteResponse | Nfsv3CreateResponse | Nfsv3MkdirResponse | Nfsv3SymlinkResponse | Nfsv3MknodResponse | Nfsv3RemoveResponse | Nfsv3RmdirResponse | Nfsv3RenameResponse | Nfsv3LinkResponse | Nfsv3ReaddirResponse | Nfsv3ReaddirplusResponse | Nfsv3FsstatResponse | Nfsv3FsinfoResponse | Nfsv3PathconfResponse | Nfsv3CommitResponse;
export declare class Nfsv3GetattrRequest {
readonly object: stucts.Nfsv3Fh;
constructor(object: stucts.Nfsv3Fh);
}
export declare class Nfsv3GetattrResOk {
readonly objAttributes: stucts.Nfsv3Fattr;
constructor(objAttributes: stucts.Nfsv3Fattr);
}
export declare class Nfsv3GetattrResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3GetattrResOk | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3GetattrResOk | undefined);
}
export declare class Nfsv3SetattrRequest {
readonly object: stucts.Nfsv3Fh;
readonly newAttributes: stucts.Nfsv3Sattr;
readonly guard: stucts.Nfsv3SattrGuard;
constructor(object: stucts.Nfsv3Fh, newAttributes: stucts.Nfsv3Sattr, guard: stucts.Nfsv3SattrGuard);
}
export declare class Nfsv3SetattrResOk {
readonly objWcc: stucts.Nfsv3WccData;
constructor(objWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3SetattrResFail {
readonly objWcc: stucts.Nfsv3WccData;
constructor(objWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3SetattrResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3SetattrResOk | undefined;
readonly resfail?: Nfsv3SetattrResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3SetattrResOk | undefined, resfail?: Nfsv3SetattrResFail | undefined);
}
export declare class Nfsv3LookupRequest {
readonly what: stucts.Nfsv3DirOpArgs;
constructor(what: stucts.Nfsv3DirOpArgs);
}
export declare class Nfsv3LookupResOk {
readonly object: stucts.Nfsv3Fh;
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
constructor(object: stucts.Nfsv3Fh, objAttributes: stucts.Nfsv3PostOpAttr, dirAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3LookupResFail {
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
constructor(dirAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3LookupResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3LookupResOk | undefined;
readonly resfail?: Nfsv3LookupResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3LookupResOk | undefined, resfail?: Nfsv3LookupResFail | undefined);
}
export declare class Nfsv3AccessRequest {
readonly object: stucts.Nfsv3Fh;
readonly access: number;
constructor(object: stucts.Nfsv3Fh, access: number);
}
export declare class Nfsv3AccessResOk {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly access: number;
constructor(objAttributes: stucts.Nfsv3PostOpAttr, access: number);
}
export declare class Nfsv3AccessResFail {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
constructor(objAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3AccessResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3AccessResOk | undefined;
readonly resfail?: Nfsv3AccessResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3AccessResOk | undefined, resfail?: Nfsv3AccessResFail | undefined);
}
export declare class Nfsv3ReadlinkRequest {
readonly symlink: stucts.Nfsv3Fh;
constructor(symlink: stucts.Nfsv3Fh);
}
export declare class Nfsv3ReadlinkResOk {
readonly symlinkAttributes: stucts.Nfsv3PostOpAttr;
readonly data: string;
constructor(symlinkAttributes: stucts.Nfsv3PostOpAttr, data: string);
}
export declare class Nfsv3ReadlinkResFail {
readonly symlinkAttributes: stucts.Nfsv3PostOpAttr;
constructor(symlinkAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3ReadlinkResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3ReadlinkResOk | undefined;
readonly resfail?: Nfsv3ReadlinkResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3ReadlinkResOk | undefined, resfail?: Nfsv3ReadlinkResFail | undefined);
}
export declare class Nfsv3ReadRequest {
readonly file: stucts.Nfsv3Fh;
readonly offset: bigint;
readonly count: number;
constructor(file: stucts.Nfsv3Fh, offset: bigint, count: number);
}
export declare class Nfsv3ReadResOk {
readonly fileAttributes: stucts.Nfsv3PostOpAttr;
readonly count: number;
readonly eof: boolean;
readonly data: Uint8Array;
constructor(fileAttributes: stucts.Nfsv3PostOpAttr, count: number, eof: boolean, data: Uint8Array);
}
export declare class Nfsv3ReadResFail {
readonly fileAttributes: stucts.Nfsv3PostOpAttr;
constructor(fileAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3ReadResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3ReadResOk | undefined;
readonly resfail?: Nfsv3ReadResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3ReadResOk | undefined, resfail?: Nfsv3ReadResFail | undefined);
}
export declare class Nfsv3WriteRequest {
readonly file: stucts.Nfsv3Fh;
readonly offset: bigint;
readonly count: number;
readonly stable: number;
readonly data: Uint8Array;
constructor(file: stucts.Nfsv3Fh, offset: bigint, count: number, stable: number, data: Uint8Array);
}
export declare class Nfsv3WriteResOk {
readonly fileWcc: stucts.Nfsv3WccData;
readonly count: number;
readonly committed: number;
readonly verf: Uint8Array;
constructor(fileWcc: stucts.Nfsv3WccData, count: number, committed: number, verf: Uint8Array);
}
export declare class Nfsv3WriteResFail {
readonly fileWcc: stucts.Nfsv3WccData;
constructor(fileWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3WriteResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3WriteResOk | undefined;
readonly resfail?: Nfsv3WriteResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3WriteResOk | undefined, resfail?: Nfsv3WriteResFail | undefined);
}
export declare class Nfsv3CreateRequest {
readonly where: stucts.Nfsv3DirOpArgs;
readonly how: stucts.Nfsv3CreateHow;
constructor(where: stucts.Nfsv3DirOpArgs, how: stucts.Nfsv3CreateHow);
}
export declare class Nfsv3CreateResOk {
readonly obj: stucts.Nfsv3PostOpFh;
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly dirWcc: stucts.Nfsv3WccData;
constructor(obj: stucts.Nfsv3PostOpFh, objAttributes: stucts.Nfsv3PostOpAttr, dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3CreateResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3CreateResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3CreateResOk | undefined;
readonly resfail?: Nfsv3CreateResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3CreateResOk | undefined, resfail?: Nfsv3CreateResFail | undefined);
}
export declare class Nfsv3MkdirRequest {
readonly where: stucts.Nfsv3DirOpArgs;
readonly attributes: stucts.Nfsv3Sattr;
constructor(where: stucts.Nfsv3DirOpArgs, attributes: stucts.Nfsv3Sattr);
}
export declare class Nfsv3MkdirResOk {
readonly obj: stucts.Nfsv3PostOpFh;
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly dirWcc: stucts.Nfsv3WccData;
constructor(obj: stucts.Nfsv3PostOpFh, objAttributes: stucts.Nfsv3PostOpAttr, dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3MkdirResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3MkdirResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3MkdirResOk | undefined;
readonly resfail?: Nfsv3MkdirResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3MkdirResOk | undefined, resfail?: Nfsv3MkdirResFail | undefined);
}
export declare class Nfsv3SymlinkRequest {
readonly where: stucts.Nfsv3DirOpArgs;
readonly symlinkAttributes: stucts.Nfsv3Sattr;
readonly symlinkData: string;
constructor(where: stucts.Nfsv3DirOpArgs, symlinkAttributes: stucts.Nfsv3Sattr, symlinkData: string);
}
export declare class Nfsv3SymlinkResOk {
readonly obj: stucts.Nfsv3PostOpFh;
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly dirWcc: stucts.Nfsv3WccData;
constructor(obj: stucts.Nfsv3PostOpFh, objAttributes: stucts.Nfsv3PostOpAttr, dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3SymlinkResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3SymlinkResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3SymlinkResOk | undefined;
readonly resfail?: Nfsv3SymlinkResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3SymlinkResOk | undefined, resfail?: Nfsv3SymlinkResFail | undefined);
}
export declare class Nfsv3MknodRequest {
readonly where: stucts.Nfsv3DirOpArgs;
readonly what: stucts.Nfsv3MknodData;
constructor(where: stucts.Nfsv3DirOpArgs, what: stucts.Nfsv3MknodData);
}
export declare class Nfsv3MknodResOk {
readonly obj: stucts.Nfsv3PostOpFh;
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly dirWcc: stucts.Nfsv3WccData;
constructor(obj: stucts.Nfsv3PostOpFh, objAttributes: stucts.Nfsv3PostOpAttr, dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3MknodResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3MknodResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3MknodResOk | undefined;
readonly resfail?: Nfsv3MknodResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3MknodResOk | undefined, resfail?: Nfsv3MknodResFail | undefined);
}
export declare class Nfsv3RemoveRequest {
readonly object: stucts.Nfsv3DirOpArgs;
constructor(object: stucts.Nfsv3DirOpArgs);
}
export declare class Nfsv3RemoveResOk {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RemoveResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RemoveResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3RemoveResOk | undefined;
readonly resfail?: Nfsv3RemoveResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3RemoveResOk | undefined, resfail?: Nfsv3RemoveResFail | undefined);
}
export declare class Nfsv3RmdirRequest {
readonly object: stucts.Nfsv3DirOpArgs;
constructor(object: stucts.Nfsv3DirOpArgs);
}
export declare class Nfsv3RmdirResOk {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RmdirResFail {
readonly dirWcc: stucts.Nfsv3WccData;
constructor(dirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RmdirResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3RmdirResOk | undefined;
readonly resfail?: Nfsv3RmdirResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3RmdirResOk | undefined, resfail?: Nfsv3RmdirResFail | undefined);
}
export declare class Nfsv3RenameRequest {
readonly from: stucts.Nfsv3DirOpArgs;
readonly to: stucts.Nfsv3DirOpArgs;
constructor(from: stucts.Nfsv3DirOpArgs, to: stucts.Nfsv3DirOpArgs);
}
export declare class Nfsv3RenameResOk {
readonly fromDirWcc: stucts.Nfsv3WccData;
readonly toDirWcc: stucts.Nfsv3WccData;
constructor(fromDirWcc: stucts.Nfsv3WccData, toDirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RenameResFail {
readonly fromDirWcc: stucts.Nfsv3WccData;
readonly toDirWcc: stucts.Nfsv3WccData;
constructor(fromDirWcc: stucts.Nfsv3WccData, toDirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3RenameResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3RenameResOk | undefined;
readonly resfail?: Nfsv3RenameResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3RenameResOk | undefined, resfail?: Nfsv3RenameResFail | undefined);
}
export declare class Nfsv3LinkRequest {
readonly file: stucts.Nfsv3Fh;
readonly link: stucts.Nfsv3DirOpArgs;
constructor(file: stucts.Nfsv3Fh, link: stucts.Nfsv3DirOpArgs);
}
export declare class Nfsv3LinkResOk {
readonly fileAttributes: stucts.Nfsv3PostOpAttr;
readonly linkDirWcc: stucts.Nfsv3WccData;
constructor(fileAttributes: stucts.Nfsv3PostOpAttr, linkDirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3LinkResFail {
readonly fileAttributes: stucts.Nfsv3PostOpAttr;
readonly linkDirWcc: stucts.Nfsv3WccData;
constructor(fileAttributes: stucts.Nfsv3PostOpAttr, linkDirWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3LinkResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3LinkResOk | undefined;
readonly resfail?: Nfsv3LinkResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3LinkResOk | undefined, resfail?: Nfsv3LinkResFail | undefined);
}
export declare class Nfsv3ReaddirRequest {
readonly dir: stucts.Nfsv3Fh;
readonly cookie: bigint;
readonly cookieverf: Uint8Array;
readonly count: number;
constructor(dir: stucts.Nfsv3Fh, cookie: bigint, cookieverf: Uint8Array, count: number);
}
export declare class Nfsv3ReaddirResOk {
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
readonly cookieverf: Uint8Array;
readonly reply: stucts.Nfsv3DirList;
constructor(dirAttributes: stucts.Nfsv3PostOpAttr, cookieverf: Uint8Array, reply: stucts.Nfsv3DirList);
}
export declare class Nfsv3ReaddirResFail {
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
constructor(dirAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3ReaddirResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3ReaddirResOk | undefined;
readonly resfail?: Nfsv3ReaddirResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3ReaddirResOk | undefined, resfail?: Nfsv3ReaddirResFail | undefined);
}
export declare class Nfsv3ReaddirplusRequest {
readonly dir: stucts.Nfsv3Fh;
readonly cookie: bigint;
readonly cookieverf: Uint8Array;
readonly dircount: number;
readonly maxcount: number;
constructor(dir: stucts.Nfsv3Fh, cookie: bigint, cookieverf: Uint8Array, dircount: number, maxcount: number);
}
export declare class Nfsv3ReaddirplusResOk {
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
readonly cookieverf: Uint8Array;
readonly reply: stucts.Nfsv3DirListPlus;
constructor(dirAttributes: stucts.Nfsv3PostOpAttr, cookieverf: Uint8Array, reply: stucts.Nfsv3DirListPlus);
}
export declare class Nfsv3ReaddirplusResFail {
readonly dirAttributes: stucts.Nfsv3PostOpAttr;
constructor(dirAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3ReaddirplusResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3ReaddirplusResOk | undefined;
readonly resfail?: Nfsv3ReaddirplusResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3ReaddirplusResOk | undefined, resfail?: Nfsv3ReaddirplusResFail | undefined);
}
export declare class Nfsv3FsstatRequest {
readonly fsroot: stucts.Nfsv3Fh;
constructor(fsroot: stucts.Nfsv3Fh);
}
export declare class Nfsv3FsstatResOk {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly tbytes: bigint;
readonly fbytes: bigint;
readonly abytes: bigint;
readonly tfiles: bigint;
readonly ffiles: bigint;
readonly afiles: bigint;
readonly invarsec: number;
constructor(objAttributes: stucts.Nfsv3PostOpAttr, tbytes: bigint, fbytes: bigint, abytes: bigint, tfiles: bigint, ffiles: bigint, afiles: bigint, invarsec: number);
}
export declare class Nfsv3FsstatResFail {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
constructor(objAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3FsstatResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3FsstatResOk | undefined;
readonly resfail?: Nfsv3FsstatResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3FsstatResOk | undefined, resfail?: Nfsv3FsstatResFail | undefined);
}
export declare class Nfsv3FsinfoRequest {
readonly fsroot: stucts.Nfsv3Fh;
constructor(fsroot: stucts.Nfsv3Fh);
}
export declare class Nfsv3FsinfoResOk {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly rtmax: number;
readonly rtpref: number;
readonly rtmult: number;
readonly wtmax: number;
readonly wtpref: number;
readonly wtmult: number;
readonly dtpref: number;
readonly maxfilesize: bigint;
readonly timeDelta: {
seconds: number;
nseconds: number;
};
readonly properties: number;
constructor(objAttributes: stucts.Nfsv3PostOpAttr, rtmax: number, rtpref: number, rtmult: number, wtmax: number, wtpref: number, wtmult: number, dtpref: number, maxfilesize: bigint, timeDelta: {
seconds: number;
nseconds: number;
}, properties: number);
}
export declare class Nfsv3FsinfoResFail {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
constructor(objAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3FsinfoResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3FsinfoResOk | undefined;
readonly resfail?: Nfsv3FsinfoResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3FsinfoResOk | undefined, resfail?: Nfsv3FsinfoResFail | undefined);
}
export declare class Nfsv3PathconfRequest {
readonly object: stucts.Nfsv3Fh;
constructor(object: stucts.Nfsv3Fh);
}
export declare class Nfsv3PathconfResOk {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
readonly linkmax: number;
readonly namemax: number;
readonly noTrunc: boolean;
readonly chownRestricted: boolean;
readonly caseInsensitive: boolean;
readonly casePreserving: boolean;
constructor(objAttributes: stucts.Nfsv3PostOpAttr, linkmax: number, namemax: number, noTrunc: boolean, chownRestricted: boolean, caseInsensitive: boolean, casePreserving: boolean);
}
export declare class Nfsv3PathconfResFail {
readonly objAttributes: stucts.Nfsv3PostOpAttr;
constructor(objAttributes: stucts.Nfsv3PostOpAttr);
}
export declare class Nfsv3PathconfResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3PathconfResOk | undefined;
readonly resfail?: Nfsv3PathconfResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3PathconfResOk | undefined, resfail?: Nfsv3PathconfResFail | undefined);
}
export declare class Nfsv3CommitRequest {
readonly file: stucts.Nfsv3Fh;
readonly offset: bigint;
readonly count: number;
constructor(file: stucts.Nfsv3Fh, offset: bigint, count: number);
}
export declare class Nfsv3CommitResOk {
readonly fileWcc: stucts.Nfsv3WccData;
readonly verf: Uint8Array;
constructor(fileWcc: stucts.Nfsv3WccData, verf: Uint8Array);
}
export declare class Nfsv3CommitResFail {
readonly fileWcc: stucts.Nfsv3WccData;
constructor(fileWcc: stucts.Nfsv3WccData);
}
export declare class Nfsv3CommitResponse {
readonly status: Nfsv3Stat;
readonly resok?: Nfsv3CommitResOk | undefined;
readonly resfail?: Nfsv3CommitResFail | undefined;
constructor(status: Nfsv3Stat, resok?: Nfsv3CommitResOk | undefined, resfail?: Nfsv3CommitResFail | undefined);
}
+619
View File
@@ -0,0 +1,619 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nfsv3RmdirResFail = exports.Nfsv3RmdirResOk = exports.Nfsv3RmdirRequest = exports.Nfsv3RemoveResponse = exports.Nfsv3RemoveResFail = exports.Nfsv3RemoveResOk = exports.Nfsv3RemoveRequest = exports.Nfsv3MknodResponse = exports.Nfsv3MknodResFail = exports.Nfsv3MknodResOk = exports.Nfsv3MknodRequest = exports.Nfsv3SymlinkResponse = exports.Nfsv3SymlinkResFail = exports.Nfsv3SymlinkResOk = exports.Nfsv3SymlinkRequest = exports.Nfsv3MkdirResponse = exports.Nfsv3MkdirResFail = exports.Nfsv3MkdirResOk = exports.Nfsv3MkdirRequest = exports.Nfsv3CreateResponse = exports.Nfsv3CreateResFail = exports.Nfsv3CreateResOk = exports.Nfsv3CreateRequest = exports.Nfsv3WriteResponse = exports.Nfsv3WriteResFail = exports.Nfsv3WriteResOk = exports.Nfsv3WriteRequest = exports.Nfsv3ReadResponse = exports.Nfsv3ReadResFail = exports.Nfsv3ReadResOk = exports.Nfsv3ReadRequest = exports.Nfsv3ReadlinkResponse = exports.Nfsv3ReadlinkResFail = exports.Nfsv3ReadlinkResOk = exports.Nfsv3ReadlinkRequest = exports.Nfsv3AccessResponse = exports.Nfsv3AccessResFail = exports.Nfsv3AccessResOk = exports.Nfsv3AccessRequest = exports.Nfsv3LookupResponse = exports.Nfsv3LookupResFail = exports.Nfsv3LookupResOk = exports.Nfsv3LookupRequest = exports.Nfsv3SetattrResponse = exports.Nfsv3SetattrResFail = exports.Nfsv3SetattrResOk = exports.Nfsv3SetattrRequest = exports.Nfsv3GetattrResponse = exports.Nfsv3GetattrResOk = exports.Nfsv3GetattrRequest = void 0;
exports.Nfsv3CommitResponse = exports.Nfsv3CommitResFail = exports.Nfsv3CommitResOk = exports.Nfsv3CommitRequest = exports.Nfsv3PathconfResponse = exports.Nfsv3PathconfResFail = exports.Nfsv3PathconfResOk = exports.Nfsv3PathconfRequest = exports.Nfsv3FsinfoResponse = exports.Nfsv3FsinfoResFail = exports.Nfsv3FsinfoResOk = exports.Nfsv3FsinfoRequest = exports.Nfsv3FsstatResponse = exports.Nfsv3FsstatResFail = exports.Nfsv3FsstatResOk = exports.Nfsv3FsstatRequest = exports.Nfsv3ReaddirplusResponse = exports.Nfsv3ReaddirplusResFail = exports.Nfsv3ReaddirplusResOk = exports.Nfsv3ReaddirplusRequest = exports.Nfsv3ReaddirResponse = exports.Nfsv3ReaddirResFail = exports.Nfsv3ReaddirResOk = exports.Nfsv3ReaddirRequest = exports.Nfsv3LinkResponse = exports.Nfsv3LinkResFail = exports.Nfsv3LinkResOk = exports.Nfsv3LinkRequest = exports.Nfsv3RenameResponse = exports.Nfsv3RenameResFail = exports.Nfsv3RenameResOk = exports.Nfsv3RenameRequest = exports.Nfsv3RmdirResponse = void 0;
class Nfsv3GetattrRequest {
constructor(object) {
this.object = object;
}
}
exports.Nfsv3GetattrRequest = Nfsv3GetattrRequest;
class Nfsv3GetattrResOk {
constructor(objAttributes) {
this.objAttributes = objAttributes;
}
}
exports.Nfsv3GetattrResOk = Nfsv3GetattrResOk;
class Nfsv3GetattrResponse {
constructor(status, resok) {
this.status = status;
this.resok = resok;
}
}
exports.Nfsv3GetattrResponse = Nfsv3GetattrResponse;
class Nfsv3SetattrRequest {
constructor(object, newAttributes, guard) {
this.object = object;
this.newAttributes = newAttributes;
this.guard = guard;
}
}
exports.Nfsv3SetattrRequest = Nfsv3SetattrRequest;
class Nfsv3SetattrResOk {
constructor(objWcc) {
this.objWcc = objWcc;
}
}
exports.Nfsv3SetattrResOk = Nfsv3SetattrResOk;
class Nfsv3SetattrResFail {
constructor(objWcc) {
this.objWcc = objWcc;
}
}
exports.Nfsv3SetattrResFail = Nfsv3SetattrResFail;
class Nfsv3SetattrResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3SetattrResponse = Nfsv3SetattrResponse;
class Nfsv3LookupRequest {
constructor(what) {
this.what = what;
}
}
exports.Nfsv3LookupRequest = Nfsv3LookupRequest;
class Nfsv3LookupResOk {
constructor(object, objAttributes, dirAttributes) {
this.object = object;
this.objAttributes = objAttributes;
this.dirAttributes = dirAttributes;
}
}
exports.Nfsv3LookupResOk = Nfsv3LookupResOk;
class Nfsv3LookupResFail {
constructor(dirAttributes) {
this.dirAttributes = dirAttributes;
}
}
exports.Nfsv3LookupResFail = Nfsv3LookupResFail;
class Nfsv3LookupResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3LookupResponse = Nfsv3LookupResponse;
class Nfsv3AccessRequest {
constructor(object, access) {
this.object = object;
this.access = access;
}
}
exports.Nfsv3AccessRequest = Nfsv3AccessRequest;
class Nfsv3AccessResOk {
constructor(objAttributes, access) {
this.objAttributes = objAttributes;
this.access = access;
}
}
exports.Nfsv3AccessResOk = Nfsv3AccessResOk;
class Nfsv3AccessResFail {
constructor(objAttributes) {
this.objAttributes = objAttributes;
}
}
exports.Nfsv3AccessResFail = Nfsv3AccessResFail;
class Nfsv3AccessResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3AccessResponse = Nfsv3AccessResponse;
class Nfsv3ReadlinkRequest {
constructor(symlink) {
this.symlink = symlink;
}
}
exports.Nfsv3ReadlinkRequest = Nfsv3ReadlinkRequest;
class Nfsv3ReadlinkResOk {
constructor(symlinkAttributes, data) {
this.symlinkAttributes = symlinkAttributes;
this.data = data;
}
}
exports.Nfsv3ReadlinkResOk = Nfsv3ReadlinkResOk;
class Nfsv3ReadlinkResFail {
constructor(symlinkAttributes) {
this.symlinkAttributes = symlinkAttributes;
}
}
exports.Nfsv3ReadlinkResFail = Nfsv3ReadlinkResFail;
class Nfsv3ReadlinkResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3ReadlinkResponse = Nfsv3ReadlinkResponse;
class Nfsv3ReadRequest {
constructor(file, offset, count) {
this.file = file;
this.offset = offset;
this.count = count;
}
}
exports.Nfsv3ReadRequest = Nfsv3ReadRequest;
class Nfsv3ReadResOk {
constructor(fileAttributes, count, eof, data) {
this.fileAttributes = fileAttributes;
this.count = count;
this.eof = eof;
this.data = data;
}
}
exports.Nfsv3ReadResOk = Nfsv3ReadResOk;
class Nfsv3ReadResFail {
constructor(fileAttributes) {
this.fileAttributes = fileAttributes;
}
}
exports.Nfsv3ReadResFail = Nfsv3ReadResFail;
class Nfsv3ReadResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3ReadResponse = Nfsv3ReadResponse;
class Nfsv3WriteRequest {
constructor(file, offset, count, stable, data) {
this.file = file;
this.offset = offset;
this.count = count;
this.stable = stable;
this.data = data;
}
}
exports.Nfsv3WriteRequest = Nfsv3WriteRequest;
class Nfsv3WriteResOk {
constructor(fileWcc, count, committed, verf) {
this.fileWcc = fileWcc;
this.count = count;
this.committed = committed;
this.verf = verf;
}
}
exports.Nfsv3WriteResOk = Nfsv3WriteResOk;
class Nfsv3WriteResFail {
constructor(fileWcc) {
this.fileWcc = fileWcc;
}
}
exports.Nfsv3WriteResFail = Nfsv3WriteResFail;
class Nfsv3WriteResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3WriteResponse = Nfsv3WriteResponse;
class Nfsv3CreateRequest {
constructor(where, how) {
this.where = where;
this.how = how;
}
}
exports.Nfsv3CreateRequest = Nfsv3CreateRequest;
class Nfsv3CreateResOk {
constructor(obj, objAttributes, dirWcc) {
this.obj = obj;
this.objAttributes = objAttributes;
this.dirWcc = dirWcc;
}
}
exports.Nfsv3CreateResOk = Nfsv3CreateResOk;
class Nfsv3CreateResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3CreateResFail = Nfsv3CreateResFail;
class Nfsv3CreateResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3CreateResponse = Nfsv3CreateResponse;
class Nfsv3MkdirRequest {
constructor(where, attributes) {
this.where = where;
this.attributes = attributes;
}
}
exports.Nfsv3MkdirRequest = Nfsv3MkdirRequest;
class Nfsv3MkdirResOk {
constructor(obj, objAttributes, dirWcc) {
this.obj = obj;
this.objAttributes = objAttributes;
this.dirWcc = dirWcc;
}
}
exports.Nfsv3MkdirResOk = Nfsv3MkdirResOk;
class Nfsv3MkdirResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3MkdirResFail = Nfsv3MkdirResFail;
class Nfsv3MkdirResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3MkdirResponse = Nfsv3MkdirResponse;
class Nfsv3SymlinkRequest {
constructor(where, symlinkAttributes, symlinkData) {
this.where = where;
this.symlinkAttributes = symlinkAttributes;
this.symlinkData = symlinkData;
}
}
exports.Nfsv3SymlinkRequest = Nfsv3SymlinkRequest;
class Nfsv3SymlinkResOk {
constructor(obj, objAttributes, dirWcc) {
this.obj = obj;
this.objAttributes = objAttributes;
this.dirWcc = dirWcc;
}
}
exports.Nfsv3SymlinkResOk = Nfsv3SymlinkResOk;
class Nfsv3SymlinkResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3SymlinkResFail = Nfsv3SymlinkResFail;
class Nfsv3SymlinkResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3SymlinkResponse = Nfsv3SymlinkResponse;
class Nfsv3MknodRequest {
constructor(where, what) {
this.where = where;
this.what = what;
}
}
exports.Nfsv3MknodRequest = Nfsv3MknodRequest;
class Nfsv3MknodResOk {
constructor(obj, objAttributes, dirWcc) {
this.obj = obj;
this.objAttributes = objAttributes;
this.dirWcc = dirWcc;
}
}
exports.Nfsv3MknodResOk = Nfsv3MknodResOk;
class Nfsv3MknodResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3MknodResFail = Nfsv3MknodResFail;
class Nfsv3MknodResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3MknodResponse = Nfsv3MknodResponse;
class Nfsv3RemoveRequest {
constructor(object) {
this.object = object;
}
}
exports.Nfsv3RemoveRequest = Nfsv3RemoveRequest;
class Nfsv3RemoveResOk {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3RemoveResOk = Nfsv3RemoveResOk;
class Nfsv3RemoveResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3RemoveResFail = Nfsv3RemoveResFail;
class Nfsv3RemoveResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3RemoveResponse = Nfsv3RemoveResponse;
class Nfsv3RmdirRequest {
constructor(object) {
this.object = object;
}
}
exports.Nfsv3RmdirRequest = Nfsv3RmdirRequest;
class Nfsv3RmdirResOk {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3RmdirResOk = Nfsv3RmdirResOk;
class Nfsv3RmdirResFail {
constructor(dirWcc) {
this.dirWcc = dirWcc;
}
}
exports.Nfsv3RmdirResFail = Nfsv3RmdirResFail;
class Nfsv3RmdirResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3RmdirResponse = Nfsv3RmdirResponse;
class Nfsv3RenameRequest {
constructor(from, to) {
this.from = from;
this.to = to;
}
}
exports.Nfsv3RenameRequest = Nfsv3RenameRequest;
class Nfsv3RenameResOk {
constructor(fromDirWcc, toDirWcc) {
this.fromDirWcc = fromDirWcc;
this.toDirWcc = toDirWcc;
}
}
exports.Nfsv3RenameResOk = Nfsv3RenameResOk;
class Nfsv3RenameResFail {
constructor(fromDirWcc, toDirWcc) {
this.fromDirWcc = fromDirWcc;
this.toDirWcc = toDirWcc;
}
}
exports.Nfsv3RenameResFail = Nfsv3RenameResFail;
class Nfsv3RenameResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3RenameResponse = Nfsv3RenameResponse;
class Nfsv3LinkRequest {
constructor(file, link) {
this.file = file;
this.link = link;
}
}
exports.Nfsv3LinkRequest = Nfsv3LinkRequest;
class Nfsv3LinkResOk {
constructor(fileAttributes, linkDirWcc) {
this.fileAttributes = fileAttributes;
this.linkDirWcc = linkDirWcc;
}
}
exports.Nfsv3LinkResOk = Nfsv3LinkResOk;
class Nfsv3LinkResFail {
constructor(fileAttributes, linkDirWcc) {
this.fileAttributes = fileAttributes;
this.linkDirWcc = linkDirWcc;
}
}
exports.Nfsv3LinkResFail = Nfsv3LinkResFail;
class Nfsv3LinkResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3LinkResponse = Nfsv3LinkResponse;
class Nfsv3ReaddirRequest {
constructor(dir, cookie, cookieverf, count) {
this.dir = dir;
this.cookie = cookie;
this.cookieverf = cookieverf;
this.count = count;
}
}
exports.Nfsv3ReaddirRequest = Nfsv3ReaddirRequest;
class Nfsv3ReaddirResOk {
constructor(dirAttributes, cookieverf, reply) {
this.dirAttributes = dirAttributes;
this.cookieverf = cookieverf;
this.reply = reply;
}
}
exports.Nfsv3ReaddirResOk = Nfsv3ReaddirResOk;
class Nfsv3ReaddirResFail {
constructor(dirAttributes) {
this.dirAttributes = dirAttributes;
}
}
exports.Nfsv3ReaddirResFail = Nfsv3ReaddirResFail;
class Nfsv3ReaddirResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3ReaddirResponse = Nfsv3ReaddirResponse;
class Nfsv3ReaddirplusRequest {
constructor(dir, cookie, cookieverf, dircount, maxcount) {
this.dir = dir;
this.cookie = cookie;
this.cookieverf = cookieverf;
this.dircount = dircount;
this.maxcount = maxcount;
}
}
exports.Nfsv3ReaddirplusRequest = Nfsv3ReaddirplusRequest;
class Nfsv3ReaddirplusResOk {
constructor(dirAttributes, cookieverf, reply) {
this.dirAttributes = dirAttributes;
this.cookieverf = cookieverf;
this.reply = reply;
}
}
exports.Nfsv3ReaddirplusResOk = Nfsv3ReaddirplusResOk;
class Nfsv3ReaddirplusResFail {
constructor(dirAttributes) {
this.dirAttributes = dirAttributes;
}
}
exports.Nfsv3ReaddirplusResFail = Nfsv3ReaddirplusResFail;
class Nfsv3ReaddirplusResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3ReaddirplusResponse = Nfsv3ReaddirplusResponse;
class Nfsv3FsstatRequest {
constructor(fsroot) {
this.fsroot = fsroot;
}
}
exports.Nfsv3FsstatRequest = Nfsv3FsstatRequest;
class Nfsv3FsstatResOk {
constructor(objAttributes, tbytes, fbytes, abytes, tfiles, ffiles, afiles, invarsec) {
this.objAttributes = objAttributes;
this.tbytes = tbytes;
this.fbytes = fbytes;
this.abytes = abytes;
this.tfiles = tfiles;
this.ffiles = ffiles;
this.afiles = afiles;
this.invarsec = invarsec;
}
}
exports.Nfsv3FsstatResOk = Nfsv3FsstatResOk;
class Nfsv3FsstatResFail {
constructor(objAttributes) {
this.objAttributes = objAttributes;
}
}
exports.Nfsv3FsstatResFail = Nfsv3FsstatResFail;
class Nfsv3FsstatResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3FsstatResponse = Nfsv3FsstatResponse;
class Nfsv3FsinfoRequest {
constructor(fsroot) {
this.fsroot = fsroot;
}
}
exports.Nfsv3FsinfoRequest = Nfsv3FsinfoRequest;
class Nfsv3FsinfoResOk {
constructor(objAttributes, rtmax, rtpref, rtmult, wtmax, wtpref, wtmult, dtpref, maxfilesize, timeDelta, properties) {
this.objAttributes = objAttributes;
this.rtmax = rtmax;
this.rtpref = rtpref;
this.rtmult = rtmult;
this.wtmax = wtmax;
this.wtpref = wtpref;
this.wtmult = wtmult;
this.dtpref = dtpref;
this.maxfilesize = maxfilesize;
this.timeDelta = timeDelta;
this.properties = properties;
}
}
exports.Nfsv3FsinfoResOk = Nfsv3FsinfoResOk;
class Nfsv3FsinfoResFail {
constructor(objAttributes) {
this.objAttributes = objAttributes;
}
}
exports.Nfsv3FsinfoResFail = Nfsv3FsinfoResFail;
class Nfsv3FsinfoResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3FsinfoResponse = Nfsv3FsinfoResponse;
class Nfsv3PathconfRequest {
constructor(object) {
this.object = object;
}
}
exports.Nfsv3PathconfRequest = Nfsv3PathconfRequest;
class Nfsv3PathconfResOk {
constructor(objAttributes, linkmax, namemax, noTrunc, chownRestricted, caseInsensitive, casePreserving) {
this.objAttributes = objAttributes;
this.linkmax = linkmax;
this.namemax = namemax;
this.noTrunc = noTrunc;
this.chownRestricted = chownRestricted;
this.caseInsensitive = caseInsensitive;
this.casePreserving = casePreserving;
}
}
exports.Nfsv3PathconfResOk = Nfsv3PathconfResOk;
class Nfsv3PathconfResFail {
constructor(objAttributes) {
this.objAttributes = objAttributes;
}
}
exports.Nfsv3PathconfResFail = Nfsv3PathconfResFail;
class Nfsv3PathconfResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3PathconfResponse = Nfsv3PathconfResponse;
class Nfsv3CommitRequest {
constructor(file, offset, count) {
this.file = file;
this.offset = offset;
this.count = count;
}
}
exports.Nfsv3CommitRequest = Nfsv3CommitRequest;
class Nfsv3CommitResOk {
constructor(fileWcc, verf) {
this.fileWcc = fileWcc;
this.verf = verf;
}
}
exports.Nfsv3CommitResOk = Nfsv3CommitResOk;
class Nfsv3CommitResFail {
constructor(fileWcc) {
this.fileWcc = fileWcc;
}
}
exports.Nfsv3CommitResFail = Nfsv3CommitResFail;
class Nfsv3CommitResponse {
constructor(status, resok, resfail) {
this.status = status;
this.resok = resok;
this.resfail = resfail;
}
}
exports.Nfsv3CommitResponse = Nfsv3CommitResponse;
//# sourceMappingURL=messages.js.map
File diff suppressed because one or more lines are too long
+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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E,EAAE,CAAC;YAC1C,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,MAAM,SAAS,GAAG,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,C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AAE,CAAC;YACtC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAC1C,GAAG,CAAC,gBAAgB,CAAC,GAAG,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"}
+155
View File
@@ -0,0 +1,155 @@
import type { Nfsv3FType, Nfsv3TimeHow, Nfsv3StableHow, Nfsv3CreateMode } from './constants';
export declare class Nfsv3Time {
readonly seconds: number;
readonly nseconds: number;
constructor(seconds: number, nseconds: number);
}
export declare class Nfsv3SpecData {
readonly specdata1: number;
readonly specdata2: number;
constructor(specdata1: number, specdata2: number);
}
export declare class Nfsv3Fh {
readonly data: Uint8Array;
constructor(data: Uint8Array);
}
export declare class Nfsv3SetMode {
readonly set: boolean;
readonly mode?: number | undefined;
constructor(set: boolean, mode?: number | undefined);
}
export declare class Nfsv3SetUid {
readonly set: boolean;
readonly uid?: number | undefined;
constructor(set: boolean, uid?: number | undefined);
}
export declare class Nfsv3SetGid {
readonly set: boolean;
readonly gid?: number | undefined;
constructor(set: boolean, gid?: number | undefined);
}
export declare class Nfsv3SetSize {
readonly set: boolean;
readonly size?: bigint | undefined;
constructor(set: boolean, size?: bigint | undefined);
}
export declare class Nfsv3SetAtime {
readonly how: Nfsv3TimeHow;
readonly atime?: Nfsv3Time | undefined;
constructor(how: Nfsv3TimeHow, atime?: Nfsv3Time | undefined);
}
export declare class Nfsv3SetMtime {
readonly how: Nfsv3TimeHow;
readonly mtime?: Nfsv3Time | undefined;
constructor(how: Nfsv3TimeHow, mtime?: Nfsv3Time | undefined);
}
export declare class Nfsv3Sattr {
readonly mode: Nfsv3SetMode;
readonly uid: Nfsv3SetUid;
readonly gid: Nfsv3SetGid;
readonly size: Nfsv3SetSize;
readonly atime: Nfsv3SetAtime;
readonly mtime: Nfsv3SetMtime;
constructor(mode: Nfsv3SetMode, uid: Nfsv3SetUid, gid: Nfsv3SetGid, size: Nfsv3SetSize, atime: Nfsv3SetAtime, mtime: Nfsv3SetMtime);
}
export declare class Nfsv3SattrGuard {
readonly check: boolean;
readonly objCtime?: Nfsv3Time | undefined;
constructor(check: boolean, objCtime?: Nfsv3Time | undefined);
}
export declare class Nfsv3DirOpArgs {
readonly dir: Nfsv3Fh;
readonly name: string;
constructor(dir: Nfsv3Fh, name: string);
}
export declare class Nfsv3WccAttr {
readonly size: bigint;
readonly mtime: Nfsv3Time;
readonly ctime: Nfsv3Time;
constructor(size: bigint, mtime: Nfsv3Time, ctime: Nfsv3Time);
}
export declare class Nfsv3PreOpAttr {
readonly attributesFollow: boolean;
readonly attributes?: Nfsv3WccAttr | undefined;
constructor(attributesFollow: boolean, attributes?: Nfsv3WccAttr | undefined);
}
export declare class Nfsv3PostOpAttr {
readonly attributesFollow: boolean;
readonly attributes?: Nfsv3Fattr | undefined;
constructor(attributesFollow: boolean, attributes?: Nfsv3Fattr | undefined);
}
export declare class Nfsv3PostOpFh {
readonly handleFollows: boolean;
readonly handle?: Nfsv3Fh | undefined;
constructor(handleFollows: boolean, handle?: Nfsv3Fh | undefined);
}
export declare class Nfsv3WccData {
readonly before: Nfsv3PreOpAttr;
readonly after: Nfsv3PostOpAttr;
constructor(before: Nfsv3PreOpAttr, after: Nfsv3PostOpAttr);
}
export declare class Nfsv3Fattr {
readonly type: Nfsv3FType;
readonly mode: number;
readonly nlink: number;
readonly uid: number;
readonly gid: number;
readonly size: bigint;
readonly used: bigint;
readonly rdev: Nfsv3SpecData;
readonly fsid: bigint;
readonly fileid: bigint;
readonly atime: Nfsv3Time;
readonly mtime: Nfsv3Time;
readonly ctime: Nfsv3Time;
constructor(type: Nfsv3FType, mode: number, nlink: number, uid: number, gid: number, size: bigint, used: bigint, rdev: Nfsv3SpecData, fsid: bigint, fileid: bigint, atime: Nfsv3Time, mtime: Nfsv3Time, ctime: Nfsv3Time);
}
export declare class Nfsv3DeviceData {
readonly devAttributes: Nfsv3Sattr;
readonly spec: Nfsv3SpecData;
constructor(devAttributes: Nfsv3Sattr, spec: Nfsv3SpecData);
}
export declare class Nfsv3MknodData {
readonly type: Nfsv3FType;
readonly chr?: Nfsv3DeviceData | undefined;
readonly blk?: Nfsv3DeviceData | undefined;
readonly sock?: Nfsv3Sattr | undefined;
readonly pipe?: Nfsv3Sattr | undefined;
constructor(type: Nfsv3FType, chr?: Nfsv3DeviceData | undefined, blk?: Nfsv3DeviceData | undefined, sock?: Nfsv3Sattr | undefined, pipe?: Nfsv3Sattr | undefined);
}
export declare class Nfsv3CreateHow {
readonly mode: Nfsv3CreateMode;
readonly objAttributes?: Nfsv3Sattr | undefined;
readonly verf?: Uint8Array | undefined;
constructor(mode: Nfsv3CreateMode, objAttributes?: Nfsv3Sattr | undefined, verf?: Uint8Array | undefined);
}
export declare class Nfsv3WriteHow {
readonly stable: Nfsv3StableHow;
constructor(stable: Nfsv3StableHow);
}
export declare class Nfsv3Entry {
readonly fileid: bigint;
readonly name: string;
readonly cookie: bigint;
readonly nextentry?: Nfsv3Entry | undefined;
constructor(fileid: bigint, name: string, cookie: bigint, nextentry?: Nfsv3Entry | undefined);
}
export declare class Nfsv3EntryPlus {
readonly fileid: bigint;
readonly name: string;
readonly cookie: bigint;
readonly nameAttributes: Nfsv3PostOpAttr;
readonly nameHandle: Nfsv3PostOpFh;
readonly nextentry?: Nfsv3EntryPlus | undefined;
constructor(fileid: bigint, name: string, cookie: bigint, nameAttributes: Nfsv3PostOpAttr, nameHandle: Nfsv3PostOpFh, nextentry?: Nfsv3EntryPlus | undefined);
}
export declare class Nfsv3DirList {
readonly eof: boolean;
readonly entries?: Nfsv3Entry | undefined;
constructor(eof: boolean, entries?: Nfsv3Entry | undefined);
}
export declare class Nfsv3DirListPlus {
readonly eof: boolean;
readonly entries?: Nfsv3EntryPlus | undefined;
constructor(eof: boolean, entries?: Nfsv3EntryPlus | undefined);
}
+210
View File
@@ -0,0 +1,210 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Nfsv3DirListPlus = exports.Nfsv3DirList = exports.Nfsv3EntryPlus = exports.Nfsv3Entry = exports.Nfsv3WriteHow = exports.Nfsv3CreateHow = exports.Nfsv3MknodData = exports.Nfsv3DeviceData = exports.Nfsv3Fattr = exports.Nfsv3WccData = exports.Nfsv3PostOpFh = exports.Nfsv3PostOpAttr = exports.Nfsv3PreOpAttr = exports.Nfsv3WccAttr = exports.Nfsv3DirOpArgs = exports.Nfsv3SattrGuard = exports.Nfsv3Sattr = exports.Nfsv3SetMtime = exports.Nfsv3SetAtime = exports.Nfsv3SetSize = exports.Nfsv3SetGid = exports.Nfsv3SetUid = exports.Nfsv3SetMode = exports.Nfsv3Fh = exports.Nfsv3SpecData = exports.Nfsv3Time = void 0;
class Nfsv3Time {
constructor(seconds, nseconds) {
this.seconds = seconds;
this.nseconds = nseconds;
}
}
exports.Nfsv3Time = Nfsv3Time;
class Nfsv3SpecData {
constructor(specdata1, specdata2) {
this.specdata1 = specdata1;
this.specdata2 = specdata2;
}
}
exports.Nfsv3SpecData = Nfsv3SpecData;
class Nfsv3Fh {
constructor(data) {
this.data = data;
}
}
exports.Nfsv3Fh = Nfsv3Fh;
class Nfsv3SetMode {
constructor(set, mode) {
this.set = set;
this.mode = mode;
}
}
exports.Nfsv3SetMode = Nfsv3SetMode;
class Nfsv3SetUid {
constructor(set, uid) {
this.set = set;
this.uid = uid;
}
}
exports.Nfsv3SetUid = Nfsv3SetUid;
class Nfsv3SetGid {
constructor(set, gid) {
this.set = set;
this.gid = gid;
}
}
exports.Nfsv3SetGid = Nfsv3SetGid;
class Nfsv3SetSize {
constructor(set, size) {
this.set = set;
this.size = size;
}
}
exports.Nfsv3SetSize = Nfsv3SetSize;
class Nfsv3SetAtime {
constructor(how, atime) {
this.how = how;
this.atime = atime;
}
}
exports.Nfsv3SetAtime = Nfsv3SetAtime;
class Nfsv3SetMtime {
constructor(how, mtime) {
this.how = how;
this.mtime = mtime;
}
}
exports.Nfsv3SetMtime = Nfsv3SetMtime;
class Nfsv3Sattr {
constructor(mode, uid, gid, size, atime, mtime) {
this.mode = mode;
this.uid = uid;
this.gid = gid;
this.size = size;
this.atime = atime;
this.mtime = mtime;
}
}
exports.Nfsv3Sattr = Nfsv3Sattr;
class Nfsv3SattrGuard {
constructor(check, objCtime) {
this.check = check;
this.objCtime = objCtime;
}
}
exports.Nfsv3SattrGuard = Nfsv3SattrGuard;
class Nfsv3DirOpArgs {
constructor(dir, name) {
this.dir = dir;
this.name = name;
}
}
exports.Nfsv3DirOpArgs = Nfsv3DirOpArgs;
class Nfsv3WccAttr {
constructor(size, mtime, ctime) {
this.size = size;
this.mtime = mtime;
this.ctime = ctime;
}
}
exports.Nfsv3WccAttr = Nfsv3WccAttr;
class Nfsv3PreOpAttr {
constructor(attributesFollow, attributes) {
this.attributesFollow = attributesFollow;
this.attributes = attributes;
}
}
exports.Nfsv3PreOpAttr = Nfsv3PreOpAttr;
class Nfsv3PostOpAttr {
constructor(attributesFollow, attributes) {
this.attributesFollow = attributesFollow;
this.attributes = attributes;
}
}
exports.Nfsv3PostOpAttr = Nfsv3PostOpAttr;
class Nfsv3PostOpFh {
constructor(handleFollows, handle) {
this.handleFollows = handleFollows;
this.handle = handle;
}
}
exports.Nfsv3PostOpFh = Nfsv3PostOpFh;
class Nfsv3WccData {
constructor(before, after) {
this.before = before;
this.after = after;
}
}
exports.Nfsv3WccData = Nfsv3WccData;
class Nfsv3Fattr {
constructor(type, mode, nlink, uid, gid, size, used, rdev, fsid, fileid, atime, mtime, ctime) {
this.type = type;
this.mode = mode;
this.nlink = nlink;
this.uid = uid;
this.gid = gid;
this.size = size;
this.used = used;
this.rdev = rdev;
this.fsid = fsid;
this.fileid = fileid;
this.atime = atime;
this.mtime = mtime;
this.ctime = ctime;
}
}
exports.Nfsv3Fattr = Nfsv3Fattr;
class Nfsv3DeviceData {
constructor(devAttributes, spec) {
this.devAttributes = devAttributes;
this.spec = spec;
}
}
exports.Nfsv3DeviceData = Nfsv3DeviceData;
class Nfsv3MknodData {
constructor(type, chr, blk, sock, pipe) {
this.type = type;
this.chr = chr;
this.blk = blk;
this.sock = sock;
this.pipe = pipe;
}
}
exports.Nfsv3MknodData = Nfsv3MknodData;
class Nfsv3CreateHow {
constructor(mode, objAttributes, verf) {
this.mode = mode;
this.objAttributes = objAttributes;
this.verf = verf;
}
}
exports.Nfsv3CreateHow = Nfsv3CreateHow;
class Nfsv3WriteHow {
constructor(stable) {
this.stable = stable;
}
}
exports.Nfsv3WriteHow = Nfsv3WriteHow;
class Nfsv3Entry {
constructor(fileid, name, cookie, nextentry) {
this.fileid = fileid;
this.name = name;
this.cookie = cookie;
this.nextentry = nextentry;
}
}
exports.Nfsv3Entry = Nfsv3Entry;
class Nfsv3EntryPlus {
constructor(fileid, name, cookie, nameAttributes, nameHandle, nextentry) {
this.fileid = fileid;
this.name = name;
this.cookie = cookie;
this.nameAttributes = nameAttributes;
this.nameHandle = nameHandle;
this.nextentry = nextentry;
}
}
exports.Nfsv3EntryPlus = Nfsv3EntryPlus;
class Nfsv3DirList {
constructor(eof, entries) {
this.eof = eof;
this.entries = entries;
}
}
exports.Nfsv3DirList = Nfsv3DirList;
class Nfsv3DirListPlus {
constructor(eof, entries) {
this.eof = eof;
this.entries = entries;
}
}
exports.Nfsv3DirListPlus = Nfsv3DirListPlus;
//# sourceMappingURL=structs.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../src/nfs/v3/structs.ts"],"names":[],"mappings":";;;AAKA,MAAa,SAAS;IACpB,YACkB,OAAe,EACf,QAAgB;QADhB,YAAO,GAAP,OAAO,CAAQ;QACf,aAAQ,GAAR,QAAQ,CAAQ;IAC/B,CAAC;CACL;AALD,8BAKC;AAKD,MAAa,aAAa;IACxB,YACkB,SAAiB,EACjB,SAAiB;QADj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