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

            MemoryStream ms = new MemoryStream();
            XdrDataWriter writer = new XdrDataWriter(ms);
            credential.Write(writer);
            _body = ms.ToArray();
        }
Ejemplo n.º 4
0
        public RpcAuthentication(RpcCredentials credential)
        {
            _flavour = credential.AuthFlavour;

            MemoryStream  ms     = new MemoryStream();
            XdrDataWriter writer = new XdrDataWriter(ms);

            credential.Write(writer);
            _body = ms.ToArray();
        }
Ejemplo n.º 5
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;
        }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
 }
Ejemplo n.º 10
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);
 }