X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Finterfaces%2Fvmm_keyed_stream.h;h=1328e4f37124567f3cccfaa24dee019e643bf33d;hb=0246f0904a4800dbe1e8e23332d49b468a58f751;hp=d9a9eeaf80ff183b76a5970216b454d4de9ff5a5;hpb=4fefacc8951fd57a8f5609cf149eb3e5710dee73;p=palacios.git diff --git a/palacios/include/interfaces/vmm_keyed_stream.h b/palacios/include/interfaces/vmm_keyed_stream.h index d9a9eea..1328e4f 100644 --- a/palacios/include/interfaces/vmm_keyed_stream.h +++ b/palacios/include/interfaces/vmm_keyed_stream.h @@ -31,6 +31,9 @@ If you open a key for reading, you get the read pointer set to its beginning. You can then make repeated reads to advance the read pointer. You cannot seek. + Reading is done with a tag supplied, and we will match the requested tag + against the actual tag. If they do not match, we immediately return + with an error. Writing works similarly. @@ -54,15 +57,21 @@ v3_keyed_stream_key_t v3_keyed_stream_open_key(v3_keyed_stream_t stream, char *k void v3_keyed_stream_close_key(v3_keyed_stream_t stream, char *key); sint64_t v3_keyed_stream_write_key(v3_keyed_stream_t stream, v3_keyed_stream_key_t key, + void *tag, + sint64_t taglen, void *buf, sint64_t len); sint64_t v3_keyed_stream_read_key(v3_keyed_stream_t stream, v3_keyed_stream_key_t key, + void *tag, + sint64_t taglen, void *buf, sint64_t len); +/* We will kill this stuff since it's now in the interface + #define STD_SAVE_RAW(stream,ks,x) \ do { \ if (sizeof((x)) != v3_keyed_stream_write_key((stream), (ks), &(x), sizeof((x)))) { \ @@ -82,6 +91,7 @@ sint64_t v3_keyed_stream_read_key(v3_keyed_stream_t stream, #define KSTREAM_MAGIC_COOKIE 0xabcd0123 + #define STD_SAVE_TAGGED(stream,ks,tag,size,x) \ do { \ uint32_t temp; \ @@ -162,6 +172,9 @@ if ((size) != v3_keyed_stream_read_key((stream),(ks),&(x),(size))) { \ #define STD_LOAD(stream,ks,x) STD_LOAD_RAW(stream,ks,x) #endif +*/ + +#endif struct v3_keyed_stream_hooks { @@ -184,11 +197,15 @@ struct v3_keyed_stream_hooks { sint64_t (*write_key)(v3_keyed_stream_t stream, v3_keyed_stream_key_t key, + void *tag, + sint64_t taglen, void *buf, sint64_t len); sint64_t (*read_key)(v3_keyed_stream_t stream, v3_keyed_stream_key_t key, + void *tag, + sint64_t taglen, void *buf, sint64_t len);