summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2000-02-07 16:25:15 +0000
committerJean-François Micouleau <jfm@samba.org>2000-02-07 16:25:15 +0000
commit195e3d44daccc3b6457486018ba0322ac9d44566 (patch)
treeaa6de6d3e640dc029b41deabc1a87e02a0ffebff /source3/rpc_parse
parent59ac32c2556e970ea1fe171e7b76cfee2142fbf0 (diff)
downloadsamba-195e3d44daccc3b6457486018ba0322ac9d44566.tar.gz
samba-195e3d44daccc3b6457486018ba0322ac9d44566.tar.bz2
samba-195e3d44daccc3b6457486018ba0322ac9d44566.zip
spoolss definitions.
also added some prs_struct functions, 'cause I'm handling buffers as prs_struct. J.F. (This used to be commit 81e375bbbe0fb022a44a2aaaa3729a9518b7a854)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_misc.c25
-rw-r--r--source3/rpc_parse/parse_prs.c50
-rw-r--r--source3/rpc_parse/parse_rpc.c21
3 files changed, 85 insertions, 11 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 5277825767..21d97b444c 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -593,6 +593,31 @@ BOOL smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth)
}
/*******************************************************************
+reads or writes a BUFFER5 structure.
+the buf_len member tells you how large the buffer is.
+********************************************************************/
+BOOL smb_io_buffer5(char *desc, BUFFER5 *buf5, prs_struct *ps, int depth)
+{
+ prs_debug(ps, depth, desc, "smb_io_buffer4");
+ depth++;
+
+ if (buf5 == NULL) return False;
+
+ prs_align(ps);
+ prs_uint32("buf_len", ps, depth, &(buf5->buf_len));
+
+ /* reading: alloc the buffer first */
+ if ( ps->io )
+ {
+ buf5->buffer=(uint16 *)malloc( sizeof(uint16)*buf5->buf_len );
+ }
+
+ prs_uint16s(True, "buffer", ps, depth, buf5->buffer, buf5->buf_len);
+
+ return True;
+}
+
+/*******************************************************************
Inits a BUFFER2 structure.
********************************************************************/
diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c
index 6bb07c5f64..24eff1b779 100644
--- a/source3/rpc_parse/parse_prs.c
+++ b/source3/rpc_parse/parse_prs.c
@@ -283,6 +283,21 @@ BOOL prs_append_prs_data(prs_struct *dst, prs_struct *src)
}
/*******************************************************************
+ Append some data from one parse_struct into another.
+ ********************************************************************/
+
+BOOL prs_append_some_prs_data(prs_struct *dst, prs_struct *src, uint32 len)
+{
+ if(!prs_grow(dst, len))
+ return False;
+
+ memcpy(&dst->data_p[dst->data_offset], prs_data_p(src), (size_t)len);
+ dst->data_offset += len;
+
+ return True;
+}
+
+/*******************************************************************
Append the data from a buffer into a parse_struct.
********************************************************************/
@@ -352,6 +367,25 @@ char *prs_mem_get(prs_struct *ps, uint32 extra_size)
}
/*******************************************************************
+ Change the struct type.
+ ********************************************************************/
+
+BOOL prs_switch_type(prs_struct *ps, BOOL io)
+{
+ if ((ps->io ^ io) == True)
+ ps->io=io;
+}
+
+/*******************************************************************
+ Force a prs_struct to be dynamic even when it's size is 0.
+ ********************************************************************/
+
+void prs_force_dynamic(prs_struct *ps)
+{
+ ps->is_dynamic=True;
+}
+
+/*******************************************************************
Stream a uint8.
********************************************************************/
@@ -417,6 +451,22 @@ BOOL prs_uint8s(BOOL charmode, char *name, prs_struct *ps, int depth, uint8 *dat
}
/******************************************************************
+ Stream an array of uint16s. Length is number of uint16s.
+ ********************************************************************/
+
+BOOL prs_uint16s(BOOL charmode, char *name, prs_struct *ps, int depth, uint16 *data16s, int len)
+{
+ char *q = prs_mem_get(ps, len * sizeof(uint16));
+ if (q == NULL)
+ return False;
+
+ DBG_RW_PSVAL(charmode, name, depth, ps->data_offset, ps->io, ps->bigendian_data, q, data16s, len)
+ ps->data_offset += (len * sizeof(uint16));
+
+ return True;
+}
+
+/******************************************************************
Stream an array of uint32s. Length is number of uint32s.
********************************************************************/
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index d4ea84628a..54d3eea74d 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -105,6 +105,15 @@ interface/version dce/rpc pipe identification
}, 0x01 \
}
+#define SYNT_SPOOLSS_V1 \
+{ \
+ { \
+ 0x12345678, 0x1234, 0xabcb, \
+ { 0xef, 0x00, 0x01, 0x23, \
+ 0x45, 0x67, 0x89, 0xab } \
+ }, 0x01 \
+}
+
#define SYNT_NONE_V0 \
{ \
{ \
@@ -114,17 +123,6 @@ interface/version dce/rpc pipe identification
}, 0x00 \
}
-/* pipe string names */
-#define PIPE_SRVSVC "\\PIPE\\srvsvc"
-#define PIPE_SAMR "\\PIPE\\samr"
-#define PIPE_WINREG "\\PIPE\\winreg"
-#define PIPE_WKSSVC "\\PIPE\\wkssvc"
-#define PIPE_NETLOGON "\\PIPE\\NETLOGON"
-#define PIPE_NTLSA "\\PIPE\\ntlsa"
-#define PIPE_NTSVCS "\\PIPE\\ntsvcs"
-#define PIPE_LSASS "\\PIPE\\lsass"
-#define PIPE_LSARPC "\\PIPE\\lsarpc"
-
struct pipe_id_info pipe_names [] =
{
/* client pipe , abstract syntax , server pipe , transfer syntax */
@@ -134,6 +132,7 @@ struct pipe_id_info pipe_names [] =
{ PIPE_SRVSVC , SYNT_SRVSVC_V3 , PIPE_NTSVCS , TRANS_SYNT_V2 },
{ PIPE_WKSSVC , SYNT_WKSSVC_V1 , PIPE_NTSVCS , TRANS_SYNT_V2 },
{ PIPE_WINREG , SYNT_WINREG_V1 , PIPE_WINREG , TRANS_SYNT_V2 },
+ { PIPE_SPOOLSS , SYNT_SPOOLSS_V1 , PIPE_SPOOLSS , TRANS_SYNT_V2 },
{ NULL , SYNT_NONE_V0 , NULL , SYNT_NONE_V0 }
};