2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2011, Peter Dinda <pdinda@northwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Peter Dinda <pdinda@northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #include <palacios/vmm_keyed_stream.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vmm_debug.h>
24 #include <palacios/vmm_types.h>
25 #include <palacios/vm_guest.h>
27 struct v3_keyed_stream_hooks * keyed_stream_hooks = 0;
29 v3_keyed_stream_t v3_keyed_stream_open(char *url, v3_keyed_stream_open_t open_type)
31 V3_ASSERT(keyed_stream_hooks != NULL);
32 V3_ASSERT(keyed_stream_hooks->open != NULL);
34 return keyed_stream_hooks->open(url,open_type);
39 void v3_keyed_stream_close(v3_keyed_stream_t stream)
41 V3_ASSERT(keyed_stream_hooks != NULL);
42 V3_ASSERT(keyed_stream_hooks->close != NULL);
44 return keyed_stream_hooks->close(stream);
49 v3_keyed_stream_key_t v3_keyed_stream_open_key(v3_keyed_stream_t stream, char *key)
51 V3_ASSERT(keyed_stream_hooks != NULL);
52 V3_ASSERT(keyed_stream_hooks->open_key != NULL);
54 return keyed_stream_hooks->open_key(stream,key);
58 void v3_keyed_stream_close_key(v3_keyed_stream_t stream, char *key)
60 V3_ASSERT(keyed_stream_hooks != NULL);
61 V3_ASSERT(keyed_stream_hooks->close_key != NULL);
63 return keyed_stream_hooks->close_key(stream,key);
67 sint64_t v3_keyed_stream_write_key(v3_keyed_stream_t stream,
68 v3_keyed_stream_key_t key,
72 V3_ASSERT(keyed_stream_hooks != NULL);
73 V3_ASSERT(keyed_stream_hooks->write_key != NULL);
75 return keyed_stream_hooks->write_key(stream,key,buf,len);
78 sint64_t v3_keyed_stream_read_key(v3_keyed_stream_t stream,
79 v3_keyed_stream_key_t key,
83 V3_ASSERT(keyed_stream_hooks != NULL);
84 V3_ASSERT(keyed_stream_hooks->read_key != NULL);
86 return keyed_stream_hooks->read_key(stream,key,buf,len);
91 void V3_Init_Keyed_Streams(struct v3_keyed_stream_hooks * hooks) {
92 keyed_stream_hooks = hooks;
93 PrintDebug("V3 keyed stream support inited\n");