/* Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup Copyright (C) Andrew Tridgell 1992-2000 Copyright (C) John H Terpstra 1996-2000 Copyright (C) Luke Kenneth Casson Leighton 1996-2000 Copyright (C) Paul Ashton 1998-2000 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _SMB_H #define _SMB_H #define BUFFER_SIZE (0xFFFF) #define SAFETY_MARGIN 1024 #define LARGE_WRITEX_HDR_SIZE 65 #define NMB_PORT 137 #define DGRAM_PORT 138 #define SMB_PORT 139 #define False (0) #define True (1) #define Auto (2) #ifndef _BOOL typedef int BOOL; #define _BOOL /* So we don't typedef BOOL again in vfs.h */ #endif /* limiting size of ipc replies */ #define REALLOC(ptr,size) Realloc(ptr,MAX((size),4*1024)) #define SIZEOFWORD 2 #ifndef DEF_CREATE_MASK #define DEF_CREATE_MASK (0755) #endif /* string manipulation flags - see clistr.c and srvstr.c */ #define STR_TERMINATE 1 #define STR_UPPER 2 #define STR_ASCII 4 #define STR_UNICODE 8 #define STR_NOALIGN 16 /* how long to wait for secondary SMB packets (milli-seconds) */ #define SMB_SECONDARY_WAIT (60*1000) /* Debugging stuff */ #include "debug.h" /* this defines the error codes that receive_smb can put in smb_read_error */ #define READ_TIMEOUT 1 #define READ_EOF 2 #define READ_ERROR 3 #define DIR_STRUCT_SIZE 43 /* these define all the command types recognised by the server - there are lots of gaps so probably there are some rare commands that are not implemented */ #define pSETDIR '\377' /* these define the attribute byte as seen by DOS */ #define aRONLY (1L<<0) #define aHIDDEN (1L<<1) #define aSYSTEM (1L<<2) #define aVOLID (1L<<3) #define aDIR (1L<<4) #define aARCH (1L<<5) /* deny modes */ #define DENY_DOS 0 #define DENY_ALL 1 #define DENY_WRITE 2 #define DENY_READ 3 #define DENY_NONE 4 #define DENY_FCB 7 /* open modes */ #define DOS_OPEN_RDONLY 0 #define DOS_OPEN_WRONLY 1 #define DOS_OPEN_RDWR 2 #define DOS_OPEN_FCB 0xF /* define shifts and masks for share and open modes. */ #define OPEN_MODE_MASK 0xF #define SHARE_MODE_SHIFT 4 #define SHARE_MODE_MASK 0x7 #define GET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) #define SET_OPEN_MODE(x) ((x) & OPEN_MODE_MASK) #define GET_DENY_MODE(x) (((x)>>SHARE_MODE_SHIFT) & SHARE_MODE_MASK) #define SET_DENY_MODE(x) (((x) & SHARE_MODE_MASK) <