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

  1. #ifndef _STRUCTS_H
  2. #define _STRUCTS_H
  3.  
  4. __BEGIN_DECLS
  5.  
  6. typedef struct code {
  7.    char *c_name;
  8.    int c_val;
  9. } Code;
  10.  
  11. /* ----------------------------------- */
  12.  
  13. /* the basic structure for all msgs.. (used as an interface) */
  14. struct msg {
  15.    int cmdlen;
  16.    char cmdmsg[MAXSEGSIZE];
  17. };
  18.  
  19. /* ----------------------------------- */
  20.  
  21. /* priority structure for syslog msg priorities */
  22. struct priority {
  23.    int single;
  24.    int exclude;
  25.  
  26.    int ignpri;
  27.    int priority;
  28. };
  29.  
  30. /* ----------------------------------- */
  31.  
  32. /* the basic struct for a syslog msg */
  33. struct log {
  34.    int fd;
  35.    char *filename;
  36.  
  37.    int facility;
  38.    struct priority priority;
  39.  
  40.    int nsync;
  41. };
  42.  
  43. /* ----------------------------------- */
  44.  
  45. /* keep track of PIDs to kill then we exit.. in client structure */
  46. struct pidstat {
  47.    volatile sig_atomic_t pid;  /* pid of the process to kill later */
  48.    int ppid; /* pid of our parent process..      */
  49.    int pgid; /* pid of the process group leader  */
  50. };
  51.  
  52. /* ----------------------------------- */
  53.  
  54. /* main structure.. for clients */
  55. struct client {
  56.    int ID;        /* client's ID */
  57.  
  58.    int sockfd;    /* fd we have with client  */
  59.    int streamfd;  /* fd to streaming storage */
  60.  
  61.    char *hname; /* connection's host name */
  62.  
  63.    int pinging;   /* are we pinging? */
  64.  
  65.    /* FIX - make this dynamic...        */
  66.    struct log logs[MAXLOGTYPES]; 
  67.  
  68.    int shmID;               /* key ID for shared memory           */
  69.  
  70.    struct msg logmsg;       /* used to receive msgs from client   */
  71.  
  72.    char *segptr;            /* pointer to malloc'd shared mem seg */
  73.    char oldbuf[MAXSEGSIZE]; 
  74.  
  75.    struct pidstat pidstats[MAXNUMKIDS];  /* PIDs to kill later    */
  76.  
  77. #  ifndef NOSSL
  78.    SSL *sslconn;
  79.    SSL_CTX *sslctx;
  80. #  endif
  81.  
  82.    /* keep track of the PIDs for all this client's connections    */
  83.    /* [note: we don't even need these yet.. ]                     */
  84.  
  85.    volatile sig_atomic_t numSubIDs;  /* current number of sub-IDs */
  86.  
  87.    struct sockaddr_in saddr; /* source/client address */
  88.  
  89.    volatile sig_atomic_t free;    /* determine if structure is free */
  90.    volatile sig_atomic_t running; /* indicate if we can run         */
  91.    volatile sig_atomic_t newData; /* indicate if we have new data   */
  92. } clients[MAXCONNS];
  93.  
  94. __END_DECLS
  95.  
  96. #endif /* _STRUCTS_H */
  97.