summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_epmapper.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2003-10-20 18:35:12 +0000
committerJim McDonough <jmcd@samba.org>2003-10-20 18:35:12 +0000
commit2cfb3e9b7046fe2db330a292aed71f1c27688a16 (patch)
treeca25dec3cf9b20a690ee22b9f8701e45ab306906 /source3/rpc_parse/parse_epmapper.c
parentf3121b19e4a4951350342a1882c9017686a995b1 (diff)
downloadsamba-2cfb3e9b7046fe2db330a292aed71f1c27688a16.tar.gz
samba-2cfb3e9b7046fe2db330a292aed71f1c27688a16.tar.bz2
samba-2cfb3e9b7046fe2db330a292aed71f1c27688a16.zip
Several updates:
- add support for named pipe and netbios queries in parse code - fix map request structure...unknown byte was alignment - add sample of named pipe over netbios query in rpcclient (comment only) (This used to be commit 71dcdf54e60204d6b499d25d8759ed20fc7a021a)
Diffstat (limited to 'source3/rpc_parse/parse_epmapper.c')
-rw-r--r--source3/rpc_parse/parse_epmapper.c45
1 files changed, 42 insertions, 3 deletions
diff --git a/source3/rpc_parse/parse_epmapper.c b/source3/rpc_parse/parse_epmapper.c
index 368ea319bd..2bdb755deb 100644
--- a/source3/rpc_parse/parse_epmapper.c
+++ b/source3/rpc_parse/parse_epmapper.c
@@ -29,6 +29,8 @@
BOOL epm_io_handle(const char *desc, EPM_HANDLE *handle, prs_struct *ps,
int depth)
{
+ if (!prs_align(ps))
+ return False;
if (!prs_uint8s(False, "data", ps, depth, handle->data,
sizeof(handle->data)))
@@ -67,6 +69,11 @@ NTSTATUS init_epm_floor(EPM_FLOOR *floor, uint8 protocol)
case EPM_FLOOR_IP:
floor->rhs.length = sizeof(floor->rhs.ip.addr);
break;
+ case EPM_FLOOR_NMPIPES:
+ case EPM_FLOOR_LRPC:
+ case EPM_FLOOR_NETBIOS:
+ floor->rhs.length = strlen(floor->rhs.string) + 1;
+ break;
default:
break;
}
@@ -114,6 +121,33 @@ NTSTATUS init_epm_floor_ip(EPM_FLOOR *floor, uint8 addr[4])
}
/*******************************************************************
+ inits an EPM_FLOOR structure for named pipe
+********************************************************************/
+NTSTATUS init_epm_floor_np(EPM_FLOOR *floor, const char *pipe_name)
+{
+ safe_strcpy(floor->rhs.string, pipe_name, sizeof(floor->rhs.string)-1);
+ return init_epm_floor(floor, EPM_FLOOR_NMPIPES);
+}
+
+/*******************************************************************
+ inits an EPM_FLOOR structure for named pipe
+********************************************************************/
+NTSTATUS init_epm_floor_lrpc(EPM_FLOOR *floor, const char *pipe_name)
+{
+ safe_strcpy(floor->rhs.string, pipe_name, sizeof(floor->rhs.string)-1);
+ return init_epm_floor(floor, EPM_FLOOR_LRPC);
+}
+
+/*******************************************************************
+ inits an EPM_FLOOR structure for named pipe
+********************************************************************/
+NTSTATUS init_epm_floor_nb(EPM_FLOOR *floor, char *host_name)
+{
+ safe_strcpy(floor->rhs.string, host_name, sizeof(floor->rhs.string)-1);
+ return init_epm_floor(floor, EPM_FLOOR_NETBIOS);
+}
+
+/*******************************************************************
reads and writes EPM_FLOOR.
********************************************************************/
BOOL epm_io_floor(const char *desc, EPM_FLOOR *floor,
@@ -156,6 +190,14 @@ BOOL epm_io_floor(const char *desc, EPM_FLOOR *floor,
sizeof(floor->rhs.ip.addr)))
return False;
break;
+ case EPM_FLOOR_NMPIPES:
+ case EPM_FLOOR_LRPC:
+ case EPM_FLOOR_NETBIOS:
+ if (!prs_uint8s(False, "string", ps, depth,
+ floor->rhs.string,
+ floor->rhs.length))
+ return False;
+ break;
default:
break;
}
@@ -227,9 +269,6 @@ BOOL epm_io_tower(const char *desc, EPM_TOWER *tower,
return False;
}
- if (!prs_uint8("unknown", ps, depth, &tower->unknown))
- return False;
-
return True;
}