private void MkDir(rpcCracker cracker, rpcPacker packer) { CreateFileOrDirectory(cracker, packer, false); }
protected override void Proc(uint proc, rpcCracker cracker, rpcPacker packer) { try { switch (proc) { case 1: GetAttr(cracker, packer); break; case 2: SetAttr(cracker, packer); break; case 3: // Root(). No-op. break; case 4: Lookup(cracker, packer); break; case 5: ReadLink(cracker, packer); break; case 6: Read(cracker, packer); break; case 8: Write(cracker, packer); break; case 9: Create(cracker, packer); break; case 10: Remove(cracker, packer); break; case 11: Rename(cracker, packer); break; case 13: SymLink(cracker, packer); break; case 14: MkDir(cracker, packer); break; case 15: RmDir(cracker, packer); break; case 16: ReadDir(cracker, packer); break; case 17: StatFS(cracker, packer); break; default: throw new BadProc(); } } catch (BadProc) { throw; } catch (NFSStatusException e) { packer.setUint32((uint)e.Status); } catch (System.IO.FileNotFoundException) { packer.setUint32((uint)NFSStatus.NFSERR_NOENT); } catch (UnauthorizedAccessException) { packer.setUint32((uint)NFSStatus.NFSERR_PERM); } catch (PathTooLongException) { packer.setUint32((uint)NFSStatus.NFSERR_NAMETOOLONG); } catch (DirectoryNotFoundException) { packer.setUint32((uint)NFSStatus.NFSERR_NOTDIR); } catch (Exception e) { Console.WriteLine("nfsd error:{0}", e); packer.setUint32((uint)NFSStatus.NFSERR_IO); } }
private void Create(rpcCracker cracker, rpcPacker packer) { CreateFileOrDirectory(cracker, packer, true); }
private void GetAttr(rpcCracker cracker, rpcPacker packer) { attrstat.PackSuccess(packer, new fattr(new fhandle(cracker))); }