home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / SRS / server / include / macros.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-12  |  4.0 KB  |  149 lines

  1. /* ------------- our macros ------------- */
  2.  
  3. #ifndef _MACROS_H
  4. #define _MACROS_H
  5.  
  6. __BEGIN_DECLS
  7.  
  8. /* various files/directories */
  9. #define SERVFILE   "/etc/srs.servers"        /* where the serv list is  */
  10.  
  11. #define LOGFILE    "SRS.log"                 /* file to log sys msgs on */
  12.  
  13. #define ERRLOG     "error.log"               /* error message log file  */
  14. #define DEBLOG     "debug.log"               /* debugging output file   */
  15.  
  16. #define USERFILE   "/etc/SRS.user"          
  17.  
  18. #define SRSDIR     "/var/log/SRS"            /* client logs are stored  */
  19. #define CLIENTDIRS "clients"                 /* client logs are stored  */
  20. /* ------------------------- */
  21.  
  22. /* client/server versions */
  23. #define CVER  "1"                 /* current client version (no floats) */
  24. #define SVER  "1"                 /* current server version (no floats) */ 
  25. /* ---------------------- */
  26.  
  27. #define PORT 797                  /* port for clients to connect to */
  28.  
  29. /* --- standard I/O locations --- */
  30. #define STDIN  0
  31. #define STDOUT 1
  32. #define STDERR 2
  33. /* ------------------------------ */
  34.  
  35. #define INIT 100            /* used for setjmp() in quit() */
  36.  
  37. #define ALL   1000
  38. #define NONE -1000
  39.  
  40. /* ----- syslogd stuff ----- */
  41. #define LOG_NPRIORITIES 12
  42.  
  43. #ifndef LOG_FAC
  44. # define LOG_FAC(p) (((p) & LOG_FACMASK) >> 2)
  45. #endif
  46.  
  47. #ifndef LOG_PRI
  48. # define LOG_PRI(p) ((p) & LOG_PRIMASK)
  49. #endif
  50.  
  51. #ifndef LOG_MAKEPRI /* ifdef SUN */
  52. # define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
  53. #endif
  54.  
  55. #ifndef INTERNAL_MARK
  56. # define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
  57. #endif
  58.  
  59. #ifndef INTERNAL_NOPRI
  60. # define INTERNAL_NOPRI 0x10
  61. #endif
  62.  
  63. #ifndef LOG_FTP
  64. #define LOG_FTP (11 << 3)
  65. #endif
  66.  
  67. #ifndef DEFUPRI
  68. # ifdef SUN
  69. #  define DEFUPRI (LOG_USER | LOG_INFO)
  70. # else
  71. #  define DEFUPRI (LOG_KERN | LOG_CRIT)
  72. # endif
  73. #endif
  74.  
  75. #ifndef DEFSPRI
  76. # define DEFSPRI (LOG_KERN | LOG_CRIT) /* for syslogd stuff */
  77. #endif
  78.  
  79. /* ------------------------- */
  80.  
  81. /* SSL related macros */
  82. #define PARAMDIR "/var/log/SRS/certs"
  83. /* ------------------ */
  84.  
  85. /* --- miscellaneous stuff --- */
  86. #ifndef INADDR_NONE
  87. # define INADDR_NONE ((unsigned long int) 0xffffffff)
  88. #endif
  89.  
  90. #define REPTIME 30       /* min time between duplicate msgs   */
  91. #define PROBETIME 60 * 5 /* time of inactivity for KEEPALIVE  */
  92.  
  93. #define NOPING 500       /* error with shmem so we can't ping */
  94.  
  95. #ifndef PAGE_SIZE
  96. # define PAGE_SIZE 4096
  97. #endif
  98.  
  99. #ifndef HAVE_MEMCPY
  100. # define memcpy(d, s, n) bcopy((s), (d), (n))
  101. #endif
  102.  
  103. #ifndef WIFEXITED
  104. # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  105. #endif
  106. /* --------------------------- */
  107.  
  108. /* --- maximum stuff --- */
  109. #define MAXSERVNUM 32          /* max. number of servers in list    */
  110. #define MAXCONNS   15          /* max. # of conns we can handle     */
  111. #define MAXSUBIDS   5          /* max # of times 1 client can conn. */
  112.  
  113. #define MAXUSERNAME 8
  114. #define MAXNUMUSERS 20
  115.  
  116. /* for all combos should be NFAC * NPRI * USERS, but that's too big */
  117. #define MAXLOGTYPES LOG_NFACILITIES + LOG_NPRIORITIES + MAXNUMUSERS
  118.  
  119. #define MAXFNAMESIZE 256       /* max. length a filename can be */
  120.  
  121. #define MAXSEGSIZE PAGE_SIZE      /* max. size of shared mem seg */
  122. #define MAXREADSIZE MAXSEGSIZE/2  /* maximum number of bytes at once */
  123. #define MAXWRITESIZE MAXSEGSIZE/2 /* maximum number of bytes at once */
  124.  
  125. #define MAXLOGSIZE MAXREADSIZE    /* max. size of sys msg from client */
  126.  
  127. /* time stuff */
  128. #define NORMPAUSE 2         /* normal amount to pause for client  */
  129. #define MAXPAUSE  5         /* max. we'll give client to leave    */
  130.  
  131. #define MAXTIMELEN 32       /* max. time() len in characters      */
  132. #define MAXTIMEOUT 3 * 60   /* max. time to wait for instruction  */
  133.  
  134. #define MAXFLUSHTIME 30     /* "last message repeated" after 30s  */
  135. /* ---------- */
  136.  
  137. #define MAXNUMKIDS MAXSUBIDS /* max # of children this can contain */
  138. /* --------------------- */
  139.  
  140. /* values for exit()/quit().. */
  141. #define ERROR   -1               /* used in error checking */
  142. #define SUCCESS  0               /* used in error checking and quiting */
  143. #define ABORT    SUCCESS         /* aborts are intentional.. so okay   */
  144. /* -------------------------- */
  145.  
  146. __END_DECLS
  147.  
  148. #endif /* _MACROS_H */
  149.