Example #1
0
 public RpcClient(string address, RpcCredentials credential)
 {
     _serverAddress = address;
     _credential = credential;
     _nextTransaction = (uint)new Random().Next();
     _transports[PortMapper.ProgramIdentifier] = new RpcTcpTransport(address, 111);
 }
Example #2
0
        public RpcAuthentication(RpcCredentials credential)
        {
            _flavour = credential.AuthFlavour;

            MemoryStream ms = new MemoryStream();
            XdrDataWriter writer = new XdrDataWriter(ms);
            credential.Write(writer);
            _body = ms.ToArray();
        }
Example #3
0
        public Nfs3Client(string address, RpcCredentials credentials, string mountPoint)
        {
            _rpcClient = new RpcClient(address, credentials);
            _mountClient = new Nfs3Mount(_rpcClient);
            _rootHandle = _mountClient.Mount(mountPoint).FileHandle;

            _nfsClient = new Nfs3(_rpcClient);

            Nfs3FileSystemInfoResult fsiResult = _nfsClient.FileSystemInfo(_rootHandle);
            _fsInfo = fsiResult.FileSystemInfo;
            _cachedAttributes = new Dictionary<Nfs3FileHandle, Nfs3FileAttributes>();
            _cachedAttributes[_rootHandle] = fsiResult.PostOpAttributes;
        }
Example #4
0
        protected XdrDataWriter StartCallMessage(MemoryStream ms, RpcCredentials credentials, uint procedure)
        {
            XdrDataWriter writer = new XdrDataWriter(ms);

            writer.Write(_client.NextTransactionId());
            writer.Write((int)RpcMessageType.Call);

            RpcCallHeader hdr = new RpcCallHeader();
            hdr.RpcVersion = RpcVersion;
            hdr.Program = (uint)Identifier;
            hdr.Version = (uint)Version;
            hdr.Proc = procedure;
            hdr.Credentials = new RpcAuthentication(credentials ?? new RpcNullCredentials());
            hdr.Verifier = RpcAuthentication.Null();
            hdr.Write(writer); 

            return writer;
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the NfsFileSystem class.
 /// </summary>
 /// <param name="address">The address of the NFS server (IP or DNS address)</param>
 /// <param name="credentials">The credentials to use when accessing the NFS server</param>
 /// <param name="mountPoint">The mount point on the server to root the file system</param>
 public NfsFileSystem(string address, RpcCredentials credentials, string mountPoint)
     : base(new NfsFileSystemOptions())
 {
     _client = new Nfs3Client(address, credentials, mountPoint);
 }