aboutsummaryrefslogtreecommitdiff
path: root/zenhttp/httpshared.h
blob: fbf35076bb3e9c02df36726c0946426727d5c719 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zencore/iohash.h>

namespace zen {

class IoBuffer;
class CbPackage;

struct CbPackageHeader
{
	uint32_t HeaderMagic;
	uint32_t AttachmentCount;
	uint32_t Reserved1;
	uint32_t Reserved2;
};

static_assert(sizeof(CbPackageHeader) == 16);

static constinit uint32_t kCbPkgMagic = 0xaa77aacc;

struct CbAttachmentEntry
{
	uint64_t AttachmentSize;
	uint32_t Reserved1;
	IoHash	 AttachmentHash;
};

static_assert(sizeof(CbAttachmentEntry) == 32);

std::vector<IoBuffer> FormatPackageMessage(const CbPackage& Data);
CbPackage			  ParsePackageMessage(IoBuffer Payload);

}  // namespace zen