ia64/xen-unstable

view tools/xfrd/marshal.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 0e23f01219c6
children
line source
1 #ifndef _XUTIL_MARSHAL_H_
2 #define _XUTIL_MARSHAL_H_
4 #include "iostream.h"
6 /** A 16-bit uint in network order, e.g. a port number. */
7 typedef uint16_t net16_t;
9 /** A 32-bit uint in network order, e.g. an IP address. */
10 typedef uint32_t net32_t;
12 extern int marshal_flush(IOStream *io);
14 extern int marshal_bytes(IOStream *io, void *s, uint32_t s_n);
15 extern int unmarshal_bytes(IOStream *io, void *s, uint32_t s_n);
17 extern int marshal_uint8(IOStream *io, uint8_t x);
18 extern int unmarshal_uint8(IOStream *io, uint8_t *x);
20 extern int marshal_uint16(IOStream *io, uint16_t x);
21 extern int unmarshal_uint16(IOStream *io, uint16_t *x);
23 extern int marshal_uint32(IOStream *io, uint32_t x);
24 extern int unmarshal_uint32(IOStream *io, uint32_t *x);
26 extern int marshal_int32(IOStream *io, int32_t x);
27 extern int unmarshal_int32(IOStream *io, int32_t *x);
29 extern int marshal_uint64(IOStream *io, uint64_t x);
30 extern int unmarshal_uint64(IOStream *io, uint64_t *x);
32 extern int marshal_net16(IOStream *io, net16_t x);
33 extern int unmarshal_net16(IOStream *io, net16_t *x);
35 extern int marshal_net32(IOStream *io, net32_t x);
36 extern int unmarshal_net32(IOStream *io, net32_t *x);
38 extern int marshal_string(IOStream *io, char *s, uint32_t s_n);
39 extern int unmarshal_string(IOStream *io, char *s, uint32_t s_n);
40 extern int unmarshal_new_string(IOStream *io, char **s, uint32_t *s_n);
42 #endif /* ! _XUTIL_MARSHAL_H_ */