|
1 | | -// Copyright 2019 Google Inc. All Rights Reserved. |
2 | | -// |
3 | | -// Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | -// you may not use this file except in compliance with the License. |
5 | | -// You may obtain a copy of the License at |
6 | | -// |
7 | | -// http://www.apache.org/licenses/LICENSE-2.0 |
8 | | -// |
9 | | -// Unless required by applicable law or agreed to in writing, software |
10 | | -// distributed under the License is distributed on an "AS IS" BASIS, |
11 | | -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | -// See the License for the specific language governing permissions and |
13 | | -// limitations under the License. |
14 | | - |
15 | | -using NtApiDotNet.Ndr.Marshal; |
16 | | -using System; |
17 | | -using System.Collections.Generic; |
18 | | - |
19 | | -namespace NtApiDotNet.Win32.Rpc.Transport |
20 | | -{ |
21 | | - /// <summary> |
22 | | - /// Interface to implement an RPC client transport. |
23 | | - /// </summary> |
24 | | - public interface IRpcClientTransport : IDisposable |
25 | | - { |
26 | | - /// <summary> |
27 | | - /// Bind the RPC transport to a specified interface. |
28 | | - /// </summary> |
29 | | - /// <param name="interface_id">The interface ID to bind to.</param> |
30 | | - /// <param name="interface_version">The interface version to bind to.</param> |
31 | | - /// <param name="transfer_syntax_id">The transfer syntax to use.</param> |
32 | | - /// <param name="transfer_syntax_version">The transfer syntax version to use.</param> |
33 | | - void Bind(Guid interface_id, Version interface_version, Guid transfer_syntax_id, Version transfer_syntax_version); |
34 | | - |
35 | | - /// <summary> |
36 | | - /// Send and receive an RPC message. |
37 | | - /// </summary> |
38 | | - /// <param name="proc_num">The procedure number.</param> |
39 | | - /// <param name="objuuid">The object UUID for the call.</param> |
40 | | - /// <param name="data_representation">NDR data representation.</param> |
41 | | - /// <param name="ndr_buffer">Marshal NDR buffer for the call.</param> |
42 | | - /// <param name="handles">List of handles marshaled into the buffer.</param> |
43 | | - /// <returns>Client response from the send.</returns> |
44 | | - RpcClientResponse SendReceive(int proc_num, Guid objuuid, NdrDataRepresentation data_representation, |
45 | | - byte[] ndr_buffer, IReadOnlyCollection<NtObject> handles); |
46 | | - |
47 | | - /// <summary> |
48 | | - /// Disconnect the transport. |
49 | | - /// </summary> |
50 | | - void Disconnect(); |
51 | | - |
52 | | - /// <summary> |
53 | | - /// Get whether the client is connected or not. |
54 | | - /// </summary> |
55 | | - bool Connected { get; } |
56 | | - |
57 | | - /// <summary> |
58 | | - /// Get the endpoint the client is connected to. |
59 | | - /// </summary> |
60 | | - string Endpoint { get; } |
61 | | - |
62 | | - /// <summary> |
63 | | - /// Get the transport protocol sequence. |
64 | | - /// </summary> |
65 | | - string ProtocolSequence { get; } |
66 | | - |
| 1 | +// Copyright 2019 Google Inc. All Rights Reserved. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +using NtApiDotNet.Ndr.Marshal; |
| 16 | +using System; |
| 17 | +using System.Collections.Generic; |
| 18 | + |
| 19 | +namespace NtApiDotNet.Win32.Rpc.Transport |
| 20 | +{ |
| 21 | + /// <summary> |
| 22 | + /// Interface to implement an RPC client transport. |
| 23 | + /// </summary> |
| 24 | + public interface IRpcClientTransport : IDisposable |
| 25 | + { |
| 26 | + /// <summary> |
| 27 | + /// Bind the RPC transport to a specified interface. |
| 28 | + /// </summary> |
| 29 | + /// <param name="interface_id">The interface ID to bind to.</param> |
| 30 | + /// <param name="interface_version">The interface version to bind to.</param> |
| 31 | + /// <param name="transfer_syntax_id">The transfer syntax to use.</param> |
| 32 | + /// <param name="transfer_syntax_version">The transfer syntax version to use.</param> |
| 33 | + void Bind(Guid interface_id, Version interface_version, Guid transfer_syntax_id, Version transfer_syntax_version); |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Send and receive an RPC message. |
| 37 | + /// </summary> |
| 38 | + /// <param name="proc_num">The procedure number.</param> |
| 39 | + /// <param name="objuuid">The object UUID for the call.</param> |
| 40 | + /// <param name="data_representation">NDR data representation.</param> |
| 41 | + /// <param name="ndr_buffer">Marshal NDR buffer for the call.</param> |
| 42 | + /// <param name="handles">List of handles marshaled into the buffer.</param> |
| 43 | + /// <returns>Client response from the send.</returns> |
| 44 | + RpcClientResponse SendReceive(int proc_num, Guid objuuid, NdrDataRepresentation data_representation, |
| 45 | + byte[] ndr_buffer, IReadOnlyCollection<NtObject> handles); |
| 46 | + |
| 47 | + /// <summary> |
| 48 | + /// Add and authenticate a new security context. |
| 49 | + /// </summary> |
| 50 | + /// <param name="transport_security">The transport security for the context.</param> |
| 51 | + /// <returns>The created security context.</returns> |
| 52 | + RpcTransportSecurityContext AddSecurityContext(RpcTransportSecurity transport_security); |
| 53 | + |
| 54 | + /// <summary> |
| 55 | + /// Disconnect the transport. |
| 56 | + /// </summary> |
| 57 | + void Disconnect(); |
| 58 | + |
| 59 | + /// <summary> |
| 60 | + /// Get whether the client is connected or not. |
| 61 | + /// </summary> |
| 62 | + bool Connected { get; } |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// Get the endpoint the client is connected to. |
| 66 | + /// </summary> |
| 67 | + string Endpoint { get; } |
| 68 | + |
| 69 | + /// <summary> |
| 70 | + /// Get the transport protocol sequence. |
| 71 | + /// </summary> |
| 72 | + string ProtocolSequence { get; } |
| 73 | + |
67 | 74 | /// <summary> |
68 | 75 | /// Get whether the client has been authenticated. |
69 | | - /// </summary> |
70 | | - bool Authenticated { get; } |
71 | | - |
| 76 | + /// </summary> |
| 77 | + bool Authenticated { get; } |
| 78 | + |
72 | 79 | /// <summary> |
73 | | - /// Get the transports authentication type. |
74 | | - /// </summary> |
75 | | - RpcAuthenticationType AuthenticationType { get; } |
76 | | - |
| 80 | + /// Get the transport's authentication type. |
| 81 | + /// </summary> |
| 82 | + RpcAuthenticationType AuthenticationType { get; } |
| 83 | + |
77 | 84 | /// <summary> |
78 | | - /// Get the transports authentication level. |
79 | | - /// </summary> |
80 | | - RpcAuthenticationLevel AuthenticationLevel { get; } |
81 | | - |
| 85 | + /// Get the transport's authentication level. |
| 86 | + /// </summary> |
| 87 | + RpcAuthenticationLevel AuthenticationLevel { get; } |
| 88 | + |
82 | 89 | /// <summary> |
83 | 90 | /// Get information about the local server process, if known. |
84 | | - /// </summary> |
| 91 | + /// </summary> |
85 | 92 | RpcServerProcessInformation ServerProcess { get; } |
86 | 93 |
|
87 | 94 | /// <summary> |
88 | 95 | /// Get the current Call ID. |
89 | 96 | /// </summary> |
90 | 97 | int CallId { get; } |
91 | | - } |
92 | | -} |
| 98 | + |
| 99 | + /// <summary> |
| 100 | + /// Indicates if this connection supported multiple security context. |
| 101 | + /// </summary> |
| 102 | + bool SupportsMultipleSecurityContexts { get; } |
| 103 | + |
| 104 | + /// <summary> |
| 105 | + /// Get the list of negotiated security context. |
| 106 | + /// </summary> |
| 107 | + IReadOnlyList<RpcTransportSecurityContext> SecurityContext { get; } |
| 108 | + |
| 109 | + /// <summary> |
| 110 | + /// Get or set the current security context. |
| 111 | + /// </summary> |
| 112 | + RpcTransportSecurityContext CurrentSecurityContext { get; set; } |
| 113 | + } |
| 114 | +} |
0 commit comments