Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenrpc_defs.h
Go to the documentation of this file.
00001 /* 00002 * RPC definitions 00003 * 00004 * Copyright 2001-2002 Ove Kåven, TransGaming Technologies 00005 * Copyright 2004 Filip Navara 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00020 */ 00021 00022 #ifndef __WINE_RPC_DEFS_H 00023 #define __WINE_RPC_DEFS_H 00024 00025 #include "pshpack1.h" 00026 typedef struct 00027 { 00028 unsigned char rpc_ver; /* RPC major version (5) */ 00029 unsigned char rpc_ver_minor; /* RPC minor version (0) */ 00030 unsigned char ptype; /* Packet type (PKT_*) */ 00031 unsigned char flags; 00032 unsigned char drep[4]; /* Data representation */ 00033 unsigned short frag_len; /* Data size in bytes including header and tail. */ 00034 unsigned short auth_len; /* Authentication length */ 00035 unsigned int call_id; /* Call identifier. */ 00036 } RpcPktCommonHdr; 00037 00038 typedef struct 00039 { 00040 RpcPktCommonHdr common; 00041 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */ 00042 unsigned short context_id; /* Presentation context identifier */ 00043 unsigned short opnum; 00044 } RpcPktRequestHdr; 00045 00046 typedef struct 00047 { 00048 RpcPktCommonHdr common; 00049 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */ 00050 unsigned short context_id; /* Presentation context identifier */ 00051 unsigned char cancel_count; 00052 unsigned char reserved; 00053 } RpcPktResponseHdr; 00054 00055 typedef struct 00056 { 00057 RpcPktCommonHdr common; 00058 unsigned int alloc_hint; /* Data size in bytes excluding header and tail. */ 00059 unsigned short context_id; /* Presentation context identifier */ 00060 unsigned char cancel_count; /* Received cancel count */ 00061 unsigned char reserved; /* Force alignment! */ 00062 unsigned int status; /* Runtime fault code (RPC_STATUS) */ 00063 unsigned int reserved2; 00064 } RpcPktFaultHdr; 00065 00066 typedef struct 00067 { 00068 unsigned short context_id; /* Presentation context identifier */ 00069 unsigned char num_syntaxes; /* Number of syntaxes */ 00070 unsigned char reserved; /* For alignment */ 00071 RPC_SYNTAX_IDENTIFIER abstract_syntax; 00072 RPC_SYNTAX_IDENTIFIER transfer_syntaxes[ANYSIZE_ARRAY]; /* size_is(num_syntaxes) */ 00073 } RpcContextElement; 00074 00075 typedef struct 00076 { 00077 RpcPktCommonHdr common; 00078 unsigned short max_tsize; /* Maximum transmission fragment size */ 00079 unsigned short max_rsize; /* Maximum receive fragment size */ 00080 unsigned int assoc_gid; /* Associated group id */ 00081 unsigned char num_elements; /* Number of elements */ 00082 unsigned char padding[3]; /* Force alignment! */ 00083 /* 00084 * Following this header are these fields: 00085 * RpcContextElement context_elements[num_elements] 00086 */ 00087 } RpcPktBindHdr; 00088 00089 typedef struct 00090 { 00091 unsigned short length; /* Length of the string including null terminator */ 00092 char string[ANYSIZE_ARRAY]; /* String data in single byte, null terminated form */ 00093 } RpcAddressString; 00094 00095 typedef struct 00096 { 00097 unsigned short result; 00098 unsigned short reason; 00099 RPC_SYNTAX_IDENTIFIER transfer_syntax; 00100 } RpcResult; 00101 00102 typedef struct 00103 { 00104 unsigned char num_results; /* Number of results */ 00105 unsigned char reserved[3]; /* Force alignment! */ 00106 RpcResult results[ANYSIZE_ARRAY]; /* size_is(num_results) */ 00107 } RpcResultList; 00108 00109 typedef struct 00110 { 00111 RpcPktCommonHdr common; 00112 unsigned short max_tsize; /* Maximum transmission fragment size */ 00113 unsigned short max_rsize; /* Maximum receive fragment size */ 00114 unsigned int assoc_gid; /* Associated group id */ 00115 /* 00116 * Following this header are these fields: 00117 * RpcAddressString server_address; 00118 * [0 - 3 bytes of padding so that results is 4-byte aligned] 00119 * RpcResultList results; 00120 */ 00121 } RpcPktBindAckHdr; 00122 00123 typedef struct 00124 { 00125 RpcPktCommonHdr common; 00126 unsigned short reject_reason; 00127 unsigned char protocols_count; 00128 struct { 00129 unsigned char rpc_ver; 00130 unsigned char rpc_ver_minor; 00131 } protocols[ANYSIZE_ARRAY]; 00132 } RpcPktBindNAckHdr; 00133 00134 /* undocumented packet sent during RPC over HTTP */ 00135 typedef struct 00136 { 00137 RpcPktCommonHdr common; 00138 unsigned short flags; 00139 unsigned short num_data_items; 00140 } RpcPktHttpHdr; 00141 00142 /* AUTH3 packet */ 00143 typedef struct 00144 { 00145 RpcPktCommonHdr common; 00146 unsigned int pad; /* ignored */ 00147 } RpcPktAuth3Hdr; 00148 00149 /* Union representing all possible packet headers */ 00150 typedef union 00151 { 00152 RpcPktCommonHdr common; 00153 RpcPktRequestHdr request; 00154 RpcPktResponseHdr response; 00155 RpcPktFaultHdr fault; 00156 RpcPktBindHdr bind; 00157 RpcPktBindAckHdr bind_ack; 00158 RpcPktBindNAckHdr bind_nack; 00159 RpcPktHttpHdr http; 00160 RpcPktAuth3Hdr auth3; 00161 } RpcPktHdr; 00162 00163 typedef struct 00164 { 00165 unsigned char auth_type; /* authentication scheme in use */ 00166 unsigned char auth_level; /* RPC_C_AUTHN_LEVEL* */ 00167 unsigned char auth_pad_length; /* length of padding to restore n % 4 alignment */ 00168 unsigned char auth_reserved; /* reserved, must be zero */ 00169 unsigned int auth_context_id; /* unique value for the authenticated connection */ 00170 } RpcAuthVerifier; 00171 #include "poppack.h" 00172 00173 #define RPC_AUTH_VERIFIER_LEN(common_hdr) \ 00174 ((common_hdr)->auth_len ? (common_hdr)->auth_len + sizeof(RpcAuthVerifier) : 0) 00175 00176 #define RPC_VER_MAJOR 5 00177 #define RPC_VER_MINOR 0 00178 00179 #define RPC_FLG_FIRST 1 00180 #define RPC_FLG_LAST 2 00181 #define RPC_FLG_OBJECT_UUID 0x80 00182 00183 #define RPC_MIN_PACKET_SIZE 0x1000 00184 #define RPC_MAX_PACKET_SIZE 0x16D0 00185 00186 enum rpc_packet_type 00187 { 00188 PKT_REQUEST = 0, 00189 PKT_PING = 1, 00190 PKT_RESPONSE = 2, 00191 PKT_FAULT = 3, 00192 PKT_WORKING = 4, 00193 PKT_NOCALL = 5, 00194 PKT_REJECT = 6, 00195 PKT_ACK = 7, 00196 PKT_CL_CANCEL = 8, 00197 PKT_FACK = 9, 00198 PKT_CANCEL_ACK = 10, 00199 PKT_BIND = 11, 00200 PKT_BIND_ACK = 12, 00201 PKT_BIND_NACK = 13, 00202 PKT_ALTER_CONTEXT = 14, 00203 PKT_ALTER_CONTEXT_RESP = 15, 00204 PKT_AUTH3 = 16, 00205 PKT_SHUTDOWN = 17, 00206 PKT_CO_CANCEL = 18, 00207 PKT_ORPHANED = 19, 00208 PKT_HTTP = 20, 00209 }; 00210 00211 #define RESULT_ACCEPT 0 00212 #define RESULT_USER_REJECTION 1 00213 #define RESULT_PROVIDER_REJECTION 2 00214 00215 #define REASON_NONE 0 00216 #define REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED 1 00217 #define REASON_TRANSFER_SYNTAXES_NOT_SUPPORTED 2 00218 #define REASON_LOCAL_LIMIT_EXCEEDED 3 00219 00220 #define REJECT_REASON_NOT_SPECIFIED 0 00221 #define REJECT_TEMPORARY_CONGESTION 1 00222 #define REJECT_LOCAL_LIMIT_EXCEEDED 2 00223 #define REJECT_CALLED_PADDR_UNKNOWN 3 /* not used */ 00224 #define REJECT_PROTOCOL_VERSION_NOT_SUPPORTED 4 00225 #define REJECT_DEFAULT_CONTEXT_NOT_SUPPORTED 5 /* not used */ 00226 #define REJECT_USER_DATA_NOT_READABLE 6 /* not used */ 00227 #define REJECT_NO_PSAP_AVAILABLE 7 /* not used */ 00228 #define REJECT_UNKNOWN_AUTHN_SERVICE 8 00229 #define REJECT_INVALID_CHECKSUM 9 00230 00231 #define NCADG_IP_UDP 0x08 00232 #define NCACN_IP_TCP 0x07 00233 #define NCADG_IPX 0x0E 00234 #define NCACN_SPX 0x0C 00235 #define NCACN_NB_NB 0x12 00236 #define NCACN_NB_IPX 0x0D 00237 #define NCACN_DNET_NSP 0x04 00238 #define NCACN_HTTP 0x1F 00239 00240 /* FreeDCE: TWR_C_FLR_PROT_ID_IP */ 00241 #define TWR_IP 0x09 00242 00243 #endif /* __WINE_RPC_DEFS_H */ Generated on Fri May 25 2012 04:24:14 for ReactOS by
1.7.6.1
|