summaryrefslogtreecommitdiff
path: root/source3/rpc_parse/parse_rpc.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-10-03 15:08:16 +0000
committerGerald Carter <jerry@samba.org>2003-10-03 15:08:16 +0000
commit8ae168b46df07414f1d56a74e2ecb8aa2332d50a (patch)
treed7f9baa26de0109a72422aad714ba47c8ee5976b /source3/rpc_parse/parse_rpc.c
parent4ed89be00f0239179182da04b6c3d017a639664d (diff)
downloadsamba-8ae168b46df07414f1d56a74e2ecb8aa2332d50a.tar.gz
samba-8ae168b46df07414f1d56a74e2ecb8aa2332d50a.tar.bz2
samba-8ae168b46df07414f1d56a74e2ecb8aa2332d50a.zip
abstract UUID parsing code to an individual function; patch from Anthony
(This used to be commit 6cbdbdf9e1e76837c8ef03e795db11caa74ccf18)
Diffstat (limited to 'source3/rpc_parse/parse_rpc.c')
-rw-r--r--source3/rpc_parse/parse_rpc.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index 558378548a..c1e663f877 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -243,29 +243,48 @@ BOOL smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth)
}
/*******************************************************************
- Reads or writes an RPC_IFACE structure.
+ Reads or writes an RPC_UUID structure.
********************************************************************/
-static BOOL smb_io_rpc_iface(const char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth)
+static BOOL smb_io_rpc_uuid(const char *desc, RPC_UUID *uuid, prs_struct *ps, int depth)
{
if (ifc == NULL)
return False;
- prs_debug(ps, depth, desc, "smb_io_rpc_iface");
+ prs_debug(ps, depth, desc, "smb_io_rpc_uuid");
depth++;
if(!prs_align(ps))
return False;
- if(!prs_uint32 ("data ", ps, depth, &ifc->uuid.time_low))
+ if(!prs_uint32 ("data ", ps, depth, &uuid->time_low))
+ return False;
+ if(!prs_uint16 ("data ", ps, depth, &uuid->time_mid))
+ return False;
+ if(!prs_uint16 ("data ", ps, depth, &uuid->time_hi_and_version))
return False;
- if(!prs_uint16 ("data ", ps, depth, &ifc->uuid.time_mid))
+
+ if(!prs_uint8s (False, "data ", ps, depth, uuid->remaining, sizeof(uuid->remaining)))
return False;
- if(!prs_uint16 ("data ", ps, depth, &ifc->uuid.time_hi_and_version))
+
+ return true;
+}
+
+/*******************************************************************
+ Reads or writes an RPC_IFACE structure.
+********************************************************************/
+
+static BOOL smb_io_rpc_iface(const char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth)
+{
+ if (ifc == NULL)
return False;
- if(!prs_uint8s (False, "data ", ps, depth, ifc->uuid.remaining, sizeof(ifc->uuid.remaining)))
+ prs_debug(ps, depth, desc, "smb_io_rpc_iface");
+ depth++;
+
+ if (!smb_io_rpc_uuid( "uuid", ps, depth, &ifc->uuid))
return False;
+
if(!prs_uint32 ( "version", ps, depth, &ifc->version))
return False;