diff options
author | Luke Leighton <lkcl@samba.org> | 2000-01-03 03:09:07 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-01-03 03:09:07 +0000 |
commit | 832488988295848f0ee74befd1fe6545413bf080 (patch) | |
tree | 85f55f2e9ab1f56f40f7f744af7d657166bfe9fa /source/rpc_parse/parse_rpc.c | |
parent | 26a1c208a515492d97d268ad961bcfbcf33cfa4c (diff) | |
download | samba-832488988295848f0ee74befd1fe6545413bf080.tar.gz |
attempting to delineate smbd / msrpc more.
Diffstat (limited to 'source/rpc_parse/parse_rpc.c')
-rw-r--r-- | source/rpc_parse/parse_rpc.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/rpc_parse/parse_rpc.c b/source/rpc_parse/parse_rpc.c index ac6ea8ea7e0..428516ffd2e 100644 --- a/source/rpc_parse/parse_rpc.c +++ b/source/rpc_parse/parse_rpc.c @@ -232,6 +232,33 @@ BOOL smb_io_rpc_hdr(char *desc, RPC_HDR *rpc, prs_struct *ps, int depth) } /******************************************************************* +checks a PDU structure. +********************************************************************/ +BOOL is_complete_pdu(prs_struct *ps) +{ + RPC_HDR hdr; + int len = ps->data_size; + + DEBUG(10,("is_complete_pdu - len %d\n", len)); + ps->offset = 0x0; + + if (!ps->io) + { + /* writing. oops!! */ + DEBUG(4,("is_complete_pdu: write set, not read!\n")); + return False; + } + + if (!smb_io_rpc_hdr("hdr", &hdr, ps, 0)) + { + return False; + } + + /* check that the fragment length is equal to the data length so far */ + return hdr.frag_len == len; +} + +/******************************************************************* reads or writes an RPC_HDR_FAULT structure. ********************************************************************/ BOOL smb_io_rpc_hdr_fault(char *desc, RPC_HDR_FAULT *rpc, prs_struct *ps, int depth) |