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 >
Wrap
C/C++ Source or Header
|
2011-09-27
|
2KB
|
54 lines
/* @(#) $Id: client.h 776 2011-09-27 06:26:02Z leres $ (LBL) */
#ifndef acld_client_h
#define acld_client_h
#ifdef HAVE_BROCCOLI
#include <broccoli.h>
#include "broccoli.h"
#endif
#include "io.h"
enum clienttype {
CTYPE_PRIV = 0, /* unlimited */
CTYPE_RO, /* read/only */
CTYPE_WEB /* permittcpdsthostport */
};
struct client {
struct client *next;
u_int n; /* client number */
int c; /* client socket */
enum clienttype type;
int close; /* finish writing and then close */
#ifdef HAVE_BROCCOLI
int broccoli; /* Broccoli client */
BroConn *bc;
#endif
struct iobuf rbuf; /* read buffer */
struct iobuf wbuf; /* write buffer */
struct req *treq; /* partially built request */
struct req *req; /* request list */
};
extern struct s2v cmd2req[];
extern struct s2v ctype2str[];
#ifdef __STDC__
struct state;
#endif
void clientfinishreq(struct state *, struct client *, struct req *);
void clientinput(struct state *, struct client *);
void clientprocess(struct state *, struct client *, struct req *);
void clientsend(struct client *, struct req *);
void clientsendfmt(struct client *, struct req *, const char *, ...)
__attribute__ ((format (printf, 3, 4)));
void clientsenderr(struct client *, struct req *,
const char *, ...) __attribute__ ((format (printf, 3, 4)));
void clientwhitelist(struct state *, struct client *, struct req *);
void clientwrite(struct client *, const char *);
void freeclient(struct state *, struct client *);
struct client *newclient(struct state *, int);
#endif