#ifndef QUICHE_QUIC_CORE_QUIC_PACKETS_H_
#define QUICHE_QUIC_CORE_QUIC_PACKETS_H_
#include <sys/types.h>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include "absl/strings/string_view.h"
#include "quiche/quic/core/frames/quic_frame.h"
#include "quiche/quic/core/quic_ack_listener_interface.h"
#include "quiche/quic/core/quic_bandwidth.h"
#include "quiche/quic/core/quic_connection_id.h"
#include "quiche/quic/core/quic_constants.h"
#include "quiche/quic/core/quic_error_codes.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/core/quic_types.h"
#include "quiche/quic/core/quic_versions.h"
#include "quiche/quic/platform/api/quic_export.h"
#include "quiche/quic/platform/api/quic_socket_address.h"
namespace quic {
class QuicPacket;
struct QuicPacketHeader;
QUICHE_EXPORT QuicConnectionId GetServerConnectionIdAsRecipient(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT QuicConnectionId GetClientConnectionIdAsRecipient(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT QuicConnectionId GetServerConnectionIdAsSender(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT QuicConnectionIdIncluded GetServerConnectionIdIncludedAsSender(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT QuicConnectionId GetClientConnectionIdAsSender(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT QuicConnectionIdIncluded GetClientConnectionIdIncludedAsSender(
const QuicPacketHeader& header, Perspective perspective);
QUICHE_EXPORT uint8_t
GetIncludedConnectionIdLength(QuicConnectionId connection_id,
QuicConnectionIdIncluded connection_id_included);
QUICHE_EXPORT uint8_t
GetIncludedDestinationConnectionIdLength(const QuicPacketHeader& header);
QUICHE_EXPORT uint8_t
GetIncludedSourceConnectionIdLength(const QuicPacketHeader& header);
QUICHE_EXPORT size_t GetPacketHeaderSize(QuicTransportVersion version,
const QuicPacketHeader& header);
QUICHE_EXPORT size_t GetPacketHeaderSize(
QuicTransportVersion version, uint8_t destination_connection_id_length,
uint8_t source_connection_id_length, bool include_version,
bool include_diversification_nonce,
QuicPacketNumberLength packet_number_length,
quiche::QuicheVariableLengthIntegerLength retry_token_length_length,
QuicByteCount retry_token_length,
quiche::QuicheVariableLengthIntegerLength length_length);
QUICHE_EXPORT size_t GetStartOfEncryptedData(QuicTransportVersion version,
const QuicPacketHeader& header);
QUICHE_EXPORT size_t GetStartOfEncryptedData(
QuicTransportVersion version, uint8_t destination_connection_id_length,
uint8_t source_connection_id_length, bool include_version,
bool include_diversification_nonce,
QuicPacketNumberLength packet_number_length,
quiche::QuicheVariableLengthIntegerLength retry_token_length_length,
QuicByteCount retry_token_length,
quiche::QuicheVariableLengthIntegerLength length_length);
struct QUICHE_EXPORT QuicPacketHeader { … };
struct QUICHE_EXPORT QuicPublicResetPacket { … };
struct QUICHE_EXPORT QuicVersionNegotiationPacket { … };
struct QUICHE_EXPORT QuicIetfStatelessResetPacket { … };
class QUICHE_EXPORT QuicData { … };
class QUICHE_EXPORT QuicPacket : public QuicData { … };
class QUICHE_EXPORT QuicEncryptedPacket : public QuicData { … };
namespace test {
class QuicReceivedPacketPeer;
}
class QUICHE_EXPORT QuicReceivedPacket : public QuicEncryptedPacket { … };
struct QUICHE_EXPORT SerializedPacket { … };
QUICHE_EXPORT SerializedPacket* CopySerializedPacket(
const SerializedPacket& serialized,
quiche::QuicheBufferAllocator* allocator, bool copy_buffer);
QUICHE_EXPORT char* CopyBuffer(const SerializedPacket& packet);
QUICHE_EXPORT char* CopyBuffer(const char* encrypted_buffer,
QuicPacketLength encrypted_length);
struct QUICHE_EXPORT QuicPerPacketContext { … };
struct QUICHE_EXPORT ReceivedPacketInfo { … };
struct QUICHE_EXPORT DispatcherSentPacket { … };
}
#endif