ia64/xen-unstable

view tools/xfrd/connection.h @ 2422:2274a0386cc9

bitkeeper revision 1.1159.69.5 (4138e882jA1YaR_OfTfNHe_uT4PDIg)

trivial
author iap10@labyrinth.cl.cam.ac.uk
date Fri Sep 03 21:56:18 2004 +0000 (2004-09-03)
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_ */