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 <stdint.h>
19
20#include <string>
21#include <tuple>
22#include <vector>
23
25
28};
29
30using BufferType = std::vector<uint8_t>;
31
32// PayloadHeader + the byte size sent over the channel
33using Payload = std::tuple<PayloadHeader, BufferType>;
34
35// this is for short messages
36constexpr const ssize_t kMaxPayloadLength = 10000;
37
38using ConfUiPacketInfo = std::vector<std::vector<uint8_t>>;
39
41 std::string session_id_;
42 std::string type_;
44};
45
46std::string ToString(const ParsedPacket& packet);
47
48} // namespace cuttlefish::confui::packet
Definition: packet.cpp:33
std::tuple< PayloadHeader, BufferType > Payload
Definition: packet_types.h:33
std::string ToString(const ParsedPacket &packet)
Definition: packet_types.cpp:26
constexpr const ssize_t kMaxPayloadLength
Definition: packet_types.h:36
std::vector< std::vector< uint8_t > > ConfUiPacketInfo
Definition: packet_types.h:38
std::vector< uint8_t > BufferType
Definition: packet_types.h:30
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:26
uint32_t payload_length_
Definition: packet_types.h:27