Commit 37364b83 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

rpcrt4: Add functions for generating and parsing the upper floors in…

rpcrt4: Add functions for generating and parsing the upper floors in endpoint-mapper towers for different transports.
parent 84ab2e78
/*
* Endpoint Mapper Tower Definitions
*
* Copyright 2006 Robert Shearman (for CodeWeavers)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#define EPM_PROTOCOL_DNET_NSP 0x04
#define EPM_PROTOCOL_OSI_TP4 0x05
#define EPM_PROTOCOL_OSI_CLNS 0x06
#define EPM_PROTOCOL_TCP 0x07
#define EPM_PROTOCOL_UDP 0x08
#define EPM_PROTOCOL_IP 0x09
#define EPM_PROTOCOL_NCADG 0x0a /* Connectionless RPC */
#define EPM_PROTOCOL_NCACN 0x0b
#define EPM_PROTOCOL_NCALRPC 0x0c /* Local RPC */
#define EPM_PROTOCOL_UUID 0x0d
#define EPM_PROTOCOL_IPX 0x0e
#define EPM_PROTOCOL_SMB 0x0f
#define EPM_PROTOCOL_PIPE 0x10
#define EPM_PROTOCOL_NETBIOS 0x11
#define EPM_PROTOCOL_NETBEUI 0x12
#define EPM_PROTOCOL_SPX 0x13
#define EPM_PROTOCOL_NB_IPX 0x14 /* NetBIOS over IPX */
#define EPM_PROTOCOL_DSP 0x16 /* AppleTalk Data Stream Protocol */
#define EPM_PROTOCOL_DDP 0x17 /* AppleTalk Data Datagram Protocol */
#define EPM_PROTOCOL_APPLETALK 0x18 /* AppleTalk */
#define EPM_PROTOCOL_VINES_SPP 0x1a
#define EPM_PROTOCOL_VINES_IPC 0x1b /* Inter Process Communication */
#define EPM_PROTOCOL_STREETTALK 0x1c /* Vines Streettalk */
#define EPM_PROTOCOL_HTTP 0x1f
#define EPM_PROTOCOL_UNIX_DS 0x20 /* Unix domain socket */
#define EPM_PROTOCOL_NULL 0x21
#include <pshpack1.h>
typedef unsigned char u_int8;
typedef unsigned short u_int16;
typedef unsigned int u_int32;
typedef GUID uuid_t;
typedef struct
{
u_int16 count_lhs;
u_int8 protid;
uuid_t uuid;
u_int16 major_version;
u_int16 count_rhs;
u_int16 minor_version;
} twr_uuid_floor_t;
typedef struct
{
u_int16 count_lhs;
u_int8 protid;
u_int16 count_rhs;
u_int16 port;
} twr_tcp_floor_t;
typedef struct
{
u_int16 count_lhs;
u_int8 protid;
u_int16 count_rhs;
u_int32 ipv4addr;
} twr_ipv4_floor_t;
typedef struct
{
u_int16 count_lhs;
u_int8 protid;
u_int16 count_rhs;
} twr_empty_floor_t;
#include <poppack.h>
......@@ -58,7 +58,8 @@ typedef struct _RpcConnection
} RpcConnection;
struct protseq_ops {
char *name;
const char *name;
unsigned char epm_protocols[2]; /* only floors 3 and 4. see http://www.opengroup.org/onlinepubs/9629399/apdxl.htm */
RpcConnection *(*alloc)(void);
RPC_STATUS (*open_connection)(RpcConnection *conn);
HANDLE (*get_connect_wait_handle)(RpcConnection *conn);
......@@ -66,6 +67,8 @@ struct protseq_ops {
int (*read)(RpcConnection *conn, void *buffer, unsigned int len);
int (*write)(RpcConnection *conn, const void *buffer, unsigned int len);
int (*close)(RpcConnection *conn);
size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint);
RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint);
};
/* don't know what MS's structure looks like */
......@@ -151,4 +154,8 @@ static inline RPC_STATUS rpcrt4_conn_handoff(RpcConnection *old_conn, RpcConnect
return old_conn->ops->handoff(old_conn, new_conn);
}
/* floors 3 and up */
RPC_STATUS RpcTransport_GetTopOfTower(unsigned char *tower_data, size_t *tower_size, const char *protseq, const char *networkaddr, const char *endpoint);
RPC_STATUS RpcTransport_ParseTopOfTower(const unsigned char *tower_data, size_t tower_size, char **protseq, char **networkaddr, char **endpoint);
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment