summaryrefslogtreecommitdiff
path: root/source3/smbparse.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-04 16:51:43 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-04 16:51:43 +0000
commit07cc8fd8e8edd58110800f3b6b7aaec94687b579 (patch)
tree3a84c01129db95ba31803aebf9552840df5248fa /source3/smbparse.c
parenta193401384a0e861c1857d256963c9178644c301 (diff)
downloadsamba-07cc8fd8e8edd58110800f3b6b7aaec94687b579.tar.gz
samba-07cc8fd8e8edd58110800f3b6b7aaec94687b579.tar.bz2
samba-07cc8fd8e8edd58110800f3b6b7aaec94687b579.zip
proto.h:
- recreated, as usual. smb.h: - added RPC_HDR structure - the 18 byte MSRPC header smbparse.c: - added smb_io_rpc_hdr() function to read/write the RPC_HDR structure. util.c: - added align2, align4, align_offset functions. - added skip_unicode_string, unistrcpy, unistrncpy functions. - modified unistrcpy and unistrncpy to return the number of unicode characters returned, effectively making skip_unicode_string redundant. (This used to be commit b0ad811cda3dcffed5b24104229813cdb17b014f)
Diffstat (limited to 'source3/smbparse.c')
-rw-r--r--source3/smbparse.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/source3/smbparse.c b/source3/smbparse.c
index bff1a1453a..d39f18de5f 100644
--- a/source3/smbparse.c
+++ b/source3/smbparse.c
@@ -354,21 +354,32 @@ char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align)
return q;
}
-#if 0
/*******************************************************************
-reads or writes a structure.
+reads or writes an RPC_HDR structure.
********************************************************************/
- char* smb_io_(BOOL io, *, char *q, char *base, int align)
+char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align)
{
- if (== NULL) return NULL;
-
- q = align_offset(q, base, align);
-
- RW_IVAL(io, q, , 0); q += 4;
+ if (rpc == NULL) return NULL;
+
+ /* reserved should be zero: enforce it */
+ rpc->reserved = 0;
+
+ RW_CVAL(io, q, rpc->major, 0); q++;
+ RW_CVAL(io, q, rpc->minor, 0); q++;
+ RW_CVAL(io, q, rpc->pkt_type, 0); q++;
+ RW_CVAL(io, q, rpc->frag, 0); q++;
+ RW_IVAL(io, q, rpc->pack_type, 0); q += 4;
+ RW_SVAL(io, q, rpc->frag_len, 0); q += 2;
+ RW_SVAL(io, q, rpc->auth_len, 0); q += 2;
+ RW_IVAL(io, q, rpc->call_id, 0); q += 4;
+ RW_SVAL(io, q, rpc->alloc_hint, 0); q += 2;
+ RW_CVAL(io, q, rpc->context_id, 0); q++;
+ RW_CVAL(io, q, rpc->reserved, 0); q++;
return q;
}
+#if 0
/*******************************************************************
reads or writes a structure.
********************************************************************/