NFS_PROGRAMconstconst NFS_PROGRAM: 100003The programs of ONC RPC the server answers: NFS and its mount protocol.
The facts of NFS version 3 (RFC 1813) and its mount protocol, as closed lists and one total table: the programs and procedures the server answers, the statuses it gives, the types of an object, and the table from a code of the POSIX view to a status. A failure is said as a local file system would say it: ENOENT is NFS3ERR_NOENT, and the few codes whose number NFS does not take from Linux (ENAMETOOLONG, ENOTEMPTY, ESTALE, ENOTSUP, EBADF) have the number RFC 1813 gives them.
import { nfsStatusOfErrno } from "./nfs.ts";
nfsStatusOfErrno("ENOENT"); // 2
nfsStatusOfErrno("ESTALE"); // 70NFS_PROGRAMconstconst NFS_PROGRAM: 100003The programs of ONC RPC the server answers: NFS and its mount protocol.
MOUNT_PROGRAMconstconst MOUNT_PROGRAM: 100005The program number of the mount protocol of ONC RPC.
NFS_VERSIONconstno test imports itconst NFS_VERSION: 3The only versions: NFS 3 and MOUNT 3.
MOUNT_VERSIONconstno test imports itconst MOUNT_VERSION: 3The one version of the mount protocol answered: 3.
NFS_PROCEDURESconstno test imports itconst NFS_PROCEDURES: readonly ["NULL", "GETATTR", "SETATTR", "LOOKUP", "ACCESS", "READLINK", "READ", "WRITE", "CREATE", "MKDIR", "SYMLINK", "MKNOD", "REMOVE", "RMDIR", "RENAME", "LINK", "READDIR", "READDIRPLUS", "FSSTAT", "FSINFO", "PATHCONF", "COMMIT"]The procedures of NFS version 3, by number.
NfsProceduretypeno test imports ittype NfsProcedure = (typeof NFS_PROCEDURES)[number];One procedure of NFS.
MOUNT_PROCEDURESconstno test imports itconst MOUNT_PROCEDURES: readonly ["NULL", "MNT", "DUMP", "UMNT", "UMNTALL", "EXPORT"]The procedures of the mount protocol, by number.
MountProceduretypeno test imports ittype MountProcedure = (typeof MOUNT_PROCEDURES)[number];One procedure of the mount protocol.
NFS_STATUSconstconst NFS_STATUS: { readonly OK: 0; readonly PERM: 1; readonly NOENT: 2; readonly IO: 5; readonly ACCES: 13; readonly EX… (477 characters)const NFS_STATUS: { readonly OK: 0; readonly PERM: 1; readonly NOENT: 2; readonly IO: 5; readonly ACCES: 13; readonly EXIST: 17; readonly XDEV: 18; readonly NOTDIR: 20; readonly ISDIR: 21; readonly INVAL: 22; readonly FBIG: 27; readonly ROFS: 30; readonly NAMETOOLONG: 63; readonly NOTEMPTY: 66; readonly STALE: 70; readonly BADHANDLE: 10001; readonly BAD_COOKIE: 10003; readonly NOTSUPP: 10004; readonly TOOSMALL: 10005; readonly SERVERFAULT: 10006; readonly BADTYPE: 10007; }The statuses of RFC 1813 the server gives.
NfsStatusNametypeno test imports ittype NfsStatusName = keyof typeof NFS_STATUS;The name of a status.
NfsStatustypeno test imports ittype NfsStatus = (typeof NFS_STATUS)[NfsStatusName];The number of a status.
MOUNT_STATUSconstno test imports itconst MOUNT_STATUS: { readonly OK: 0; readonly NOENT: 2; readonly ACCES: 13; readonly INVAL: 22; }The statuses of the mount protocol the server gives.
FTYPEconstno test imports itconst FTYPE: { readonly file: 1; readonly dir: 2; }The types of an object in NFS (ftype3): the store has files and directories only.
ERRNOS_DIFFERconstconst ERRNOS_DIFFER: readonly ("EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV")[]The codes whose status is not the number of Linux.
nfsStatusOfErrnofunctionfunction nfsStatusOfErrno(errno: "EACCES" | "EBADF" | "EEXIST" | "EFBIG" | "EINVAL" | "EIO" | "EISDIR" | "ENAMETOOLONG" | "ENOENT" | "ENOTDIR" | "ENOTEMPTY" | "ENOTSUP" | "EROFS" | "ESTALE" | "EXDEV"): NfsStatusThe status of a code of the POSIX view: the number of Linux where NFS takes it, else the number of RFC 1813. Total: a registry the compiler holds with one entry for each code.
isNfsStatusfunctionfunction isNfsStatus(n: number): n is NfsStatusWhether a number is a status of RFC 1813 the server gives.
TRANSFERconstno test imports itconst TRANSFER: { readonly rtmax: 1048576; readonly rtpref: 262144; readonly rtmult: 4096; readonly wtmax: 1048576; readonly wtpref: 262144; readonly wtmult: 4096; readonly dtpref: 32768; }What the server tells a client it can do (FSINFO): the sizes of a transfer.
ACCESSconstno test imports itconst ACCESS: { readonly READ: 1; readonly LOOKUP: 2; readonly MODIFY: 4; readonly EXTEND: 8; readonly DELETE: 16; readonly EXECUTE: 32; }The bits of ACCESS.
STABLEconstno test imports itconst STABLE: { readonly UNSTABLE: 0; readonly DATA_SYNC: 1; readonly FILE_SYNC: 2; }How stable a write is asked to be (stable_how).