public ChannelFactory(IConfiguration config,
                       IVirtualFileSystemFactory fileSystemFactory,
                       ILoggerFactory loggerFactory)
 {
     this.config            = config;
     this.fileSystemFactory = fileSystemFactory;
     this.loggerFactory     = loggerFactory;
 }
Exemple #2
0
        public Channel(IPacketSender packetSender, IConfiguration config, IVirtualFileSystemFactory fileSystemFactory, ILogger logger, uint serverChannelId, ChannelOpen packet)
        {
            this.packetSender      = packetSender;
            this.config            = config;
            this.fileSystemFactory = fileSystemFactory;
            this.logger            = logger;

            ServerChannelId   = serverChannelId;
            ClientChannelId   = packet.SenderChannel;
            WindowSize        = packet.InitialWindowSize;
            MaximumPacketSize = packet.MaximumPacketSize;
        }
Exemple #3
0
        public SftpSubsystem(Channel channel, IVirtualFileSystemFactory fileSystemFactory, ILogger logger)
        {
            this.channel = channel;
            this.logger  = logger;

            packetTypes.Add(SftpPacketType.SSH_FXP_INIT, typeof(InitPacket));
            packetTypes.Add(SftpPacketType.SSH_FXP_REALPATH, typeof(RealPathPacket));
            packetTypes.Add(SftpPacketType.SSH_FXP_OPENDIR, typeof(OpenDirPacket));
            packetTypes.Add(SftpPacketType.SSH_FXP_READDIR, typeof(ReadDirPacket));
            packetTypes.Add(SftpPacketType.SSH_FXP_CLOSE, typeof(ClosePacket));

            fileSystem = fileSystemFactory.Create();
        }