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

  1. /* ------------- our macros ------------- */
  2.  
  3. #ifndef _MACROS_H
  4. #define _MACROS_H
  5.  
  6. __BEGIN_DECLS
  7.  
  8. /* marker macros */
  9.  
  10. #define BEGIN_HOUR 0
  11. #define END_HOUR 23
  12. #define END_MINUTE 59
  13. #define END_SECOND 0
  14.  
  15. #define ID   "0001" /* client's identification  */
  16. #define VER  "1"    /* current client version */
  17.  
  18. #define SRSMAILADDR "SRS@repsec.com"   /* report/request from here */
  19.  
  20. /* info servers... */
  21. #define PRIMSERV "128.11.253.1"  /* enigma.repsec.com  */
  22. #define SECSERV  "128.11.253.60" /* prodigy.repsec.com */
  23.  
  24. /* ----------------------------- */
  25.  
  26. /* file/directory information */
  27. /* -------------------------- */
  28.  
  29. #ifdef _PATH_LOG
  30. # define SYSLOGFILE _PATH_LOG          /* where syslogs come from */
  31. #else
  32. # define SYSLOGFILE "/dev/log"
  33. #endif
  34.  
  35. /* this never changes does it? */
  36. # define SUNLOGFILE "/devices/pseudo/log@0:log" /* /dev/log -> this */
  37.  
  38. #ifdef _PATH_KLOG
  39. # define KLOGFILE _PATH_KLOG
  40. #else
  41. # define KLOGFILE "/dev/klog"
  42. #endif
  43.  
  44. /* -------------------------- */
  45.  
  46. #ifdef _PATH_LOGCONF
  47. # define CONFILE _PATH_LOGCONF
  48. #else
  49. # define CONFILE   "/etc/syslog.conf"  /* the SRS config file    */ 
  50. #endif
  51.  
  52. #define USERFILE "/etc/SRS.user"
  53.  
  54. /* -------------------------- */
  55.  
  56. #ifndef UTMP_FILE
  57. # ifdef UTMP_FILENAME
  58. #  define UTMP_FILE UTMP_FILENAME
  59. # else
  60. #  ifdef _PATH_UTMP
  61. #   define UTMP_FILE _PATH_UTMP
  62. #  else
  63. #   define UTMP_FILE "/etc/utmp"
  64. #  endif
  65. # endif
  66. #endif
  67.  
  68. /* -------------------------- */
  69.  
  70. #define PATH_LOGPID "/etc/SRS.pid"
  71.  
  72. #define LOGFILE    "SRS.log"           /* file for syslogs */
  73.  
  74. #define ERRLOG     "error.log"         /* file to log errors to  */
  75. #define DEBLOG     "debug.log"         /* file to output db info */
  76. /* -------------------------- */
  77.  
  78. /* ssl macros */
  79. #ifndef NOSSL
  80. #define PARAMDIR "/var/log/SRS/certs"
  81. #endif
  82. /* ---------- */
  83.  
  84. /* miscellaneous stuff */
  85. #ifndef INADDR_NONE
  86. # define INADDR_NONE ((unsigned long int) 0xffffffff)
  87. #endif
  88.  
  89. #ifndef IPPORT_RESERVED
  90. #define IPPORT_RESERVED 1024
  91. #endif
  92.  
  93. #define PORT 797     /* server port to conn to     */
  94. #define LOCPORT 979  /* local port to bind to      */
  95.  
  96. #define INIT 100    /* used by INIT for setjmp()   */
  97.  
  98. #define ALL   1000  /* used for '*' facilities     */
  99. #define NONE -1000  /* used for 'none' facilitites */
  100.  
  101. #define REPTIME 30          /* min time between duplicate msgs  */
  102. #define PROBETIME 5 * 60    /* time of inactivity for KEEPALIVE */
  103. /* -------------------------- */
  104.  
  105. #ifndef HAVE_MEMCPY
  106. # define memcpy(d, s, n) bcopy((s), (d), (n))
  107. #endif
  108.  
  109. #ifndef WIFEXITED
  110. # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  111. #endif
  112. /* -------------------------- */
  113.  
  114. /* ------ syslog stuff ------ */
  115. #define LOG_NPRIORITIES 12 /* I think it's 12.. */
  116.  
  117. #ifndef LOG_FAC
  118. # define LOG_FAC(p) (((p) & LOG_FACMASK) >> 2)
  119. #endif
  120.  
  121. #ifndef LOG_PRI
  122. # define LOG_PRI(p) ((p) & LOG_PRIMASK)
  123. #endif
  124.  
  125. #ifndef LOG_MAKEPRI
  126. # define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
  127. #endif
  128.  
  129. #ifndef INTERNAL_MARK
  130. # define INTERNAL_MARK LOG_MAKEPRI(LOG_NFACILITIES, 0)
  131. #endif
  132.  
  133. #ifndef INTERNAL_NOPRI
  134. # define INTERNAL_NOPRI 0x10
  135. #endif
  136.  
  137. #ifndef DEFUPRI
  138. # ifdef SUN
  139. #  define DEFUPRI (LOG_USER | LOG_INFO)
  140. # else
  141. #  define DEFUPRI (LOG_USER | LOG_NOTICE)
  142. # endif
  143. #endif
  144.  
  145. #ifndef DEFSPRI
  146. # define DEFSPRI (LOG_KERN | LOG_CRIT)
  147. #endif
  148. /* -------------------------- */
  149.  
  150. /* --- I/O declarations. ---  */
  151. #define STDIN  0
  152. #define STDOUT 1
  153. #define STDERR 2
  154. /* -------------------------- */
  155.  
  156.  
  157. /* maximum stuff */
  158. /* ------------- */
  159.  
  160. /* the real # of combos = NFAC * NPRI * USERS, but that's too big */
  161. #define MAXLOGTYPES LOG_NFACILITIES + LOG_NPRIORITIES + MAXNUMUSERS
  162.  
  163. #define MAXUSERNAME 8             /* max. length of a user name */
  164. #define MAXNUMUSERS 20            /* max. # users to report to  */
  165.  
  166. #define MAXFNAMESIZE 256           /* max. length of a filename  */
  167. #define MAXDNAMESIZE 256           /* max. length of a directory */
  168.  
  169. #ifndef PAGE_SIZE
  170. #define PAGE_SIZE 4096
  171. #endif
  172.  
  173. #define MAXSEGSIZE   PAGE_SIZE     /* max. size of shared mem. seg */
  174.  
  175. #define MAXREADSIZE  MAXSEGSIZE/2  /* max. number of bytes at once */
  176. #define MAXWRITESIZE MAXSEGSIZE/2  /* max. number of bytes at once */
  177.  
  178. #define MAXLOGSIZE MAXREADSIZE
  179.  
  180. #define MAXSERVNUM 32              /* maximum # of servers in list */
  181.  
  182. /* -------------------------- */
  183.  
  184. /* time stuff */
  185. #define MAXPAUSE  5               /* max. sleep() when waiting...  */
  186. #define NORMPAUSE 2               /* avg. time to sleep() for wait */
  187.  
  188. #define MAXTIMEOUT 2 * 60         /* max # of seconds to wait...   */
  189.  
  190. #define MAXFLUSHTIME 30           /* "last message repeated" after */
  191. /* -------------------------- */
  192.  
  193. /* for error checking.. quit()/exit().. etc. */
  194. #define ERROR   -1   
  195. #define SUCCESS  0
  196. #define ABORT    SUCCESS /* aborts are intentional.. so its okay */
  197.  
  198. __END_DECLS
  199.  
  200. #endif /* _MACROS_H */
  201.