ia64/xen-unstable

view tools/xfrd/connection.h @ 1820:3d4f8eb89670

bitkeeper revision 1.1106.1.2 (40faa780dekT3E5arFwcbQDu1MbX6g)

Cleaned up Xen's instruction emulator.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jul 18 16:38:24 2004 +0000 (2004-07-18)
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_ */