Android-cuttlefish cvd tool
packet_types.h
Go to the documentation of this file.
1//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include <cstdint>
19#include <sstream>
20#include <string>
21#include <tuple>
22#include <vector>
23
24namespace cuttlefish {
25namespace confui {
26namespace packet {
28 std::uint32_t payload_length_;
29};
30
31using BufferType = std::vector<std::uint8_t>;
32
33// PayloadHeader + the byte size sent over the channel
34using Payload = std::tuple<PayloadHeader, BufferType>;
35
36// this is for short messages
37constexpr const ssize_t kMaxPayloadLength = 10000;
38
39using ConfUiPacketInfo = std::vector<std::vector<std::uint8_t>>;
41 std::string session_id_;
42 std::string type_;
44};
45
46std::string ToString(const ParsedPacket& packet);
47} // end of namespace packet
48} // end of namespace confui
49} // end of namespace cuttlefish
std::tuple< PayloadHeader, BufferType > Payload
Definition: packet_types.h:34
std::string ToString(const ParsedPacket &packet)
Definition: packet_types.cpp:23
std::vector< std::uint8_t > BufferType
Definition: packet_types.h:31
constexpr const ssize_t kMaxPayloadLength
Definition: packet_types.h:37
std::vector< std::vector< std::uint8_t > > ConfUiPacketInfo
Definition: packet_types.h:39
Definition: alloc_utils.cpp:23
Definition: packet_types.h:40
std::string session_id_
Definition: packet_types.h:41
ConfUiPacketInfo additional_info_
Definition: packet_types.h:43
std::string type_
Definition: packet_types.h:42
Definition: packet_types.h:27
std::uint32_t payload_length_
Definition: packet_types.h:28