ia64/xen-unstable

view tools/xfrd/connection.h @ 1921:24ecc060e9d7

bitkeeper revision 1.1108.21.1 (41062740xHG36OEbpVAmVX5N9WCaNw)

make vmlinuz really stripped
author cl349@freefall.cl.cam.ac.uk
date Tue Jul 27 09:58:24 2004 +0000 (2004-07-27)
parents bae23a1177c6
children
line source
1 /* $Id: connection.h,v 1.1 2003/10/17 15:48:43 mjw Exp $ */
2 #ifndef _VFC_CONNECTION_H_
3 #define _VFC_CONNECTION_H_
5 #include <netinet/in.h>
7 #include "iostream.h"
8 #include "sxpr_parser.h"
10 /** A connection.
11 * The underlying transport is a socket.
12 * Contains in and out streams using the socket.
13 */
14 typedef struct Conn {
15 struct sockaddr_in addr;
16 int sock;
17 IOStream *in;
18 IOStream *out;
19 Parser *parser;
20 } Conn;
22 enum {
23 CONN_NOBUFFER=1,
24 CONN_READ_COMPRESS=2,
25 CONN_WRITE_COMPRESS=4,
26 };
28 extern int Conn_read_header(int sock, int *flags);
29 extern int Conn_write_header(int sock, int flags);
30 extern int Conn_init(Conn *conn, int flags, int sock, struct sockaddr_in addr);
31 extern int Conn_connect(Conn *conn, int flags, struct in_addr ipaddr, uint16_t port);
32 extern void Conn_close(Conn *conn);
34 extern int Conn_sxpr(Conn *conn, Sxpr *sxpr);
36 #endif /* ! _VFC_CONNECTION_H_ */