summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-11-23 06:28:12 +0000
committerAndrew Tridgell <tridge@samba.org>2003-11-23 06:28:12 +0000
commit800d3e0134b72135fa359fa5a239f1c68adf4ca1 (patch)
tree1f0e6cafab8f1d62dee9a3796443ab18b6394fe1 /source4/librpc/ndr/ndr.c
parent02dc7536dd625e0cdee23a96e66cb41b407cdba8 (diff)
downloadsamba-800d3e0134b72135fa359fa5a239f1c68adf4ca1.tar.gz
samba-800d3e0134b72135fa359fa5a239f1c68adf4ca1.tar.bz2
samba-800d3e0134b72135fa359fa5a239f1c68adf4ca1.zip
ooh, this is fun!
I have recoded the core dcerpc packet structures (all the PDUs etc) in terms of IDL, which means we now use pidl to generate all the code for handling the most basic dcerpc packets. This is not normally possible as it isn't completely valid NDR, but pidl has a number of extensions that make it quite easy. This also means we get the server side dcerpc marshalling/unmarshalling code for free. (This used to be commit 92bcad02587c3c1b31b523ee9fa46658a6cef9ff)
Diffstat (limited to 'source4/librpc/ndr/ndr.c')
-rw-r--r--source4/librpc/ndr/ndr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index 44472147fd..bce4759d8a 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -31,6 +31,16 @@
#define NDR_BASE_MARSHALL_SIZE 1024
+
+/*
+ work out the number of bytes needed to align on a n byte boundary
+*/
+size_t ndr_align_size(uint32 offset, size_t n)
+{
+ if ((offset & (n-1)) == 0) return 0;
+ return n - (offset & (n-1));
+}
+
/*
initialise a ndr parse structure from a data blob
*/