summaryrefslogtreecommitdiffstats
path: root/source/include
diff options
context:
space:
mode:
Diffstat (limited to 'source/include')
-rw-r--r--source/include/byteorder.h200
-rw-r--r--source/include/charset.h75
-rw-r--r--source/include/clitar.h17
-rw-r--r--source/include/includes.h1290
-rw-r--r--source/include/kanji.h133
-rw-r--r--source/include/local.h167
-rw-r--r--source/include/nameserv.h427
-rw-r--r--source/include/nterr.h505
-rw-r--r--source/include/proto.h1057
-rw-r--r--source/include/smb.h1694
-rw-r--r--source/include/trans2.h251
-rw-r--r--source/include/version.h1
-rw-r--r--source/include/vt_mode.h48
13 files changed, 0 insertions, 5865 deletions
diff --git a/source/include/byteorder.h b/source/include/byteorder.h
deleted file mode 100644
index 0664a338175..00000000000
--- a/source/include/byteorder.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- SMB Byte handling
- Copyright (C) Andrew Tridgell 1992-1997
-
- 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.
-*/
-
-/*
- This file implements macros for machine independent short and
- int manipulation
-
-Here is a description of this file that I emailed to the samba list once:
-
-> I am confused about the way that byteorder.h works in Samba. I have
-> looked at it, and I would have thought that you might make a distinction
-> between LE and BE machines, but you only seem to distinguish between 386
-> and all other architectures.
->
-> Can you give me a clue?
-
-sure.
-
-The distinction between 386 and other architectures is only there as
-an optimisation. You can take it out completely and it will make no
-difference. The routines (macros) in byteorder.h are totally byteorder
-independent. The 386 optimsation just takes advantage of the fact that
-the x86 processors don't care about alignment, so we don't have to
-align ints on int boundaries etc. If there are other processors out
-there that aren't alignment sensitive then you could also define
-CAREFUL_ALIGNMENT=0 on those processors as well.
-
-Ok, now to the macros themselves. I'll take a simple example, say we
-want to extract a 2 byte integer from a SMB packet and put it into a
-type called uint16 that is in the local machines byte order, and you
-want to do it with only the assumption that uint16 is _at_least_ 16
-bits long (this last condition is very important for architectures
-that don't have any int types that are 2 bytes long)
-
-You do this:
-
-#define CVAL(buf,pos) (((unsigned char *)(buf))[pos])
-#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-
-then to extract a uint16 value at offset 25 in a buffer you do this:
-
-char *buffer = foo_bar();
-uint16 xx = SVAL(buffer,25);
-
-We are using the byteoder independence of the ANSI C bitshifts to do
-the work. A good optimising compiler should turn this into efficient
-code, especially if it happens to have the right byteorder :-)
-
-I know these macros can be made a bit tidier by removing some of the
-casts, but you need to look at byteorder.h as a whole to see the
-reasoning behind them. byteorder.h defines the following macros:
-
-SVAL(buf,pos) - extract a 2 byte SMB value
-IVAL(buf,pos) - extract a 4 byte SMB value
-SVALS(buf,pos) signed version of SVAL()
-IVALS(buf,pos) signed version of IVAL()
-
-SSVAL(buf,pos,val) - put a 2 byte SMB value into a buffer
-SIVAL(buf,pos,val) - put a 4 byte SMB value into a buffer
-SSVALS(buf,pos,val) - signed version of SSVAL()
-SIVALS(buf,pos,val) - signed version of SIVAL()
-
-RSVAL(buf,pos) - like SVAL() but for NMB byte ordering
-RIVAL(buf,pos) - like IVAL() but for NMB byte ordering
-RSSVAL(buf,pos,val) - like SSVAL() but for NMB ordering
-RSIVAL(buf,pos,val) - like SIVAL() but for NMB ordering
-
-it also defines lots of intermediate macros, just ignore those :-)
-
-*/
-
-/* some switch macros that do both store and read to and from SMB buffers */
-
-#define RW_PCVAL(read,inbuf,outbuf,len) \
- if (read) { PCVAL (inbuf,0,outbuf,len) } \
- else { PSCVAL(inbuf,0,outbuf,len) }
-
-#define RW_PSVAL(read,inbuf,outbuf,len) \
- if (read) { PSVAL (inbuf,0,outbuf,len) } \
- else { PSSVAL(inbuf,0,outbuf,len) }
-
-#define RW_CVAL(read, inbuf, outbuf, offset) \
- if (read) (outbuf) = CVAL (inbuf,offset); \
- else SCVAL(inbuf,offset,outbuf);
-
-#define RW_IVAL(read, inbuf, outbuf, offset) \
- if (read) (outbuf)= IVAL (inbuf,offset); \
- else SIVAL(inbuf,offset,outbuf);
-
-#define RW_SVAL(read, inbuf, outbuf, offset) \
- if (read) (outbuf)= SVAL (inbuf,offset); \
- else SSVAL(inbuf,offset,outbuf);
-
-#undef CAREFUL_ALIGNMENT
-
-/* we know that the 386 can handle misalignment and has the "right"
- byteorder */
-#ifdef __i386__
-#define CAREFUL_ALIGNMENT 0
-#endif
-
-#ifndef CAREFUL_ALIGNMENT
-#define CAREFUL_ALIGNMENT 1
-#endif
-
-#define CVAL(buf,pos) (((unsigned char *)(buf))[pos])
-#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
-#define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val))
-
-
-#if CAREFUL_ALIGNMENT
-
-#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
-#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
-#define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)
-#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
-#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
-#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
-
-#else
-
-/* this handles things for architectures like the 386 that can handle
- alignment errors */
-/*
- WARNING: This section is dependent on the length of int16 and int32
- being correct
-*/
-
-/* get single value from an SMB buffer */
-#define SVAL(buf,pos) (*(uint16 *)((char *)(buf) + (pos)))
-#define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos)))
-#define SVALS(buf,pos) (*(int16 *)((char *)(buf) + (pos)))
-#define IVALS(buf,pos) (*(int32 *)((char *)(buf) + (pos)))
-
-/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL(buf,pos)=((uint16)(val))
-#define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val))
-#define SSVALS(buf,pos,val) SVALS(buf,pos)=((int16)(val))
-#define SIVALS(buf,pos,val) IVALS(buf,pos)=((int32)(val))
-
-#endif
-
-
-/* macros for reading / writing arrays */
-
-#define SMBMACRO(macro,buf,pos,val,len,size) \
-{ int l; for (l = 0; l < (len); l++) (val)[l] = macro((buf), (pos) + (size)*l); }
-
-#define SSMBMACRO(macro,buf,pos,val,len,size) \
-{ int l; for (l = 0; l < (len); l++) macro((buf), (pos) + (size)*l, (val)[l]); }
-
-/* reads multiple data from an SMB buffer */
-#define PCVAL(buf,pos,val,len) SMBMACRO(CVAL,buf,pos,val,len,1)
-#define PSVAL(buf,pos,val,len) SMBMACRO(SVAL,buf,pos,val,len,2)
-#define PIVAL(buf,pos,val,len) SMBMACRO(IVAL,buf,pos,val,len,4)
-#define PCVALS(buf,pos,val,len) SMBMACRO(CVALS,buf,pos,val,len,1)
-#define PSVALS(buf,pos,val,len) SMBMACRO(SVALS,buf,pos,val,len,2)
-#define PIVALS(buf,pos,val,len) SMBMACRO(IVALS,buf,pos,val,len,4)
-
-/* stores multiple data in an SMB buffer */
-#define PSCVAL(buf,pos,val,len) SSMBMACRO(SCVAL,buf,pos,val,len,1)
-#define PSSVAL(buf,pos,val,len) SSMBMACRO(SSVAL,buf,pos,val,len,2)
-#define PSIVAL(buf,pos,val,len) SSMBMACRO(SIVAL,buf,pos,val,len,4)
-#define PSCVALS(buf,pos,val,len) SSMBMACRO(SCVALS,buf,pos,val,len,1)
-#define PSSVALS(buf,pos,val,len) SSMBMACRO(SSVALS,buf,pos,val,len,2)
-#define PSIVALS(buf,pos,val,len) SSMBMACRO(SIVALS,buf,pos,val,len,4)
-
-
-/* now the reverse routines - these are used in nmb packets (mostly) */
-#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
-#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
-
-#define RSVAL(buf,pos) SREV(SVAL(buf,pos))
-#define RIVAL(buf,pos) IREV(IVAL(buf,pos))
-#define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val))
-#define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val))
-
diff --git a/source/include/charset.h b/source/include/charset.h
deleted file mode 100644
index fb184897c07..00000000000
--- a/source/include/charset.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- Character set handling
- Copyright (C) Andrew Tridgell 1992-1997
-
- 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 CHARSET_C
-
-extern char *dos_char_map;
-extern char *upper_char_map;
-extern char *lower_char_map;
-extern void add_char_string(char *s);
-extern void charset_initialise(void);
-
-#ifdef toupper
-#undef toupper
-#endif
-
-#ifdef tolower
-#undef tolower
-#endif
-
-#ifdef isupper
-#undef isupper
-#endif
-
-#ifdef islower
-#undef islower
-#endif
-
-#ifdef isdoschar
-#undef isdoschar
-#endif
-
-#ifdef isspace
-#undef isspace
-#endif
-
-#define toupper(c) (upper_char_map[(c&0xff)] & 0xff)
-#define tolower(c) (lower_char_map[(c&0xff)] & 0xff)
-#define isupper(c) ((c&0xff) != tolower(c&0xff))
-#define islower(c) ((c&0xff) != toupper(c&0xff))
-#define isdoschar(c) (dos_char_map[(c&0xff)] != 0)
-#define isspace(c) ((c)==' ' || (c) == '\t')
-
-/* this is used to determine if a character is safe to use in
- something that may be put on a command line */
-#define issafe(c) (isalnum((c&0xff)) || strchr("-._",c))
-#endif
-
-/* Dynamic codepage files defines. */
-
-/* Version id for dynamically loadable codepage files. */
-#define CODEPAGE_FILE_VERSION_ID 0x1
-/* Version 1 codepage file header size. */
-#define CODEPAGE_HEADER_SIZE 8
-/* Offsets for codepage file header entries. */
-#define CODEPAGE_VERSION_OFFSET 0
-#define CODEPAGE_CLIENT_CODEPAGE_OFFSET 2
-#define CODEPAGE_LENGTH_OFFSET 4
diff --git a/source/include/clitar.h b/source/include/clitar.h
deleted file mode 100644
index 2305fceeec7..00000000000
--- a/source/include/clitar.h
+++ /dev/null
@@ -1,17 +0,0 @@
-
-#define TBLOCK 512
-#define NAMSIZ 100
-union hblock {
- char dummy[TBLOCK];
- struct header {
- char name[NAMSIZ];
- char mode[8];
- char uid[8];
- char gid[8];
- char size[12];
- char mtime[12];
- char chksum[8];
- char linkflag;
- char linkname[NAMSIZ];
- } dbuf;
-};
diff --git a/source/include/includes.h b/source/include/includes.h
deleted file mode 100644
index a877f1ffb35..00000000000
--- a/source/include/includes.h
+++ /dev/null
@@ -1,1290 +0,0 @@
-#ifndef _INCLUDES_H
-#define _INCLUDES_H
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- Machine customisation and include handling
- Copyright (C) Andrew Tridgell 1994-1997
-
- 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.
-*/
-/*
- This file does all the #includes's. This makes it easier to
- port to a new unix. Hopefully a port will only have to edit the Makefile
- and add a section for the new unix below.
-*/
-
-
-/* the first OS dependent section is to setup what includes will be used.
- the main OS dependent section comes later on
-*/
-
-#ifdef ALTOS
-#define NO_UTIMEH
-#endif
-
-#ifdef MIPS
-#define POSIX_H
-#define NO_UTIMEH
-#endif
-
-#ifdef sun386
-#define NO_UTIMEH
-#endif
-
-#ifdef NEXT2
-#define NO_UTIMEH
-#endif
-
-#ifdef NEXT3_0
-#define NO_UTIMEH
-#define NO_UNISTDH
-#endif
-
-#ifdef APOLLO
-#define NO_UTIMEH
-#define NO_SYSMOUNTH
-#define NO_UNISTDH
-#endif
-
-#ifdef AIX
-#define NO_SYSMOUNTH
-#endif
-
-#ifdef M88K_R3
-#define SVR3H
-#define NO_RESOURCEH
-#endif
-
-#ifdef DNIX
-#define NO_SYSMOUNTH
-#define NO_NETIFH
-#define NO_RESOURCEH
-#define PRIME_NMBD 0
-#define NO_SETGROUPS
-#endif
-
-
-#ifdef ISC
-#define SYSSTREAMH
-#define NO_RESOURCEH
-#endif
-
-#ifdef QNX
-#define NO_RESOURCEH
-#define NO_SYSMOUNTH
-#define USE_MMAP 1
-#ifdef __386__
- #define __i386__
-#endif
-#endif
-
-#ifdef NEWS42
-#define NO_UTIMEH
-#define NO_STRFTIME
-#define NO_UTIMBUF
-#define REPLACE_MKTIME
-#define NO_TM_NAME
-#endif
-
-#ifdef OS2
-#define NO_SYSMOUNTH
-#define NO_NETIFH
-#endif
-
-#ifdef LYNX
-#define NO_SYSMOUNTH
-#endif
-
-
-#if (defined(SHADOW_PWD)||defined(OSF1_ENH_SEC)||defined(SecureWare)||defined(PWDAUTH))
-#define PASSWORD_LENGTH 16
-#endif
-
-/* here is the general includes section - with some ifdefs generated
- by the previous section
-*/
-#include "local.h"
-#include <stdio.h>
-#ifdef POSIX_STDLIBH
-#include <posix/stdlib.h>
-#else
-#include <stdlib.h>
-#endif
-#include <ctype.h>
-#include <time.h>
-#ifndef NO_UTIMEH
-#include <utime.h>
-#endif
-#include <sys/types.h>
-
-#ifdef SVR3H
-#include <sys/statfs.h>
-#include <sys/stream.h>
-#include <netinet/types.h>
-#include <netinet/ether.h>
-#include <netinet/ip_if.h>
-#endif
-
-#include <sys/socket.h>
-#ifdef AXPROC
-#include <termio.h>
-#endif
-#include <sys/ioctl.h>
-#include <stddef.h>
-#ifdef POSIX_H
-#include <posix/utime.h>
-#include <bsd/sys/time.h>
-#include <bsd/netinet/in.h>
-#else
-#include <sys/time.h>
-#include <netinet/in.h>
-#endif
-#include <netdb.h>
-#include <signal.h>
-#include <errno.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/param.h>
-#include <grp.h>
-#ifndef NO_RESOURCEH
-#include <sys/resource.h>
-#endif
-#ifndef NO_SYSMOUNTH
-#include <sys/mount.h>
-#endif
-#include <pwd.h>
-#ifdef __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-#ifndef NO_UNISTDH
-#include <unistd.h>
-#endif
-#include <sys/wait.h>
-#ifdef SYSSTREAMH
-#include <sys/stream.h>
-#endif
-#ifndef NO_NETIFH
-#ifdef POSIX_H
-#include <bsd/net/if.h>
-#else
-#include <net/if.h>
-#endif
-#endif
-
-#if defined(GETPWANAM)
-#include <sys/types.h>
-#include <sys/label.h>
-#include <sys/audit.h>
-#include <pwdadj.h>
-#endif
-
-#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX)
-#include <shadow.h>
-#endif
-
-#ifdef SYSLOG
-#include <syslog.h>
-#endif
-
-
-
-/***************************************************************************
-Here come some platform specific sections
-***************************************************************************/
-
-
-#ifdef LINUX
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/vfs.h>
-#include <netinet/in.h>
-#ifndef NO_ASMSIGNALH
-#include <asm/signal.h>
-#endif
-#ifdef GLIBC2
-#define _LINUX_C_LIB_VERSION_MAJOR 6
-#include <termios.h>
-#include <rpcsvc/ypclnt.h>
-#include <crypt.h>
-#include <netinet/tcp.h>
-#include <netinet/ip.h>
-#endif
-#define SIGNAL_CAST (__sighandler_t)
-#define USE_GETCWD
-#define USE_SETSID
-#define HAVE_BZERO
-#define HAVE_MEMMOVE
-#define USE_SIGPROCMASK
-#define USE_WAITPID
-#if 0
-/* SETFS disabled until we can check on some bug reports */
-#if _LINUX_C_LIB_VERSION_MAJOR >= 5
-#define USE_SETFS
-#endif
-#endif
-#ifdef SHADOW_PWD
-#if _LINUX_C_LIB_VERSION_MAJOR < 5
-#ifndef crypt
-#define crypt pw_encrypt
-#endif
-#endif
-#endif
-#endif
-
-#ifdef SUNOS4
-#define SIGNAL_CAST (void (*)(int))
-#include <netinet/tcp.h>
-#include <dirent.h>
-#include <sys/acct.h>
-#include <sys/vfs.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/wait.h>
-#include <signal.h>
-/* #include <termios.h> */
-#ifdef sun386
-#define NO_STRFTIME
-#define NO_UTIMBUF
-#define mktime timelocal
-typedef unsigned short mode_t;
-#else
-#include <utime.h>
-#define NO_STRERROR
-#endif
-#ifndef REPLACE_GETPASS
-#define REPLACE_GETPASS
-#endif
-#ifndef BSD_TERMIO
-#define BSD_TERMIO
-#endif
-#ifndef USE_SIGPROCMASK
-#define USE_SIGPROCMASK
-#endif
-#ifndef USE_WAITPID
-#define USE_WAITPID
-#endif
-/* SunOS doesn't have POSIX atexit */
-#define atexit on_exit
-#endif
-
-
-#ifdef SUNOS5
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/acct.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/filio.h>
-#include <sys/sockio.h>
-#include <netinet/in_systm.h>
-#include <netinet/tcp.h>
-#include <netinet/ip.h>
-#include <string.h>
-#include <arpa/inet.h>
-#include <rpcsvc/ypclnt.h>
-#include <termios.h>
-#include <sys/stropts.h>
-#ifndef USE_LIBDES
-#include <crypt.h>
-#endif /* USE_LIBDES */
-extern int gettimeofday (struct timeval *, void *);
-extern int gethostname (char *name, int namelen);
-extern int innetgr (const char *, const char *, const char *, const char *);
-#define USE_SETVBUF
-#define SIGNAL_CAST (void (*)(int))
-#ifndef SYSV
-#define SYSV
-#endif
-#define USE_WAITPID
-#define REPLACE_STRLEN
-#define USE_STATVFS
-#define USE_GETCWD
-#define USE_SETSID
-#ifndef REPLACE_GETPASS
-#define REPLACE_GETPASS
-#endif /* REPLACE_GETPASS */
-#define USE_SIGPROCMASK
-#endif
-
-
-#ifdef ULTRIX
-#include <strings.h>
-#include <nfs/nfs_clnt.h>
-#include <nfs/vfs.h>
-#include <netinet/tcp.h>
-#ifdef ULTRIX_AUTH
-#include <auth.h>
-#endif
-char *getwd(char *);
-#define NOSTRDUP
-#ifdef __STDC__
-#define SIGNAL_CAST (void(*)(int))
-#endif
-#define USE_DIRECT
-#define USE_WAITPID
-#endif
-
-#ifdef SGI4
-#include <netinet/tcp.h>
-#include <sys/statfs.h>
-#include <string.h>
-#include <signal.h>
-#ifndef SYSV
-#define SYSV
-#endif
-#define SIGNAL_CAST (void (*)())
-#define STATFS4
-#define USE_WAITPID
-#define USE_DIRECT
-#define USE_SETSID
-#endif
-
-#if defined(SGI5) || defined(SGI6)
-#include <arpa/inet.h>
-#include <netinet/tcp.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <sys/statvfs.h>
-#include <string.h>
-#include <signal.h>
-#include <dirent.h>
-#define USE_WAITPID
-#define NETGROUP
-#ifndef SYSV
-#define SYSV
-#endif
-#define SIGNAL_CAST (void (*)())
-#define USE_STATVFS
-#define USE_WAITPID
-#define USE_SETSID
-#endif
-
-
-#ifdef MIPS
-#include <bsd/net/soioctl.h>
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/wait.h>
-#include <sys/termio.h>
-#define SIGNAL_CAST (void (*)())
-typedef int mode_t;
-extern struct group *getgrnam();
-extern struct passwd *getpwnam();
-#define STATFS4
-#define NO_STRERROR
-#define REPLACE_STRSTR
-#endif /* MIPS */
-
-
-
-#ifdef DGUX
-#include <string.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <fcntl.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define STATFS4
-#define USE_GETCWD
-#endif
-
-
-#ifdef SVR4
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/vfs.h>
-#include <sys/filio.h>
-#include <fcntl.h>
-#include <sys/sockio.h>
-#include <netinet/tcp.h>
-#include <stropts.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_STATVFS
-#define USE_GETCWD
-#define USE_SETSID
-#endif
-
-
-#ifdef OSF1
-#include <termios.h>
-#include <strings.h>
-#include <dirent.h>
-char *getwd(char *);
-char *mktemp(char *); /* No standard include */
-#include <netinet/in.h>
-#include <arpa/inet.h> /* both for inet_ntoa */
-#define SIGNAL_CAST ( void (*) (int) )
-#define STATFS3
-#define USE_F_FSIZE
-#define USE_SETSID
-#include <netinet/tcp.h>
-#ifdef OSF1_ENH_SEC
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/security.h>
-#include <prot.h>
-#include <unistd.h>
-#define PASSWORD_LENGTH 16
-#define NEED_AUTH_PARAMETERS
-#endif /* OSF1_ENH_SEC */
-#endif
-
-
-#ifdef CLIX
-#include <dirent.h>
-#define SIGNAL_CAST (void (*)())
-#include <sys/fcntl.h>
-#include <sys/statfs.h>
-#include <string.h>
-#define NO_EID
-#define USE_WAITPID
-#define STATFS4
-#define NO_FSYNC
-#define USE_GETCWD
-#define USE_SETSID
-#ifndef REPLACE_GETPASS
-#define REPLACE_GETPASS
-#endif /* REPLACE_GETPASS */
-#define NO_GETRLIMIT
-#endif /* CLIX */
-
-
-
-#ifdef BSDI
-#include <string.h>
-#include <netinet/tcp.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_DIRECT
-#endif
-
-
-#ifdef NETBSD
-#include <strings.h>
-#include <netinet/tcp.h>
-/* you may not need this */
-#define NO_GETSPNAM
-#define SIGNAL_CAST (void (*)())
-#define USE_DIRECT
-#define REPLACE_INNETGR
-#endif
-
-
-
-#ifdef FreeBSD
-#include <arpa/inet.h>
-#include <strings.h>
-#include <netinet/tcp.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_SETVBUF
-#define USE_SETSID
-#define USE_GETCWD
-#define USE_WAITPID
-#define USE_DIRECT
-#define HAVE_MEMMOVE
-#define HAVE_BZERO
-#define HAVE_GETTIMEOFDAY
-#define HAVE_PATHCONF
-#define HAVE_GETGRNAM 1
-#endif
-
-
-
-#ifdef AIX
-#include <strings.h>
-#include <sys/dir.h>
-#include <sys/select.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/vfs.h>
-#include <sys/id.h>
-#include <sys/priv.h>
-#include <netinet/tcp.h>
-#include <locale.h>
-#define SYSV
-#define USE_WAITPID
-#define USE_SIGBLOCK
-#define SIGNAL_CAST (void (*)())
-#define DEFAULT_PRINTING PRINT_AIX
-/* we undef this because sys/param.h is broken in aix. uggh. */
-#undef MAXHOSTNAMELEN
-#endif
-
-
-#ifdef HPUX
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/vfs.h>
-#include <sys/types.h>
-#include <sys/termios.h>
-#include <netinet/tcp.h>
-#ifdef HPUX_10_TRUSTED
-#include <hpsecurity.h>
-#include <prot.h>
-#define NEED_AUTH_PARAMETERS
-#endif
-#define SIGNAL_CAST (void (*)(__harg))
-#ifndef HPUX10 /* This is only needed for HPUX 9.x */
-#define SELECT_CAST (int *)
-#endif /* HPUX10 */
-#define SYSV
-#define USE_WAITPID
-#define WAIT3_CAST2 (int *)
-#define USE_GETCWD
-#define USE_SETSID
-#define USE_SETRES
-#define DEFAULT_PRINTING PRINT_HPUX
-/* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is
- not good for HPUX */
-/* #define SIGCLD_IGNORE */
-#endif /* HPUX */
-
-
-#ifdef SEQUENT
-#include <signal.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/statfs.h>
-#include <sys/stat.h>
-#include <sys/buf.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <fcntl.h>
-#define SIGNAL_CAST (void (*)(int))
-#define USE_WAITPID
-#define USE_GETCWD
-#define NO_EID
-#define STATFS4
-#define USE_DIRECT
-#ifdef PTX4
-#undef USE_DIRECT
-#endif
-#endif
-
-
-
-#ifdef SEQUENT_PTX4
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <sys/statvfs.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
-#include <sys/sockio.h>
-#include <netinet/tcp.h>
-#include <stropts.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_STATVFS
-#define USE_GETCWD
-#ifndef seteuid
-#define seteuid(uid) setreuid(-1,uid)
-#endif
-#ifndef setegid
-#define setegid(gid) setregid(-1,gid)
-#endif
-#endif
-
-
-#ifdef NEXT2
-#include <sys/types.h>
-#include <strings.h>
-#include <dirent.h>
-#include <sys/vfs.h>
-#define bzero(b,len) memset(b,0,len)
-#define mode_t int
-#define NO_UTIMBUF
-#include <libc.h>
-#define NOSTRDUP
-#define USE_DIRECT
-#define USE_WAITPID
-#endif
-
-
-#ifdef NEXT3_0
-#include <strings.h>
-#include <sys/dir.h>
-#include <sys/vfs.h>
-#define bzero(b,len) memset(b,0,len)
-#define NO_UTIMBUF
-#include <libc.h>
-#define NOSTRDUP
-#define USE_DIRECT
-#define mode_t int
-#define GID_TYPE int
-#define gid_t int
-#define pid_t int
-#define SIGNAL_CAST (void (*)(int))
-#define WAIT3_CAST1 (union wait *)
-#define HAVE_GMTOFF
-#endif
-
-
-
-#ifdef APOLLO
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#define NO_UTIMBUF
-#define USE_DIRECT
-#define USE_GETCWD
-#define SIGNAL_CAST (void (*)())
-#define HAVE_FCNTL_LOCK 0
-#define HAVE_GETTIMEOFDAY
-#define STATFS4
-#endif
-
-
-
-#ifdef SCO
-#include <sys/netinet/tcp.h>
-#include <sys/netinet/in_systm.h>
-#include <sys/netinet/ip.h>
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/stropts.h>
-#include <limits.h>
-#include <locale.h>
-#ifdef EVEREST
-#include <unistd.h>
-#endif /* EVEREST */
-#ifdef NETGROUP
-#include <rpcsvc/ypclnt.h>
-#endif /* NETGROUP */
-#ifdef SecureWare
-#include <sys/security.h>
-#include <sys/audit.h>
-#include <prot.h>
-#define crypt bigcrypt
-#endif /* SecureWare */
-#define SIGNAL_CAST (void (*)(int))
-#define USE_WAITPID
-#define USE_GETCWD
-#define USE_SETSID
-#ifdef SCO3_2_2
-#define setuid(u) setreuid(u,-1)
-#define seteuid(u) setreuid(-1,u)
-#else /* SCO3_2_2 */
-#ifndef EVEREST
-#define ftruncate(f,l) syscall(0x0a28,f,l)
-#define USE_IFREQ
-#define NO_INITGROUPS
-#endif /* EVEREST */
-#endif /* SCO3_2_2 */
-#define STATFS4
-#define NO_FSYNC
-#define HAVE_PATHCONF
-#define NO_GETRLIMIT
-#endif /* SCO */
-
-
-
-/* Definitions for RiscIX */
-#ifdef RiscIX
-#define SIGNAL_CAST (void (*)(int))
-#include <sys/dirent.h>
-#include <sys/acct.h>
-#include <sys/vfs.h>
-#include <string.h>
-#include <utime.h>
-#include <signal.h>
-#define HAVE_GETTIMEOFDAY
-#define NOSTRCASECMP
-#define NOSTRDUP
-#endif
-
-
-
-#ifdef ISC
-#include <net/errno.h>
-#include <string.h>
-#include <sys/dir.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <fcntl.h>
-#include <sys/sioctl.h>
-#include <stropts.h>
-#include <limits.h>
-#include <netinet/tcp.h>
-#define FIONREAD FIORDCHK
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-#define USE_GETCWD
-#define USE_SETSID
-#define USE_IFREQ
-#define NO_FTRUNCATE
-#define STATFS4
-#define NO_FSYNC
-#endif
-
-
-
-#ifdef AUX
-#include <fstab.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
-#include <termios.h>
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-char *strdup (char *);
-#define USE_GETCWD
-#endif
-
-
-#ifdef M88K_R3
-#include <string.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <termios.h>
-#define STATFS4
-#define SYSV
-#define USE_WAITPID
-#define SIGNAL_CAST (void (*)(int))
-char *strdup (char *);
-#define USE_GETCWD
-#define NO_FSYNC
-#define NO_EID
-#endif
-
-
-#ifdef DNIX
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#include <sys/stropts.h>
-#define NO_GET_BROADCAST
-#define USE_WAITPID
-#define USE_GETCWD
-#define USE_SETSID
-#define STATFS4
-#define NO_EID
-#define PF_INET AF_INET
-#define NO_STRERROR
-#define ftruncate(f,l) chsize(f,l)
-#endif /* DNIX */
-
-#ifdef CONVEX
-#include <netinet/tcp.h>
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <sys/vfs.h>
-#include <fcntl.h>
-#define DONT_REINSTALL_SIG
-#define USE_SIGBLOCK
-#define USE_WAITPID
-#define SIGNAL_CAST (_SigFunc_Ptr_t)
-#define NO_GETSPNAM
-#define HAVE_MEMMOVE
-extern char *mktemp(char *);
-extern int fsync(int);
-extern int seteuid(uid_t);
-extern int setgroups(int, int *);
-extern int initgroups(char *, int);
-extern int statfs(char *, struct statfs *);
-extern int setegid(gid_t);
-extern int getopt(int, char *const *, const char *);
-extern int chroot(char *);
-extern int gettimeofday(struct timeval *, struct timezone *);
-extern int gethostname(char *, int);
-extern char *crypt(char *, char *);
-extern char *getpass(char *);
-#endif
-
-
-#ifdef CRAY
-#define MAXPATHLEN 1024
-#include <dirent.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/statfs.h>
-#define SIGNAL_CAST (void (*)(int))
-#define SIGCLD_IGNORE
-#define HAVE_FCNTL_LOCK 1
-#define USE_SETSID
-#define STATFS4
-#endif
-
-
-#ifdef ALTOS
-#include <unistd.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/fcntl.h>
-#include <sys/statfs.h>
-#define const
-#define uid_t int
-#define gid_t int
-#define mode_t int
-#define ptrdiff_t int
-#define HAVE_GETGRNAM 0
-#define NO_EID
-#define NO_FSYNC
-#define NO_FTRUNCATE
-#define NO_GETRLIMIT
-#define NO_INITGROUPS
-#define NO_SELECT
-#define NO_SETGROUPS
-#define NO_STRERROR
-#define NO_STRFTIME
-#define NO_TM_NAME
-#define NO_UTIMEH
-#define NOSTRCASECMP
-#define REPLACE_MKTIME
-#define REPLACE_RENAME
-#define REPLACE_STRSTR
-#define STATFS4
-#define USE_GETCWD
-#endif
-
-#ifdef QNX
-#define STATFS4
-#include <sys/statfs.h>
-#include <sys/select.h>
-#include <signal.h>
-#include <sys/dir.h>
-#define SIGNAL_CAST (void (*)())
-#define USE_WAITPID
-#define NO_INITGROUPS
-#define NO_SETGROUPS
-#define HAVE_TIMEZONE
-#define USE_GETCWD
-#define USE_SETSID
-#define HAVE_FCNTL_LOCK 1
-#define DEFAULT_PRINTING PRINT_QNX
-#endif
-
-
-#ifdef NEWS42
-#include <string.h>
-#include <dirent.h>
-#include <sys/vfs.h>
-#include <sys/timeb.h>
-typedef int mode_t;
-#endif
-
-#ifdef OS2
-#include <dirent.h>
-#include <sys/statfs.h>
-#include <string.h>
-#include <limits.h>
-#define SIGNAL_CAST (void (*)())
-#define HAVE_FCNTL_LOCK 0
-#define USE_WAITPID
-#define NO_GET_BROADCAST
-#define NO_EID
-#define NO_SETGROUPS
-#define NO_INITGROUPS
-#define NO_CRYPT
-#define NO_STATFS
-#define NO_CHROOT
-#define NO_CHOWN
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#endif
-
-
-#ifdef LYNX
-#define SIGNAL_CAST (void (*)())
-#define WAIT3_CAST1 (union wait *)
-#define STATFS4
-#include <fcntl.h>
-#include <resource.h>
-#include <stat.h>
-#include <string.h>
-#include <dirent.h>
-#include <sys/statfs.h>
-#define USE_GETCWD
-#define USE_GETSID
-#endif
-
-
-#ifdef BOS
-#define SIGNAL_CAST (void (*)(int))
-#include <string.h>
-#include <sys/dir.h>
-#include <sys/select.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/statfs.h>
-#include <sys/bsdioctl.h>
-#endif
-
-#ifdef AMIGA
-#include <arpa/inet.h>
-#include <dirent.h>
-#include <string.h>
-#include <netinet/tcp.h>
-#include <sys/acct.h>
-#include <sys/fcntl.h>
-#include <sys/filio.h>
-#include <sys/sockio.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <sys/termios.h>
-#include <limits.h>
-#include <sys/timeb.h>
-
-#define SIGNAL_CAST (void (*)(int))
-#define USE_GETCWD
-#define HAVE_BZERO
-#define HAVE_MEMMOVE
-#define USE_SIGPROCMASK
-#define USE_WAITPID
-#define USE_DIRECT
-#define USE_F_FSIZE
-#define HAVE_FCNTL_LOCK 0
-#define HAVE_GETTIMEOFDAY
-#define HAVE_PATHCONF
-
-#define HAVE_NO_PROC
-#define NO_FORK_DEBUG
-#define HAVE_FORK 0
-#define HAVE_VFORK 1
-#endif
-
-/* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */
-#ifdef IA_UINFO
-#include <iaf.h>
-#include <ia.h>
-#endif
-
-
-/*******************************************************************
-end of the platform specific sections
-********************************************************************/
-
-#if defined(USE_MMAP) || defined(FAST_SHARE_MODES)
-#include <sys/mman.h>
-#endif
-
-#ifdef SecureWare
-#define NEED_AUTH_PARAMETERS
-#endif
-
-#ifdef REPLACE_GETPASS
-extern char *getsmbpass(char *);
-#define getpass(s) getsmbpass(s)
-#endif
-
-#ifdef REPLACE_INNETGR
-#define innetgr(group,host,user,dom) InNetGr(group,host,user,dom)
-#endif
-
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 255
-#endif
-
-#ifndef __STDC__
-#define const
-#endif
-
-/* Now for some other grungy stuff */
-#ifdef NO_GETSPNAM
-struct spwd { /* fake shadow password structure */
- char *sp_pwdp;
-};
-#endif
-
-#ifndef HAVE_BZERO
-#ifndef bzero
-#define bzero(p,s) memset(p,0,s)
-#endif
-#endif
-
-#ifndef HAVE_MEMMOVE
-#ifndef memmove
-#define memmove(d,s,n) MemMove(d,s,n)
-#endif
-#endif
-
-#ifdef USE_DIRECT
-#include <sys/dir.h>
-#endif
-
-/* some unixes have ENOTTY instead of TIOCNOTTY */
-#ifndef TIOCNOTTY
-#ifdef ENOTTY
-#define TIOCNOTTY ENOTTY
-#endif
-#endif
-
-#ifndef SIGHUP
-#define SIGHUP 1
-#endif
-
-/* if undefined then use bsd or sysv printing */
-#ifndef DEFAULT_PRINTING
-#ifdef SYSV
-#define DEFAULT_PRINTING PRINT_SYSV
-#else
-#define DEFAULT_PRINTING PRINT_BSD
-#endif
-#endif
-
-
-#ifdef AFS_AUTH
-#include <afs/stds.h>
-#include <afs/kautils.h>
-#endif
-
-#ifdef DFS_AUTH
-#include <dce/dce_error.h>
-#include <dce/sec_login.h>
-#endif
-
-#ifdef KRB5_AUTH
-#include <krb5.h>
-#endif
-
-#ifdef NO_UTIMBUF
-struct utimbuf {
- time_t actime;
- time_t modtime;
-};
-#endif
-
-#ifdef NO_STRERROR
-#ifndef strerror
-extern char *sys_errlist[];
-#define strerror(i) sys_errlist[i]
-#endif
-#endif
-
-#ifndef perror
-#define perror(m) printf("%s: %s\n",m,strerror(errno))
-#endif
-
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 255
-#endif
-
-#include "version.h"
-#include "smb.h"
-#include "nameserv.h"
-#include "proto.h"
-#include "byteorder.h"
-
-#include "kanji.h"
-#include "charset.h"
-
-#ifndef S_IFREG
-#define S_IFREG 0100000
-#endif
-
-#ifndef S_ISREG
-#define S_ISREG(x) ((S_IFREG & (x))!=0)
-#endif
-
-#ifndef S_ISDIR
-#define S_ISDIR(x) ((S_IFDIR & (x))!=0)
-#endif
-
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(x) ((S_IFLNK & (x))!=0)
-#endif
-
-#ifdef UFC_CRYPT
-#define crypt ufc_crypt
-#endif
-
-#ifdef REPLACE_STRLEN
-#define strlen(s) Strlen(s)
-#endif
-
-#ifdef REPLACE_STRSTR
-#define strstr(s,p) Strstr(s,p)
-#endif
-
-#ifdef REPLACE_MKTIME
-#define mktime(t) Mktime(t)
-#endif
-
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 128
-#endif
-
-#ifndef EDQUOT
-#define EDQUOT ENOSPC
-#endif
-
-#ifndef HAVE_GETGRNAM
-#define HAVE_GETGRNAM 1
-#endif
-
-#ifndef SOL_TCP
-#define SOL_TCP 6
-#endif
-
-/* default to using ftruncate workaround as this is safer than assuming
-it works and getting lots of bug reports */
-#ifndef FTRUNCATE_CAN_EXTEND
-#define FTRUNCATE_CAN_EXTEND 0
-#endif
-
-/* maybe this unix doesn't separate RD and WR locks? */
-#ifndef F_RDLCK
-#define F_RDLCK F_WRLCK
-#endif
-
-#ifndef ENOTSOCK
-#define ENOTSOCK EINVAL
-#endif
-
-#ifndef SIGCLD
-#define SIGCLD SIGCHLD
-#endif
-
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
-#ifndef HAVE_FCNTL_LOCK
-#define HAVE_FCNTL_LOCK 1
-#endif
-
-#ifndef WAIT3_CAST2
-#define WAIT3_CAST2 (struct rusage *)
-#endif
-
-#ifndef WAIT3_CAST1
-#define WAIT3_CAST1 (int *)
-#endif
-
-#ifndef QSORT_CAST
-#define QSORT_CAST (int (*)())
-#endif
-
-#ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK 0x7f000001
-#endif /* INADDR_LOOPBACK */
-
-/* this is a rough check to see if this machine has a lstat() call.
- it is not guaranteed to work */
-#if !defined(S_ISLNK)
-#define lstat stat
-#endif
-
-/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
-#ifndef errno
-extern int errno;
-#endif
-
-
-#ifdef NO_EID
-#define geteuid() getuid()
-#define getegid() getgid()
-#define seteuid(x) setuid(x)
-#define setegid(x) setgid(x)
-#endif
-
-
-#if (HAVE_FCNTL_LOCK == 0)
-/* since there is no locking available, system includes */
-/* for DomainOS 10.4 do not contain any of the following */
-/* #define's. So, to satisfy the compiler, add these */
-/* #define's, although they arn't really necessary. */
-#define F_GETLK 0
-#define F_SETLK 0
-#define F_WRLCK 0
-#define F_UNLCK 0
-#endif /* HAVE_FCNTL_LOCK == 0 */
-
-#ifdef NOSTRCASECMP
-#define strcasecmp(s1,s2) StrCaseCmp(s1,s2)
-#define strncasecmp(s1,s2,n) StrnCaseCmp(s1,s2,n)
-#endif
-
-#ifndef strcpy
-#define strcpy(dest,src) StrCpy(dest,src)
-#endif
-
-
-/* possibly wrap the malloc calls */
-#if WRAP_MALLOC
-
-/* undo the old malloc def if necessary */
-#ifdef malloc
-#define xx_old_malloc malloc
-#undef malloc
-#endif
-
-#define malloc(size) malloc_wrapped(size,__FILE__,__LINE__)
-
-/* undo the old realloc def if necessary */
-#ifdef realloc
-#define xx_old_realloc realloc
-#undef realloc
-#endif
-
-#define realloc(ptr,size) realloc_wrapped(ptr,size,__FILE__,__LINE__)
-
-/* undo the old free def if necessary */
-#ifdef free
-#define xx_old_free free
-#undef free
-#endif
-
-#define free(ptr) free_wrapped(ptr,__FILE__,__LINE__)
-
-/* and the malloc prototypes */
-void *malloc_wrapped(int,char *,int);
-void *realloc_wrapped(void *,int,char *,int);
-void free_wrapped(void *,char *,int);
-
-#endif
-
-
-#if WRAP_MEMCPY
-/* undo the old memcpy def if necessary */
-#ifdef memcpy
-#define xx_old_memcpy memcpy
-#undef memcpy
-#endif
-
-#define memcpy(d,s,l) memcpy_wrapped(d,s,l,__FILE__,__LINE__)
-void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
-#endif
-
-#endif
diff --git a/source/include/kanji.h b/source/include/kanji.h
deleted file mode 100644
index cf303659208..00000000000
--- a/source/include/kanji.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- Kanji Extensions
- Copyright (C) Andrew Tridgell 1992-1997
-
- 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.
-
- Adding for Japanese language by <fujita@ainix.isac.co.jp> 1994.9.5
- and extend coding system to EUC/SJIS/JIS/HEX at 1994.10.11
- and add all jis codes sequence at 1995.8.16
- Notes: Hexadecimal code by <ohki@gssm.otuka.tsukuba.ac.jp>
- and add upper/lower case conversion 1997.8.21
-*/
-#ifndef _KANJI_H_
-#define _KANJI_H_
-
-/* FOR SHIFT JIS CODE */
-#define is_shift_jis(c) \
- ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \
- || (0xe0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xef))
-#define is_shift_jis2(c) \
- (0x40 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfc \
- && ((unsigned char) (c)) != 0x7f)
-#define is_kana(c) ((0xa0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xdf))
-
-/* case conversion */
-#define is_sj_upper2(c) \
- ((0x60 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x79))
-#define is_sj_lower2(c) \
- ((0x81 <= (unsigned char) (c)) && ((unsigned char) (c) <= 0x9A))
-#define sjis_alph 0x82
-#define is_sj_alph(c) (sjis_alph == (unsigned char) (c))
-#define is_sj_upper(c1, c2) (is_sj_alph (c1) && is_sj_upper2 (c2))
-#define is_sj_lower(c1, c2) (is_sj_alph (c1) && is_sj_lower2 (c2))
-#define sj_toupper2(c) \
- (is_sj_lower2 (c) ? ((int) ((unsigned char) (c) - 0x81 + 0x60)) : \
- ((int) (unsigned char) (c)))
-#define sj_tolower2(c) \
- (is_sj_upper2 (c) ? ((int) ((unsigned char) (c) - 0x60 + 0x81)) : \
- ((int) (unsigned char) (c)))
-
-#ifdef _KANJI_C_
-/* FOR EUC CODE */
-#define euc_kana (0x8e)
-#define is_euc_kana(c) (((unsigned char) (c)) == euc_kana)
-#define is_euc(c) (0xa0 < ((unsigned char) (c)) && ((unsigned char) (c)) < 0xff)
-
-/* FOR JIS CODE */
-/* default jis third shift code, use for output */
-#ifndef JIS_KSO
-#define JIS_KSO 'B'
-#endif
-#ifndef JIS_KSI
-#define JIS_KSI 'J'
-#endif
-/* in: \E$B or \E$@ */
-/* out: \E(J or \E(B or \E(H */
-#define jis_esc (0x1b)
-#define jis_so (0x0e)
-#define jis_so1 ('$')
-#define jis_so2 ('B')
-#define jis_si (0x0f)
-#define jis_si1 ('(')
-#define jis_si2 ('J')
-#define is_esc(c) (((unsigned char) (c)) == jis_esc)
-#define is_so1(c) (((unsigned char) (c)) == jis_so1)
-#define is_so2(c) (((unsigned char) (c)) == jis_so2 || ((unsigned char) (c)) == '@')
-#define is_si1(c) (((unsigned char) (c)) == jis_si1)
-#define is_si2(c) (((unsigned char) (c)) == jis_si2 || ((unsigned char) (c)) == 'B' \
- || ((unsigned char) (c)) == 'H')
-#define is_so(c) (((unsigned char) (c)) == jis_so)
-#define is_si(c) (((unsigned char) (c)) == jis_si)
-#define junet_kana1 ('(')
-#define junet_kana2 ('I')
-#define is_juk1(c) (((unsigned char) (c)) == junet_kana1)
-#define is_juk2(c) (((unsigned char) (c)) == junet_kana2)
-
-#define _KJ_ROMAN (0)
-#define _KJ_KANJI (1)
-#define _KJ_KANA (2)
-
-/* FOR HEX */
-#define HEXTAG ':'
-#define hex2bin(x) \
- ( ((int) '0' <= ((int) (x)) && ((int) (x)) <= (int)'9')? \
- (((int) (x))-(int)'0'): \
- ((int) 'a'<= ((int) (x)) && ((int) (x))<= (int) 'f')? \
- (((int) (x)) - (int)'a'+10): \
- (((int) (x)) - (int)'A'+10) )
-#define bin2hex(x) \
- ( (((int) (x)) >= 10)? (((int) (x))-10 + (int) 'a'): (((int) (x)) + (int) '0') )
-
-#else /* not _KANJI_C_ */
-
-extern char *(*_dos_to_unix)(char *str, BOOL overwrite);
-extern char *(*_unix_to_dos)(char *str, BOOL overwrite);
-
-#define strchr sj_strchr
-#define strrchr sj_strrchr
-#define strstr sj_strstr
-#define strtok sj_strtok
-
-#endif /* _KANJI_C_ */
-
-#define UNKNOWN_CODE (-1)
-#define SJIS_CODE (0)
-#define EUC_CODE (1)
-#define JIS7_CODE (2)
-#define JIS8_CODE (3)
-#define JUNET_CODE (4)
-#define HEX_CODE (5)
-#define CAP_CODE (6)
-#define DOSV_CODE SJIS_CODE
-
-int interpret_coding_system (char *str, int def);
-
-#define unix_to_dos(x,y) unix2dos_format(x,y)
-#define dos_to_unix(x,y) dos2unix_format(x,y)
-
-#endif /* _KANJI_H_ */
diff --git a/source/include/local.h b/source/include/local.h
deleted file mode 100644
index 97857727c74..00000000000
--- a/source/include/local.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/* local definitions for file server */
-#ifndef _LOCAL_H
-#define _LOCAL_H
-
-/* This defines the section name in the configuration file that will contain */
-/* global parameters - that is, parameters relating to the whole server, not */
-/* just services. This name is then reserved, and may not be used as a */
-/* a service name. It will default to "global" if not defined here. */
-#define GLOBAL_NAME "global"
-#define GLOBAL_NAME2 "globals"
-
-/* This defines the section name in the configuration file that will
- refer to the special "homes" service */
-#define HOMES_NAME "homes"
-
-/* This defines the section name in the configuration file that will
- refer to the special "printers" service */
-#define PRINTERS_NAME "printers"
-
-/* This defines the name of the printcap file. It is MOST UNLIKELY that
- this will change BUT! Specifying a file with the format of a printcap
- file but containing only a subset of the printers actually in your real
- printcap file is a quick-n-dirty way to allow dynamic access to a subset
- of available printers.
-*/
-#define PRINTCAP_NAME "/etc/printcap"
-
-/* set these to define the limits of the server. NOTE These are on a
- per-client basis. Thus any one machine can't connect to more than
- MAX_CONNECTIONS services, but any number of machines may connect at
- one time. */
-#define MAX_CONNECTIONS 127
-#define MAX_OPEN_FILES 100
-
-/* the max number of connections that the smbstatus program will show */
-#define MAXSTATUS 1000
-
-/* max number of directories open at once */
-/* note that with the new directory code this no longer requires a
- file handle per directory, but large numbers do use more memory */
-#define MAXDIR 64
-
-#define WORDMAX 0xFFFF
-
-/* the maximum password length before we declare a likely attack */
-#define MAX_PASS_LEN 200
-
-/* separators for lists */
-#define LIST_SEP " \t,;:\n\r"
-
-#ifndef LOCKDIR
-/* this should have been set in the Makefile */
-#define LOCKDIR "/tmp/samba"
-#endif
-
-/* this is where browse lists are kept in the lock dir */
-#define SERVER_LIST "browse.dat"
-
-/* shall guest entries in printer queues get changed to user entries,
- so they can be deleted using the windows print manager? */
-#define LPQ_GUEST_TO_USER
-
-/* shall filenames with illegal chars in them get mangled in long
- filename listings? */
-#define MANGLE_LONG_FILENAMES
-
-/* define this if you want to stop spoofing with .. and soft links
- NOTE: This also slows down the server considerably */
-#define REDUCE_PATHS
-
-/* the size of the directory cache */
-#define DIRCACHESIZE 20
-
-/* what type of filesystem do we want this to show up as in a NT file
- manager window? */
-#define FSTYPE_STRING "Samba"
-
-/* do you want smbd to send a 1 byte packet to nmbd to trigger it to start
- when smbd starts? */
-#ifndef PRIME_NMBD
-#define PRIME_NMBD 1
-#endif
-
-/* do you want session setups at user level security with a invalid
- password to be rejected or allowed in as guest? WinNT rejects them
- but it can be a pain as it means "net view" needs to use a password
-
- You have 3 choices:
-
- GUEST_SESSSETUP = 0 means session setups with an invalid password
- are rejected.
-
- GUEST_SESSSETUP = 1 means session setups with an invalid password
- are rejected, unless the username does not exist, in which case it
- is treated as a guest login
-
- GUEST_SESSSETUP = 2 means session setups with an invalid password
- are treated as a guest login
-
- Note that GUEST_SESSSETUP only has an effect in user or server
- level security.
- */
-#ifndef GUEST_SESSSETUP
-#define GUEST_SESSSETUP 0
-#endif
-
-/* the default pager to use for the client "more" command. Users can
- override this with the PAGER environment variable */
-#ifndef PAGER
-#define PAGER "more"
-#endif
-
-/* the size of the uid cache used to reduce valid user checks */
-#define UID_CACHE_SIZE 4
-
-/* the following control timings of various actions. Don't change
- them unless you know what you are doing. These are all in seconds */
-#define DEFAULT_SMBD_TIMEOUT (60*60*24*7)
-#define SMBD_RELOAD_CHECK (60)
-#define IDLE_CLOSED_TIMEOUT (60)
-#define DPTR_IDLE_TIMEOUT (120)
-#define SMBD_SELECT_LOOP (10)
-#define NMBD_SELECT_LOOP (10)
-#define BROWSE_INTERVAL (60)
-#define REGISTRATION_INTERVAL (10*60)
-#define NMBD_INETD_TIMEOUT (120)
-#define NMBD_MAX_TTL (24*60*60)
-#define LPQ_LOCK_TIMEOUT (5)
-
-/* the following are in milliseconds */
-#define LOCK_RETRY_TIMEOUT (100)
-
-/* do you want to dump core (carefully!) when an internal error is
- encountered? Samba will be careful to make the core file only
- accessible to root */
-#define DUMP_CORE 1
-
-/* what is the longest significant password available on your system?
- Knowing this speeds up password searches a lot */
-#ifndef PASSWORD_LENGTH
-#define PASSWORD_LENGTH 8
-#endif
-
-#define SMB_ALIGNMENT 1
-
-
-/* shall we support browse requests via a FIFO to nmbd? */
-#define ENABLE_FIFO 1
-
-/* keep the password server open, this uses up a aocket, but is needed
- by many apps */
-#define KEEP_PASSWORD_SERVER_OPEN 1
-
-/* how long to wait for a socket connect to happen */
-#define LONG_CONNECT_TIMEOUT 30
-#define SHORT_CONNECT_TIMEOUT 5
-
-
-/* the directory to sit in when idle */
-/* #define IDLE_DIR "/" */
-
-/* Timout (in seconds) to wait for an oplock break
- message to return. */
-
-#define OPLOCK_BREAK_TIMEOUT 30
-
-#endif
diff --git a/source/include/nameserv.h b/source/include/nameserv.h
deleted file mode 100644
index 83f3a3c5246..00000000000
--- a/source/include/nameserv.h
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- NBT netbios header - version 2
- Copyright (C) Andrew Tridgell 1994-1997
-
- 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.
-
-*/
-
-#define GET_TTL(ttl) ((ttl)?MIN(ttl,lp_max_ttl()):lp_max_ttl())
-
-/* NTAS uses 2, NT uses 1, WfWg uses 0 */
-#define MAINTAIN_LIST 2
-#define ELECTION_VERSION 1
-
-#define MAX_DGRAM_SIZE (576) /* tcp/ip datagram limit is 576 bytes */
-#define MIN_DGRAM_SIZE 12
-
-#define NMB_QUERY 0x20
-#define NMB_STATUS 0x21
-
-#define NMB_REG 0x05 /* see rfc1002.txt 4.2.2,3,5,6,7,8 */
-#define NMB_REG_REFRESH 0x09 /* see rfc1002.txt 4.2.4 */
-#define NMB_REL 0x06 /* see rfc1002.txt 4.2.9,10,11 */
-#define NMB_WAIT_ACK 0x07 /* see rfc1002.txt 4.2.16 */
-/* XXXX what about all the other types?? 0x1, 0x2, 0x3, 0x4, 0x8? */
-
-#define FIND_SELF 0x01
-#define FIND_WINS 0x02
-#define FIND_LOCAL 0x04
-
-/* NetBIOS flags */
-#define NB_GROUP 0x80
-#define NB_PERM 0x02
-#define NB_ACTIVE 0x04
-#define NB_CONFL 0x08
-#define NB_DEREG 0x10
-#define NB_BFLAG 0x00 /* broadcast node type */
-#define NB_PFLAG 0x20 /* point-to-point node type */
-#define NB_MFLAG 0x40 /* mixed bcast & p-p node type */
-#define NB_HFLAG 0x60 /* microsoft 'hybrid' node type */
-#define NB_FLGMSK 0x60
-
-#define REFRESH_TIME (15*60)
-#define NAME_POLL_REFRESH_TIME (5*60)
-#define NAME_POLL_INTERVAL 15
-
-/* NetBIOS flag identifier */
-#define NAME_PERMANENT(p) ((p) & NB_PERM)
-#define NAME_ACTIVE(p) ((p) & NB_ACTIVE)
-#define NAME_CONFLICT(p) ((p) & NB_CONFL)
-#define NAME_DEREG(p) ((p) & NB_DEREG)
-#define NAME_GROUP(p) ((p) & NB_GROUP)
-
-#define NAME_BFLAG(p) (((p) & NB_FLGMSK) == NB_BFLAG)
-#define NAME_PFLAG(p) (((p) & NB_FLGMSK) == NB_PFLAG)
-#define NAME_MFLAG(p) (((p) & NB_FLGMSK) == NB_MFLAG)
-#define NAME_HFLAG(p) (((p) & NB_FLGMSK) == NB_HFLAG)
-
-/* server type identifiers */
-#define AM_MASTER(work) (work->ServerType & SV_TYPE_MASTER_BROWSER)
-#define AM_BACKUP(work) (work->ServerType & SV_TYPE_BACKUP_BROWSER)
-#define AM_DOMMST(work) (work->ServerType & SV_TYPE_DOMAIN_MASTER)
-#define AM_DOMMEM(work) (work->ServerType & SV_TYPE_DOMAIN_MEMBER)
-
-/* microsoft browser NetBIOS name */
-#define MSBROWSE "\001\002__MSBROWSE__\002"
-
-/* mail slots */
-#define BROWSE_MAILSLOT "\\MAILSLOT\\BROWSE"
-#define NET_LOGON_MAILSLOT "\\MAILSLOT\\NET\\NETLOGON"
-
-enum name_source {STATUS_QUERY, LMHOSTS, REGISTER, SELF, DNS, DNSFAIL};
-enum node_type {B_NODE=0, P_NODE=1, M_NODE=2, NBDD_NODE=3};
-enum packet_type {NMB_PACKET, DGRAM_PACKET};
-
-enum master_state
-{
- MST_POTENTIAL,
- MST_BACK,
- MST_MSB,
- MST_BROWSER
-};
-
-enum domain_state
-{
- DOMAIN_NONE,
- DOMAIN_WAIT,
- DOMAIN_MST
-};
-
-enum logon_state
-{
- LOGON_NONE,
- LOGON_WAIT,
- LOGON_SRV
-};
-
-enum state_type
-{
- NAME_STATUS_DOM_SRV_CHK,
- NAME_STATUS_SRV_CHK,
- NAME_REGISTER_CHALLENGE,
- NAME_REGISTER,
- NAME_RELEASE,
- NAME_QUERY_CONFIRM,
- NAME_QUERY_SYNC_LOCAL,
- NAME_QUERY_SYNC_REMOTE,
- NAME_QUERY_DOM_SRV_CHK,
- NAME_QUERY_SRV_CHK,
- NAME_QUERY_FIND_MST,
- NAME_QUERY_MST_CHK,
- NAME_QUERY_DOMAIN
-};
-
-/* a netbios name structure */
-struct nmb_name {
- char name[17];
- char scope[64];
- int name_type;
-};
-
-/* a netbios flags + ip address structure */
-/* this is used for multi-homed systems and for internet group names */
-struct nmb_ip
-{
- struct in_addr ip; /* ip address of host that owns this name */
- uint16 nb_flags; /* netbios flags */
-};
-
-/* this is the structure used for the local netbios name list */
-struct name_record
-{
- struct name_record *next;
- struct name_record *prev;
-
- struct nmb_name name; /* the netbios name */
- struct nmb_ip *ip_flgs; /* the ip + flags */
- int num_ips; /* number of ip+flags entries */
-
- enum name_source source; /* where the name came from */
-
- time_t death_time; /* time record must be removed (do not remove if 0) */
- time_t refresh_time; /* time record should be refreshed */
-};
-
-struct subnet_record;
-
-/* browse and backup server cache for synchronising browse list */
-struct browse_cache_record
-{
- struct browse_cache_record *next;
- struct browse_cache_record *prev;
-
- pstring name;
- int type;
- pstring group;
- struct in_addr ip;
- time_t sync_time;
- BOOL synced;
- BOOL local;
- struct subnet_record *subnet;
-};
-
-/* this is used to hold the list of servers in my domain, and is */
-/* contained within lists of domains */
-struct server_record
-{
- struct server_record *next;
- struct server_record *prev;
-
- struct server_info_struct serv;
- time_t death_time;
-};
-
-/* a workgroup structure. it contains a list of servers */
-struct work_record
-{
- struct work_record *next;
- struct work_record *prev;
-
- struct server_record *serverlist;
-
- /* stage of development from non-local-master up to local-master browser */
- enum master_state mst_state;
-
- /* stage of development from non-domain-master to domain master browser */
- enum domain_state dom_state;
-
- /* stage of development from non-logon-server to logon server */
- enum logon_state log_state;
-
- /* work group info */
- fstring work_group;
- int token; /* used when communicating with backup browsers */
- int ServerType;
-
- /* announce info */
- time_t lastannounce_time;
- int announce_interval;
- BOOL needannounce;
-
-
- /* election info */
- BOOL RunningElection;
- BOOL needelection;
- int ElectionCount;
- uint32 ElectionCriterion;
-};
-
-/* initiated name queries recorded in this list to track any responses... */
-/* sadly, we need to group everything together. i suppose that if this
- gets unwieldy, then a union ought to be considered. oh for c++... */
-struct response_record
-{
- struct response_record *next;
- struct response_record *prev;
-
- uint16 response_id;
- enum state_type state;
-
- int fd;
- int quest_type;
- struct nmb_name name;
- int nb_flags;
- time_t ttl;
-
- int server_type;
- fstring my_name;
- fstring my_comment;
-
- BOOL bcast;
- BOOL recurse;
- struct in_addr send_ip;
- struct in_addr reply_to_ip;
-
- int num_msgs;
-
- time_t repeat_time;
- time_t repeat_interval;
- int repeat_count;
-};
-
-/* a subnet structure. it contains a list of workgroups and netbios names*/
-
-/* note that a subnet of 255.255.255.255 contains all the WINS netbios names.
- all communication from such nodes are on a non-broadcast basis: they
- are point-to-point (P nodes) or mixed point-to-point and broadcast
- (M nodes). M nodes use point-to-point as a preference, and will use
- broadcasting for certain activities, or will resort to broadcasting as a
- last resort, if the WINS server fails (users of wfwg will notice that their
- machine often freezes for 30 seconds at a time intermittently, if the WINS
- server is down).
-
- B nodes will have their own, totally separate subnet record, with their
- own netbios name set. these do NOT interact with other subnet records'
- netbios names, INCLUDING the WINS one (with an ip "address", so called,
- of 255.255.255.255)
-
- there is a separate response list for each subnet record. in the case of
- the 255.255.255.255 subnet record (WINS), the WINS server will be able to
- use this to poll (infrequently!) each of its entries, to ensure that the
- names are still in use.
- XXXX this polling is a planned feature for a really over-cautious WINS server
-*/
-
-struct subnet_record
-{
- struct subnet_record *next;
- struct subnet_record *prev;
-
- struct work_record *workgrouplist; /* list of workgroups */
- struct name_record *namelist; /* list of netbios names */
- struct response_record *responselist; /* list of responses expected */
-
- struct in_addr bcast_ip;
- struct in_addr mask_ip;
- struct in_addr myip;
-};
-
-/* a resource record */
-struct res_rec {
- struct nmb_name rr_name;
- int rr_type;
- int rr_class;
- int ttl;
- int rdlength;
- char rdata[MAX_DGRAM_SIZE];
-};
-
-/* define a nmb packet. */
-struct nmb_packet
-{
- struct {
- int name_trn_id;
- int opcode;
- BOOL response;
- struct {
- BOOL bcast;
- BOOL recursion_available;
- BOOL recursion_desired;
- BOOL trunc;
- BOOL authoritative;
- } nm_flags;
- int rcode;
- int qdcount;
- int ancount;
- int nscount;
- int arcount;
- } header;
-
- struct {
- struct nmb_name question_name;
- int question_type;
- int question_class;
- } question;
-
- struct res_rec *answers;
- struct res_rec *nsrecs;
- struct res_rec *additional;
-};
-
-
-/* a datagram - this normally contains SMB data in the data[] array */
-struct dgram_packet {
- struct {
- int msg_type;
- struct {
- enum node_type node_type;
- BOOL first;
- BOOL more;
- } flags;
- int dgm_id;
- struct in_addr source_ip;
- int source_port;
- int dgm_length;
- int packet_offset;
- } header;
- struct nmb_name source_name;
- struct nmb_name dest_name;
- int datasize;
- char data[MAX_DGRAM_SIZE];
-};
-
-/* define a structure used to queue packets. this will be a linked
- list of nmb packets */
-struct packet_struct
-{
- struct packet_struct *next;
- struct packet_struct *prev;
- struct in_addr ip;
- int port;
- int fd;
- time_t timestamp;
- enum packet_type packet_type;
- union {
- struct nmb_packet nmb;
- struct dgram_packet dgram;
- } packet;
-};
-
-
-/* ids for netbios packet types */
-#define ANN_HostAnnouncement 1
-#define ANN_AnnouncementRequest 2
-#define ANN_Election 8
-#define ANN_GetBackupListReq 9
-#define ANN_GetBackupListResp 10
-#define ANN_BecomeBackup 11
-#define ANN_DomainAnnouncement 12
-#define ANN_MasterAnnouncement 13
-#define ANN_ResetBrowserState 14
-#define ANN_LocalMasterAnnouncement 15
-
-
-/* broadcast packet announcement intervals, in minutes */
-
-/* attempt to add domain logon and domain master names */
-#define CHECK_TIME_ADD_DOM_NAMES 5
-
-/* search for master browsers of workgroups samba knows about,
- except default */
-#define CHECK_TIME_MST_BROWSE 5
-
-/* request backup browser announcements from other servers */
-#define CHECK_TIME_ANNOUNCE_BACKUP 15
-
-/* request host announcements from other servers: min and max of interval */
-#define CHECK_TIME_MIN_HOST_ANNCE 3
-#define CHECK_TIME_MAX_HOST_ANNCE 12
-
-/* announce as master to WINS server and any Primary Domain Controllers */
-#define CHECK_TIME_MST_ANNOUNCE 15
-
-/* do all remote announcements this often */
-#define REMOTE_ANNOUNCE_INTERVAL 180
-
-/* Types of machine we can announce as */
-#define ANNOUNCE_AS_NT 1
-#define ANNOUNCE_AS_WIN95 2
-#define ANNOUNCE_AS_WFW 3
-
-/* Macro's to enumerate subnets either with or without
- the WINS subnet. */
-
-extern struct subnet_record *subnetlist;
-extern struct subnet_record *wins_subnet;
-
-#define FIRST_SUBNET subnetlist
-#define NEXT_SUBNET_EXCLUDING_WINS(x) ((x)->next)
-#define NEXT_SUBNET_INCLUDING_WINS(x) ( ((x) == wins_subnet) ? NULL : \
- (((x)->next == NULL) ? wins_subnet : \
- (x)->next))
-
diff --git a/source/include/nterr.h b/source/include/nterr.h
deleted file mode 100644
index 92f02612dbc..00000000000
--- a/source/include/nterr.h
+++ /dev/null
@@ -1,505 +0,0 @@
-/* these are the NT error codes less than 1000. They are here for when
- we start supporting NT error codes in Samba. They were extracted
- using a loop in smbclient then printing a netmon sniff to a file */
-
-#define NT_STATUS_UNSUCCESSFUL (1)
-#define NT_STATUS_NOT_IMPLEMENTED (2)
-#define NT_STATUS_INVALID_INFO_CLASS (3)
-#define NT_STATUS_INFO_LENGTH_MISMATCH (4)
-#define NT_STATUS_ACCESS_VIOLATION (5)
-#define NT_STATUS_IN_PAGE_ERROR (6)
-#define NT_STATUS_PAGEFILE_QUOTA (7)
-#define NT_STATUS_INVALID_HANDLE (8)
-#define NT_STATUS_BAD_INITIAL_STACK (9)
-#define NT_STATUS_BAD_INITIAL_PC (10)
-#define NT_STATUS_INVALID_CID (11)
-#define NT_STATUS_TIMER_NOT_CANCELED (12)
-#define NT_STATUS_INVALID_PARAMETER (13)
-#define NT_STATUS_NO_SUCH_DEVICE (14)
-#define NT_STATUS_NO_SUCH_FILE (15)
-#define NT_STATUS_INVALID_DEVICE_REQUEST (16)
-#define NT_STATUS_END_OF_FILE (17)
-#define NT_STATUS_WRONG_VOLUME (18)
-#define NT_STATUS_NO_MEDIA_IN_DEVICE (19)
-#define NT_STATUS_UNRECOGNIZED_MEDIA (20)
-#define NT_STATUS_NONEXISTENT_SECTOR (21)
-#define NT_STATUS_MORE_PROCESSING_REQUIRED (22)
-#define NT_STATUS_NO_MEMORY (23)
-#define NT_STATUS_CONFLICTING_ADDRESSES (24)
-#define NT_STATUS_NOT_MAPPED_VIEW (25)
-#define NT_STATUS_UNABLE_TO_FREE_VM (26)
-#define NT_STATUS_UNABLE_TO_DELETE_SECTION (27)
-#define NT_STATUS_INVALID_SYSTEM_SERVICE (28)
-#define NT_STATUS_ILLEGAL_INSTRUCTION (29)
-#define NT_STATUS_INVALID_LOCK_SEQUENCE (30)
-#define NT_STATUS_INVALID_VIEW_SIZE (31)
-#define NT_STATUS_INVALID_FILE_FOR_SECTION (32)
-#define NT_STATUS_ALREADY_COMMITTED (33)
-#define NT_STATUS_ACCESS_DENIED (34)
-#define NT_STATUS_BUFFER_TOO_SMALL (35)
-#define NT_STATUS_OBJECT_TYPE_MISMATCH (36)
-#define NT_STATUS_NONCONTINUABLE_EXCEPTION (37)
-#define NT_STATUS_INVALID_DISPOSITION (38)
-#define NT_STATUS_UNWIND (39)
-#define NT_STATUS_BAD_STACK (40)
-#define NT_STATUS_INVALID_UNWIND_TARGET (41)
-#define NT_STATUS_NOT_LOCKED (42)
-#define NT_STATUS_PARITY_ERROR (43)
-#define NT_STATUS_UNABLE_TO_DECOMMIT_VM (44)
-#define NT_STATUS_NOT_COMMITTED (45)
-#define NT_STATUS_INVALID_PORT_ATTRIBUTES (46)
-#define NT_STATUS_PORT_MESSAGE_TOO_LONG (47)
-#define NT_STATUS_INVALID_PARAMETER_MIX (48)
-#define NT_STATUS_INVALID_QUOTA_LOWER (49)
-#define NT_STATUS_DISK_CORRUPT_ERROR (50)
-#define NT_STATUS_OBJECT_NAME_INVALID (51)
-#define NT_STATUS_OBJECT_NAME_NOT_FOUND (52)
-#define NT_STATUS_OBJECT_NAME_COLLISION (53)
-#define NT_STATUS_HANDLE_NOT_WAITABLE (54)
-#define NT_STATUS_PORT_DISCONNECTED (55)
-#define NT_STATUS_DEVICE_ALREADY_ATTACHED (56)
-#define NT_STATUS_OBJECT_PATH_INVALID (57)
-#define NT_STATUS_OBJECT_PATH_NOT_FOUND (58)
-#define NT_STATUS_OBJECT_PATH_SYNTAX_BAD (59)
-#define NT_STATUS_DATA_OVERRUN (60)
-#define NT_STATUS_DATA_LATE_ERROR (61)
-#define NT_STATUS_DATA_ERROR (62)
-#define NT_STATUS_CRC_ERROR (63)
-#define NT_STATUS_SECTION_TOO_BIG (64)
-#define NT_STATUS_PORT_CONNECTION_REFUSED (65)
-#define NT_STATUS_INVALID_PORT_HANDLE (66)
-#define NT_STATUS_SHARING_VIOLATION (67)
-#define NT_STATUS_QUOTA_EXCEEDED (68)
-#define NT_STATUS_INVALID_PAGE_PROTECTION (69)
-#define NT_STATUS_MUTANT_NOT_OWNED (70)
-#define NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED (71)
-#define NT_STATUS_PORT_ALREADY_SET (72)
-#define NT_STATUS_SECTION_NOT_IMAGE (73)
-#define NT_STATUS_SUSPEND_COUNT_EXCEEDED (74)
-#define NT_STATUS_THREAD_IS_TERMINATING (75)
-#define NT_STATUS_BAD_WORKING_SET_LIMIT (76)
-#define NT_STATUS_INCOMPATIBLE_FILE_MAP (77)
-#define NT_STATUS_SECTION_PROTECTION (78)
-#define NT_STATUS_EAS_NOT_SUPPORTED (79)
-#define NT_STATUS_EA_TOO_LARGE (80)
-#define NT_STATUS_NONEXISTENT_EA_ENTRY (81)
-#define NT_STATUS_NO_EAS_ON_FILE (82)
-#define NT_STATUS_EA_CORRUPT_ERROR (83)
-#define NT_STATUS_FILE_LOCK_CONFLICT (84)
-#define NT_STATUS_LOCK_NOT_GRANTED (85)
-#define NT_STATUS_DELETE_PENDING (86)
-#define NT_STATUS_CTL_FILE_NOT_SUPPORTED (87)
-#define NT_STATUS_UNKNOWN_REVISION (88)
-#define NT_STATUS_REVISION_MISMATCH (89)
-#define NT_STATUS_INVALID_OWNER (90)
-#define NT_STATUS_INVALID_PRIMARY_GROUP (91)
-#define NT_STATUS_NO_IMPERSONATION_TOKEN (92)
-#define NT_STATUS_CANT_DISABLE_MANDATORY (93)
-#define NT_STATUS_NO_LOGON_SERVERS (94)
-#define NT_STATUS_NO_SUCH_LOGON_SESSION (95)
-#define NT_STATUS_NO_SUCH_PRIVILEGE (96)
-#define NT_STATUS_PRIVILEGE_NOT_HELD (97)
-#define NT_STATUS_INVALID_ACCOUNT_NAME (98)
-#define NT_STATUS_USER_EXISTS (99)
-#define NT_STATUS_NO_SUCH_USER (100)
-#define NT_STATUS_GROUP_EXISTS (101)
-#define NT_STATUS_NO_SUCH_GROUP (102)
-#define NT_STATUS_MEMBER_IN_GROUP (103)
-#define NT_STATUS_MEMBER_NOT_IN_GROUP (104)
-#define NT_STATUS_LAST_ADMIN (105)
-#define NT_STATUS_WRONG_PASSWORD (106)
-#define NT_STATUS_ILL_FORMED_PASSWORD (107)
-#define NT_STATUS_PASSWORD_RESTRICTION (108)
-#define NT_STATUS_LOGON_FAILURE (109)
-#define NT_STATUS_ACCOUNT_RESTRICTION (110)
-#define NT_STATUS_INVALID_LOGON_HOURS (111)
-#define NT_STATUS_INVALID_WORKSTATION (112)
-#define NT_STATUS_PASSWORD_EXPIRED (113)
-#define NT_STATUS_ACCOUNT_DISABLED (114)
-#define NT_STATUS_NONE_MAPPED (115)
-#define NT_STATUS_TOO_MANY_LUIDS_REQUESTED (116)
-#define NT_STATUS_LUIDS_EXHAUSTED (117)
-#define NT_STATUS_INVALID_SUB_AUTHORITY (118)
-#define NT_STATUS_INVALID_ACL (119)
-#define NT_STATUS_INVALID_SID (120)
-#define NT_STATUS_INVALID_SECURITY_DESCR (121)
-#define NT_STATUS_PROCEDURE_NOT_FOUND (122)
-#define NT_STATUS_INVALID_IMAGE_FORMAT (123)
-#define NT_STATUS_NO_TOKEN (124)
-#define NT_STATUS_BAD_INHERITANCE_ACL (125)
-#define NT_STATUS_RANGE_NOT_LOCKED (126)
-#define NT_STATUS_DISK_FULL (127)
-#define NT_STATUS_SERVER_DISABLED (128)
-#define NT_STATUS_SERVER_NOT_DISABLED (129)
-#define NT_STATUS_TOO_MANY_GUIDS_REQUESTED (130)
-#define NT_STATUS_GUIDS_EXHAUSTED (131)
-#define NT_STATUS_INVALID_ID_AUTHORITY (132)
-#define NT_STATUS_AGENTS_EXHAUSTED (133)
-#define NT_STATUS_INVALID_VOLUME_LABEL (134)
-#define NT_STATUS_SECTION_NOT_EXTENDED (135)
-#define NT_STATUS_NOT_MAPPED_DATA (136)
-#define NT_STATUS_RESOURCE_DATA_NOT_FOUND (137)
-#define NT_STATUS_RESOURCE_TYPE_NOT_FOUND (138)
-#define NT_STATUS_RESOURCE_NAME_NOT_FOUND (139)
-#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED (140)
-#define NT_STATUS_FLOAT_DENORMAL_OPERAND (141)
-#define NT_STATUS_FLOAT_DIVIDE_BY_ZERO (142)
-#define NT_STATUS_FLOAT_INEXACT_RESULT (143)
-#define NT_STATUS_FLOAT_INVALID_OPERATION (144)
-#define NT_STATUS_FLOAT_OVERFLOW (145)
-#define NT_STATUS_FLOAT_STACK_CHECK (146)
-#define NT_STATUS_FLOAT_UNDERFLOW (147)
-#define NT_STATUS_INTEGER_DIVIDE_BY_ZERO (148)
-#define NT_STATUS_INTEGER_OVERFLOW (149)
-#define NT_STATUS_PRIVILEGED_INSTRUCTION (150)
-#define NT_STATUS_TOO_MANY_PAGING_FILES (151)
-#define NT_STATUS_FILE_INVALID (152)
-#define NT_STATUS_ALLOTTED_SPACE_EXCEEDED (153)
-#define NT_STATUS_INSUFFICIENT_RESOURCES (154)
-#define NT_STATUS_DFS_EXIT_PATH_FOUND (155)
-#define NT_STATUS_DEVICE_DATA_ERROR (156)
-#define NT_STATUS_DEVICE_NOT_CONNECTED (157)
-#define NT_STATUS_DEVICE_POWER_FAILURE (158)
-#define NT_STATUS_FREE_VM_NOT_AT_BASE (159)
-#define NT_STATUS_MEMORY_NOT_ALLOCATED (160)
-#define NT_STATUS_WORKING_SET_QUOTA (161)
-#define NT_STATUS_MEDIA_WRITE_PROTECTED (162)
-#define NT_STATUS_DEVICE_NOT_READY (163)
-#define NT_STATUS_INVALID_GROUP_ATTRIBUTES (164)
-#define NT_STATUS_BAD_IMPERSONATION_LEVEL (165)
-#define NT_STATUS_CANT_OPEN_ANONYMOUS (166)
-#define NT_STATUS_BAD_VALIDATION_CLASS (167)
-#define NT_STATUS_BAD_TOKEN_TYPE (168)
-#define NT_STATUS_BAD_MASTER_BOOT_RECORD (169)
-#define NT_STATUS_INSTRUCTION_MISALIGNMENT (170)
-#define NT_STATUS_INSTANCE_NOT_AVAILABLE (171)
-#define NT_STATUS_PIPE_NOT_AVAILABLE (172)
-#define NT_STATUS_INVALID_PIPE_STATE (173)
-#define NT_STATUS_PIPE_BUSY (174)
-#define NT_STATUS_ILLEGAL_FUNCTION (175)
-#define NT_STATUS_PIPE_DISCONNECTED (176)
-#define NT_STATUS_PIPE_CLOSING (177)
-#define NT_STATUS_PIPE_CONNECTED (178)
-#define NT_STATUS_PIPE_LISTENING (179)
-#define NT_STATUS_INVALID_READ_MODE (180)
-#define NT_STATUS_IO_TIMEOUT (181)
-#define NT_STATUS_FILE_FORCED_CLOSED (182)
-#define NT_STATUS_PROFILING_NOT_STARTED (183)
-#define NT_STATUS_PROFILING_NOT_STOPPED (184)
-#define NT_STATUS_COULD_NOT_INTERPRET (185)
-#define NT_STATUS_FILE_IS_A_DIRECTORY (186)
-#define NT_STATUS_NOT_SUPPORTED (187)
-#define NT_STATUS_REMOTE_NOT_LISTENING (188)
-#define NT_STATUS_DUPLICATE_NAME (189)
-#define NT_STATUS_BAD_NETWORK_PATH (190)
-#define NT_STATUS_NETWORK_BUSY (191)
-#define NT_STATUS_DEVICE_DOES_NOT_EXIST (192)
-#define NT_STATUS_TOO_MANY_COMMANDS (193)
-#define NT_STATUS_ADAPTER_HARDWARE_ERROR (194)
-#define NT_STATUS_INVALID_NETWORK_RESPONSE (195)
-#define NT_STATUS_UNEXPECTED_NETWORK_ERROR (196)
-#define NT_STATUS_BAD_REMOTE_ADAPTER (197)
-#define NT_STATUS_PRINT_QUEUE_FULL (198)
-#define NT_STATUS_NO_SPOOL_SPACE (199)
-#define NT_STATUS_PRINT_CANCELLED (200)
-#define NT_STATUS_NETWORK_NAME_DELETED (201)
-#define NT_STATUS_NETWORK_ACCESS_DENIED (202)
-#define NT_STATUS_BAD_DEVICE_TYPE (203)
-#define NT_STATUS_BAD_NETWORK_NAME (204)
-#define NT_STATUS_TOO_MANY_NAMES (205)
-#define NT_STATUS_TOO_MANY_SESSIONS (206)
-#define NT_STATUS_SHARING_PAUSED (207)
-#define NT_STATUS_REQUEST_NOT_ACCEPTED (208)
-#define NT_STATUS_REDIRECTOR_PAUSED (209)
-#define NT_STATUS_NET_WRITE_FAULT (210)
-#define NT_STATUS_PROFILING_AT_LIMIT (211)
-#define NT_STATUS_NOT_SAME_DEVICE (212)
-#define NT_STATUS_FILE_RENAMED (213)
-#define NT_STATUS_VIRTUAL_CIRCUIT_CLOSED (214)
-#define NT_STATUS_NO_SECURITY_ON_OBJECT (215)
-#define NT_STATUS_CANT_WAIT (216)
-#define NT_STATUS_PIPE_EMPTY (217)
-#define NT_STATUS_CANT_ACCESS_DOMAIN_INFO (218)
-#define NT_STATUS_CANT_TERMINATE_SELF (219)
-#define NT_STATUS_INVALID_SERVER_STATE (220)
-#define NT_STATUS_INVALID_DOMAIN_STATE (221)
-#define NT_STATUS_INVALID_DOMAIN_ROLE (222)
-#define NT_STATUS_NO_SUCH_DOMAIN (223)
-#define NT_STATUS_DOMAIN_EXISTS (224)
-#define NT_STATUS_DOMAIN_LIMIT_EXCEEDED (225)
-#define NT_STATUS_OPLOCK_NOT_GRANTED (226)
-#define NT_STATUS_INVALID_OPLOCK_PROTOCOL (227)
-#define NT_STATUS_INTERNAL_DB_CORRUPTION (228)
-#define NT_STATUS_INTERNAL_ERROR (229)
-#define NT_STATUS_GENERIC_NOT_MAPPED (230)
-#define NT_STATUS_BAD_DESCRIPTOR_FORMAT (231)
-#define NT_STATUS_INVALID_USER_BUFFER (232)
-#define NT_STATUS_UNEXPECTED_IO_ERROR (233)
-#define NT_STATUS_UNEXPECTED_MM_CREATE_ERR (234)
-#define NT_STATUS_UNEXPECTED_MM_MAP_ERROR (235)
-#define NT_STATUS_UNEXPECTED_MM_EXTEND_ERR (236)
-#define NT_STATUS_NOT_LOGON_PROCESS (237)
-#define NT_STATUS_LOGON_SESSION_EXISTS (238)
-#define NT_STATUS_INVALID_PARAMETER_1 (239)
-#define NT_STATUS_INVALID_PARAMETER_2 (240)
-#define NT_STATUS_INVALID_PARAMETER_3 (241)
-#define NT_STATUS_INVALID_PARAMETER_4 (242)
-#define NT_STATUS_INVALID_PARAMETER_5 (243)
-#define NT_STATUS_INVALID_PARAMETER_6 (244)
-#define NT_STATUS_INVALID_PARAMETER_7 (245)
-#define NT_STATUS_INVALID_PARAMETER_8 (246)
-#define NT_STATUS_INVALID_PARAMETER_9 (247)
-#define NT_STATUS_INVALID_PARAMETER_10 (248)
-#define NT_STATUS_INVALID_PARAMETER_11 (249)
-#define NT_STATUS_INVALID_PARAMETER_12 (250)
-#define NT_STATUS_REDIRECTOR_NOT_STARTED (251)
-#define NT_STATUS_REDIRECTOR_STARTED (252)
-#define NT_STATUS_STACK_OVERFLOW (253)
-#define NT_STATUS_NO_SUCH_PACKAGE (254)
-#define NT_STATUS_BAD_FUNCTION_TABLE (255)
-#define NT_STATUS_DIRECTORY_NOT_EMPTY (257)
-#define NT_STATUS_FILE_CORRUPT_ERROR (258)
-#define NT_STATUS_NOT_A_DIRECTORY (259)
-#define NT_STATUS_BAD_LOGON_SESSION_STATE (260)
-#define NT_STATUS_LOGON_SESSION_COLLISION (261)
-#define NT_STATUS_NAME_TOO_LONG (262)
-#define NT_STATUS_FILES_OPEN (263)
-#define NT_STATUS_CONNECTION_IN_USE (264)
-#define NT_STATUS_MESSAGE_NOT_FOUND (265)
-#define NT_STATUS_PROCESS_IS_TERMINATING (266)
-#define NT_STATUS_INVALID_LOGON_TYPE (267)
-#define NT_STATUS_NO_GUID_TRANSLATION (268)
-#define NT_STATUS_CANNOT_IMPERSONATE (269)
-#define NT_STATUS_IMAGE_ALREADY_LOADED (270)
-#define NT_STATUS_ABIOS_NOT_PRESENT (271)
-#define NT_STATUS_ABIOS_LID_NOT_EXIST (272)
-#define NT_STATUS_ABIOS_LID_ALREADY_OWNED (273)
-#define NT_STATUS_ABIOS_NOT_LID_OWNER (274)
-#define NT_STATUS_ABIOS_INVALID_COMMAND (275)
-#define NT_STATUS_ABIOS_INVALID_LID (276)
-#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE (277)
-#define NT_STATUS_ABIOS_INVALID_SELECTOR (278)
-#define NT_STATUS_NO_LDT (279)
-#define NT_STATUS_INVALID_LDT_SIZE (280)
-#define NT_STATUS_INVALID_LDT_OFFSET (281)
-#define NT_STATUS_INVALID_LDT_DESCRIPTOR (282)
-#define NT_STATUS_INVALID_IMAGE_NE_FORMAT (283)
-#define NT_STATUS_RXACT_INVALID_STATE (284)
-#define NT_STATUS_RXACT_COMMIT_FAILURE (285)
-#define NT_STATUS_MAPPED_FILE_SIZE_ZERO (286)
-#define NT_STATUS_TOO_MANY_OPENED_FILES (287)
-#define NT_STATUS_CANCELLED (288)
-#define NT_STATUS_CANNOT_DELETE (289)
-#define NT_STATUS_INVALID_COMPUTER_NAME (290)
-#define NT_STATUS_FILE_DELETED (291)
-#define NT_STATUS_SPECIAL_ACCOUNT (292)
-#define NT_STATUS_SPECIAL_GROUP (293)
-#define NT_STATUS_SPECIAL_USER (294)
-#define NT_STATUS_MEMBERS_PRIMARY_GROUP (295)
-#define NT_STATUS_FILE_CLOSED (296)
-#define NT_STATUS_TOO_MANY_THREADS (297)
-#define NT_STATUS_THREAD_NOT_IN_PROCESS (298)
-#define NT_STATUS_TOKEN_ALREADY_IN_USE (299)
-#define NT_STATUS_PAGEFILE_QUOTA_EXCEEDED (300)
-#define NT_STATUS_COMMITMENT_LIMIT (301)
-#define NT_STATUS_INVALID_IMAGE_LE_FORMAT (302)
-#define NT_STATUS_INVALID_IMAGE_NOT_MZ (303)
-#define NT_STATUS_INVALID_IMAGE_PROTECT (304)
-#define NT_STATUS_INVALID_IMAGE_WIN_16 (305)
-#define NT_STATUS_LOGON_SERVER_CONFLICT (306)
-#define NT_STATUS_TIME_DIFFERENCE_AT_DC (307)
-#define NT_STATUS_SYNCHRONIZATION_REQUIRED (308)
-#define NT_STATUS_DLL_NOT_FOUND (309)
-#define NT_STATUS_OPEN_FAILED (310)
-#define NT_STATUS_IO_PRIVILEGE_FAILED (311)
-#define NT_STATUS_ORDINAL_NOT_FOUND (312)
-#define NT_STATUS_ENTRYPOINT_NOT_FOUND (313)
-#define NT_STATUS_CONTROL_C_EXIT (314)
-#define NT_STATUS_LOCAL_DISCONNECT (315)
-#define NT_STATUS_REMOTE_DISCONNECT (316)
-#define NT_STATUS_REMOTE_RESOURCES (317)
-#define NT_STATUS_LINK_FAILED (318)
-#define NT_STATUS_LINK_TIMEOUT (319)
-#define NT_STATUS_INVALID_CONNECTION (320)
-#define NT_STATUS_INVALID_ADDRESS (321)
-#define NT_STATUS_DLL_INIT_FAILED (322)
-#define NT_STATUS_MISSING_SYSTEMFILE (323)
-#define NT_STATUS_UNHANDLED_EXCEPTION (324)
-#define NT_STATUS_APP_INIT_FAILURE (325)
-#define NT_STATUS_PAGEFILE_CREATE_FAILED (326)
-#define NT_STATUS_NO_PAGEFILE (327)
-#define NT_STATUS_INVALID_LEVEL (328)
-#define NT_STATUS_WRONG_PASSWORD_CORE (329)
-#define NT_STATUS_ILLEGAL_FLOAT_CONTEXT (330)
-#define NT_STATUS_PIPE_BROKEN (331)
-#define NT_STATUS_REGISTRY_CORRUPT (332)
-#define NT_STATUS_REGISTRY_IO_FAILED (333)
-#define NT_STATUS_NO_EVENT_PAIR (334)
-#define NT_STATUS_UNRECOGNIZED_VOLUME (335)
-#define NT_STATUS_SERIAL_NO_DEVICE_INITED (336)
-#define NT_STATUS_NO_SUCH_ALIAS (337)
-#define NT_STATUS_MEMBER_NOT_IN_ALIAS (338)
-#define NT_STATUS_MEMBER_IN_ALIAS (339)
-#define NT_STATUS_ALIAS_EXISTS (340)
-#define NT_STATUS_LOGON_NOT_GRANTED (341)
-#define NT_STATUS_TOO_MANY_SECRETS (342)
-#define NT_STATUS_SECRET_TOO_LONG (343)
-#define NT_STATUS_INTERNAL_DB_ERROR (344)
-#define NT_STATUS_FULLSCREEN_MODE (345)
-#define NT_STATUS_TOO_MANY_CONTEXT_IDS (346)
-#define NT_STATUS_LOGON_TYPE_NOT_GRANTED (347)
-#define NT_STATUS_NOT_REGISTRY_FILE (348)
-#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED (349)
-#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR (350)
-#define NT_STATUS_FT_MISSING_MEMBER (351)
-#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY (352)
-#define NT_STATUS_ILLEGAL_CHARACTER (353)
-#define NT_STATUS_UNMAPPABLE_CHARACTER (354)
-#define NT_STATUS_UNDEFINED_CHARACTER (355)
-#define NT_STATUS_FLOPPY_VOLUME (356)
-#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND (357)
-#define NT_STATUS_FLOPPY_WRONG_CYLINDER (358)
-#define NT_STATUS_FLOPPY_UNKNOWN_ERROR (359)
-#define NT_STATUS_FLOPPY_BAD_REGISTERS (360)
-#define NT_STATUS_DISK_RECALIBRATE_FAILED (361)
-#define NT_STATUS_DISK_OPERATION_FAILED (362)
-#define NT_STATUS_DISK_RESET_FAILED (363)
-#define NT_STATUS_SHARED_IRQ_BUSY (364)
-#define NT_STATUS_FT_ORPHANING (365)
-#define NT_STATUS_PARTITION_FAILURE (370)
-#define NT_STATUS_INVALID_BLOCK_LENGTH (371)
-#define NT_STATUS_DEVICE_NOT_PARTITIONED (372)
-#define NT_STATUS_UNABLE_TO_LOCK_MEDIA (373)
-#define NT_STATUS_UNABLE_TO_UNLOAD_MEDIA (374)
-#define NT_STATUS_EOM_OVERFLOW (375)
-#define NT_STATUS_NO_MEDIA (376)
-#define NT_STATUS_NO_SUCH_MEMBER (378)
-#define NT_STATUS_INVALID_MEMBER (379)
-#define NT_STATUS_KEY_DELETED (380)
-#define NT_STATUS_NO_LOG_SPACE (381)
-#define NT_STATUS_TOO_MANY_SIDS (382)
-#define NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED (383)
-#define NT_STATUS_KEY_HAS_CHILDREN (384)
-#define NT_STATUS_CHILD_MUST_BE_VOLATILE (385)
-#define NT_STATUS_DEVICE_CONFIGURATION_ERROR (386)
-#define NT_STATUS_DRIVER_INTERNAL_ERROR (387)
-#define NT_STATUS_INVALID_DEVICE_STATE (388)
-#define NT_STATUS_IO_DEVICE_ERROR (389)
-#define NT_STATUS_DEVICE_PROTOCOL_ERROR (390)
-#define NT_STATUS_BACKUP_CONTROLLER (391)
-#define NT_STATUS_LOG_FILE_FULL (392)
-#define NT_STATUS_TOO_LATE (393)
-#define NT_STATUS_NO_TRUST_LSA_SECRET (394)
-#define NT_STATUS_NO_TRUST_SAM_ACCOUNT (395)
-#define NT_STATUS_TRUSTED_DOMAIN_FAILURE (396)
-#define NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE (397)
-#define NT_STATUS_EVENTLOG_FILE_CORRUPT (398)
-#define NT_STATUS_EVENTLOG_CANT_START (399)
-#define NT_STATUS_TRUST_FAILURE (400)
-#define NT_STATUS_MUTANT_LIMIT_EXCEEDED (401)
-#define NT_STATUS_NETLOGON_NOT_STARTED (402)
-#define NT_STATUS_ACCOUNT_EXPIRED (403)
-#define NT_STATUS_POSSIBLE_DEADLOCK (404)
-#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT (405)
-#define NT_STATUS_REMOTE_SESSION_LIMIT (406)
-#define NT_STATUS_EVENTLOG_FILE_CHANGED (407)
-#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT (408)
-#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT (409)
-#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT (410)
-#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT (411)
-#define NT_STATUS_FS_DRIVER_REQUIRED (412)
-#define NT_STATUS_NO_USER_SESSION_KEY (514)
-#define NT_STATUS_USER_SESSION_DELETED (515)
-#define NT_STATUS_RESOURCE_LANG_NOT_FOUND (516)
-#define NT_STATUS_INSUFF_SERVER_RESOURCES (517)
-#define NT_STATUS_INVALID_BUFFER_SIZE (518)
-#define NT_STATUS_INVALID_ADDRESS_COMPONENT (519)
-#define NT_STATUS_INVALID_ADDRESS_WILDCARD (520)
-#define NT_STATUS_TOO_MANY_ADDRESSES (521)
-#define NT_STATUS_ADDRESS_ALREADY_EXISTS (522)
-#define NT_STATUS_ADDRESS_CLOSED (523)
-#define NT_STATUS_CONNECTION_DISCONNECTED (524)
-#define NT_STATUS_CONNECTION_RESET (525)
-#define NT_STATUS_TOO_MANY_NODES (526)
-#define NT_STATUS_TRANSACTION_ABORTED (527)
-#define NT_STATUS_TRANSACTION_TIMED_OUT (528)
-#define NT_STATUS_TRANSACTION_NO_RELEASE (529)
-#define NT_STATUS_TRANSACTION_NO_MATCH (530)
-#define NT_STATUS_TRANSACTION_RESPONDED (531)
-#define NT_STATUS_TRANSACTION_INVALID_ID (532)
-#define NT_STATUS_TRANSACTION_INVALID_TYPE (533)
-#define NT_STATUS_NOT_SERVER_SESSION (534)
-#define NT_STATUS_NOT_CLIENT_SESSION (535)
-#define NT_STATUS_CANNOT_LOAD_REGISTRY_FILE (536)
-#define NT_STATUS_DEBUG_ATTACH_FAILED (537)
-#define NT_STATUS_SYSTEM_PROCESS_TERMINATED (538)
-#define NT_STATUS_DATA_NOT_ACCEPTED (539)
-#define NT_STATUS_NO_BROWSER_SERVERS_FOUND (540)
-#define NT_STATUS_VDM_HARD_ERROR (541)
-#define NT_STATUS_DRIVER_CANCEL_TIMEOUT (542)
-#define NT_STATUS_REPLY_MESSAGE_MISMATCH (543)
-#define NT_STATUS_MAPPED_ALIGNMENT (544)
-#define NT_STATUS_IMAGE_CHECKSUM_MISMATCH (545)
-#define NT_STATUS_LOST_WRITEBEHIND_DATA (546)
-#define NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID (547)
-#define NT_STATUS_PASSWORD_MUST_CHANGE (548)
-#define NT_STATUS_NOT_FOUND (549)
-#define NT_STATUS_NOT_TINY_STREAM (550)
-#define NT_STATUS_RECOVERY_FAILURE (551)
-#define NT_STATUS_STACK_OVERFLOW_READ (552)
-#define NT_STATUS_FAIL_CHECK (553)
-#define NT_STATUS_DUPLICATE_OBJECTID (554)
-#define NT_STATUS_OBJECTID_EXISTS (555)
-#define NT_STATUS_CONVERT_TO_LARGE (556)
-#define NT_STATUS_RETRY (557)
-#define NT_STATUS_FOUND_OUT_OF_SCOPE (558)
-#define NT_STATUS_ALLOCATE_BUCKET (559)
-#define NT_STATUS_PROPSET_NOT_FOUND (560)
-#define NT_STATUS_MARSHALL_OVERFLOW (561)
-#define NT_STATUS_INVALID_VARIANT (562)
-#define NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (563)
-#define NT_STATUS_ACCOUNT_LOCKED_OUT (564)
-#define NT_STATUS_HANDLE_NOT_CLOSABLE (565)
-#define NT_STATUS_CONNECTION_REFUSED (566)
-#define NT_STATUS_GRACEFUL_DISCONNECT (567)
-#define NT_STATUS_ADDRESS_ALREADY_ASSOCIATED (568)
-#define NT_STATUS_ADDRESS_NOT_ASSOCIATED (569)
-#define NT_STATUS_CONNECTION_INVALID (570)
-#define NT_STATUS_CONNECTION_ACTIVE (571)
-#define NT_STATUS_NETWORK_UNREACHABLE (572)
-#define NT_STATUS_HOST_UNREACHABLE (573)
-#define NT_STATUS_PROTOCOL_UNREACHABLE (574)
-#define NT_STATUS_PORT_UNREACHABLE (575)
-#define NT_STATUS_REQUEST_ABORTED (576)
-#define NT_STATUS_CONNECTION_ABORTED (577)
-#define NT_STATUS_BAD_COMPRESSION_BUFFER (578)
-#define NT_STATUS_USER_MAPPED_FILE (579)
-#define NT_STATUS_AUDIT_FAILED (580)
-#define NT_STATUS_TIMER_RESOLUTION_NOT_SET (581)
-#define NT_STATUS_CONNECTION_COUNT_LIMIT (582)
-#define NT_STATUS_LOGIN_TIME_RESTRICTION (583)
-#define NT_STATUS_LOGIN_WKSTA_RESTRICTION (584)
-#define NT_STATUS_IMAGE_MP_UP_MISMATCH (585)
-#define NT_STATUS_INSUFFICIENT_LOGON_INFO (592)
-#define NT_STATUS_BAD_DLL_ENTRYPOINT (593)
-#define NT_STATUS_BAD_SERVICE_ENTRYPOINT (594)
-#define NT_STATUS_LPC_REPLY_LOST (595)
-#define NT_STATUS_IP_ADDRESS_CONFLICT1 (596)
-#define NT_STATUS_IP_ADDRESS_CONFLICT2 (597)
-#define NT_STATUS_REGISTRY_QUOTA_LIMIT (598)
-#define NT_STATUS_PATH_NOT_COVERED (599)
-#define NT_STATUS_NO_CALLBACK_ACTIVE (600)
-#define NT_STATUS_LICENSE_QUOTA_EXCEEDED (601)
-#define NT_STATUS_PWD_TOO_SHORT (602)
-#define NT_STATUS_PWD_TOO_RECENT (603)
-#define NT_STATUS_PWD_HISTORY_CONFLICT (604)
-#define NT_STATUS_PLUGPLAY_NO_DEVICE (606)
-#define NT_STATUS_UNSUPPORTED_COMPRESSION (607)
-#define NT_STATUS_INVALID_HW_PROFILE (608)
-#define NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH (609)
-#define NT_STATUS_DRIVER_ORDINAL_NOT_FOUND (610)
-#define NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND (611)
-#define NT_STATUS_RESOURCE_NOT_OWNED (612)
-#define NT_STATUS_TOO_MANY_LINKS (613)
-#define NT_STATUS_QUOTA_LIST_INCONSISTENT (614)
-#define NT_STATUS_FILE_IS_OFFLINE (615)
diff --git a/source/include/proto.h b/source/include/proto.h
deleted file mode 100644
index 009d83db5c2..00000000000
--- a/source/include/proto.h
+++ /dev/null
@@ -1,1057 +0,0 @@
-/* This file is automatically generated with "make proto". DO NOT EDIT */
-
-
-/*The following definitions come from access.c */
-
-BOOL check_access(int snum);
-BOOL allow_access(char *deny_list,char *allow_list,char *cname,char *caddr);
-
-/*The following definitions come from charcnv.c */
-
-char *unix2dos_format(char *str,BOOL overwrite);
-char *dos2unix_format(char *str, BOOL overwrite);
-int interpret_character_set(char *str, int def);
-
-/*The following definitions come from charset.c */
-
-void charset_initialise();
-void codepage_initialise(int client_codepage);
-void add_char_string(char *s);
-
-/*The following definitions come from chgpasswd.c */
-
-BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence);
-BOOL chgpasswd(char *name,char *oldpass,char *newpass);
-BOOL chgpasswd(char *name,char *oldpass,char *newpass);
-
-/*The following definitions come from client.c */
-
-void setup_pkt(char *outbuf);
-void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(),BOOL recurse_dir);
-void cmd_help(void);
-BOOL reopen_connection(char *inbuf,char *outbuf);
-char *smb_errstr(char *inbuf);
-
-/*The following definitions come from clientutil.c */
-
-void cli_setup_pkt(char *outbuf);
-BOOL cli_receive_trans_response(char *inbuf,int trans,int *data_len,
- int *param_len, char **data,char **param);
-BOOL cli_send_session_request(char *inbuf, char *outbuf);
-BOOL cli_send_login(char *inbuf, char *outbuf, BOOL start_session, BOOL use_setup);
-void cli_send_logout(void);
-BOOL cli_call_api(int prcnt,int drcnt,int mprcnt,int mdrcnt,int *rprcnt,
- int *rdrcnt, char *param,char *data, char **rparam,char **rdata);
-BOOL cli_send_trans_request(char *outbuf, int trans, char *name, int fid, int flags,
- char *data,char *param,uint16 *setup, int ldata,int lparam,
- int lsetup,int mdata,int mparam,int msetup);
-BOOL cli_open_sockets(int port);
-BOOL cli_reopen_connection(char *inbuf,char *outbuf);
-char *smb_errstr(char *inbuf);
-
-/*The following definitions come from clitar.c */
-
-int padit(char *buf, int bufsize, int padsize);
-void cmd_block(void);
-void cmd_tarmode(void);
-void cmd_setmode(void);
-void cmd_tar(char *inbuf, char *outbuf);
-int process_tar(char *inbuf, char *outbuf);
-int clipfind(char **aret, int ret, char *tok);
-int tar_parseargs(int argc, char *argv[], char *Optarg, int Optind);
-
-/*The following definitions come from dir.c */
-
-void init_dptrs(void);
-char *dptr_path(int key);
-char *dptr_wcard(int key);
-BOOL dptr_set_wcard(int key, char *wcard);
-BOOL dptr_set_attr(int key, uint16 attr);
-uint16 dptr_attr(int key);
-void dptr_close(int key);
-void dptr_closecnum(int cnum);
-void dptr_idlecnum(int cnum);
-void dptr_closepath(char *path,int pid);
-int dptr_create(int cnum,char *path, BOOL expect_close,int pid);
-BOOL dptr_fill(char *buf1,unsigned int key);
-BOOL dptr_zero(char *buf);
-void *dptr_fetch(char *buf,int *num);
-void *dptr_fetch_lanman2(char *params,int dptr_num);
-BOOL dir_check_ftype(int cnum,int mode,struct stat *st,int dirtype);
-BOOL get_dir_entry(int cnum,char *mask,int dirtype,char *fname,int *size,int *mode,time_t *date,BOOL check_descend);
-void *OpenDir(int cnum, char *name, BOOL use_veto);
-void CloseDir(void *p);
-char *ReadDirName(void *p);
-BOOL SeekDir(void *p,int pos);
-int TellDir(void *p);
-void DirCacheAdd(char *path,char *name,char *dname,int snum);
-char *DirCacheCheck(char *path,char *name,int snum);
-void DirCacheFlush(int snum);
-
-/*The following definitions come from fault.c */
-
-void fault_setup(void (*fn)());
-
-/*The following definitions come from getsmbpass.c */
-
-char *getsmbpass(char *prompt) ;
-
-/*The following definitions come from interface.c */
-
-void load_interfaces(void);
-void iface_set_default(char *ip,char *bcast,char *nmask);
-BOOL ismyip(struct in_addr ip);
-BOOL ismybcast(struct in_addr bcast);
-int iface_count(void);
-struct in_addr *iface_n_ip(int n);
-struct in_addr *iface_bcast(struct in_addr ip);
-struct in_addr *iface_nmask(struct in_addr ip);
-struct in_addr *iface_ip(struct in_addr ip);
-
-/*The following definitions come from ipc.c */
-
-int reply_trans(char *inbuf,char *outbuf);
-
-/*The following definitions come from kanji.c */
-
-char *sj_strtok(char *s1, char *s2);
-char *sj_strstr(char *s1, char *s2);
-char *sj_strchr (char *s, int c);
-char *sj_strrchr(char *s, int c);
-int interpret_coding_system(char *str, int def);
-
-/*The following definitions come from loadparm.c */
-
-char *lp_string(char *s);
-char *lp_logfile(void);
-char *lp_smbrun(void);
-char *lp_configfile(void);
-char *lp_smb_passwd_file(void);
-char *lp_serverstring(void);
-char *lp_printcapname(void);
-char *lp_lockdir(void);
-char *lp_rootdir(void);
-char *lp_defaultservice(void);
-char *lp_msg_command(void);
-char *lp_dfree_command(void);
-char *lp_hosts_equiv(void);
-char *lp_auto_services(void);
-char *lp_passwd_program(void);
-char *lp_passwd_chat(void);
-char *lp_passwordserver(void);
-char *lp_workgroup(void);
-char *lp_domain_controller(void);
-char *lp_username_map(void);
-char *lp_character_set(void);
-char *lp_logon_script(void);
-char *lp_logon_path(void);
-char *lp_remote_announce(void);
-char *lp_wins_server(void);
-char *lp_interfaces(void);
-char *lp_socket_address(void);
-char *lp_nis_home_map_name(void);
-char *lp_announce_version(void);
-char *lp_netbios_aliases(void);
-char *lp_domainsid(void);
-BOOL lp_dns_proxy(void);
-BOOL lp_wins_support(void);
-BOOL lp_wins_proxy(void);
-BOOL lp_local_master(void);
-BOOL lp_domain_master(void);
-BOOL lp_domain_logons(void);
-BOOL lp_preferred_master(void);
-BOOL lp_load_printers(void);
-BOOL lp_use_rhosts(void);
-BOOL lp_getwdcache(void);
-BOOL lp_readprediction(void);
-BOOL lp_readbmpx(void);
-BOOL lp_readraw(void);
-BOOL lp_writeraw(void);
-BOOL lp_null_passwords(void);
-BOOL lp_strip_dot(void);
-BOOL lp_encrypted_passwords(void);
-BOOL lp_syslog_only(void);
-BOOL lp_browse_list(void);
-BOOL lp_unix_realname(void);
-BOOL lp_nis_home_map(void);
-BOOL lp_time_server(void);
-int lp_os_level(void);
-int lp_max_ttl(void);
-int lp_max_log_size(void);
-int lp_mangledstack(void);
-int lp_maxxmit(void);
-int lp_maxmux(void);
-int lp_maxpacket(void);
-int lp_keepalive(void);
-int lp_passwordlevel(void);
-int lp_usernamelevel(void);
-int lp_readsize(void);
-int lp_shmem_size(void);
-int lp_shmem_hash_size(void);
-int lp_deadtime(void);
-int lp_maxprotocol(void);
-int lp_security(void);
-int lp_printing(void);
-int lp_maxdisksize(void);
-int lp_lpqcachetime(void);
-int lp_syslog(void);
-int lp_client_code_page(void);
-int lp_announce_as(void);
-char *lp_preexec(int );
-char *lp_postexec(int );
-char *lp_rootpreexec(int );
-char *lp_rootpostexec(int );
-char *lp_servicename(int );
-char *lp_pathname(int );
-char *lp_dontdescend(int );
-char *lp_username(int );
-char *lp_guestaccount(int );
-char *lp_invalid_users(int );
-char *lp_valid_users(int );
-char *lp_admin_users(int );
-char *lp_printcommand(int );
-char *lp_lpqcommand(int );
-char *lp_lprmcommand(int );
-char *lp_lppausecommand(int );
-char *lp_lpresumecommand(int );
-char *lp_printername(int );
-char *lp_printerdriver(int );
-char *lp_hostsallow(int );
-char *lp_hostsdeny(int );
-char *lp_magicscript(int );
-char *lp_magicoutput(int );
-char *lp_comment(int );
-char *lp_force_user(int );
-char *lp_force_group(int );
-char *lp_readlist(int );
-char *lp_writelist(int );
-char *lp_volume(int );
-char *lp_mangled_map(int );
-char *lp_veto_files(int );
-char *lp_hide_files(int );
-BOOL lp_alternate_permissions(int );
-BOOL lp_revalidate(int );
-BOOL lp_casesensitive(int );
-BOOL lp_preservecase(int );
-BOOL lp_shortpreservecase(int );
-BOOL lp_casemangle(int );
-BOOL lp_status(int );
-BOOL lp_hide_dot_files(int );
-BOOL lp_browseable(int );
-BOOL lp_readonly(int );
-BOOL lp_no_set_dir(int );
-BOOL lp_guest_ok(int );
-BOOL lp_guest_only(int );
-BOOL lp_print_ok(int );
-BOOL lp_postscript(int );
-BOOL lp_map_hidden(int );
-BOOL lp_map_archive(int );
-BOOL lp_locking(int );
-BOOL lp_strict_locking(int );
-BOOL lp_share_modes(int );
-BOOL lp_oplocks(int );
-BOOL lp_onlyuser(int );
-BOOL lp_manglednames(int );
-BOOL lp_widelinks(int );
-BOOL lp_symlinks(int );
-BOOL lp_syncalways(int );
-BOOL lp_map_system(int );
-BOOL lp_delete_readonly(int );
-BOOL lp_fake_oplocks(int );
-BOOL lp_recursive_veto_delete(int );
-int lp_create_mode(int );
-int lp_force_create_mode(int );
-int lp_dir_mode(int );
-int lp_force_dir_mode(int );
-int lp_max_connections(int );
-int lp_defaultcase(int );
-int lp_minprintspace(int );
-char lp_magicchar(int );
-BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir);
-int lp_add_service(char *pszService, int iDefaultService);
-BOOL lp_add_printer(char *pszPrintername, int iDefaultService);
-BOOL lp_file_list_changed(void);
-BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue);
-int lp_next_parameter(int snum, int *i, char *label,
- char *value, int allparameters);
-BOOL lp_snum_ok(int iService);
-BOOL lp_loaded(void);
-void lp_killunused(BOOL (*snumused)(int ));
-BOOL lp_load(char *pszFname,BOOL global_only);
-int lp_numservices(void);
-void lp_dump(FILE *f);
-int lp_servicenumber(char *pszServiceName);
-char *volume_label(int snum);
-void lp_rename_service(int snum, char *new_name);
-void lp_remove_service(int snum);
-void lp_copy_service(int snum, char *new_name);
-int lp_default_server_announce(void);
-int lp_major_announce_version(void);
-int lp_minor_announce_version(void);
-
-/*The following definitions come from locking.c */
-
-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);
-BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok);
-BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token);
-int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode,
- min_share_mode_entry **old_shares);
-void del_share_mode(share_lock_token token, int fnum);
-BOOL set_share_mode(share_lock_token token, int fnum, uint16 port, uint16 op_type);
-BOOL remove_share_oplock(int fnum, share_lock_token token);
-BOOL lock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token *ptok);
-BOOL unlock_share_entry(int cnum, uint32 dev, uint32 inode, share_lock_token token);
-int get_share_modes(int cnum, share_lock_token token, uint32 dev, uint32 inode,
- min_share_mode_entry **old_shares);
-void del_share_mode(share_lock_token token, int fnum);
-BOOL set_share_mode(share_lock_token token,int fnum, uint16 port, uint16 op_type);
-BOOL remove_share_oplock(int fnum, share_lock_token token);
-
-/*The following definitions come from lsaparse.c */
-
-char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align);
-char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align);
-char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align);
-char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align);
-char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align);
-char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align);
-char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align);
-char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align);
-char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align);
-char* lsa_io_q_auth2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align);
-char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align);
-char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align);
-char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align);
-char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align);
-char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align);
-char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align);
-char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align);
-char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align);
-
-/*The following definitions come from mangle.c */
-
-int str_checksum(char *s);
-BOOL is_8_3(char *fname, BOOL check_case);
-void create_mangled_stack(int size);
-BOOL check_mangled_stack(char *s);
-BOOL is_mangled(char *s);
-void mangle_name_83(char *s);
-BOOL name_map_mangle(char *OutName,BOOL need83,int snum);
-
-/*The following definitions come from md4.c */
-
-void mdfour(unsigned char *out, unsigned char *in, int n);
-
-/*The following definitions come from message.c */
-
-int reply_sends(char *inbuf,char *outbuf);
-int reply_sendstrt(char *inbuf,char *outbuf);
-int reply_sendtxt(char *inbuf,char *outbuf);
-int reply_sendend(char *inbuf,char *outbuf);
-
-/*The following definitions come from nameannounce.c */
-
-void announce_request(struct work_record *work, struct in_addr ip);
-void do_announce_request(char *info, char *to_name, int announce_type,
- int from,
- int to, struct in_addr dest_ip);
-void sync_server(enum state_type state, char *serv_name, char *work_name,
- int name_type,
- struct subnet_record *d,
- struct in_addr ip);
-void do_announce_host(int command,
- char *from_name, int from_type, struct in_addr from_ip,
- char *to_name , int to_type , struct in_addr to_ip,
- time_t announce_interval,
- char *server_name, int server_type, char *server_comment);
-void announce_my_servers_removed(void);
-void announce_server(struct subnet_record *d, struct work_record *work,
- char *name, char *comment, time_t ttl, int server_type);
-void announce_host(time_t t);
-void reset_announce_timer();
-void announce_master(time_t t);
-void announce_remote(time_t t);
-
-/*The following definitions come from namebrowse.c */
-
-void expire_browse_cache(time_t t);
-struct browse_cache_record *add_browser_entry(char *name, int type, char *wg,
- time_t ttl, struct subnet_record *d,
- struct in_addr ip, BOOL local);
-void do_browser_lists(time_t t);
-
-/*The following definitions come from namedbname.c */
-
-void set_samba_nb_type(void);
-BOOL name_equal(struct nmb_name *n1,struct nmb_name *n2);
-BOOL ms_browser_name(char *name, int type);
-void remove_name(struct subnet_record *d, struct name_record *n);
-struct name_record *find_name(struct name_record *n,
- struct nmb_name *name, int search);
-struct name_record *find_name_search(struct subnet_record **d,
- struct nmb_name *name,
- int search, struct in_addr ip);
-void dump_names(void);
-void load_netbios_names(void);
-void remove_netbios_name(struct subnet_record *d,
- char *name,int type, enum name_source source,
- struct in_addr ip);
-struct name_record *add_netbios_entry(struct subnet_record *d,
- char *name, int type, int nb_flags,
- int ttl, enum name_source source, struct in_addr ip,
- BOOL new_only,BOOL wins);
-void expire_names(time_t t);
-struct name_record *dns_name_search(struct nmb_name *question, int Time);
-
-/*The following definitions come from namedbresp.c */
-
-void add_response_record(struct subnet_record *d,
- struct response_record *n);
-void remove_response_record(struct subnet_record *d,
- struct response_record *n);
-struct response_record *make_response_queue_record(enum state_type state,
- int id,uint16 fd,
- int quest_type, char *name,int type, int nb_flags, time_t ttl,
- int server_type, char *my_name, char *my_comment,
- BOOL bcast,BOOL recurse,
- struct in_addr send_ip, struct in_addr reply_to_ip);
-struct response_record *find_response_record(struct subnet_record **d,
- uint16 id);
-
-/*The following definitions come from namedbserver.c */
-
-void remove_old_servers(struct work_record *work, time_t t,
- BOOL remove_all);
-struct server_record *find_server(struct work_record *work, char *name);
-struct server_record *add_server_entry(struct subnet_record *d,
- struct work_record *work,
- char *name,int servertype,
- int ttl,char *comment,
- BOOL replace);
-void expire_servers(time_t t);
-
-/*The following definitions come from namedbsubnet.c */
-
-struct subnet_record *find_subnet(struct in_addr bcast_ip);
-struct subnet_record *find_req_subnet(struct in_addr ip, BOOL bcast);
-struct subnet_record *find_subnet_all(struct in_addr bcast_ip);
-void add_workgroup_to_subnet( struct subnet_record *d, char *group);
-void add_my_subnets(char *group);
-void write_browse_list(time_t t);
-
-/*The following definitions come from namedbwork.c */
-
-struct work_record *remove_workgroup(struct subnet_record *d,
- struct work_record *work,
- BOOL remove_all_servers);
-struct work_record *find_workgroupstruct(struct subnet_record *d,
- fstring name, BOOL add);
-void dump_workgroups(void);
-
-/*The following definitions come from nameelect.c */
-
-void check_master_browser(time_t t);
-void browser_gone(char *work_name, struct in_addr ip);
-void send_election(struct subnet_record *d, char *group,uint32 criterion,
- int timeup,char *name);
-void name_unregister_work(struct subnet_record *d, char *name, int name_type);
-void name_register_work(struct subnet_record *d, char *name, int name_type,
- int nb_flags, time_t ttl, struct in_addr ip, BOOL bcast);
-void become_local_master(struct subnet_record *d, struct work_record *work);
-void become_domain_master(struct subnet_record *d, struct work_record *work);
-void become_logon_server(struct subnet_record *d, struct work_record *work);
-void unbecome_local_master(struct subnet_record *d, struct work_record *work,
- int remove_type);
-void unbecome_domain_master(struct subnet_record *d, struct work_record *work,
- int remove_type);
-void unbecome_logon_server(struct subnet_record *d, struct work_record *work,
- int remove_type);
-void run_elections(time_t t);
-void process_election(struct packet_struct *p,char *buf);
-BOOL check_elections(void);
-
-/*The following definitions come from namelogon.c */
-
-void process_logon_packet(struct packet_struct *p,char *buf,int len);
-
-/*The following definitions come from namepacket.c */
-
-void debug_browse_data(char *outbuf, int len);
-void initiate_netbios_packet(uint16 *id,
- int fd,int quest_type,char *name,int name_type,
- int nb_flags,BOOL bcast,BOOL recurse,
- struct in_addr to_ip);
-void reply_netbios_packet(struct packet_struct *p1,int trn_id,
- int rcode, int rcv_code, int opcode,
- BOOL recursion_available,
- BOOL recursion_desired,
- struct nmb_name *rr_name,int rr_type,int rr_class,int ttl,
- char *data,int len);
-void queue_packet(struct packet_struct *packet);
-void run_packet_queue();
-void listen_for_packets(BOOL run_election);
-BOOL send_mailslot_reply(BOOL unique, char *mailslot,int fd,char *buf,int len,char *srcname,
- char *dstname,int src_type,int dest_type,
- struct in_addr dest_ip,struct in_addr src_ip);
-
-/*The following definitions come from namequery.c */
-
-BOOL name_status(int fd,char *name,int name_type,BOOL recurse,
- struct in_addr to_ip,char *master,char *rname,
- void (*fn)());
-BOOL name_query(int fd,char *name,int name_type,
- BOOL bcast,BOOL recurse,
- struct in_addr to_ip, struct in_addr *ip,void (*fn)());
-
-/*The following definitions come from nameresp.c */
-
-void expire_netbios_response_entries(time_t t);
-struct response_record *queue_netbios_pkt_wins(
- int fd,int quest_type,enum state_type state,
- char *name,int name_type,int nb_flags, time_t ttl,
- int server_type, char *my_name, char *my_comment,
- struct in_addr send_ip, struct in_addr reply_to_ip);
-struct response_record *queue_netbios_packet(struct subnet_record *d,
- int fd,int quest_type,enum state_type state,char *name,
- int name_type,int nb_flags, time_t ttl,
- int server_type, char *my_name, char *my_comment,
- BOOL bcast,BOOL recurse,
- struct in_addr send_ip, struct in_addr reply_to_ip);
-
-/*The following definitions come from nameserv.c */
-
-void remove_name_entry(struct subnet_record *d, char *name,int type);
-void add_my_name_entry(struct subnet_record *d,char *name,int type,int nb_flags);
-void add_domain_logon_names(void);
-void add_domain_master_bcast(void);
-void add_domain_master_wins(void);
-void add_domain_names(time_t t);
-void add_my_names(void);
-void remove_my_names();
-void refresh_my_names(time_t t);
-void query_refresh_names(time_t t);
-
-/*The following definitions come from nameservreply.c */
-
-void add_name_respond(struct subnet_record *d, int fd, struct in_addr from_ip,
- uint16 response_id,
- struct nmb_name *name,
- int nb_flags, int ttl, struct in_addr register_ip,
- BOOL new_owner, struct in_addr reply_to_ip);
-void reply_name_release(struct packet_struct *p);
-void reply_name_reg(struct packet_struct *p);
-void reply_name_status(struct packet_struct *p);
-void reply_name_query(struct packet_struct *p);
-
-/*The following definitions come from nameservresp.c */
-
-void debug_state_type(int state);
-void response_netbios_packet(struct packet_struct *p);
-
-/*The following definitions come from namework.c */
-
-void reset_server(char *name, int state, struct in_addr ip);
-void tell_become_backup(void);
-BOOL same_context(struct dgram_packet *dgram);
-void process_browse_packet(struct packet_struct *p,char *buf,int len);
-
-/*The following definitions come from nmbd.c */
-
-BOOL reload_services(BOOL test);
-
-/*The following definitions come from nmblib.c */
-
-char *lookup_opcode_name( int opcode );
-void debug_nmb_packet(struct packet_struct *p);
-char *namestr(struct nmb_name *n);
-void free_nmb_packet(struct nmb_packet *nmb);
-void free_packet(struct packet_struct *packet);
-struct packet_struct *read_packet(int fd,enum packet_type packet_type);
-void make_nmb_name(struct nmb_name *n,char *name,int type,char *this_scope);
-BOOL send_packet(struct packet_struct *p);
-struct packet_struct *receive_packet(int fd,enum packet_type type,int t);
-
-/*The following definitions come from nmblookup.c */
-
-int main(int argc,char *argv[]);
-
-/*The following definitions come from nmbsync.c */
-
-char *getsmbpass(char *pass);
-void sync_browse_lists(struct subnet_record *d, struct work_record *work,
- char *name, int nm_type, struct in_addr ip, BOOL local);
-
-/*The following definitions come from params.c */
-
-BOOL pm_process( char *FileName,
- BOOL (*sfunc)(char *),
- BOOL (*pfunc)(char *, char *) );
-
-/*The following definitions come from password.c */
-
-void generate_next_challenge(char *challenge);
-BOOL set_challenge(char *challenge);
-BOOL last_challenge(char *challenge);
-user_struct *get_valid_user_struct(uint16 vuid);
-void invalidate_vuid(uint16 vuid);
-char *validated_username(uint16 vuid);
-uint16 register_vuid(int uid,int gid, char *name,BOOL guest);
-void add_session_user(char *user);
-void dfs_unlogin(void);
-BOOL password_check(char *password);
-BOOL smb_password_check(char *password, unsigned char *part_passwd, unsigned char *c8);
-BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd);
-BOOL user_ok(char *user,int snum);
-BOOL authorise_login(int snum,char *user,char *password, int pwlen,
- BOOL *guest,BOOL *force,uint16 vuid);
-BOOL check_hosts_equiv(char *user);
-BOOL server_cryptkey(char *buf);
-BOOL server_validate(char *buf);
-
-/*The following definitions come from pcap.c */
-
-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);
-char *dom_sid_to_string(DOM_SID *sid);
-BOOL api_ntlsarpcTNP(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);
-void do_read_prediction();
-void invalidate_read_prediction(int fd);
-
-/*The following definitions come from printing.c */
-
-void lpq_reset(int snum);
-void print_file(int fnum);
-int get_printqueue(int snum,int cnum,print_queue_struct **queue,
- print_status_struct *status);
-void del_printqueue(int cnum,int snum,int jobid);
-void status_printjob(int cnum,int snum,int jobid,int status);
-int printjob_encode(int snum, int job);
-void printjob_decode(int jobid, int *snum, int *job);
-
-/*The following definitions come from quotas.c */
-
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize);
-
-/*The following definitions come from replace.c */
-
-char *Strstr(char *s, char *p);
-time_t Mktime(struct tm *t);
-int InNetGr(char *group,char *host,char *user,char *dom);
-void *malloc_wrapped(int size,char *file,int line);
-void *realloc_wrapped(void *ptr,int size,char *file,int line);
-void free_wrapped(void *ptr,char *file,int line);
-void *memcpy_wrapped(void *d,void *s,int l,char *fname,int line);
-
-/*The following definitions come from reply.c */
-
-int reply_special(char *inbuf,char *outbuf);
-int reply_tcon(char *inbuf,char *outbuf);
-int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_unknown(char *inbuf,char *outbuf);
-int reply_ioctl(char *inbuf,char *outbuf);
-int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_chkpth(char *inbuf,char *outbuf);
-int reply_getatr(char *inbuf,char *outbuf);
-int reply_setatr(char *inbuf,char *outbuf);
-int reply_dskattr(char *inbuf,char *outbuf);
-int reply_search(char *inbuf,char *outbuf);
-int reply_fclose(char *inbuf,char *outbuf);
-int reply_open(char *inbuf,char *outbuf);
-int reply_open_and_X(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_ulogoffX(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_mknew(char *inbuf,char *outbuf);
-int reply_ctemp(char *inbuf,char *outbuf);
-int reply_unlink(char *inbuf,char *outbuf);
-int reply_readbraw(char *inbuf, char *outbuf);
-int reply_lockread(char *inbuf,char *outbuf);
-int reply_read(char *inbuf,char *outbuf);
-int reply_read_and_X(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_writebraw(char *inbuf,char *outbuf);
-int reply_writeunlock(char *inbuf,char *outbuf);
-int reply_write(char *inbuf,char *outbuf,int dum1,int dum2);
-int reply_write_and_X(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_lseek(char *inbuf,char *outbuf);
-int reply_flush(char *inbuf,char *outbuf);
-int reply_exit(char *inbuf,char *outbuf);
-int reply_close(char *inbuf,char *outbuf);
-int reply_writeclose(char *inbuf,char *outbuf);
-int reply_lock(char *inbuf,char *outbuf);
-int reply_unlock(char *inbuf,char *outbuf);
-int reply_tdis(char *inbuf,char *outbuf);
-int reply_echo(char *inbuf,char *outbuf);
-int reply_printopen(char *inbuf,char *outbuf);
-int reply_printclose(char *inbuf,char *outbuf);
-int reply_printqueue(char *inbuf,char *outbuf);
-int reply_printwrite(char *inbuf,char *outbuf);
-int reply_mkdir(char *inbuf,char *outbuf);
-int reply_rmdir(char *inbuf,char *outbuf);
-int reply_mv(char *inbuf,char *outbuf);
-int reply_copy(char *inbuf,char *outbuf);
-int reply_setdir(char *inbuf,char *outbuf);
-int reply_lockingX(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_readbmpx(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_writebmpx(char *inbuf,char *outbuf);
-int reply_writebs(char *inbuf,char *outbuf);
-int reply_setattrE(char *inbuf,char *outbuf);
-int reply_getattrE(char *inbuf,char *outbuf);
-
-/*The following definitions come from server.c */
-
-void *dflt_sig(void);
-void killkids(void);
-mode_t unix_mode(int cnum,int dosmode);
-int dos_mode(int cnum,char *path,struct stat *sbuf);
-int dos_chmod(int cnum,char *fname,int dosmode,struct stat *st);
-BOOL unix_convert(char *name,int cnum,pstring saved_last_component, BOOL *bad_path);
-int disk_free(char *path,int *bsize,int *dfree,int *dsize);
-int sys_disk_free(char *path,int *bsize,int *dfree,int *dsize);
-BOOL check_name(char *name,int cnum);
-void sync_file(int fnum);
-void close_file(int fnum);
-BOOL check_file_sharing(int cnum,char *fname);
-int check_share_mode( min_share_mode_entry *share, int deny_mode, char *fname,
- BOOL fcbopen, int *flags);
-void open_file_shared(int fnum,int cnum,char *fname,int share_mode,int ofun,
- int mode,int oplock_request, int *Access,int *action);
-int seek_file(int fnum,uint32 pos);
-int read_file(int fnum,char *data,uint32 pos,int n);
-int write_file(int fnum,char *data,int n);
-BOOL become_service(int cnum,BOOL do_chdir);
-int find_service(char *service);
-int cached_error_packet(char *inbuf,char *outbuf,int fnum,int line);
-int unix_error_packet(char *inbuf,char *outbuf,int def_class,uint32 def_code,int line);
-int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int line);
-BOOL oplock_break(uint32 dev, uint32 inode, struct timeval *tval);
-BOOL request_oplock_break(min_share_mode_entry *share_entry,
- uint32 dev, uint32 inode);
-BOOL snum_used(int snum);
-BOOL reload_services(BOOL test);
-int setup_groups(char *user, int uid, int gid, int *p_ngroups,
- int **p_igroups, gid_t **p_groups);
-int make_connection(char *service,char *user,char *password, int pwlen, char *dev,uint16 vuid);
-int find_free_file(void );
-int reply_corep(char *outbuf);
-int reply_coreplus(char *outbuf);
-int reply_lanman1(char *outbuf);
-int reply_lanman2(char *outbuf);
-int reply_nt1(char *outbuf);
-void close_cnum(int cnum, uint16 vuid);
-BOOL yield_connection(int cnum,char *name,int max_connections);
-BOOL claim_connection(int cnum,char *name,int max_connections,BOOL Clear);
-void exit_server(char *reason);
-void standard_sub(int cnum,char *str);
-char *smb_fn_name(int type);
-int chain_reply(char *inbuf,char *outbuf,int size,int bufsize);
-int construct_reply(char *inbuf,char *outbuf,int size,int bufsize);
-
-/*The following definitions come from shmem.c */
-
-BOOL smb_shm_create_hash_table( unsigned int size );
-BOOL smb_shm_open( char *file_name, int size);
-BOOL smb_shm_close( void );
-smb_shm_offset_t smb_shm_alloc(int size);
-BOOL smb_shm_free(smb_shm_offset_t offset);
-smb_shm_offset_t smb_shm_get_userdef_off(void);
-BOOL smb_shm_set_userdef_off(smb_shm_offset_t userdef_off);
-void *smb_shm_offset2addr(smb_shm_offset_t offset);
-smb_shm_offset_t smb_shm_addr2offset(void *addr);
-BOOL smb_shm_lock_hash_entry( unsigned int entry);
-BOOL smb_shm_unlock_hash_entry( unsigned int entry );
-BOOL smb_shm_get_usage(int *bytes_free,
- int *bytes_used,
- int *bytes_overhead);
-
-/*The following definitions come from smbdes.c */
-
-void E_P16(unsigned char *p14,unsigned char *p16);
-void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24);
-
-/*The following definitions come from smbencrypt.c */
-
-void SMBencrypt(uchar *passwd, uchar *c8, uchar *p24);
-void E_md4hash(uchar *passwd, uchar *p16);
-void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24);
-
-/*The following definitions come from smbparse.c */
-
-char* smb_io_utime(BOOL io, UTIME *t, char *q, char *base, int align);
-char* smb_io_time(BOOL io, NTTIME *nttime, char *q, char *base, int align);
-char* smb_io_dom_sid(BOOL io, DOM_SID *sid, char *q, char *base, int align);
-char* smb_io_unihdr(BOOL io, UNIHDR *hdr, char *q, char *base, int align);
-char* smb_io_unihdr2(BOOL io, UNIHDR2 *hdr2, char *q, char *base, int align);
-char* smb_io_unistr(BOOL io, UNISTR *uni, char *q, char *base, int align);
-char* smb_io_unistr2(BOOL io, UNISTR2 *uni2, char *q, char *base, int align);
-char* smb_io_dom_sid2(BOOL io, DOM_SID2 *sid2, char *q, char *base, int align);
-char* smb_io_dom_rid2(BOOL io, DOM_RID2 *rid2, char *q, char *base, int align);
-char* smb_io_log_info(BOOL io, DOM_LOG_INFO *log, char *q, char *base, int align);
-char* smb_io_chal(BOOL io, DOM_CHAL *chal, char *q, char *base, int align);
-char* smb_io_cred(BOOL io, DOM_CRED *cred, char *q, char *base, int align);
-char* smb_io_clnt_info(BOOL io, DOM_CLNT_INFO *clnt, char *q, char *base, int align);
-char* smb_io_logon_id(BOOL io, DOM_LOGON_ID *log, char *q, char *base, int align);
-char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align);
-char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align);
-char* smb_io_sam_info(BOOL io, DOM_SAM_INFO *sam, char *q, char *base, int align);
-char* smb_io_gid(BOOL io, DOM_GID *gid, char *q, char *base, int align);
-char* smb_io_rpc_hdr(BOOL io, RPC_HDR *rpc, char *q, char *base, int align);
-char* smb_io_pol_hnd(BOOL io, LSA_POL_HND *pol, char *q, char *base, int align);
-char* smb_io_dom_query_3(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align);
-char* smb_io_dom_query_5(BOOL io, DOM_QUERY_3 *d_q, char *q, char *base, int align);
-char* smb_io_dom_query(BOOL io, DOM_QUERY *d_q, char *q, char *base, int align);
-char* smb_io_dom_r_ref(BOOL io, DOM_R_REF *r_r, char *q, char *base, int align);
-char* smb_io_dom_name(BOOL io, DOM_NAME *name, char *q, char *base, int align);
-char* smb_io_neg_flags(BOOL io, NEG_FLAGS *neg, char *q, char *base, int align);
-
-/*The following definitions come from smbpass.c */
-
-int pw_file_lock(char *name, int type, int secs);
-int pw_file_unlock(int fd);
-struct smb_passwd *get_smbpwnam(char *name);
-
-/*The following definitions come from smbpasswd.c */
-
-
-/*The following definitions come from smbrun.c */
-
-
-/*The following definitions come from status.c */
-
-void Ucrit_addUsername(pstring username);
-unsigned int Ucrit_checkUsername(pstring username);
-void Ucrit_addPid(int pid);
-unsigned int Ucrit_checkPid(int pid);
-
-/*The following definitions come from system.c */
-
-int sys_select(fd_set *fds,struct timeval *tval);
-int sys_select(fd_set *fds,struct timeval *tval);
-int sys_unlink(char *fname);
-int sys_open(char *fname,int flags,int mode);
-DIR *sys_opendir(char *dname);
-int sys_stat(char *fname,struct stat *sbuf);
-int sys_waitpid(pid_t pid,int *status,int options);
-int sys_lstat(char *fname,struct stat *sbuf);
-int sys_mkdir(char *dname,int mode);
-int sys_rmdir(char *dname);
-int sys_chdir(char *dname);
-int sys_utime(char *fname,struct utimbuf *times);
-int sys_rename(char *from, char *to);
-int sys_chmod(char *fname,int mode);
-char *sys_getwd(char *s);
-int sys_chown(char *fname,int uid,int gid);
-int sys_chroot(char *dname);
-struct hostent *sys_gethostbyname(char *name);
-
-/*The following definitions come from testparm.c */
-
-
-/*The following definitions come from testprns.c */
-
-int main(int argc, char *argv[]);
-
-/*The following definitions come from time.c */
-
-void GetTimeOfDay(struct timeval *tval);
-void TimeInit(void);
-int TimeDiff(time_t t);
-struct tm *LocalTime(time_t *t);
-time_t interpret_long_date(char *p);
-void put_long_date(char *p,time_t t);
-void put_dos_date(char *buf,int offset,time_t unixdate);
-void put_dos_date2(char *buf,int offset,time_t unixdate);
-void put_dos_date3(char *buf,int offset,time_t unixdate);
-time_t make_unix_date(void *date_ptr);
-time_t make_unix_date2(void *date_ptr);
-time_t make_unix_date3(void *date_ptr);
-BOOL set_filetime(char *fname,time_t mtime);
-char *timestring(void );
-
-/*The following definitions come from trans2.c */
-
-int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_transs2(char *inbuf,char *outbuf,int length,int bufsize);
-int reply_trans2(char *inbuf,char *outbuf,int length,int bufsize);
-
-/*The following definitions come from ufc.c */
-
-char *ufc_crypt(char *key,char *salt);
-
-/*The following definitions come from uid.c */
-
-void init_uid(void);
-BOOL become_guest(void);
-BOOL become_user(int cnum, uint16 vuid);
-BOOL unbecome_user(void );
-int smbrun(char *cmd,char *outfile,BOOL shared);
-
-/*The following definitions come from username.c */
-
-char *get_home_dir(char *user);
-void map_username(char *user);
-struct passwd *Get_Pwnam(char *user,BOOL allow_change);
-BOOL user_in_list(char *user,char *list);
-
-/*The following definitions come from util.c */
-
-void setup_logging(char *pname,BOOL interactive);
-void reopen_logs(void);
-char *tmpdir(void);
-BOOL is_a_socket(int fd);
-BOOL next_token(char **ptr,char *buff,char *sep);
-char **toktocliplist(int *ctok, char *sep);
-void *MemMove(void *dest,void *src,int size);
-void array_promote(char *array,int elsize,int element);
-void set_socket_options(int fd, char *options);
-void close_sockets(void );
-BOOL in_group(gid_t group, int current_gid, int ngroups, int *groups);
-char *StrCpy(char *dest,char *src);
-char *StrnCpy(char *dest,char *src,int n);
-void putip(void *dest,void *src);
-int name_mangle( char *In, char *Out, char name_type );
-BOOL file_exist(char *fname,struct stat *sbuf);
-time_t file_modtime(char *fname);
-BOOL directory_exist(char *dname,struct stat *st);
-uint32 file_size(char *file_name);
-char *attrib_string(int mode);
-int StrCaseCmp(char *s, char *t);
-int StrnCaseCmp(char *s, char *t, int n);
-BOOL strequal(char *s1, char *s2);
-BOOL strnequal(char *s1,char *s2,int n);
-BOOL strcsequal(char *s1,char *s2);
-void strlower(char *s);
-void strupper(char *s);
-void strnorm(char *s);
-BOOL strisnormal(char *s);
-void string_replace(char *s,char oldc,char newc);
-void unix_format(char *fname);
-void dos_format(char *fname);
-void show_msg(char *buf);
-int smb_len(char *buf);
-void _smb_setlen(char *buf,int len);
-void smb_setlen(char *buf,int len);
-int set_message(char *buf,int num_words,int num_bytes,BOOL zero);
-int smb_numwords(char *buf);
-int smb_buflen(char *buf);
-int smb_buf_ofs(char *buf);
-char *smb_buf(char *buf);
-int smb_offset(char *p,char *buf);
-char *skip_string(char *buf,int n);
-BOOL trim_string(char *s,char *front,char *back);
-void dos_clean_name(char *s);
-void unix_clean_name(char *s);
-int ChDir(char *path);
-char *GetWd(char *str);
-BOOL reduce_name(char *s,char *dir,BOOL widelinks);
-void expand_mask(char *Mask,BOOL doext);
-BOOL strhasupper(char *s);
-BOOL strhaslower(char *s);
-int count_chars(char *s,char c);
-void make_dir_struct(char *buf,char *mask,char *fname,unsigned int size,int mode,time_t date);
-void close_low_fds(void);
-int set_blocking(int fd, BOOL set);
-int write_socket(int fd,char *buf,int len);
-int read_udp_socket(int fd,char *buf,int len);
-int read_with_timeout(int fd,char *buf,int mincnt,int maxcnt,long time_out);
-int read_max_udp(int fd,char *buffer,int bufsize,int maxtime);
-int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
-BOOL send_keepalive(int client);
-int read_data(int fd,char *buffer,int N);
-int write_data(int fd,char *buffer,int N);
-int transfer_file(int infd,int outfd,int n,char *header,int headlen,int align);
-int read_smb_length(int fd,char *inbuf,int timeout);
-BOOL receive_smb(int fd,char *buffer, int timeout);
-BOOL receive_local_message(int fd, char *buffer, int buffer_len, int timeout);
-BOOL push_local_message(char *buf, int msg_len);
-BOOL receive_message_or_smb(int smbfd, int oplock_fd,
- char *buffer, int buffer_len,
- int timeout, BOOL *got_smb);
-BOOL send_smb(int fd,char *buffer);
-char *name_ptr(char *buf,int ofs);
-int name_extract(char *buf,int ofs,char *name);
-int name_len( char *s );
-BOOL send_one_packet(char *buf,int len,struct in_addr ip,int port,int type);
-void msleep(int t);
-BOOL in_list(char *s,char *list,BOOL casesensitive);
-BOOL string_init(char **dest,char *src);
-void string_free(char **s);
-BOOL string_set(char **dest,char *src);
-BOOL string_sub(char *s,char *pattern,char *insert);
-BOOL do_match(char *str, char *regexp, int case_sig);
-BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2);
-void become_daemon(void);
-BOOL yesno(char *p);
-char *fgets_slash(char *s2,int maxlen,FILE *f);
-int set_filelen(int fd, long len);
-int byte_checksum(char *buf,int len);
-char *dirname_dos(char *path,char *buf);
-void *Realloc(void *p,int size);
-void Abort(void );
-BOOL get_myname(char *my_name,struct in_addr *ip);
-BOOL ip_equal(struct in_addr ip1,struct in_addr ip2);
-int open_socket_in(int type, int port, int dlevel,uint32 socket_addr);
-int open_socket_out(int type, struct in_addr *addr, int port ,int timeout);
-int interpret_protocol(char *str,int def);
-int interpret_security(char *str,int def);
-uint32 interpret_addr(char *str);
-struct in_addr *interpret_addr2(char *str);
-BOOL zero_ip(struct in_addr ip);
-void reset_globals_after_fork();
-char *client_name(void);
-char *client_addr(void);
-void standard_sub_basic(char *str);
-BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask);
-int PutUniCode(char *dst,char *src);
-struct hostent *Get_Hostbyname(char *name);
-BOOL process_exists(int pid);
-char *uidtoname(int uid);
-char *gidtoname(int gid);
-void BlockSignals(BOOL block,int signum);
-void ajt_panic(void);
-char *readdirname(void *p);
-BOOL is_in_path(char *name, name_compare_entry *namelist);
-void set_namearray(name_compare_entry **ppname_array, char *namelist);
-void free_namearray(name_compare_entry *name_array);
-BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type);
-int file_lock(char *name,int timeout);
-void file_unlock(int fd);
-BOOL is_myname(char *s);
-void set_remote_arch(enum remote_arch_types type);
-enum remote_arch_types get_remote_arch();
-char *skip_unicode_string(char *buf,int n);
-char *unistr2(uint16 *buf);
-char *unistr(char *buf);
-int unistrncpy(char *dst, char *src, int len);
-int unistrcpy(char *dst, char *src);
-void fstrcpy(char *dest, char *src);
-void pstrcpy(char *dest, char *src);
-char *align4(char *q, char *base);
-char *align2(char *q, char *base);
-char *align_offset(char *q, char *base, int align_offset_len);
diff --git a/source/include/smb.h b/source/include/smb.h
deleted file mode 100644
index 54ce9e88e88..00000000000
--- a/source/include/smb.h
+++ /dev/null
@@ -1,1694 +0,0 @@
-/*
- 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
-
- 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
-
-#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
-
-/* Default number of hash buckets used in shared memory share mode */
-#ifndef SHMEM_HASH_SIZE
-#define SHMEM_HASH_SIZE 113
-#endif
-
-#define NMB_PORT 137
-#define DGRAM_PORT 138
-#define SMB_PORT 139
-
-#define False (0)
-#define True (1)
-#define BOOLSTR(b) ((b) ? "Yes" : "No")
-#define BITSETB(ptr,bit) ((((char *)ptr)[0] & (1<<(bit)))!=0)
-#define BITSETW(ptr,bit) ((SVAL(ptr,0) & (1<<(bit)))!=0)
-#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((char *)(p1)) - (char *)(p2)))
-
-typedef int BOOL;
-
-/* offset in shared memory */
-typedef int smb_shm_offset_t;
-#define NULL_OFFSET (smb_shm_offset_t)(0)
-
-
-/*
- Samba needs type definitions for int16, int32, uint16 and uint32.
-
- Normally these are signed and unsigned 16 and 32 bit integers, but
- they actually only need to be at least 16 and 32 bits
- respectively. Thus if your word size is 8 bytes just defining them
- as signed and unsigned int will work.
-*/
-
-/* afs/stds.h defines int16 and int32 */
-#ifndef AFS_AUTH
-typedef short int16;
-typedef int int32;
-#endif
-
-#ifndef uint8
-typedef unsigned char uint8;
-#endif
-
-#ifndef uint16
-typedef unsigned short uint16;
-#endif
-
-#ifndef uint32
-typedef unsigned int uint32;
-#endif
-
-#ifndef uchar
-#define uchar unsigned char
-#endif
-#ifndef int16
-#define int16 short
-#endif
-#ifndef uint16
-#define uint16 unsigned short
-#endif
-#ifndef uint32
-#define uint32 unsigned int
-#endif
-
-#define SIZEOFWORD 2
-
-#ifndef DEF_CREATE_MASK
-#define DEF_CREATE_MASK (0755)
-#endif
-
-/* 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;
-
-#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
-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
-
-/* share types */
-#define STYPE_DISKTREE 0 /* Disk drive */
-#define STYPE_PRINTQ 1 /* Spooler queue */
-#define STYPE_DEVICE 2 /* Serial device */
-#define STYPE_IPC 3 /* Interprocess communication (IPC) */
-
-/* SMB X/Open error codes for the ERRdos error class */
-#define ERRbadfunc 1 /* Invalid function (or system call) */
-#define ERRbadfile 2 /* File not found (pathname error) */
-#define ERRbadpath 3 /* Directory not found */
-#define ERRnofids 4 /* Too many open files */
-#define ERRnoaccess 5 /* Access denied */
-#define ERRbadfid 6 /* Invalid fid */
-#define ERRnomem 8 /* Out of memory */
-#define ERRbadmem 9 /* Invalid memory block address */
-#define ERRbadenv 10 /* Invalid environment */
-#define ERRbadaccess 12 /* Invalid open mode */
-#define ERRbaddata 13 /* Invalid data (only from ioctl call) */
-#define ERRres 14 /* reserved */
-#define ERRbaddrive 15 /* Invalid drive */
-#define ERRremcd 16 /* Attempt to delete current directory */
-#define ERRdiffdevice 17 /* rename/move across different filesystems */
-#define ERRnofiles 18 /* no more files found in file search */
-#define ERRbadshare 32 /* Share mode on file conflict with open mode */
-#define ERRlock 33 /* Lock request conflicts with existing lock */
-#define ERRfilexists 80 /* File in operation already exists */
-#define ERRcannotopen 110 /* Cannot open the file specified */
-#define ERRunknownlevel 124
-#define ERRbadpipe 230 /* Named pipe invalid */
-#define ERRpipebusy 231 /* All instances of pipe are busy */
-#define ERRpipeclosing 232 /* named pipe close in progress */
-#define ERRnotconnected 233 /* No process on other end of named pipe */
-#define ERRmoredata 234 /* More data to be returned */
-#define ERRbaddirectory 267 /* Invalid directory name in a path. */
-#define ERROR_EAS_DIDNT_FIT 275 /* Extended attributes didn't fit */
-#define ERROR_EAS_NOT_SUPPORTED 282 /* Extended attributes not supported */
-#define ERRunknownipc 2142
-
-
-/* here's a special one from observing NT */
-#define ERRnoipc 66 /* don't support ipc */
-
-/* Error codes for the ERRSRV class */
-
-#define ERRerror 1 /* Non specific error code */
-#define ERRbadpw 2 /* Bad password */
-#define ERRbadtype 3 /* reserved */
-#define ERRaccess 4 /* No permissions to do the requested operation */
-#define ERRinvnid 5 /* tid invalid */
-#define ERRinvnetname 6 /* Invalid servername */
-#define ERRinvdevice 7 /* Invalid device */
-#define ERRqfull 49 /* Print queue full */
-#define ERRqtoobig 50 /* Queued item too big */
-#define ERRinvpfid 52 /* Invalid print file in smb_fid */
-#define ERRsmbcmd 64 /* Unrecognised command */
-#define ERRsrverror 65 /* smb server internal error */
-#define ERRfilespecs 67 /* fid and pathname invalid combination */
-#define ERRbadlink 68 /* reserved */
-#define ERRbadpermits 69 /* Access specified for a file is not valid */
-#define ERRbadpid 70 /* reserved */
-#define ERRsetattrmode 71 /* attribute mode invalid */
-#define ERRpaused 81 /* Message server paused */
-#define ERRmsgoff 82 /* Not receiving messages */
-#define ERRnoroom 83 /* No room for message */
-#define ERRrmuns 87 /* too many remote usernames */
-#define ERRtimeout 88 /* operation timed out */
-#define ERRnoresource 89 /* No resources currently available for request. */
-#define ERRtoomanyuids 90 /* too many userids */
-#define ERRbaduid 91 /* bad userid */
-#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
-#define ERRuseSTD 251 /* temporarily unable to use raw mode, use standard mode */
-#define ERRcontMPX 252 /* resume MPX mode */
-#define ERRbadPW /* reserved */
-#define ERRnosupport 0xFFFF
-#define ERRunknownsmb 22 /* from NT 3.5 response */
-
-
-/* Error codes for the ERRHRD class */
-
-#define ERRnowrite 19 /* read only media */
-#define ERRbadunit 20 /* Unknown device */
-#define ERRnotready 21 /* Drive not ready */
-#define ERRbadcmd 22 /* Unknown command */
-#define ERRdata 23 /* Data (CRC) error */
-#define ERRbadreq 24 /* Bad request structure length */
-#define ERRseek 25
-#define ERRbadmedia 26
-#define ERRbadsector 27
-#define ERRnopaper 28
-#define ERRwrite 29 /* write fault */
-#define ERRread 30 /* read fault */
-#define ERRgeneral 31 /* General hardware failure */
-#define ERRwrongdisk 34
-#define ERRFCBunavail 35
-#define ERRsharebufexc 36 /* share buffer exceeded */
-#define ERRdiskfull 39
-
-
-typedef char pstring[1024];
-typedef char fstring[128];
-typedef fstring string;
-
-
-/* NETLOGON opcodes and data structures */
-
-#define NET_QUERYFORPDC 7 /* Query for PDC */
-#define NET_QUERYFORPDC_R 12 /* Response to Query for PDC */
-#define NET_SAMLOGON 18
-#define NET_SAMLOGON_R 19
-
-/* Allowable account control bits */
-#define ACB_DISABLED 1 /* 1 = User account disabled */
-#define ACB_HOMDIRREQ 2 /* 1 = Home directory required */
-#define ACB_PWNOTREQ 4 /* 1 = User password not required */
-#define ACB_TEMPDUP /* 1 = Temporary duplicate account */
-#define ACB_NORMAL /* 1 = Normal user account */
-#define ACB_MNS /* 1 = MNS logon user account */
-#define ACB_DOMTRUST /* 1 = Interdomain trust account */
-#define ACB_WSTRUST /* 1 = Workstation trust account */
-#define ACB_SVRTRUST /* 1 = Server trust account */
-#define ACB_PWNOEXP /* 1 = User password does not expire */
-#define ACB_AUTOLOCK /* 1 = Account auto locked */
-
-#define LSA_OPENPOLICY 0x2c
-#define LSA_QUERYINFOPOLICY 0x07
-#define LSA_ENUMTRUSTDOM 0x0d
-#define LSA_REQCHAL 0x04
-#define LSA_SVRPWSET 0x06
-#define LSA_SAMLOGON 0x02
-#define LSA_AUTH2 0x0f
-#define LSA_CLOSE 0x00
-
-/* unknown .... */
-#define LSA_OPENSECRET 0xFF
-#define LSA_LOOKUPSIDS 0xFE
-#define LSA_LOOKUPNAMES 0xFD
-#define LSA_SAMLOGOFF 0xFC
-
-
-/* 32 bit time (sec) since 01jan1970 - cifs6.txt, section 3.5, page 30 */
-typedef struct time_info
-{
- uint32 time;
-
-} UTIME;
-
-/* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */
-typedef struct nttime_info
-{
- uint32 low;
- uint32 high;
-
-} NTTIME;
-
-
-#define MAXSUBAUTHS 10 /* max sub authorities in a SID */
-
-/* DOM_SID - security id */
-typedef struct sid_info
-{
- uint8 sid_no; /* SID revision number */
- uint8 num_auths; /* number of sub-authorities */
- uint8 id_auth[6]; /* Identifier Authority */
- uint16 sub_auths[MAXSUBAUTHS]; /* pointer to sub-authorities. */
-
-} DOM_SID;
-
-/* UNIHDR - unicode string header */
-typedef struct unihdr_info
-{
- uint16 uni_max_len;
- uint16 uni_str_len;
- uint32 undoc; /* usually has a value of 4 */
-
-} UNIHDR;
-
-/* UNIHDR2 - unicode string header and undocumented buffer */
-typedef struct unihdr2_info
-{
- UNIHDR unihdr;
- uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */
-
-} UNIHDR2;
-
-/* clueless as to what maximum length should be */
-#define MAX_UNISTRLEN 1024
-
-/* UNISTR - unicode string size and buffer */
-typedef struct unistr_info
-{
- uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. ***MUST*** be null-terminated */
-
-} UNISTR;
-
-/* UNISTR2 - unicode string size and buffer */
-typedef struct unistr2_info
-{
- uint32 uni_max_len;
- uint32 undoc;
- uint32 uni_str_len;
- uint16 buffer[MAX_UNISTRLEN]; /* unicode characters. **NOT** necessarily null-terminated */
-
-} UNISTR2;
-
-/* DOM_SID2 - domain SID structure - SIDs stored in unicode */
-typedef struct domsid2_info
-{
- uint32 type; /* value is 5 */
- uint32 undoc; /* value is 0 */
-
- UNIHDR2 hdr; /* XXXX conflict between hdr and str for length */
- UNISTR str; /* XXXX conflict between hdr and str for length */
-
-} DOM_SID2;
-
-/* DOM_RID2 - domain RID structure */
-typedef struct domrid2_info
-{
- uint32 type; /* value is 5 */
- uint32 undoc; /* value is 5 */
- uint32 rid;
- uint32 rid_idx; /* don't know what this is */
-
-} DOM_RID2;
-
-/* DOM_LOG_INFO - login info */
-typedef struct log_info
-{
- uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */
- UNISTR2 uni_logon_srv; /* logon server name */
- UNISTR2 uni_acct_name; /* account name */
- uint16 sec_chan; /* secure channel type */
- UNISTR2 uni_comp_name; /* client machine name */
-
-} DOM_LOG_INFO;
-
-/* DOM_CHAL - challenge info */
-typedef struct chal_info
-{
- uint8 data[8]; /* credentials */
-
-} DOM_CHAL;
-
-/* DOM_CREDs - timestamped client or server credentials */
-typedef struct cred_info
-{
- DOM_CHAL challenge; /* credentials */
- UTIME timestamp; /* credential time-stamp */
-
-} DOM_CRED;
-
-/* DOM_CLNT_INFO - client info */
-typedef struct clnt_info
-{
- DOM_LOG_INFO login;
- DOM_CRED cred;
-
-} DOM_CLNT_INFO;
-
-/* DOM_LOGON_ID - logon id */
-typedef struct logon_info
-{
- uint32 low;
- uint32 high;
-
-} DOM_LOGON_ID;
-
-/* ARC4_OWF */
-typedef struct arc4_owf_info
-{
- uint8 data[16];
-
-} ARC4_OWF;
-
-
-/* DOM_ID_INFO_1 */
-typedef struct id_info_1
-{
- UNIHDR hdr_domain_name; /* domain name unicode header */
- uint32 param; /* param control */
- DOM_LOGON_ID logon_id; /* logon ID */
- UNIHDR hdr_user_name; /* user name unicode header */
- UNIHDR hdr_workgroup_name; /* workgroup name unicode header */
- ARC4_OWF arc4_lm_owf; /* arc4 LM OWF Password */
- ARC4_OWF arc4_nt_owf; /* arc4 NT OWF Password */
- UNISTR2 uni_domain_name; /* domain name unicode string */
- UNISTR2 uni_user_name; /* user name unicode string */
- UNISTR2 uni_workgroup_name; /* workgroup name unicode string */
-
-} DOM_ID_INFO_1;
-
-/* SAM_INFO - sam logon/off id structure */
-typedef struct sam_info
-{
- DOM_CLNT_INFO client;
- DOM_CRED rtn_cred; /* return credentials */
- uint16 logon_level;
- uint32 auth_level; /* undocumented */
-
- union
- {
- DOM_ID_INFO_1 id1; /* auth-level 1 */
-
- } auth;
-
-} DOM_SAM_INFO;
-
-/* DOM_GID - group id + user attributes */
-typedef struct gid_info
-{
- uint32 gid; /* group id */
- uint32 attr;
-
-} DOM_GID;
-
-/* RPC_HDR - ms rpc header */
-typedef struct rpc_hdr_info
-{
- uint8 major; /* 5 - RPC major version */
- uint8 minor; /* 0 - RPC minor version */
- uint8 pkt_type; /* 2 - RPC response packet */
- uint8 frag; /* 3 - first frag + last frag */
- uint32 pack_type; /* 0x0000 0010 - packed data representation */
- uint16 frag_len; /* fragment length - data size (bytes) inc header and tail. */
- uint16 auth_len; /* 0 - authentication length */
- uint32 call_id; /* call identifier. matches 12th uint32 of incoming RPC data. */
- uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */
- uint16 context_id; /* 0 - presentation context identifier */
- uint8 cancel_count; /* 0 - cancel count */
- uint8 reserved; /* 0 - reserved */
-
-} RPC_HDR;
-
-/* DOM_QUERY - info class 3 and 5 LSA Query response */
-typedef struct dom_query_info
-{
- uint16 uni_dom_max_len; /* domain name string length * 2 */
- uint16 padding; /* 2 padding bytes? */
- uint16 uni_dom_str_len; /* domain name string length * 2 */
- uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
- uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
- UNISTR2 uni_domain_name; /* domain name (unicode string) */
- DOM_SID dom_sid; /* domain SID */
-
-} DOM_QUERY;
-
-/* level 5 is same as level 3. we hope. */
-typedef DOM_QUERY DOM_QUERY_3;
-typedef DOM_QUERY DOM_QUERY_5;
-
-#define POL_HND_SIZE 20
-
-/* LSA_POL_HND */
-typedef struct lsa_policy_info
-{
- uint8 data[POL_HND_SIZE]; /* policy handle */
-
-} LSA_POL_HND;
-
-
-/* LSA_R_OPEN_POL - response to LSA Open Policy */
-typedef struct lsa_r_open_pol_info
-{
- LSA_POL_HND pol; /* policy handle */
-
- uint32 status; /* return code */
-
-} LSA_R_OPEN_POL;
-
-/* LSA_Q_QUERY_INFO - LSA query info policy */
-typedef struct lsa_query_info
-{
- LSA_POL_HND pol; /* policy handle */
- uint16 info_class; /* info class */
-
-} LSA_Q_QUERY_INFO;
-
-/* LSA_R_QUERY_INFO - response to LSA query info policy */
-typedef struct lsa_r_query_info
-{
- uint32 undoc_buffer; /* undocumented buffer pointer */
- uint16 info_class; /* info class (same as info class in request) */
-
- union
- {
- DOM_QUERY_3 id3;
- DOM_QUERY_5 id5;
- } dom;
-
- uint32 status; /* return code */
-
-} LSA_R_QUERY_INFO;
-
-#define MAX_REF_DOMAINS 10
-
-/* DOM_R_REF */
-typedef struct dom_ref_info
-{
- uint32 undoc_buffer; /* undocumented buffer pointer. */
- uint32 num_ref_doms_1; /* num referenced domains? */
- uint32 buffer_dom_name; /* undocumented domain name buffer pointer. */
- uint32 max_entries; /* 32 - max number of entries */
- uint32 num_ref_doms_2; /* 4 - num referenced domains? */
-
- UNIHDR2 hdr_dom_name; /* domain name unicode string header */
- UNIHDR2 hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domain unicode string headers */
-
- UNISTR uni_dom_name; /* domain name unicode string */
- DOM_SID ref_dom[MAX_REF_DOMAINS]; /* referenced domain SIDs */
-
-} DOM_R_REF;
-
-#define MAX_LOOKUP_SIDS 10
-
-/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */
-typedef struct lsa_q_lookup_sids
-{
- LSA_POL_HND pol_hnd; /* policy handle */
- uint32 num_entries;
- uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */
- uint32 buffer_dom_name; /* undocumented domain name buffer pointer */
- uint32 buffer_lookup_sids[MAX_LOOKUP_SIDS]; /* undocumented domain SID pointers to be looked up. */
- DOM_SID dom_sids[MAX_LOOKUP_SIDS]; /* domain SIDs to be looked up. */
- uint8 undoc[16]; /* completely undocumented 16 bytes */
-
-} LSA_Q_LOOKUP_SIDS;
-
-/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */
-typedef struct lsa_r_lookup_sids
-{
- DOM_R_REF dom_ref; /* domain reference info */
-
- uint32 num_entries;
- uint32 undoc_buffer; /* undocumented buffer pointer */
- uint32 num_entries2;
-
- DOM_SID2 dom_sid[MAX_LOOKUP_SIDS]; /* domain SIDs being looked up */
-
- uint32 num_entries3;
-
- uint32 status; /* return code */
-
-} LSA_R_LOOKUP_SIDS;
-
-/* DOM_NAME - XXXX not sure about this structure */
-typedef struct dom_name_info
-{
- uint32 uni_str_len;
- UNISTR str;
-
-} DOM_NAME;
-
-
-#define UNKNOWN_LEN 1
-
-/* LSA_Q_LOOKUP_RIDS - LSA Lookup RIDs */
-typedef struct lsa_q_lookup_rids
-{
-
- LSA_POL_HND pol_hnd; /* policy handle */
- uint32 num_entries;
- uint32 num_entries2;
- uint32 buffer_dom_sid; /* undocumented domain SID buffer pointer */
- uint32 buffer_dom_name; /* undocumented domain name buffer pointer */
- DOM_NAME lookup_name[MAX_LOOKUP_SIDS]; /* names to be looked up */
- uint8 undoc[UNKNOWN_LEN]; /* completely undocumented bytes of unknown length */
-
-} LSA_Q_LOOKUP_RIDS;
-
-/* LSA_R_LOOKUP_RIDS - response to LSA Lookup Names */
-typedef struct lsa_r_lookup_rids
-{
- DOM_R_REF dom_ref; /* domain reference info */
-
- uint32 num_entries;
- uint32 undoc_buffer; /* undocumented buffer pointer */
-
- uint32 num_entries2;
- DOM_RID2 dom_rid[MAX_LOOKUP_SIDS]; /* domain RIDs being looked up */
-
- uint32 num_entries3;
-
- uint32 status; /* return code */
-
-} LSA_R_LOOKUP_RIDS;
-
-
-
-/* NEG_FLAGS */
-typedef struct lsa_neg_flags_info
-{
- uint32 neg_flags; /* negotiated flags */
-
-} NEG_FLAGS;
-
-
-/* LSA_Q_REQ_CHAL */
-typedef struct lsa_q_req_chal_info
-{
- uint32 undoc_buffer; /* undocumented buffer pointer */
- UNISTR2 uni_logon_srv; /* logon server unicode string */
- UNISTR2 uni_logon_clnt; /* logon client unicode string */
- DOM_CHAL clnt_chal; /* client challenge */
-
-} LSA_Q_REQ_CHAL;
-
-
-/* LSA_R_REQ_CHAL */
-typedef struct lsa_r_req_chal_info
-{
- DOM_CHAL srv_chal; /* server challenge */
-
- uint32 status; /* return code */
-
-} LSA_R_REQ_CHAL;
-
-
-
-/* LSA_Q_AUTH_2 */
-typedef struct lsa_q_auth2_info
-{
- DOM_LOG_INFO clnt_id; /* client identification info */
- DOM_CHAL clnt_chal; /* client-calculated credentials */
-
- NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */
-
-} LSA_Q_AUTH_2;
-
-
-/* LSA_R_AUTH_2 */
-typedef struct lsa_r_auth2_info
-{
- DOM_CHAL srv_chal; /* server-calculated credentials */
- NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */
-
- uint32 status; /* return code */
-
-} LSA_R_AUTH_2;
-
-
-/* LSA_Q_SRV_PWSET */
-typedef struct lsa_q_srv_pwset_info
-{
- DOM_CLNT_INFO clnt_id; /* client identification/authentication info */
- char pwd[16]; /* new password - undocumented. */
-
-} LSA_Q_SRV_PWSET;
-
-/* LSA_R_SRV_PWSET */
-typedef struct lsa_r_srv_pwset_info
-{
- DOM_CRED srv_cred; /* server-calculated credentials */
-
- uint32 status; /* return code */
-
-} LSA_R_SRV_PWSET;
-
-#define LSA_MAX_GROUPS 32
-#define LSA_MAX_SIDS 32
-
-/* LSA_USER_INFO */
-typedef struct lsa_q_user_info
-{
- uint32 undoc_buffer;
-
- NTTIME logon_time; /* logon time */
- NTTIME logoff_time; /* logoff time */
- NTTIME kickoff_time; /* kickoff time */
- NTTIME pass_last_set_time; /* password last set time */
- NTTIME pass_can_change_time; /* password can change time */
- NTTIME pass_must_change_time; /* password must change time */
-
- UNIHDR hdr_user_name; /* username unicode string header */
- UNIHDR hdr_full_name; /* user's full name unicode string header */
- UNIHDR hdr_logon_script; /* logon script unicode string header */
- UNIHDR hdr_profile_path; /* profile path unicode string header */
- UNIHDR hdr_home_dir; /* home directory unicode string header */
- UNIHDR hdr_dir_drive; /* home directory drive unicode string header */
-
- uint16 logon_count; /* logon count */
- uint16 bad_pw_count; /* bad password count */
-
- uint32 user_id; /* User ID */
- uint32 group_id; /* Group ID */
- uint32 num_groups; /* num groups */
- uint32 buffer_groups; /* undocumented buffer pointer to groups. */
- uint32 user_flgs; /* user flags */
-
- char sess_key[16]; /* unused user session key */
-
- UNIHDR hdr_logon_srv; /* logon server unicode string header */
- UNIHDR hdr_logon_dom; /* logon domain unicode string header */
-
- uint32 buffer_dom_id; /* undocumented logon domain id pointer */
- char padding[40]; /* unused padding bytes? */
-
- uint32 num_other_sids; /* 0 - num_sids */
- uint32 buffer_other_sids; /* NULL - undocumented pointer to SIDs. */
-
- UNISTR2 uni_user_name; /* username unicode string */
- UNISTR2 uni_full_name; /* user's full name unicode string */
- UNISTR2 uni_logon_script; /* logon script unicode string */
- UNISTR2 uni_profile_path; /* profile path unicode string */
- UNISTR2 uni_home_dir; /* home directory unicode string */
- UNISTR2 uni_dir_drive; /* home directory drive unicode string */
-
- uint32 num_groups2; /* num groups */
- DOM_GID gids[LSA_MAX_GROUPS]; /* group info */
-
- UNISTR2 uni_logon_srv; /* logon server unicode string */
- UNISTR2 uni_logon_dom; /* logon domain unicode string */
-
- DOM_SID dom_sid; /* domain SID */
- DOM_SID other_sids[LSA_MAX_SIDS]; /* undocumented - domain SIDs */
-
-} LSA_USER_INFO;
-
-
-/* LSA_Q_SAM_LOGON */
-typedef struct lsa_q_sam_logon_info
-{
- DOM_SAM_INFO sam_id;
-
-} LSA_Q_SAM_LOGON;
-
-/* LSA_R_SAM_LOGON */
-typedef struct lsa_r_sam_logon_info
-{
- uint32 buffer_creds; /* undocumented buffer pointer */
- DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
-
- uint32 buffer_user;
- LSA_USER_INFO *user;
-
- uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */
-
- uint32 status; /* return code */
-
-} LSA_R_SAM_LOGON;
-
-
-/* LSA_Q_SAM_LOGOFF */
-typedef struct lsa_q_sam_logoff_info
-{
- DOM_SAM_INFO sam_id;
-
-} LSA_Q_SAM_LOGOFF;
-
-/* LSA_R_SAM_LOGOFF */
-typedef struct lsa_r_sam_logoff_info
-{
- uint32 buffer_creds; /* undocumented buffer pointer */
- DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */
-
- uint32 status; /* return code */
-
-} LSA_R_SAM_LOGOFF;
-
-/*
-
-Yet to be turned into structures:
-
-6) \\MAILSLOT\NET\NTLOGON
--------------------------
-
-6.1) Query for PDC
-------------------
-
-Request:
-
- uint16 0x0007 - Query for PDC
- STR machine name
- STR response mailslot
- uint8[] padding to 2-byte align with start of mailslot.
- UNISTR machine name
- uint32 NTversion
- uint16 LMNTtoken
- uint16 LM20token
-
-Response:
-
- uint16 0x000A - Respose to Query for PDC
- STR machine name (in uppercase)
- uint8[] padding to 2-byte align with start of mailslot.
- UNISTR machine name
- UNISTR domain name
- uint32 NTversion (same as received in request)
- uint16 LMNTtoken (same as received in request)
- uint16 LM20token (same as received in request)
-
-
-6.2) SAM Logon
---------------
-
-Request:
-
- uint16 0x0012 - SAM Logon
- uint16 request count
- UNISTR machine name
- UNISTR user name
- STR response mailslot
- uint32 alloweable account
- uint32 domain SID size
- char[sid_size] domain SID, of sid_size bytes.
- uint8[] ???? padding to 4? 2? -byte align with start of mailslot.
- uint32 NTversion
- uint16 LMNTtoken
- uint16 LM20token
-
-Response:
-
- uint16 0x0013 - Response to SAM Logon
- UNISTR machine name
- UNISTR user name - workstation trust account
- UNISTR domain name
- uint32 NTversion
- uint16 LMNTtoken
- uint16 LM20token
-
-*/
-
-
-struct smb_passwd {
- int smb_userid;
- char *smb_name;
- unsigned char *smb_passwd; /* Null if no password */
- unsigned char *smb_nt_passwd; /* Null if no password */
- /* Other fields / flags may be added later */
-};
-
-
-struct current_user {
- int cnum, id;
- int uid, gid;
- int ngroups;
- gid_t *groups;
- int *igroups;
-};
-
-typedef struct
-{
- int size;
- int mode;
- int uid;
- int gid;
- /* these times are normally kept in GMT */
- time_t mtime;
- time_t atime;
- time_t ctime;
- pstring name;
-} file_info;
-
-
-/* Structure used when SMBwritebmpx is active */
-typedef struct
- {
- int wr_total_written; /* So we know when to discard this */
- int32 wr_timeout;
- int32 wr_errclass;
- int32 wr_error; /* Cached errors */
- BOOL wr_mode; /* write through mode) */
- BOOL wr_discard; /* discard all further data */
- } write_bmpx_struct;
-
-/*
- * Structure used to indirect fd's from the files_struct.
- * Needed as POSIX locking is based on file and process, not
- * file descriptor and process.
- */
-
-typedef struct
-{
- uint16 ref_count;
- uint32 dev;
- uint32 inode;
- int fd;
- int fd_readonly;
- int fd_writeonly;
- int real_open_flags;
-} file_fd_struct;
-
-typedef struct
-{
- int cnum;
- file_fd_struct *fd_ptr;
- int pos;
- uint32 size;
- int mode;
- int uid;
- char *mmap_ptr;
- uint32 mmap_size;
- write_bmpx_struct *wbmpx_ptr;
- struct timeval open_time;
- BOOL open;
- BOOL can_lock;
- BOOL can_read;
- BOOL can_write;
- BOOL share_mode;
- BOOL print_file;
- BOOL modified;
- BOOL granted_oplock;
- char *name;
-} files_struct;
-
-
-struct uid_cache {
- int entries;
- int list[UID_CACHE_SIZE];
-};
-
-typedef struct
-{
- char *name;
- BOOL is_wild;
-} name_compare_entry;
-
-typedef struct
-{
- int service;
- BOOL force_user;
- struct uid_cache uid_cache;
- void *dirptr;
- BOOL open;
- BOOL printer;
- BOOL ipc;
- BOOL read_only;
- BOOL admin_user;
- char *dirpath;
- char *connectpath;
- char *origpath;
- char *user; /* name of user who *opened* this connection */
- int uid; /* uid of user who *opened* this connection */
- int gid; /* gid of user who *opened* this connection */
- uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */
- /* following groups stuff added by ih */
- /* This groups info is valid for the user that *opened* the connection */
- int ngroups;
- gid_t *groups;
- int *igroups; /* an integer version - some OSes are broken :-( */
- time_t lastused;
- BOOL used;
- 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). */
-} connection_struct;
-
-
-typedef struct
-{
- int uid; /* uid of a validated user */
- int gid; /* gid of a validated user */
- fstring name; /* name of a validated user */
- BOOL guest;
- /* following groups stuff added by ih */
- /* This groups info is needed for when we become_user() for this uid */
- int user_ngroups;
- gid_t *user_groups;
- int *user_igroups; /* an integer version - some OSes are broken :-( */
-#if (defined(NETGROUP) && defined(AUTOMOUNT))
- char *home_share; /* to store NIS home of a user - simeon */
-#endif
- char *real_name; /* to store real name from password file - simeon */
-} user_struct;
-
-
-enum {LPQ_QUEUED,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING};
-
-typedef struct
-{
- int job;
- int size;
- int status;
- int priority;
- time_t time;
- char user[30];
- char file[100];
-} print_queue_struct;
-
-enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};
-
-typedef struct
-{
- fstring message;
- int status;
-} print_status_struct;
-
-/* used for server information: client, nameserv and ipc */
-struct server_info_struct
-{
- fstring name;
- uint32 type;
- fstring comment;
- fstring domain; /* used ONLY in ipc.c NOT namework.c */
- BOOL server_added; /* used ONLY in ipc.c NOT namework.c */
-};
-
-
-/* used for network interfaces */
-struct interface
-{
- struct interface *next;
- struct in_addr ip;
- struct in_addr bcast;
- struct in_addr nmask;
-};
-
-/* share mode record pointed to in shared memory hash bucket */
-typedef struct
-{
- smb_shm_offset_t next_offset; /* offset of next record in chain from hash bucket */
- int locking_version;
- int32 st_dev;
- int32 st_ino;
- int num_share_mode_entries;
- smb_shm_offset_t share_mode_entries; /* Chain of share mode entries for this file */
- char file_name[1];
-} share_mode_record;
-
-/* share mode entry pointed to by share_mode_record struct */
-typedef struct
-{
- smb_shm_offset_t next_share_mode_entry;
- int pid;
- uint16 op_port;
- uint16 op_type;
- int share_mode;
- struct timeval time;
-} share_mode_entry;
-
-/* struct returned by get_share_modes */
-typedef struct
-{
- int pid;
- uint16 op_port;
- uint16 op_type;
- int share_mode;
- struct timeval time;
-} min_share_mode_entry;
-
-/* Token returned by lock_share_entry (actually ignored by FAST_SHARE_MODES code) */
-typedef int share_lock_token;
-
-/* Conversion to hash entry index from device and inode numbers. */
-#define HASH_ENTRY(dev,ino) ((( (uint32)(dev) )* ( (uint32)(ino) )) % lp_shmem_hash_size())
-
-/* this is used for smbstatus */
-struct connect_record
-{
- int magic;
- int pid;
- int cnum;
- int uid;
- int gid;
- char name[24];
- char addr[24];
- char machine[128];
- time_t start;
-};
-
-#ifndef LOCKING_VERSION
-#define LOCKING_VERSION 4
-#endif /* LOCKING_VERSION */
-
-#if !defined(FAST_SHARE_MODES)
-/*
- * Defines for slow share modes.
- */
-
-/*
- * Locking file header lengths & offsets.
- */
-#define SMF_VERSION_OFFSET 0
-#define SMF_NUM_ENTRIES_OFFSET 4
-#define SMF_FILENAME_LEN_OFFSET 8
-#define SMF_HEADER_LENGTH 10
-
-#define SMF_ENTRY_LENGTH 20
-
-/*
- * Share mode record offsets.
- */
-
-#define SME_SEC_OFFSET 0
-#define SME_USEC_OFFSET 4
-#define SME_SHAREMODE_OFFSET 8
-#define SME_PID_OFFSET 12
-#define SME_PORT_OFFSET 16
-#define SME_OPLOCK_TYPE_OFFSET 18
-
-#endif /* FAST_SHARE_MODES */
-
-/* these are useful macros for checking validity of handles */
-#define VALID_FNUM(fnum) (((fnum) >= 0) && ((fnum) < MAX_OPEN_FILES))
-#define OPEN_FNUM(fnum) (VALID_FNUM(fnum) && Files[fnum].open)
-#define VALID_CNUM(cnum) (((cnum) >= 0) && ((cnum) < MAX_CONNECTIONS))
-#define OPEN_CNUM(cnum) (VALID_CNUM(cnum) && Connections[cnum].open)
-#define IS_IPC(cnum) (VALID_CNUM(cnum) && Connections[cnum].ipc)
-#define IS_PRINT(cnum) (VALID_CNUM(cnum) && Connections[cnum].printer)
-#define FNUM_OK(fnum,c) (OPEN_FNUM(fnum) && (c)==Files[fnum].cnum)
-
-#define CHECK_FNUM(fnum,c) if (!FNUM_OK(fnum,c)) \
- return(ERROR(ERRDOS,ERRbadfid))
-#define CHECK_READ(fnum) if (!Files[fnum].can_read) \
- return(ERROR(ERRDOS,ERRbadaccess))
-#define CHECK_WRITE(fnum) if (!Files[fnum].can_write) \
- return(ERROR(ERRDOS,ERRbadaccess))
-#define CHECK_ERROR(fnum) if (HAS_CACHED_ERROR(fnum)) \
- return(CACHED_ERROR(fnum))
-
-/* translates a connection number into a service number */
-#define SNUM(cnum) (Connections[cnum].service)
-
-/* access various service details */
-#define SERVICE(snum) (lp_servicename(snum))
-#define PRINTCAP (lp_printcapname())
-#define PRINTCOMMAND(snum) (lp_printcommand(snum))
-#define PRINTERNAME(snum) (lp_printername(snum))
-#define CAN_WRITE(cnum) (OPEN_CNUM(cnum) && !Connections[cnum].read_only)
-#define VALID_SNUM(snum) (lp_snum_ok(snum))
-#define GUEST_OK(snum) (VALID_SNUM(snum) && lp_guest_ok(snum))
-#define GUEST_ONLY(snum) (VALID_SNUM(snum) && lp_guest_only(snum))
-#define CAN_SETDIR(snum) (!lp_no_set_dir(snum))
-#define CAN_PRINT(cnum) (OPEN_CNUM(cnum) && lp_print_ok(SNUM(cnum)))
-#define POSTSCRIPT(cnum) (OPEN_CNUM(cnum) && lp_postscript(SNUM(cnum)))
-#define MAP_HIDDEN(cnum) (OPEN_CNUM(cnum) && lp_map_hidden(SNUM(cnum)))
-#define MAP_SYSTEM(cnum) (OPEN_CNUM(cnum) && lp_map_system(SNUM(cnum)))
-#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 SMBENCRYPT() (lp_encrypted_passwords())
-
-/* the basic packet size, assuming no words or bytes */
-#define smb_size 39
-
-/* offsets into message for common items */
-#define smb_com 8
-#define smb_rcls 9
-#define smb_reh 10
-#define smb_err 11
-#define smb_flg 13
-#define smb_flg2 14
-#define smb_reb 13
-#define smb_tid 28
-#define smb_pid 30
-#define smb_uid 32
-#define smb_mid 34
-#define smb_wct 36
-#define smb_vwv 37
-#define smb_vwv0 37
-#define smb_vwv1 39
-#define smb_vwv2 41
-#define smb_vwv3 43
-#define smb_vwv4 45
-#define smb_vwv5 47
-#define smb_vwv6 49
-#define smb_vwv7 51
-#define smb_vwv8 53
-#define smb_vwv9 55
-#define smb_vwv10 57
-#define smb_vwv11 59
-#define smb_vwv12 61
-#define smb_vwv13 63
-#define smb_vwv14 65
-#define smb_vwv15 67
-#define smb_vwv16 69
-#define smb_vwv17 71
-
-
-/* the complete */
-#define SMBmkdir 0x00 /* create directory */
-#define SMBrmdir 0x01 /* delete directory */
-#define SMBopen 0x02 /* open file */
-#define SMBcreate 0x03 /* create file */
-#define SMBclose 0x04 /* close file */
-#define SMBflush 0x05 /* flush file */
-#define SMBunlink 0x06 /* delete file */
-#define SMBmv 0x07 /* rename file */
-#define SMBgetatr 0x08 /* get file attributes */
-#define SMBsetatr 0x09 /* set file attributes */
-#define SMBread 0x0A /* read from file */
-#define SMBwrite 0x0B /* write to file */
-#define SMBlock 0x0C /* lock byte range */
-#define SMBunlock 0x0D /* unlock byte range */
-#define SMBctemp 0x0E /* create temporary file */
-#define SMBmknew 0x0F /* make new file */
-#define SMBchkpth 0x10 /* check directory path */
-#define SMBexit 0x11 /* process exit */
-#define SMBlseek 0x12 /* seek */
-#define SMBtcon 0x70 /* tree connect */
-#define SMBtconX 0x75 /* tree connect and X*/
-#define SMBtdis 0x71 /* tree disconnect */
-#define SMBnegprot 0x72 /* negotiate protocol */
-#define SMBdskattr 0x80 /* get disk attributes */
-#define SMBsearch 0x81 /* search directory */
-#define SMBsplopen 0xC0 /* open print spool file */
-#define SMBsplwr 0xC1 /* write to print spool file */
-#define SMBsplclose 0xC2 /* close print spool file */
-#define SMBsplretq 0xC3 /* return print queue */
-#define SMBsends 0xD0 /* send single block message */
-#define SMBsendb 0xD1 /* send broadcast message */
-#define SMBfwdname 0xD2 /* forward user name */
-#define SMBcancelf 0xD3 /* cancel forward */
-#define SMBgetmac 0xD4 /* get machine name */
-#define SMBsendstrt 0xD5 /* send start of multi-block message */
-#define SMBsendend 0xD6 /* send end of multi-block message */
-#define SMBsendtxt 0xD7 /* send text of multi-block message */
-
-/* Core+ protocol */
-#define SMBlockread 0x13 /* Lock a range and read */
-#define SMBwriteunlock 0x14 /* Unlock a range then write */
-#define SMBreadbraw 0x1a /* read a block of data with no smb header */
-#define SMBwritebraw 0x1d /* write a block of data with no smb header */
-#define SMBwritec 0x20 /* secondary write request */
-#define SMBwriteclose 0x2c /* write a file then close it */
-
-/* dos extended protocol */
-#define SMBreadBraw 0x1A /* read block raw */
-#define SMBreadBmpx 0x1B /* read block multiplexed */
-#define SMBreadBs 0x1C /* read block (secondary response) */
-#define SMBwriteBraw 0x1D /* write block raw */
-#define SMBwriteBmpx 0x1E /* write block multiplexed */
-#define SMBwriteBs 0x1F /* write block (secondary request) */
-#define SMBwriteC 0x20 /* write complete response */
-#define SMBsetattrE 0x22 /* set file attributes expanded */
-#define SMBgetattrE 0x23 /* get file attributes expanded */
-#define SMBlockingX 0x24 /* lock/unlock byte ranges and X */
-#define SMBtrans 0x25 /* transaction - name, bytes in/out */
-#define SMBtranss 0x26 /* transaction (secondary request/response) */
-#define SMBioctl 0x27 /* IOCTL */
-#define SMBioctls 0x28 /* IOCTL (secondary request/response) */
-#define SMBcopy 0x29 /* copy */
-#define SMBmove 0x2A /* move */
-#define SMBecho 0x2B /* echo */
-#define SMBopenX 0x2D /* open and X */
-#define SMBreadX 0x2E /* read and X */
-#define SMBwriteX 0x2F /* write and X */
-#define SMBsesssetupX 0x73 /* Session Set Up & X (including User Logon) */
-#define SMBffirst 0x82 /* find first */
-#define SMBfunique 0x83 /* find unique */
-#define SMBfclose 0x84 /* find close */
-#define SMBinvalid 0xFE /* invalid command */
-
-/* Extended 2.0 protocol */
-#define SMBtrans2 0x32 /* TRANS2 protocol set */
-#define SMBtranss2 0x33 /* TRANS2 protocol set, secondary command */
-#define SMBfindclose 0x34 /* Terminate a TRANSACT2_FINDFIRST */
-#define SMBfindnclose 0x35 /* Terminate a TRANSACT2_FINDNOTIFYFIRST */
-#define SMBulogoffX 0x74 /* user logoff */
-
-/* NT SMB extensions. */
-#define SMBnttrans 0xA0 /* NT transact */
-#define SMBnttranss 0xA1 /* NT transact secondary */
-#define SMBntcreateX 0xA2 /* NT create and X */
-#define SMBntcancel 0xA4 /* NT cancel */
-
-/* These are the TRANS2 sub commands */
-#define TRANSACT2_OPEN 0
-#define TRANSACT2_FINDFIRST 1
-#define TRANSACT2_FINDNEXT 2
-#define TRANSACT2_QFSINFO 3
-#define TRANSACT2_SETFSINFO 4
-#define TRANSACT2_QPATHINFO 5
-#define TRANSACT2_SETPATHINFO 6
-#define TRANSACT2_QFILEINFO 7
-#define TRANSACT2_SETFILEINFO 8
-#define TRANSACT2_FSCTL 9
-#define TRANSACT2_IOCTL 0xA
-#define TRANSACT2_FINDNOTIFYFIRST 0xB
-#define TRANSACT2_FINDNOTIFYNEXT 0xC
-#define TRANSACT2_MKDIR 0xD
-#define TRANSACT2_SESSION_SETUP 0xE
-#define TRANSACT2_GET_DFS_REFERRAL 0x10
-#define TRANSACT2_REPORT_DFS_INCONSISTANCY 0x11
-
-/* These are the NT transact sub commands. */
-#define NT_TRANSACT_CREATE 1
-#define NT_TRANSACT_IOCTL 2
-#define NT_TRANSACT_SET_SECURITY_DESC 3
-#define NT_TRANSACT_NOTIFY_CHANGE 4
-#define NT_TRANSACT_RENAME 5
-#define NT_TRANSACT_QUERY_SECURITY_DESC 6
-
-/* these are the trans2 sub fields for primary requests */
-#define smb_tpscnt smb_vwv0
-#define smb_tdscnt smb_vwv1
-#define smb_mprcnt smb_vwv2
-#define smb_mdrcnt smb_vwv3
-#define smb_msrcnt smb_vwv4
-#define smb_flags smb_vwv5
-#define smb_timeout smb_vwv6
-#define smb_pscnt smb_vwv9
-#define smb_psoff smb_vwv10
-#define smb_dscnt smb_vwv11
-#define smb_dsoff smb_vwv12
-#define smb_suwcnt smb_vwv13
-#define smb_setup smb_vwv14
-#define smb_setup0 smb_setup
-#define smb_setup1 (smb_setup+2)
-#define smb_setup2 (smb_setup+4)
-
-/* these are for the secondary requests */
-#define smb_spscnt smb_vwv2
-#define smb_spsoff smb_vwv3
-#define smb_spsdisp smb_vwv4
-#define smb_sdscnt smb_vwv5
-#define smb_sdsoff smb_vwv6
-#define smb_sdsdisp smb_vwv7
-#define smb_sfid smb_vwv8
-
-/* and these for responses */
-#define smb_tprcnt smb_vwv0
-#define smb_tdrcnt smb_vwv1
-#define smb_prcnt smb_vwv3
-#define smb_proff smb_vwv4
-#define smb_prdisp smb_vwv5
-#define smb_drcnt smb_vwv6
-#define smb_droff smb_vwv7
-#define smb_drdisp smb_vwv8
-
-/* where to find the base of the SMB packet proper */
-#define smb_base(buf) (((char *)(buf))+4)
-
-
-#define SUCCESS 0 /* The request was successful. */
-#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
-#define ERRSRV 0x02 /* Error is generated by the server network file manager.*/
-#define ERRHRD 0x03 /* Error is an hardware error. */
-#define ERRCMD 0xFF /* Command was not in the "SMB" format. */
-
-#ifdef __STDC__
-int Debug1(char *, ...);
-#else
-int Debug1();
-#endif
-
-#ifdef DFS_AUTH
-void dfs_unlogin(void);
-extern int dcelogin_atmost_once;
-#endif
-
-#if AJT
-void ajt_panic(void);
-#endif
-
-#ifdef NOSTRDUP
-char *strdup(char *s);
-#endif
-
-#ifdef REPLACE_STRLEN
-int Strlen(char *);
-#endif
-
-#ifdef REPLACE_STRSTR
-char *Strstr(char *s, char *p);
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
-#ifndef ABS
-#define ABS(a) ((a)>0?(a):(-(a)))
-#endif
-
-#ifndef SIGNAL_CAST
-#define SIGNAL_CAST
-#endif
-
-#ifndef SELECT_CAST
-#define SELECT_CAST
-#endif
-
-
-/* Some POSIX definitions for those without */
-
-#ifndef S_IFDIR
-#define S_IFDIR 0x4000
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 00700 /* read, write, execute: owner */
-#endif
-#ifndef S_IRUSR
-#define S_IRUSR 00400 /* read permission: owner */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 00200 /* write permission: owner */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 00100 /* execute permission: owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 00070 /* read, write, execute: group */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 00040 /* read permission: group */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 00020 /* write permission: group */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 00010 /* execute permission: group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 00007 /* read, write, execute: other */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 00004 /* read permission: other */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 00002 /* write permission: other */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 00001 /* execute permission: other */
-#endif
-
-
-/* these are used in NetServerEnum to choose what to receive */
-#define SV_TYPE_WORKSTATION 0x00000001
-#define SV_TYPE_SERVER 0x00000002
-#define SV_TYPE_SQLSERVER 0x00000004
-#define SV_TYPE_DOMAIN_CTRL 0x00000008
-#define SV_TYPE_DOMAIN_BAKCTRL 0x00000010
-#define SV_TYPE_TIME_SOURCE 0x00000020
-#define SV_TYPE_AFP 0x00000040
-#define SV_TYPE_NOVELL 0x00000080
-#define SV_TYPE_DOMAIN_MEMBER 0x00000100
-#define SV_TYPE_PRINTQ_SERVER 0x00000200
-#define SV_TYPE_DIALIN_SERVER 0x00000400
-#define SV_TYPE_SERVER_UNIX 0x00000800
-#define SV_TYPE_NT 0x00001000
-#define SV_TYPE_WFW 0x00002000
-#define SV_TYPE_SERVER_MFPN 0x00004000
-#define SV_TYPE_SERVER_NT 0x00008000
-#define SV_TYPE_POTENTIAL_BROWSER 0x00010000
-#define SV_TYPE_BACKUP_BROWSER 0x00020000
-#define SV_TYPE_MASTER_BROWSER 0x00040000
-#define SV_TYPE_DOMAIN_MASTER 0x00080000
-#define SV_TYPE_SERVER_OSF 0x00100000
-#define SV_TYPE_SERVER_VMS 0x00200000
-#define SV_TYPE_WIN95_PLUS 0x00400000
-#define SV_TYPE_ALTERNATE_XPORT 0x20000000
-#define SV_TYPE_LOCAL_LIST_ONLY 0x40000000
-#define SV_TYPE_DOMAIN_ENUM 0x80000000
-#define SV_TYPE_ALL 0xFFFFFFFF
-
-/* what server type are we currently - JHT Says we ARE 4.20 */
-/* this was set by JHT in liaison with Jeremy Allison early 1997 */
-/* setting to 4.20 at same time as announcing ourselves as NT Server */
-/* History: */
-/* Version 4.0 - never made public */
-/* Version 4.10 - New to 1.9.16p2, lost in space 1.9.16p3 to 1.9.16p9 */
-/* - Reappeared in 1.9.16p11 with fixed smbd services */
-/* Version 4.20 - To indicate that nmbd and browsing now works better */
-
-#define DEFAULT_MAJOR_VERSION 0x04
-#define DEFAULT_MINOR_VERSION 0x02
-
-/* Browser Election Values */
-#define BROWSER_ELECTION_VERSION 0x010f
-#define BROWSER_CONSTANT 0xaa55
-
-
-/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
-
-#define CAP_RAW_MODE 0x0001
-#define CAP_MPX_MODE 0x0002
-#define CAP_UNICODE 0x0004
-#define CAP_LARGE_FILES 0x0008
-#define CAP_NT_SMBS 0x0010
-#define CAP_RPC_REMOTE_APIS 0x0020
-#define CAP_STATUS32 0x0040
-#define CAP_LEVEL_II_OPLOCKS 0x0080
-#define CAP_LOCK_AND_READ 0x0100
-#define CAP_NT_FIND 0x0200
-#define CAP_DFS 0x1000
-#define CAP_LARGE_READX 0x4000
-
-/* protocol types. It assumes that higher protocols include lower protocols
- as subsets */
-enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1};
-
-/* security levels */
-enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER};
-
-/* printing types */
-enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX,
- PRINT_QNX,PRINT_PLP,PRINT_LPRNG};
-
-/* Remote architectures we know about. */
-enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMBA};
-
-/* case handling */
-enum case_handling {CASE_LOWER,CASE_UPPER};
-
-
-/* Macros to get at offsets within smb_lkrng and smb_unlkrng
- structures. We cannot define these as actual structures
- due to possible differences in structure packing
- on different machines/compilers. */
-
-#define SMB_LPID_OFFSET(indx) (10 * (indx))
-#define SMB_LKOFF_OFFSET(indx) ( 2 + (10 * (indx)))
-#define SMB_LKLEN_OFFSET(indx) ( 6 + (10 * (indx)))
-
-/* Macro to cache an error in a write_bmpx_struct */
-#define CACHE_ERROR(w,c,e) ((w)->wr_errclass = (c), (w)->wr_error = (e), \
- w->wr_discard = True, -1)
-/* Macro to test if an error has been cached for this fnum */
-#define HAS_CACHED_ERROR(fnum) (Files[(fnum)].open && \
- Files[(fnum)].wbmpx_ptr && \
- Files[(fnum)].wbmpx_ptr->wr_discard)
-/* Macro to turn the cached error into an error packet */
-#define CACHED_ERROR(fnum) cached_error_packet(inbuf,outbuf,fnum,__LINE__)
-
-/* these are the datagram types */
-#define DGRAM_DIRECT_UNIQUE 0x10
-
-#define ERROR(class,x) error_packet(inbuf,outbuf,class,x,__LINE__)
-
-/* this is how errors are generated */
-#define UNIXERROR(defclass,deferror) unix_error_packet(inbuf,outbuf,defclass,deferror,__LINE__)
-
-#define ROUNDUP(x,g) (((x)+((g)-1))&~((g)-1))
-
-/*
- * Global value meaing that the smb_uid field should be
- * ingored (in share level security and protocol level == CORE)
- */
-
-#define UID_FIELD_INVALID 0
-#define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */
-
-#endif
-
-/* Defines needed for multi-codepage support. */
-#define KANJI_CODEPAGE 932
-
-#ifdef KANJI
-/*
- * Default client code page - Japanese
- */
-#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE
-#else /* KANJI */
-/*
- * Default client code page - 850 - Western European
- */
-#define DEFAULT_CLIENT_CODE_PAGE 850
-#endif /* KANJI */
-
-/*
- * Size of buffer to use when moving files across filesystems.
- */
-#define COPYBUF_SIZE (8*1024)
-
-/*
- * Integers used to override error codes.
- */
-extern int unix_ERR_class;
-extern int unix_ERR_code;
-
-/*
- * Map the Core and Extended Oplock requesst bits down
- * to common bits (EXCLUSIVE_OPLOCK & BATCH_OPLOCK).
- */
-
-/*
- * Core protocol.
- */
-#define CORE_OPLOCK_REQUEST(inbuf) (((CVAL(inbuf,smb_flg)|(1<<5))>>5) | \
- ((CVAL(inbuf,smb_flg)|(1<<6))>>5))
-
-/*
- * Extended protocol.
- */
-#define EXTENDED_OPLOCK_REQUEST(inbuf) (((SVAL(inbuf,smb_vwv2)|(1<<1))>>1) | \
- ((SVAL(inbuf,smb_vwv2)|(1<<2))>>1))
-
-/* Lock types. */
-#define LOCKING_ANDX_SHARED_LOCK 0x1
-#define LOCKING_ANDX_OPLOCK_RELEASE 0x2
-#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x4
-#define LOCKING_ANDX_CANCEL_LOCK 0x8
-#define LOCKING_ANDX_LARGE_FILES 0x10
-
-/* Oplock levels */
-#define OPLOCKLEVEL_NONE 0
-#define OPLOCKLEVEL_II 1
-
-/*
- * Bits we test with.
- */
-#define EXCLUSIVE_OPLOCK 1
-#define BATCH_OPLOCK 2
-
-#define CORE_OPLOCK_GRANTED (1<<5)
-#define EXTENDED_OPLOCK_GRANTED (1<<15)
-
-/*
- * Loopback command offsets.
- */
-
-#define UDP_CMD_LEN_OFFSET 0
-#define UDP_CMD_PORT_OFFSET 4
-#define UDP_CMD_HEADER_LEN 6
-
-#define UDP_MESSAGE_CMD_OFFSET 0
-
-/*
- * Oplock break command code to send over the udp socket.
- *
- * Form of this is :
- *
- * 0 2 6 10 14 18 22
- * +----+--------+--------+--------+-------+--------+
- * | cmd| pid | dev | inode | sec | usec |
- * +----+--------+--------+--------+-------+--------+
- */
-
-#define OPLOCK_BREAK_CMD 0x1
-#define OPLOCK_BREAK_PID_OFFSET 2
-#define OPLOCK_BREAK_DEV_OFFSET 6
-#define OPLOCK_BREAK_INODE_OFFSET 10
-#define OPLOCK_BREAK_SEC_OFFSET 14
-#define OPLOCK_BREAK_USEC_OFFSET 18
-#define OPLOCK_BREAK_MSG_LEN 22
-
-
-#define CMD_REPLY 0x8000
-
-/* _SMB_H */
diff --git a/source/include/trans2.h b/source/include/trans2.h
deleted file mode 100644
index 9a2de631095..00000000000
--- a/source/include/trans2.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- SMB transaction2 handling
- Copyright (C) Jeremy Allison 1994-1997
-
- Extensively modified by Andrew Tridgell, 1995
-
- 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 _TRANS2_H_
-#define _TRANS2_H_
-
-/* Define the structures needed for the trans2 calls. */
-
-/*******************************************************
- For DosFindFirst/DosFindNext - level 1
-
-MAXFILENAMELEN = 255;
-FDATE == uint16
-FTIME == uint16
-ULONG == uint32
-USHORT == uint16
-
-typedef struct _FILEFINDBUF {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 FDATE fdateCreation;
-2 FTIME ftimeCreation;
-4 FDATE fdateLastAccess;
-6 FTIME ftimeLastAccess;
-8 FDATE fdateLastWrite;
-10 FTIME ftimeLastWrite;
-12 ULONG cbFile file length in bytes
-16 ULONG cbFileAlloc size of file allocation unit
-20 USHORT attrFile
-22 UCHAR cchName length of name to follow (not including zero)
-23 UCHAR achName[MAXFILENAMELEN]; Null terminated name
-} FILEFINDBUF;
-*********************************************************/
-
-#define l1_fdateCreation 0
-#define l1_fdateLastAccess 4
-#define l1_fdateLastWrite 8
-#define l1_cbFile 12
-#define l1_cbFileAlloc 16
-#define l1_attrFile 20
-#define l1_cchName 22
-#define l1_achName 23
-
-/**********************************************************
-For DosFindFirst/DosFindNext - level 2
-
-typedef struct _FILEFINDBUF2 {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 FDATE fdateCreation;
-2 FTIME ftimeCreation;
-4 FDATE fdateLastAccess;
-6 FTIME ftimeLastAccess;
-8 FDATE fdateLastWrite;
-10 FTIME ftimeLastWrite;
-12 ULONG cbFile file length in bytes
-16 ULONG cbFileAlloc size of file allocation unit
-20 USHORT attrFile
-22 ULONG cbList Extended attribute list (always 0)
-26 UCHAR cchName length of name to follow (not including zero)
-27 UCHAR achName[MAXFILENAMELEN]; Null terminated name
-} FILEFINDBUF2;
-*************************************************************/
-
-#define l2_fdateCreation 0
-#define l2_fdateLastAccess 4
-#define l2_fdateLastWrite 8
-#define l2_cbFile 12
-#define l2_cbFileAlloc 16
-#define l2_attrFile 20
-#define l2_cbList 22
-#define l2_cchName 26
-#define l2_achName 27
-
-
-/**********************************************************
-For DosFindFirst/DosFindNext - level 260
-
-typedef struct _FILEFINDBUF260 {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 ULONG NextEntryOffset;
-4 ULONG FileIndex;
-8 LARGE_INTEGER CreationTime;
-16 LARGE_INTEGER LastAccessTime;
-24 LARGE_INTEGER LastWriteTime;
-32 LARGE_INTEGER ChangeTime;
-40 LARGE_INTEGER EndOfFile;
-48 LARGE_INTEGER AllocationSize;
-56 ULONG FileAttributes;
-60 ULONG FileNameLength;
-64 ULONG EaSize;
-68 CHAR ShortNameLength;
-70 UNICODE ShortName[12];
-94 UNICODE FileName[];
-*************************************************************/
-
-#define l260_achName 94
-
-
-/**********************************************************
-For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
-DosSetFileInfo - level 1
-
-typedef struct _FILESTATUS {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 FDATE fdateCreation;
-2 FTIME ftimeCreation;
-4 FDATE fdateLastAccess;
-6 FTIME ftimeLastAccess;
-8 FDATE fdateLastWrite;
-10 FTIME ftimeLastWrite;
-12 ULONG cbFile file length in bytes
-16 ULONG cbFileAlloc size of file allocation unit
-20 USHORT attrFile
-} FILESTATUS;
-*************************************************************/
-
-/* Use the l1_ defines from DosFindFirst */
-
-/**********************************************************
-For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
-DosSetFileInfo - level 2
-
-typedef struct _FILESTATUS2 {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 FDATE fdateCreation;
-2 FTIME ftimeCreation;
-4 FDATE fdateLastAccess;
-6 FTIME ftimeLastAccess;
-8 FDATE fdateLastWrite;
-10 FTIME ftimeLastWrite;
-12 ULONG cbFile file length in bytes
-16 ULONG cbFileAlloc size of file allocation unit
-20 USHORT attrFile
-22 ULONG cbList Length of EA's (0)
-} FILESTATUS2;
-*************************************************************/
-
-/* Use the l2_ #defines from DosFindFirst */
-
-/**********************************************************
-For DosQFSInfo/DosSetFSInfo - level 1
-
-typedef struct _FSALLOCATE {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 ULONG idFileSystem id of file system
-4 ULONG cSectorUnit number of sectors per allocation unit
-8 ULONG cUnit number of allocation units
-12 ULONG cUnitAvail Available allocation units
-16 USHORT cbSector bytes per sector
-} FSALLOCATE;
-*************************************************************/
-
-#define l1_idFileSystem 0
-#define l1_cSectorUnit 4
-#define l1_cUnit 8
-#define l1_cUnitAvail 12
-#define l1_cbSector 16
-
-/**********************************************************
-For DosQFSInfo/DosSetFSInfo - level 2
-
-typedef struct _FSINFO {
-Byte offset Type name description
--------------+-------+-------------------+--------------
-0 FDATE vol_fdateCreation
-2 FTIME vol_ftimeCreation
-4 UCHAR vol_cch length of volume name (excluding NULL)
-5 UCHAR vol_szVolLabel[12] volume name
-} FSINFO;
-*************************************************************/
-
-#define SMB_INFO_STANDARD 1
-#define SMB_INFO_QUERY_EA_SIZE 2
-#define SMB_INFO_QUERY_EAS_FROM_LIST 3
-#define SMB_INFO_QUERY_ALL_EAS 4
-#define SMB_INFO_IS_NAME_VALID 6
-#define SMB_QUERY_FS_LABEL_INFO 0x101
-#define SMB_QUERY_FS_VOLUME_INFO 0x102
-#define SMB_QUERY_FS_SIZE_INFO 0x103
-#define SMB_QUERY_FS_DEVICE_INFO 0x104
-#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
-
-
-#define l2_vol_fdateCreation 0
-#define l2_vol_cch 4
-#define l2_vol_szVolLabel 5
-
-
-#define SMB_QUERY_FILE_BASIC_INFO 0x101
-#define SMB_QUERY_FILE_STANDARD_INFO 0x102
-#define SMB_QUERY_FILE_EA_INFO 0x103
-#define SMB_QUERY_FILE_NAME_INFO 0x104
-#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
-#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
-#define SMB_QUERY_FILE_ALL_INFO 0x107
-#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
-#define SMB_QUERY_FILE_STREAM_INFO 0x109
-
-#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
-#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
-#define SMB_FIND_FILE_NAMES_INFO 0x103
-#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
-
-#define SMB_SET_FILE_BASIC_INFO 0x101
-#define SMB_SET_FILE_DISPOSITION_INFO 0x102
-#define SMB_SET_FILE_ALLOCATION_INFO 0x103
-#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
-
-#define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName))
-
-/* NT uses a FILE_ATTRIBUTE_NORMAL when no other attributes
- are set. */
-
-#define NT_FILE_ATTRIBUTE_NORMAL 0x80
-
-/* Function prototypes */
-
-
-int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
-
-int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
-
-#endif
-
-
-
diff --git a/source/include/version.h b/source/include/version.h
deleted file mode 100644
index 33c9d240baf..00000000000
--- a/source/include/version.h
+++ /dev/null
@@ -1 +0,0 @@
-#define VERSION "1.9.18alpha1"
diff --git a/source/include/vt_mode.h b/source/include/vt_mode.h
deleted file mode 100644
index 85b481122ee..00000000000
--- a/source/include/vt_mode.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* vt_mode.h */
-/*
-support vtp-sessions
-
-written by Christian A. Lademann <cal@zls.com>
-*/
-
-/*
-02.05.95:cal:ported to samba-1.9.13
-*/
-
-#ifndef __vt_mode_h__
-# define __vt_mode_h__
-
-# define VT_CLOSED 0
-# define VT_OPEN 1
-
-# define MS_NONE 0
-# define MS_PTY 1
-# define MS_STREAM 2
-# define MS_VTY 3
-
-# define VT_MAXREAD 32
-
-
-# undef EXTERN
-
-# ifndef __vt_mode_c__
-# define EXTERN extern
-# define DEFAULT(v)
-# else
-# define EXTERN
-# define DEFAULT(v) =(v)
-# endif
-
- EXTERN int VT_Status DEFAULT(VT_CLOSED),
- VT_Fd DEFAULT(-1),
- VT_ChildPID DEFAULT(-1);
-
- EXTERN BOOL VT_Mode DEFAULT(False),
- VT_ChildDied DEFAULT(False);
-
- EXTERN char *VT_Line DEFAULT(NULL);
-
-# undef EXTERN
-
-
-#endif /* __vt_mode_h__ */