aboutsummaryrefslogtreecommitdiff
path: root/libqcdm/src/utils.h
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-02-22 10:52:59 -0800
committerDan Williams <dcbw@redhat.com>2010-02-22 10:52:59 -0800
commit0f9d4d2a1ac3414b25c71f736c5b1293e1595721 (patch)
tree4d7fb6885eab580005a5608cd44dbda1d757cb00 /libqcdm/src/utils.h
parentf5d1a9b40038c4c81b361a089b0753d149b3107c (diff)
qcdm: fix QCDM packet decapsulation
Rename and document the encapsulate/decapsulate functions, CRC-check the incoming packet, and make callers aware of the difference in how big the decapsulated packet is versus how many bytes they should discard from the buffer (since the decapsulated packet is at least 3 bytes shorter than the incoming packet due to the CRC + framing).
Diffstat (limited to 'libqcdm/src/utils.h')
-rw-r--r--libqcdm/src/utils.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/libqcdm/src/utils.h b/libqcdm/src/utils.h
index 15fc346b..5fccf7f9 100644
--- a/libqcdm/src/utils.h
+++ b/libqcdm/src/utils.h
@@ -36,11 +36,19 @@ gsize dm_unescape (const char *inbuf,
gsize outbuf_len,
gboolean *escaping);
-gsize dm_prepare_buffer (char *inbuf,
- gsize cmd_len,
- gsize inbuf_len,
- char *outbuf,
- gsize outbuf_len);
+gsize dm_encapsulate_buffer (char *inbuf,
+ gsize cmd_len,
+ gsize inbuf_len,
+ char *outbuf,
+ gsize outbuf_len);
+
+gboolean dm_decapsulate_buffer (const char *inbuf,
+ gsize inbuf_len,
+ char *outbuf,
+ gsize outbuf_len,
+ gsize *out_decap_len,
+ gsize *out_used,
+ gboolean *out_need_more);
#endif /* UTILS_H */