2 Unix SMB/CIFS implementation.
4 [MS-RPCH] - RPC over HTTP
6 Copyright (C) 2013 Samuel Cabrero <samuelcabrero@kernevil.me>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "librpc/gen_ndr/misc.h"
28 struct tstream_context;
29 struct tstream_tls_params;
33 * The ConnectionTimeout command specifies the desired frequency for
34 * sending keep-alive PDUs (2.2.3.5.3)
36 unsigned int connection_timeout;
38 unsigned int sent_bytes;
40 struct GUID channel_cookie;
42 struct tevent_queue *send_queue;
44 struct tstream_context *raw;
45 struct tstream_context *tls;
46 struct tstream_context *active;
50 enum roh_protocol_version {
55 enum roh_connection_state {
57 ROH_STATE_OUT_CHANNEL_WAIT,
64 * protocol_version: A client node should be capable of using v1 and v2,
65 * try to use v2 in first place. If it fails, fallback
67 * connection_state: Tracks the protocol current state
68 * connection_cookie: Identifies the virtual connection among a client, one
69 * or more inbound proxies, one or more outbound proxies,
71 * association_group_id_cookie: Used by higher layer protocols to link
72 * multiple virtual connections (2.2.3.1)
74 * default_channel_out:
75 * non_default_channel_in:
76 * non_default_channel_out:
78 struct roh_connection {
79 enum roh_protocol_version protocol_version;
80 enum roh_connection_state connection_state;
82 struct GUID connection_cookie;
83 struct GUID association_group_id_cookie;
85 struct roh_channel *default_channel_in;
86 struct roh_channel *non_default_channel_in;
88 struct roh_channel *default_channel_out;
89 struct roh_channel *non_default_channel_out;
91 /* Client role specific fields (3.2.2.1) */
93 uint32_t current_keep_alive_time;
94 uint32_t current_keep_alive_interval;
96 /* TODO Add timers 3.2.2.2 */
99 /* Command type constants */
100 #define ROH_CMD_TYPE_RECV_WINDOWS_SIZE 0x00000000 /* Section 2.2.3.5.1 */
101 #define ROH_CMD_TYPE_FLOW_CONTROL_ACK 0x00000001 /* Section 2.2.3.5.2 */
102 #define ROH_CMD_TYPE_CONNECTION_TIMEOUT 0x00000002 /* Section 2.2.3.5.3 */
103 #define ROH_CMD_TYPE_COOKIE 0x00000003 /* Section 2.2.3.5.4 */
104 #define ROH_CMD_TYPE_CHANNEL_LIFETIME 0x00000004 /* Section 2.2.3.5.5 */
105 #define ROH_CMD_TYPE_CLIENT_KEEPALIVE 0x00000005 /* Section 2.2.3.5.6 */
106 #define ROH_CMD_TYPE_VERSION 0x00000006 /* Section 2.2.3.5.7 */
107 #define ROH_CMD_TYPE_EMPTY 0x00000007 /* Section 2.2.3.5.8 */
108 #define ROH_CMD_TYPE_PADDING 0x00000008 /* Section 2.2.3.5.9 */
109 #define ROH_CMD_TYPE_NEGATIVE_ANCE 0x00000009 /* Section 2.2.3.5.10 */
110 #define ROH_CMD_TYPE_ANCE 0x0000000A /* Section 2.2.3.5.11 */
111 #define ROH_CMD_TYPE_CLIENT_ADDRESS 0x0000000B /* Section 2.2.3.5.12 */
112 #define ROH_CMD_TYPE_ASSOCIATION_GRP_ID 0x0000000C /* Section 2.2.3.5.13 */
113 #define ROH_CMD_TYPE_DESTINATION 0x0000000D /* Section 2.2.3.5.14 */
114 #define ROH_CMD_TYPE_PING 0x0000000E /* Section 2.2.3.5.15 */
116 #endif /* DCERPC_ROH_H_ */