aboutsummaryrefslogtreecommitdiffstats
path: root/alignment.h
diff options
context:
space:
mode:
authorsharpe <sharpe@f5534014-38df-0310-8fa8-9805f1628bb7>1999-05-09 04:20:59 +0000
committersharpe <sharpe@f5534014-38df-0310-8fa8-9805f1628bb7>1999-05-09 04:20:59 +0000
commit727a7914e34710ca9cf890fe71016606596f1a5c (patch)
tree6e4bea4b3afb937cabbb511f0aa6aa1173ac746f /alignment.h
parentb0549afa5a94fb321df5427697dece51173a2914 (diff)
Added new files for SMB decode: packet-smb.c, alignment.h, smb.h
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@259 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'alignment.h')
-rw-r--r--alignment.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/alignment.h b/alignment.h
new file mode 100644
index 0000000000..e585f515e7
--- /dev/null
+++ b/alignment.h
@@ -0,0 +1,36 @@
+ /*
+ * alignment.h, Copyright, 1998, Richard Sharpe, All Rights Reserved
+ *
+ * Please see the file COPYING in the top level for details of copying
+ * this software. Use of this software is approved only under certain
+ * conditions.
+ *
+ * This file implements the alignment macros for the Threaded SMB Server
+ *
+ * For the moment we assume Intel style architecture, but can support
+ * others.
+ *
+ * Modification History
+ *
+ * 16-Oct-1998, RJS, Initial Coding
+ *
+ */
+
+#ifndef __ALIGNMENT_H
+#define __ALIGNMENT_H
+#ifdef __i386__
+
+#define GBYTE(buf, pos) (unsigned char)((char)buf[pos])
+#define PBYTE(buf, pos, val) GBYTE(buf, pos) = (unsigned char)(val)
+#define GSHORT(buf, pos) ((unsigned short *)((buf) + pos))[0]
+#define PSHORT(buf, pos, val) GSHORT(buf, pos) = (unsigned short)(val)
+#define GSSHORT(buf, pos) ((signed short *)((buf) + pos))[0]
+
+#define GWORD(buf, pos) ((unsigned int *)((buf) + pos))[0]
+#define PWORD(buf, pos, val) GWORD(buf, pos) = (unsigned int)(val)
+
+#else
+
+
+#endif
+#endif