#region Copyright 2010-2014 by Roger Knapp, Licensed under the Apache License, Version 2.0 /* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using System; using System.Security.Principal; namespace CSharpTest.Net.RpcLibrary { /// /// An interface that provide contextual information about the client within an Rpc server call /// public interface IRpcClientInfo { /// /// Returns true if the caller is using LRPC /// bool IsClientLocal { get; } /// /// Returns a most random set of bytes, undocumented Win32 value. /// byte[] ClientAddress { get; } /// /// Defines the type of the procol being used in the communication, unavailable on Windows XP /// RpcProtoseqType ProtocolType { get; } /// /// Returns the packet protection level of the communications /// RpcProtectionLevel ProtectionLevel { get; } /// /// Returns the authentication level of the connection /// RpcAuthentication AuthenticationLevel { get; } /// /// Returns the ProcessId of the LRPC caller, may not be valid on all platforms /// IntPtr ClientPid { get; } /// /// Returns true if the caller has authenticated as a user /// bool IsAuthenticated { get; } /// /// Returns the client user name if authenticated, not available on WinXP /// string ClientPrincipalName { get; } /// /// Returns the identity of the client user or Anonymous if unauthenticated /// WindowsIdentity ClientUser { get; } /// /// Returns true if already impersonating the caller /// bool IsImpersonating { get; } /// /// Returns a disposable context that is used to impersonate the calling user /// IDisposable Impersonate(); } }