summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/epmapper.idl12
-rw-r--r--source4/librpc/rpc/dcerpc_tcp.c10
-rw-r--r--source4/librpc/rpc/dcerpc_util.c34
3 files changed, 51 insertions, 5 deletions
diff --git a/source4/librpc/idl/epmapper.idl b/source4/librpc/idl/epmapper.idl
index e09d729c81..250129f84d 100644
--- a/source4/librpc/idl/epmapper.idl
+++ b/source4/librpc/idl/epmapper.idl
@@ -32,10 +32,14 @@ interface epmapper
} epm_prot_uuid;
typedef enum {
- EPM_PROTOCOL_TCP = 0x07,
- EPM_PROTOCOL_IP = 0x09,
- EPM_PROTOCOL_RPC_C = 0x0b,
- EPM_PROTOCOL_UUID = 0x0d
+ EPM_PROTOCOL_TCP = 0x07,
+ EPM_PROTOCOL_IP = 0x09,
+ EPM_PROTOCOL_PIPE = 0x10,
+ EPM_PROTOCOL_NETBIOS = 0x11,
+ EPM_PROTOCOL_RPC_C = 0x0b,
+ EPM_PROTOCOL_UUID = 0x0d,
+ EPM_PROTOCOL_SMB = 0x0f,
+ EPM_PROTOCOL_HTTP = 0x1f
} epm_protocols;
typedef [nodiscriminant] union {
diff --git a/source4/librpc/rpc/dcerpc_tcp.c b/source4/librpc/rpc/dcerpc_tcp.c
index c50b71c3f0..468cd9465b 100644
--- a/source4/librpc/rpc/dcerpc_tcp.c
+++ b/source4/librpc/rpc/dcerpc_tcp.c
@@ -48,6 +48,16 @@ static NTSTATUS tcp_raw_recv(struct dcerpc_pipe *p,
return NT_STATUS_NET_WRITE_FAULT;
}
+ /* this could be a ncacn_http endpoint - this doesn't work
+ yet, but it goes close */
+ if (strncmp(blob1.data, "ncacn_http/1.0", 14) == 0) {
+ memmove(blob1.data, blob1.data+14, 2);
+ ret = read_data(tcp->fd, blob1.data+2, 14);
+ if (ret != 14) {
+ return NT_STATUS_NET_WRITE_FAULT;
+ }
+ }
+
/* we might have recieved a partial fragment, in which case we
need to pull the rest of it */
frag_length = SVAL(blob1.data, 8);
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index e9499f969b..d439c89e65 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -143,7 +143,7 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server,
}
if (twr_r->towers.num_floors != 5 ||
- twr_r->towers.floors[3].lhs.protocol != EPM_PROTOCOL_TCP ||
+ twr_r->towers.floors[3].lhs.protocol != twr.towers.floors[3].lhs.protocol ||
twr_r->towers.floors[3].rhs.rhs_data.length != 2) {
dcerpc_pipe_close(p);
return NT_STATUS_PORT_UNREACHABLE;
@@ -155,3 +155,35 @@ NTSTATUS dcerpc_epm_map_tcp_port(const char *server,
return NT_STATUS_OK;
}
+
+
+/*
+ find the pipe name for a local IDL interface
+*/
+const char *idl_pipe_name(const char *uuid, uint32 if_version)
+{
+ int i;
+ for (i=0;dcerpc_pipes[i];i++) {
+ if (strcasecmp(dcerpc_pipes[i]->uuid, uuid) == 0 &&
+ dcerpc_pipes[i]->if_version == if_version) {
+ return dcerpc_pipes[i]->name;
+ }
+ }
+ return "UNKNOWN";
+}
+
+/*
+ find the number of calls defined by local IDL
+*/
+int idl_num_calls(const char *uuid, uint32 if_version)
+{
+ int i;
+ for (i=0;dcerpc_pipes[i];i++) {
+ if (strcasecmp(dcerpc_pipes[i]->uuid, uuid) == 0 &&
+ dcerpc_pipes[i]->if_version == if_version) {
+ return dcerpc_pipes[i]->num_calls;
+ }
+ }
+ return -1;
+}
+