using System; using System.Net; namespace mooftpserv { /// /// Interface for a class managing user authentication and allowing connections. /// public interface IAuthHandler { /// /// Make a new instance for a new session with the given peer. /// Each FTP session uses a separate, cloned instance. /// IAuthHandler Clone(IPEndPoint peer); /// /// Check the given login. Note that the method can be called in three ways: /// - user and pass are null: anonymous authentication /// - pass is null: login only with username (e.g. "anonymous") /// - both are non-null: login with user and password /// /// /// The username, or null. /// /// /// The password, or null. /// bool AllowLogin(string user, string pass); /// /// Check if a control connection from the peer should be allowed. /// bool AllowControlConnection(); /// /// Check if the PORT command of the peer with the given /// target endpoint should be allowed. /// /// The argument given by the peer in the PORT command. /// bool AllowActiveDataConnection(IPEndPoint target); } }