root/src/vfs/smbfs/helpers/include/includes.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 #ifndef _INCLUDES_H
   2 #define _INCLUDES_H
   3 /*
   4    Unix SMB/Netbios implementation.
   5    Version 1.9.
   6    Machine customisation and include handling
   7  */
   8 
   9 #ifndef NO_CONFIG_H             /* for some tests */
  10 #include "config.h"
  11 #endif
  12 
  13 #include "local.h"
  14 
  15 #ifdef AIX
  16 #define DEFAULT_PRINTING PRINT_AIX
  17 #define PRINTCAP_NAME "/etc/qconfig"
  18 #endif
  19 
  20 #ifdef HPUX
  21 #define DEFAULT_PRINTING PRINT_HPUX
  22 #endif
  23 
  24 #ifdef QNX
  25 #define DEFAULT_PRINTING PRINT_QNX
  26 #endif
  27 
  28 #include <sys/types.h>
  29 #include <fcntl.h>
  30 #include <sys/stat.h>
  31 #include <sys/time.h>
  32 #include <time.h>
  33 #include <unistd.h>
  34 #include <stdio.h>
  35 #include <stddef.h>
  36 #include <stdlib.h>
  37 #include <signal.h>
  38 #include <sys/wait.h>
  39 
  40 #ifdef HAVE_SYS_RESOURCE_H
  41 #include <sys/resource.h>
  42 #endif
  43 
  44 #ifdef HAVE_SYS_PARAM_H
  45 #include <sys/param.h>
  46 #endif
  47 
  48 #ifdef HAVE_SYS_SOCKET_H
  49 #include <sys/socket.h>
  50 #endif
  51 
  52 #ifdef HAVE_SYS_SYSCALL_H
  53 #include <sys/syscall.h>
  54 #elif HAVE_SYSCALL_H
  55 #include <syscall.h>
  56 #endif
  57 
  58 #ifdef HAVE_STRING_H
  59 #include <string.h>
  60 #endif
  61 
  62 #ifdef HAVE_STRINGS_H
  63 #include <strings.h>
  64 #endif
  65 
  66 #ifdef HAVE_MEMORY_H
  67 #include <memory.h>
  68 #endif
  69 
  70 #ifdef MEM_MAN
  71 #include "../mem_man/mem_man.h"
  72 #else
  73 #ifdef HAVE_MALLOC_H
  74 #include <malloc.h>
  75 #endif
  76 #endif
  77 
  78 #ifdef HAVE_LIMITS_H
  79 #include <limits.h>
  80 #endif
  81 
  82 #ifdef HAVE_SYS_IOCTL_H
  83 #include <sys/ioctl.h>
  84 #endif
  85 
  86 #ifdef HAVE_SYS_FILIO_H
  87 #include <sys/filio.h>
  88 #endif
  89 
  90 
  91 #ifdef HAVE_CTYPE_H
  92 #include <ctype.h>
  93 #endif
  94 #include <grp.h>
  95 #ifdef HAVE_SYS_ID_H
  96 #include <sys/id.h>
  97 #endif
  98 
  99 /* AIX 4.1 and previous needs this for setpriv */
 100 #if defined(HAVE_SETPRIV) && defined(HAVE_SYS_PRIV_H)
 101 #include <sys/priv.h>
 102 #endif
 103 
 104 #include <errno.h>
 105 
 106 #ifdef HAVE_UTIME_H
 107 #include <utime.h>
 108 #endif
 109 
 110 #ifdef HAVE_SYS_SELECT_H
 111 #include <sys/select.h>
 112 #endif
 113 
 114 #ifdef HAVE_SYS_MODE_H
 115 /* apparently AIX needs this for S_ISLNK */
 116 #ifndef S_ISLNK
 117 #include <sys/mode.h>
 118 #endif
 119 #endif
 120 
 121 #ifdef HAVE_GLOB_H
 122 #include <glob.h>
 123 #endif
 124 
 125 #include <pwd.h>
 126 
 127 #ifdef HAVE_STDARG_H
 128 #include <stdarg.h>
 129 #else
 130 #include <varargs.h>
 131 #endif
 132 
 133 #include <netinet/in.h>
 134 #include <arpa/inet.h>
 135 #include <netdb.h>
 136 #include <syslog.h>
 137 #include <sys/file.h>
 138 
 139 #ifdef HAVE_NETINET_TCP_H
 140 #include <netinet/tcp.h>
 141 #endif
 142 
 143 /*
 144  * The next two defines are needed to the IPTOS_* options
 145  * on some systems.
 146  */
 147 
 148 #ifdef HAVE_NETINET_IN_SYSTM_H
 149 #include <netinet/in_systm.h>
 150 #endif
 151 
 152 #ifdef HAVE_NETINET_IN_IP_H
 153 #include <netinet/ip.h>
 154 #endif
 155 
 156 /* POSIX terminal handling. */
 157 #include <termios.h>
 158 
 159 #include <dirent.h>
 160 
 161 #ifdef HAVE_SYS_MMAN_H
 162 #include <sys/mman.h>
 163 #endif
 164 
 165 #ifdef HAVE_SYSV_IPC
 166 #include <sys/ipc.h>
 167 #include <sys/shm.h>
 168 #include <sys/sem.h>
 169 #endif
 170 
 171 #ifdef HAVE_NET_IF_H
 172 #include <net/if.h>
 173 #endif
 174 
 175 
 176 #ifdef HAVE_SYS_MOUNT_H
 177 #include <sys/mount.h>
 178 #endif
 179 
 180 #ifdef HAVE_SYS_VFS_H
 181 #include <sys/vfs.h>
 182 #endif
 183 
 184 #ifdef HAVE_SYS_ACL_H
 185 #include <sys/acl.h>
 186 #endif
 187 
 188 #ifdef HAVE_SYS_FS_S5PARAM_H
 189 #include <sys/fs/s5param.h>
 190 #endif
 191 
 192 #if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
 193 #include <sys/filsys.h>
 194 #endif
 195 
 196 #ifdef HAVE_SYS_STATFS_H
 197 #include <sys/statfs.h>
 198 #endif
 199 
 200 #ifdef HAVE_SYS_STATVFS_H
 201 #include <sys/statvfs.h>
 202 #endif
 203 
 204 #ifdef HAVE_SHADOW_H
 205 #include <shadow.h>
 206 #endif
 207 
 208 #ifdef HAVE_GETPWANAM
 209 #include <sys/label.h>
 210 #include <sys/audit.h>
 211 #include <pwdadj.h>
 212 #endif
 213 
 214 #ifdef HAVE_SYS_SECURITY_H
 215 #include <sys/security.h>
 216 #include <prot.h>
 217 #define PASSWORD_LENGTH 16
 218 #endif /* HAVE_SYS_SECURITY_H */
 219 
 220 #ifdef HAVE_COMPAT_H
 221 #include <compat.h>
 222 #endif
 223 
 224 #ifdef HAVE_STROPTS_H
 225 #include <stropts.h>
 226 #endif
 227 
 228 #ifdef HAVE_POLL_H
 229 #include <poll.h>
 230 #endif
 231 
 232 #if defined(HAVE_RPC_RPC_H)
 233 /*
 234  * Check for AUTH_ERROR define conflict with rpc/rpc.h in prot.h.
 235  */
 236 #if defined(HAVE_SYS_SECURITY_H) && defined(HAVE_RPC_AUTH_ERROR_CONFLICT)
 237 #undef AUTH_ERROR
 238 #endif
 239 #include <rpc/rpc.h>
 240 #endif
 241 
 242 #if defined(HAVE_YP_GET_DEFAULT_DOMAIN) && defined(HAVE_SETNETGRENT) && defined(HAVE_ENDNETGRENT) && defined(HAVE_GETNETGRENT)
 243 #define HAVE_NETGROUP 1
 244 #endif
 245 
 246 #if defined (HAVE_NETGROUP)
 247 #if defined(HAVE_RPCSVC_YP_PROT_H)
 248 #include <rpcsvc/yp_prot.h>
 249 #endif
 250 #if defined(HAVE_RPCSVC_YPCLNT_H)
 251 #include <rpcsvc/ypclnt.h>
 252 #endif
 253 #endif /* HAVE_NETGROUP */
 254 
 255 #ifndef uchar
 256 #define uchar unsigned char
 257 #endif
 258 
 259 #define schar signed char
 260 
 261 /*
 262    Samba needs type definitions for int16, int32, uint16 and uint32.
 263 
 264    Normally these are signed and unsigned 16 and 32 bit integers, but
 265    they actually only need to be at least 16 and 32 bits
 266    respectively. Thus if your word size is 8 bytes just defining them
 267    as signed and unsigned int will work.
 268  */
 269 
 270 #ifndef uint8
 271 #define uint8 unsigned char
 272 #endif
 273 
 274 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
 275 #if (SIZEOF_SHORT == 4)
 276 #define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
 277 #else /* SIZEOF_SHORT != 4 */
 278 #define int16 short
 279 #endif /* SIZEOF_SHORT != 4 */
 280 #endif
 281 
 282 /*
 283  * Note we duplicate the size tests in the unsigned 
 284  * case as int16 may be a typedef from rpc/rpc.h
 285  */
 286 
 287 #if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
 288 #if (SIZEOF_SHORT == 4)
 289 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
 290 #else /* SIZEOF_SHORT != 4 */
 291 #define uint16 unsigned short
 292 #endif /* SIZEOF_SHORT != 4 */
 293 #endif
 294 
 295 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
 296 #if (SIZEOF_INT == 4)
 297 #define int32 int
 298 #elif (SIZEOF_LONG == 4)
 299 #define int32 long
 300 #elif (SIZEOF_SHORT == 4)
 301 #define int32 short
 302 #endif
 303 #endif
 304 
 305 /*
 306  * Note we duplicate the size tests in the unsigned 
 307  * case as int32 may be a typedef from rpc/rpc.h
 308  */
 309 
 310 #if !defined(uint32) && !defined(HAVE_UINT32_FROM_RPC_RPC_H)
 311 #if (SIZEOF_INT == 4)
 312 #define uint32 unsigned int
 313 #elif (SIZEOF_LONG == 4)
 314 #define uint32 unsigned long
 315 #elif (SIZEOF_SHORT == 4)
 316 #define uint32 unsigned short
 317 #endif
 318 #endif
 319 
 320 /*
 321  * Types for devices, inodes and offsets.
 322  */
 323 
 324 #ifndef SMB_DEV_T
 325 #define SMB_DEV_T dev_t
 326 #endif
 327 
 328 /*
 329  * Setup the correctly sized inode type.
 330  */
 331 
 332 #ifndef SMB_INO_T
 333 #define SMB_INO_T ino_t
 334 #endif
 335 
 336 #ifndef LARGE_SMB_INO_T
 337 #if defined(SIZEOF_INO_T) && (SIZEOF_INO_T == 8)
 338 #define LARGE_SMB_INO_T 1
 339 #endif
 340 #endif
 341 
 342 #ifdef LARGE_SMB_INO_T
 343 #define SINO_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
 344 #else
 345 #define SINO_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
 346 #endif
 347 
 348 #ifndef SMB_OFF_T
 349 #define SMB_OFF_T off_t
 350 #endif
 351 
 352 #define SMB_OFF_T_BITS (sizeof(SMB_OFF_T)*8)
 353 
 354 /*
 355  * Set the define that tells us if we can do 64 bit
 356  * NT SMB calls.
 357  */
 358 
 359 #ifndef LARGE_SMB_OFF_T
 360 #if defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)
 361 #define LARGE_SMB_OFF_T 1
 362 #endif
 363 #endif
 364 
 365 #ifdef LARGE_SMB_OFF_T
 366 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
 367 #else
 368 #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
 369 #endif
 370 
 371 /*
 372  * Type for stat structure.
 373  */
 374 
 375 #ifndef SMB_STRUCT_STAT
 376 #define SMB_STRUCT_STAT struct stat
 377 #endif
 378 
 379 /*
 380  * Type for dirent structure.
 381  */
 382 
 383 #ifndef SMB_STRUCT_DIRENT
 384 #define SMB_STRUCT_DIRENT struct dirent
 385 #endif
 386 
 387 /*
 388  * Defines for 64 bit fcntl locks.
 389  */
 390 
 391 #ifndef SMB_STRUCT_FLOCK
 392 #define SMB_STRUCT_FLOCK struct flock
 393 #endif
 394 
 395 #ifndef SMB_F_SETLKW
 396 #define SMB_F_SETLKW F_SETLKW
 397 #endif
 398 
 399 #ifndef SMB_F_SETLK
 400 #define SMB_F_SETLK F_SETLK
 401 #endif
 402 
 403 #ifndef SMB_F_GETLK
 404 #define SMB_F_GETLK F_GETLK
 405 #endif
 406 
 407 #if defined(HAVE_LONGLONG)
 408 #define SMB_BIG_UINT unsigned long long
 409 #define SMB_BIG_INT long long
 410 #define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
 411 #else
 412 #define SMB_BIG_UINT unsigned long
 413 #define SMB_BIG_INT long
 414 #define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
 415 #endif
 416 
 417 #ifndef MIN
 418 #define MIN(a,b) ((a)<(b)?(a):(b))
 419 #endif
 420 
 421 #ifndef MAX
 422 #define MAX(a,b) ((a)>(b)?(a):(b))
 423 #endif
 424 
 425 #ifdef HAVE_BROKEN_GETGROUPS
 426 #define GID_T int
 427 #else
 428 #define GID_T gid_t
 429 #endif
 430 
 431 
 432 #include "version.h"
 433 #include "smb.h"
 434 #include "nameserv.h"
 435 
 436 #include "byteorder.h"
 437 
 438 #include "kanji.h"
 439 #include "charset.h"
 440 
 441 #include "nterr.h"
 442 
 443 #ifndef MAXCODEPAGELINES
 444 #define MAXCODEPAGELINES 256
 445 #endif
 446 
 447 /***** automatically generated prototypes *****/
 448 #include "proto.h"
 449 
 450 #ifdef sprintf
 451 #undef sprintf
 452 #endif /* sprintf */
 453 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
 454 
 455 #define pstrcpy(d,s) safe_strcpy((d),(s),sizeof(pstring)-1)
 456 #define pstrcat(d,s) safe_strcat((d),(s),sizeof(pstring)-1)
 457 #define fstrcpy(d,s) safe_strcpy((d),(s),sizeof(fstring)-1)
 458 #define fstrcat(d,s) safe_strcat((d),(s),sizeof(fstring)-1)
 459 
 460 #ifdef __COMPAR_FN_T
 461 #define QSORT_CAST (__compar_fn_t)
 462 #endif
 463 
 464 #ifndef QSORT_CAST
 465 #define QSORT_CAST (int (*)(const void *, const void *))
 466 #endif
 467 
 468 /* this guess needs to be improved (tridge) */
 469 #if (defined(STAT_STATVFS) || defined(STAT_STATVFS64)) && !defined(SYSV)
 470 #define SYSV 1
 471 #endif
 472 
 473 #ifndef DEFAULT_PRINTING
 474 #ifdef SYSV
 475 #define DEFAULT_PRINTING PRINT_SYSV
 476 #define PRINTCAP_NAME "lpstat"
 477 #else
 478 #define DEFAULT_PRINTING PRINT_BSD
 479 #define PRINTCAP_NAME "/etc/printcap"
 480 #endif
 481 #endif
 482 
 483 #ifndef PRINTCAP_NAME
 484 #define PRINTCAP_NAME "/etc/printcap"
 485 #endif
 486 
 487 #ifndef SIGCLD
 488 #define SIGCLD SIGCHLD
 489 #endif
 490 
 491 #if (defined(HAVE_SYSV_IPC) || defined(HAVE_SHARED_MMAP))
 492 #define FAST_SHARE_MODES 1
 493 #endif
 494 
 495 #ifndef MAP_FILE
 496 #define MAP_FILE 0
 497 #endif
 498 
 499 #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP))
 500 #define USE_SMBPASS_DB 1
 501 #endif
 502 
 503 #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS)
 504 #define OSF1_ENH_SEC 1
 505 #endif
 506 
 507 #ifndef ALLOW_CHANGE_PASSWORD
 508 #if (defined(HAVE_TERMIOS_H) && defined(HAVE_DUP2) && defined(HAVE_SETSID))
 509 #define ALLOW_CHANGE_PASSWORD 1
 510 #endif
 511 #endif
 512 
 513 /* what is the longest significant password available on your system? 
 514    Knowing this speeds up password searches a lot */
 515 #ifndef PASSWORD_LENGTH
 516 #define PASSWORD_LENGTH 8
 517 #endif
 518 
 519 #ifndef HAVE_PIPE
 520 #define SYNC_DNS 1
 521 #endif
 522 
 523 #ifndef MAXPATHLEN
 524 #define MAXPATHLEN 256
 525 #endif
 526 
 527 #ifndef SEEK_SET
 528 #define SEEK_SET 0
 529 #endif
 530 
 531 #ifndef INADDR_LOOPBACK
 532 #define INADDR_LOOPBACK 0x7f000001
 533 #endif
 534 
 535 #ifndef INADDR_NONE
 536 #define INADDR_NONE 0xffffffff
 537 #endif
 538 
 539 #ifndef O_ACCMODE
 540 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
 541 #endif
 542 
 543 #ifndef HAVE_INITGROUPS
 544 int initgroups (char *name, gid_t id);
 545 #endif
 546 
 547 #ifndef HAVE_RENAME
 548 int rename (const char *zfrom, const char *zto);
 549 #endif
 550 
 551 #ifndef HAVE_MKTIME
 552 time_t mktime (struct tm *t);
 553 #endif
 554 
 555 #ifndef HAVE_STRTOUL
 556 unsigned long strtoul (const char *nptr, char **endptr, int base);
 557 #endif
 558 
 559 #ifdef REPLACE_GETPASS
 560 #define getpass(prompt) getsmbpass((prompt))
 561 #endif
 562 
 563 /*
 564  * Some older systems seem not to have MAXHOSTNAMELEN
 565  * defined.
 566  */
 567 #ifndef MAXHOSTNAMELEN
 568 #define MAXHOSTNAMELEN 254
 569 #endif
 570 
 571 /* yuck, I'd like a better way of doing this */
 572 #define DIRP_SIZE (256 + 32)
 573 
 574 #endif /* _INCLUDES_H */

/* [previous][next][first][last][top][bottom][index][help]  */