コード例 #1
0
 public RpcClient(string address, RpcCredentials credential)
 {
     _serverAddress   = address;
     _credential      = credential;
     _nextTransaction = (uint)new Random().Next();
     _transports[PortMapper.ProgramIdentifier] = new RpcTcpTransport(address, 111);
 }
コード例 #2
0
ファイル: RpcClient.cs プロジェクト: marinehero/ThinkAway.net
 public RpcClient(string address, RpcCredentials credential)
 {
     _serverAddress = address;
     _credential = credential;
     _nextTransaction = (uint)new Random().Next();
     _transports[PortMapper.ProgramIdentifier] = new RpcTcpTransport(address, 111);
 }
コード例 #3
0
        public RpcAuthentication(RpcCredentials credential)
        {
            _flavour = credential.AuthFlavour;

            MemoryStream ms = new MemoryStream();
            XdrDataWriter writer = new XdrDataWriter(ms);
            credential.Write(writer);
            _body = ms.ToArray();
        }
コード例 #4
0
        public RpcAuthentication(RpcCredentials credential)
        {
            _flavour = credential.AuthFlavour;

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

            credential.Write(writer);
            _body = ms.ToArray();
        }
コード例 #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;
        }
コード例 #6
0
ファイル: Nfs3Client.cs プロジェクト: ibeae/ThinkAway.net
        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;
        }
コード例 #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;
        }
コード例 #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);
        }
コード例 #9
0
ファイル: NfsFileSystem.cs プロジェクト: ibeae/ThinkAway.net
 /// <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);
 }
コード例 #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);
 }