diff options
author | Jeremy Allison <jra@samba.org> | 2006-01-12 22:17:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:06:05 -0500 |
commit | 33174847994128387a36a8103f147fe5a96c15fd (patch) | |
tree | 72ef01910bac6df965a9e0554c235bab145fa209 /source3/include | |
parent | 80f2848260d5c9be70f4a037ca3ea5c5b6a76166 (diff) | |
download | samba-33174847994128387a36a8103f147fe5a96c15fd.tar.gz samba-33174847994128387a36a8103f147fe5a96c15fd.tar.xz samba-33174847994128387a36a8103f147fe5a96c15fd.zip |
r12877: Stop passing structs around in smb messages, instead
always linearize into little-endian. Should fix all
Solaris issues with this, plus provide a cleaner base
moving forward for cluster-aware Samba where smbd's
can communicate across different compilers/architectures
(eventually these message will have to go cross-machine).
Jeremy.
(This used to be commit d01824b78576a034428e1cef73868d1169057991)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 20 | ||||
-rw-r--r-- | source3/include/smb.h | 44 |
2 files changed, 61 insertions, 3 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 44b5ea1bd7..a9b792d5f6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -657,6 +657,20 @@ typedef int socklen_t; # endif #endif +#ifndef LARGE_SMB_DEV_T +# if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8)) +# define LARGE_SMB_DEV_T 1 +# endif +#endif + +#ifdef LARGE_SMB_DEV_T +#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32)) +#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32))) +#else +#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0)) +#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs)))) +#endif + /* * Setup the correctly sized inode type. */ @@ -676,9 +690,11 @@ typedef int socklen_t; #endif #ifdef LARGE_SMB_INO_T -#define SINO_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) +#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32)) +#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32))) #else -#define SINO_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) +#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) +#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs)))) #endif #ifndef SMB_OFF_T diff --git a/source3/include/smb.h b/source3/include/smb.h index d2eb5644e0..6ceb4ec1cd 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -631,6 +631,25 @@ struct share_mode_entry { unsigned long share_file_id; }; +/* oplock break message definition - linearization of share_mode_entry. + +Offset Data length. +0 struct process_id pid 4 +4 uint16 op_mid 2 +6 uint16 op_type 2 +8 uint32 access_mask 4 +12 uint32 share_access 4 +16 uint32 private_options 4 +20 uint32 time sec 4 +24 uint32 time usec 4 +28 SMB_DEV_T dev 8 bytes. +36 SMB_INO_T inode 8 bytes +44 unsigned long file_id 4 bytes +48 + +*/ +#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 48 + struct share_mode_lock { const char *servicepath; /* canonicalized. */ const char *filename; @@ -1456,18 +1475,41 @@ struct inform_level2_message { unsigned long source_file_id; }; +/* kernel_oplock_message definition. + struct kernel_oplock_message { SMB_DEV_T dev; SMB_INO_T inode; unsigned long file_id; }; +Offset Data length. +0 SMB_DEV_T dev 8 bytes. +8 SMB_INO_T inode 8 bytes +16 unsigned long file_id 4 bytes +20 + +*/ +#define MSG_SMB_KERNEL_BREAK_SIZE 20 + +/* file_renamed_message definition. + struct file_renamed_message { SMB_DEV_T dev; SMB_INO_T inode; - char names[1]; /* A variable area containing sharepath and filename. */ + char names[1]; A variable area containing sharepath and filename. }; +Offset Data length. +0 SMB_DEV_T dev 8 bytes. +8 SMB_INO_T inode 8 bytes +16 char [] name zero terminated namelen bytes +minimum length == 18. + +*/ + +#define MSG_FILE_RENAMED_MIN_SIZE 16 + /* * On the wire return values for oplock types. */ |