#define BUFFER_SIZE (0xFFFF)
#define SAFETY_MARGIN 1024
-#ifndef EXTERN
-# define EXTERN extern
+/* size of shared memory used for share mode locking */
+#ifndef SHMEM_SIZE
+#define SHMEM_SIZE 102400
#endif
#define NMB_PORT 137
typedef int BOOL;
+/* offset in shared memory */
+typedef int shm_offset_t;
+#define NULL_OFFSET (shm_offset_t)(0)
+
+
/*
Samba needs type definitions for int16, int32, uint16 and uint32.
#define DEF_CREATE_MASK (0755)
#endif
-#ifndef DEFAULT_PIPE_TIMEOUT
-#define DEFAULT_PIPE_TIMEOUT 10000000 /* Ten seconds */
-#endif
-
-/* how long to wait for secondary SMB packets (seconds) */
-#define SMB_SECONDARY_WAIT 30
+/* how long to wait for secondary SMB packets (milli-seconds) */
+#define SMB_SECONDARY_WAIT (60*1000)
/* debugging code */
#ifndef SYSLOG
#define DEBUG(level,body) ((DEBUGLEVEL>=(level))?(Debug1 body):0)
#else
-EXTERN int syslog_level;
+extern int syslog_level;
-#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? \
- (syslog_level = (level), Debug1 body):0)
+#define DEBUG(level,body) ((DEBUGLEVEL>=(level))? (syslog_level = (level), Debug1 body):0)
#endif
+/* 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
int pos;
int size;
int mode;
+ int uid;
char *mmap_ptr;
int mmap_size;
write_bmpx_struct *wbmpx_ptr;
};
+/* used for network interfaces */
+struct interface
+{
+ struct interface *next;
+ struct in_addr ip;
+ struct in_addr bcast;
+ struct in_addr nmask;
+};
+
+/* share mode record in shared memory */
+typedef struct
+{
+ shm_offset_t next_offset; /* offset of next record in list in shared mem */
+ int locking_version;
+ int share_mode;
+ time_t time;
+ int pid;
+ dev_t st_dev;
+ ino_t st_ino;
+ char file_name[1]; /* dynamically allocated with correct size */
+} share_mode_record;
+
+
/* this is used for smbstatus */
struct connect_record
{
#define ERRHRD 0x03 /* Error is an hardware error. */
#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
-/* structure used to hold the incoming hosts info */
-struct from_host {
- char *name; /* host name */
- char *addr; /* host address */
- struct sockaddr_in *sin; /* their side of the link */
-};
-
#ifdef __STDC__
int Debug1(char *, ...);
#else
#define SV_TYPE_DOMAIN_ENUM 0x80000000
#define SV_TYPE_ALL 0xFFFFFFFF
+/* what server type are we currently */
/* protocol types. It assumes that higher protocols include lower protocols
/* printing types */
enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
- PRINT_QNX,PRINT_PLP};
+ PRINT_QNX,PRINT_PLP,PRINT_LPRNG};
/* case handling */