diff options
author | Gerald Carter <jerry@samba.org> | 2003-10-03 15:07:15 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-10-03 15:07:15 +0000 |
commit | faca10b35d5a3a311f55301889dca9743ad0e176 (patch) | |
tree | e27ebde1b03b8c0ab4a6e9870a7f6f24d64e6666 | |
parent | 635dff752869d8284386d9c4b84a87840868ecd6 (diff) | |
download | samba-faca10b35d5a3a311f55301889dca9743ad0e176.tar.gz samba-faca10b35d5a3a311f55301889dca9743ad0e176.tar.bz2 samba-faca10b35d5a3a311f55301889dca9743ad0e176.zip |
abstract UUID parsing code to an individual function; patch from Anthony
(This used to be commit 9365c619d6feb15289d963e9e70e1f947b7f8c3f)
-rw-r--r-- | source3/rpc_parse/parse_rpc.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index 1752e10114..5b97c44d65 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; |