summaryrefslogtreecommitdiff
path: root/stubdom/vtpmmgr/marshal.h
diff options
context:
space:
mode:
Diffstat (limited to 'stubdom/vtpmmgr/marshal.h')
-rw-r--r--stubdom/vtpmmgr/marshal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/stubdom/vtpmmgr/marshal.h b/stubdom/vtpmmgr/marshal.h
index dce19c6439..f1037a7976 100644
--- a/stubdom/vtpmmgr/marshal.h
+++ b/stubdom/vtpmmgr/marshal.h
@@ -891,6 +891,15 @@ inline int sizeof_TPM_AUTH_SESSION(const TPM_AUTH_SESSION* auth) {
}
static
+inline int sizeof_TPM_RQU_HEADER(BYTE* ptr) {
+ int rv = 0;
+ rv += sizeof_UINT16(ptr);
+ rv += sizeof_UINT32(ptr);
+ rv += sizeof_UINT32(ptr);
+ return rv;
+}
+
+static
inline BYTE* pack_TPM_RQU_HEADER(BYTE* ptr,
TPM_TAG tag,
UINT32 size,
@@ -920,8 +929,14 @@ inline int unpack3_TPM_RQU_HEADER(BYTE* ptr, UINT32* pos, UINT32 max,
unpack3_UINT32(ptr, pos, max, ord);
}
+static
+inline int sizeof_TPM_RQU_GetRandom(BYTE* ptr) {
+ return sizeof_TPM_RQU_HEADER(ptr) + sizeof_UINT32(ptr);
+}
+
#define pack_TPM_RSP_HEADER(p, t, s, r) pack_TPM_RQU_HEADER(p, t, s, r)
#define unpack_TPM_RSP_HEADER(p, t, s, r) unpack_TPM_RQU_HEADER(p, t, s, r)
#define unpack3_TPM_RSP_HEADER(p, l, m, t, s, r) unpack3_TPM_RQU_HEADER(p, l, m, t, s, r)
+#define sizeof_TPM_RSP_HEADER(p) sizeof_TPM_RQU_HEADER(p)
#endif