diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-08-15 15:11:34 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-08-15 15:11:34 +0000 |
commit | 47673b32ed4a907b380b70d5f4f366ba8be301d2 (patch) | |
tree | 384a13167ec3b96d217acce3e6add82e391d1246 /source3/include | |
parent | 7ea7a3361320c4c25e6bb80c1ed763c229fa541a (diff) | |
download | samba-47673b32ed4a907b380b70d5f4f366ba8be301d2.tar.gz samba-47673b32ed4a907b380b70d5f4f366ba8be301d2.tar.bz2 samba-47673b32ed4a907b380b70d5f4f366ba8be301d2.zip |
- added FAST_SHARE_MODES code
- added some named pipe code from Jim
(This used to be commit c94866e9e44ea1eb72da06bc65ef1c032ae8e0c9)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/includes.h | 8 | ||||
-rw-r--r-- | source3/include/proto.h | 34 | ||||
-rw-r--r-- | source3/include/smb.h | 26 |
3 files changed, 59 insertions, 9 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index 3057531f7f..fd468abc07 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -183,7 +183,7 @@ #endif #endif -#if USE_MMAP +#if defined(USE_MMAP) || defined(FAST_SHARE_MODES) #include <sys/mman.h> #endif @@ -223,7 +223,7 @@ Here come some platform specific sections #define USE_SETSID #define HAVE_BZERO #define HAVE_MEMMOVE -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #if 0 /* SETFS disabled until we can check on some bug reports */ #if _LINUX_C_LIB_VERSION_MAJOR >= 5 @@ -259,7 +259,7 @@ typedef unsigned short mode_t; #endif #define REPLACE_GETPASS #define BSD_TERMIO -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #endif @@ -293,7 +293,7 @@ extern int innetgr (const char *, const char *, const char *, const char *); #define USE_GETCWD #define USE_SETSID #define REPLACE_GETPASS -#define USE_SIGBLOCK +#define USE_SIGPROCMASK #endif diff --git a/source3/include/proto.h b/source3/include/proto.h index dd9413605f..04f5ef158d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -259,12 +259,14 @@ void file_unlock(int fd); BOOL is_locked(int fnum,int cnum,uint32 count,uint32 offset); BOOL do_lock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); BOOL do_unlock(int fnum,int cnum,uint32 count,uint32 offset,int *eclass,uint32 *ecode); +BOOL start_share_mode_mgmt(void); +BOOL stop_share_mode_mgmt(void); int get_share_mode_by_fnum(int cnum,int fnum,int *pid); int get_share_mode_byname(int cnum,char *fname,int *pid); int get_share_mode(int cnum,struct stat *sbuf,int *pid); void del_share_mode(int fnum); BOOL set_share_mode(int fnum,int mode); -void clean_share_files(void); +void clean_share_modes(void); /*The following definitions come from mangle.c */ @@ -545,6 +547,18 @@ BOOL server_validate(char *buf); BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); void pcap_printer_fn(void (*fn)()); +/*The following definitions come from pipes.c */ + +int reply_open_pipe_and_X(char *inbuf,char *outbuf,int length,int bufsize); +BOOL api_LsarpcSNPHS(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); +BOOL api_LsarpcTNP(int cnum,int uid, char *param,char *data, + int mdrcnt,int mprcnt, + char **rdata,char **rparam, + int *rdata_len,int *rparam_len); + /*The following definitions come from predict.c */ int read_predict(int fd,int offset,char *buf,char **ptr,int num); @@ -674,6 +688,22 @@ char *smb_fn_name(int type); int chain_reply(int type,char *inbuf,char *inbuf2,char *outbuf,char *outbuf2,int size,int bufsize); int construct_reply(char *inbuf,char *outbuf,int size,int bufsize); +/*The following definitions come from shmem.c */ + +BOOL shm_open( char *file_name, int size); +BOOL shm_close( void ); +shm_offset_t shm_alloc(int size); +BOOL shm_free(shm_offset_t offset); +shm_offset_t shm_get_userdef_off(void); +BOOL shm_set_userdef_off(shm_offset_t userdef_off); +void * shm_offset2addr(shm_offset_t offset); +shm_offset_t shm_addr2offset(void *addr); +BOOL shm_lock(void); +BOOL shm_unlock(void); +BOOL shm_get_usage(int *bytes_free, + int *bytes_used, + int *bytes_overhead); + /*The following definitions come from smbencrypt.c */ void str_to_key(uchar *str,uchar *key); @@ -876,7 +906,7 @@ struct hostent *Get_Hostbyname(char *name); BOOL process_exists(int pid); char *uidtoname(int uid); char *gidtoname(int gid); -void BlockSignals(BOOL block); +void BlockSignals(BOOL block,int signum); void ajt_panic(void); char *readdirname(void *p); diff --git a/source3/include/smb.h b/source3/include/smb.h index 317f31b19e..c9180dd50c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -36,8 +36,9 @@ #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 @@ -53,6 +54,11 @@ 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. @@ -106,7 +112,7 @@ typedef unsigned int uint32; #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) #endif @@ -395,6 +401,20 @@ struct interface 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 { |