home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.lbl.gov / 2014.05.ftp.ee.lbl.gov.tar / ftp.ee.lbl.gov / acld-1.11.tar.gz / acld-1.11.tar / acld-1.11 / client.h < prev    next >
C/C++ Source or Header  |  2011-09-27  |  2KB  |  54 lines

  1. /* @(#) $Id: client.h 776 2011-09-27 06:26:02Z leres $ (LBL) */
  2. #ifndef acld_client_h
  3. #define acld_client_h
  4.  
  5. #ifdef HAVE_BROCCOLI
  6. #include <broccoli.h>
  7.  
  8. #include "broccoli.h"
  9. #endif
  10. #include "io.h"
  11.  
  12. enum clienttype {
  13.     CTYPE_PRIV = 0,            /* unlimited */
  14.     CTYPE_RO,            /* read/only */
  15.     CTYPE_WEB            /* permittcpdsthostport */
  16. };
  17.  
  18. struct client {
  19.     struct client *next;
  20.     u_int n;            /* client number */
  21.     int c;                /* client socket */
  22.     enum clienttype type;
  23.     int close;            /* finish writing and then close */
  24. #ifdef HAVE_BROCCOLI
  25.     int broccoli;            /* Broccoli client */
  26.     BroConn *bc;
  27. #endif
  28.     struct iobuf rbuf;        /* read buffer */
  29.     struct iobuf wbuf;        /* write buffer */
  30.     struct req *treq;        /* partially built request */
  31.     struct req *req;        /* request list */
  32. };
  33.  
  34. extern struct s2v cmd2req[];
  35. extern struct s2v ctype2str[];
  36.  
  37. #ifdef __STDC__
  38. struct state;
  39. #endif
  40.  
  41. void clientfinishreq(struct state *, struct client *, struct req *);
  42. void clientinput(struct state *, struct client *);
  43. void clientprocess(struct state *, struct client *, struct req *);
  44. void clientsend(struct client *, struct req *);
  45. void clientsendfmt(struct client *, struct req *, const char *, ...)
  46.     __attribute__ ((format (printf, 3, 4)));
  47. void clientsenderr(struct client *, struct req *,
  48.     const char *, ...) __attribute__ ((format (printf, 3, 4)));
  49. void clientwhitelist(struct state *, struct client *, struct req *);
  50. void clientwrite(struct client *, const char *);
  51. void freeclient(struct state *, struct client *);
  52. struct client *newclient(struct state *, int);
  53. #endif
  54.