Change the multibyte character set support so that
[kai/samba.git] / source3 / include / smb.h
index afa9e3d9b903974ea6f6362996a401cffbadc8ee..f7a134d797b79cf020fbc67f350cd0cce4a71964 100644 (file)
@@ -2,10 +2,10 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    SMB parameters and setup
-   Copyright (C) Andrew Tridgell 1992-1997
-   Copyright (C) John H Terpstra 1996-1997
-   Copyright (C) Luke Kenneth Casson Leighton 1996-1997
-   Copyright (C) Paul Ashton 1997
+   Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) John H Terpstra 1996-1998
+   Copyright (C) Luke Kenneth Casson Leighton 1996-1998
+   Copyright (C) Paul Ashton 1998
    
    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
 #ifndef _SMB_H
 #define _SMB_H
 
-#ifndef MAX_CONNECTIONS
-#define MAX_CONNECTIONS 127
-#endif
-
-#ifndef MAX_OPEN_FILES
-#define MAX_OPEN_FILES 50
-#endif
-
-#ifndef GUEST_ACCOUNT
-#define GUEST_ACCOUNT "nobody"
-#endif
-
 #define BUFFER_SIZE (0xFFFF)
 #define SAFETY_MARGIN 1024
 
-/* Default size of shared memory used for share mode locking */
-#ifndef SHMEM_SIZE
-#define SHMEM_SIZE 102400
-#endif
-
 #define NMB_PORT 137
 #define DGRAM_PORT 138
 #define SMB_PORT 139
@@ -1383,7 +1366,7 @@ struct cli_state {
 
 struct current_user
 {
-  int cnum, id;
+  int cnum, vuid;
   int uid, gid;
   int ngroups;
   gid_t *groups;
@@ -1441,7 +1424,7 @@ typedef struct
   int pos;
   uint32 size;
   int mode;
-  int uid;
+  int vuid;
   char *mmap_ptr;
   uint32 mmap_size;
   write_bmpx_struct *wbmpx_ptr;
@@ -1454,6 +1437,8 @@ typedef struct
   BOOL print_file;
   BOOL modified;
   BOOL granted_oplock;
+  BOOL sent_oplock_break;
+  BOOL reserved;
   char *name;
 } files_struct;
 
@@ -1502,6 +1487,7 @@ typedef struct
   int num_files_open;
   name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */
   name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */
+  name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */
 
 } connection_struct;
 
@@ -1600,7 +1586,7 @@ struct share_ops {
        BOOL (*stop_mgmt)(void);
        BOOL (*lock_entry)(int , uint32 , uint32 , int *);
        BOOL (*unlock_entry)(int , uint32 , uint32 , int );
-       BOOL (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **);
+       int (*get_entries)(int , int , uint32 , uint32 , share_mode_entry **);
        void (*del_entry)(int , int );
        BOOL (*set_entry)(int , int , uint16 , uint16 );
        BOOL (*remove_oplock)(int , int);
@@ -1611,9 +1597,9 @@ struct share_ops {
 /* each implementation of the shared memory code needs
    to support the following operations */
 struct shmem_ops {
-       BOOL (*close)( void );
-       int (*alloc)(int );
-       BOOL (*free)(int );
+       BOOL (*shm_close)( void );
+       int (*shm_alloc)(int );
+       BOOL (*shm_free)(int );
        int (*get_userdef_off)(void);
        void *(*offset2addr)(int );
        int (*addr2offset)(void *addr);
@@ -1638,6 +1624,25 @@ struct connect_record
   time_t start;
 };
 
+/* This is used by smbclient to send it to a smbfs mount point */
+struct connection_options {
+  int protocol;
+  /* Connection-Options */
+  uint32 max_xmit;
+  uint16 server_uid;
+  uint16 tid;
+  /* The following are LANMAN 1.0 options */
+  uint16 sec_mode;
+  uint16 max_mux;
+  uint16 max_vcs;
+  uint16 rawmode;
+  uint32 sesskey;
+  /* The following are NT LM 0.12 options */
+  uint32 maxraw;
+  uint32 capabilities;
+  uint16 serverzone;
+};
+
 #ifndef LOCKING_VERSION
 #define LOCKING_VERSION 4
 #endif /* LOCKING_VERSION */
@@ -1680,6 +1685,7 @@ struct connect_record
 #define MAP_ARCHIVE(cnum)   (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum)))
 #define IS_HIDDEN_PATH(cnum,path)  (is_in_path((path),Connections[(cnum)].hide_list))
 #define IS_VETO_PATH(cnum,path)  (is_in_path((path),Connections[(cnum)].veto_list))
+#define IS_VETO_OPLOCK_PATH(cnum,path)  (is_in_path((path),Connections[(cnum)].veto_oplock_list))
 
 #define SMBENCRYPT()       (lp_encrypted_passwords())
 
@@ -2093,7 +2099,10 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 #endif 
 
 /* Defines needed for multi-codepage support. */
+#define MSDOS_LATIN_1_CODEPAGE 850
 #define KANJI_CODEPAGE 932
+#define HANGUL_CODEPAGE 949
+#define BIG5_CODEPAGE 950
 
 #ifdef KANJI
 /* 
@@ -2104,7 +2113,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
 /* 
  * Default client code page - 850 - Western European 
  */
-#define DEFAULT_CLIENT_CODE_PAGE 850
+#define DEFAULT_CLIENT_CODE_PAGE MSDOS_LATIN_1_CODEPAGE
 #endif /* KANJI */
 
 /*