#include "quiche/common/capsule.h"
#include <cstddef>
#include <cstdint>
#include <limits>
#include <ostream>
#include <string>
#include <type_traits>
#include <utility>
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/span.h"
#include "absl/types/variant.h"
#include "quiche/common/platform/api/quiche_bug_tracker.h"
#include "quiche/common/platform/api/quiche_export.h"
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/common/quiche_buffer_allocator.h"
#include "quiche/common/quiche_data_reader.h"
#include "quiche/common/quiche_data_writer.h"
#include "quiche/common/quiche_ip_address.h"
#include "quiche/common/quiche_status_utils.h"
#include "quiche/common/wire_serialization.h"
#include "quiche/web_transport/web_transport.h"
namespace quiche {
std::string CapsuleTypeToString(CapsuleType capsule_type) { … }
std::ostream& operator<<(std::ostream& os, const CapsuleType& capsule_type) { … }
Capsule Capsule::Datagram(absl::string_view http_datagram_payload) { … }
Capsule Capsule::LegacyDatagram(absl::string_view http_datagram_payload) { … }
Capsule Capsule::LegacyDatagramWithoutContext(
absl::string_view http_datagram_payload) { … }
Capsule Capsule::CloseWebTransportSession(
webtransport::SessionErrorCode error_code,
absl::string_view error_message) { … }
Capsule Capsule::AddressRequest() { … }
Capsule Capsule::AddressAssign() { … }
Capsule Capsule::RouteAdvertisement() { … }
Capsule Capsule::Unknown(uint64_t capsule_type,
absl::string_view unknown_capsule_data) { … }
bool Capsule::operator==(const Capsule& other) const { … }
std::string DatagramCapsule::ToString() const { … }
std::string LegacyDatagramCapsule::ToString() const { … }
std::string LegacyDatagramWithoutContextCapsule::ToString() const { … }
std::string CloseWebTransportSessionCapsule::ToString() const { … }
std::string DrainWebTransportSessionCapsule::ToString() const { … }
std::string AddressRequestCapsule::ToString() const { … }
std::string AddressAssignCapsule::ToString() const { … }
std::string RouteAdvertisementCapsule::ToString() const { … }
std::string UnknownCapsule::ToString() const { … }
std::string WebTransportStreamDataCapsule::ToString() const { … }
std::string WebTransportResetStreamCapsule::ToString() const { … }
std::string WebTransportStopSendingCapsule::ToString() const { … }
std::string WebTransportMaxStreamDataCapsule::ToString() const { … }
std::string WebTransportMaxStreamsCapsule::ToString() const { … }
std::string Capsule::ToString() const { … }
std::ostream& operator<<(std::ostream& os, const Capsule& capsule) { … }
CapsuleParser::CapsuleParser(Visitor* visitor) : … { … }
class WirePrefixWithId { … };
class WireIpAddressRange { … };
template <typename... T>
absl::StatusOr<quiche::QuicheBuffer> SerializeCapsuleFields(
CapsuleType type, QuicheBufferAllocator* allocator, T... fields) { … }
absl::StatusOr<quiche::QuicheBuffer> SerializeCapsuleWithStatus(
const Capsule& capsule, quiche::QuicheBufferAllocator* allocator) { … }
QuicheBuffer SerializeDatagramCapsuleHeader(uint64_t datagram_size,
QuicheBufferAllocator* allocator) { … }
QUICHE_EXPORT QuicheBuffer SerializeWebTransportStreamCapsuleHeader(
webtransport::StreamId stream_id, bool fin, uint64_t write_size,
QuicheBufferAllocator* allocator) { … }
QuicheBuffer SerializeCapsule(const Capsule& capsule,
quiche::QuicheBufferAllocator* allocator) { … }
bool CapsuleParser::IngestCapsuleFragment(absl::string_view capsule_fragment) { … }
namespace {
absl::Status ReadWebTransportStreamId(QuicheDataReader& reader,
webtransport::StreamId& id) { … }
absl::StatusOr<Capsule> ParseCapsulePayload(QuicheDataReader& reader,
CapsuleType type) { … }
}
absl::StatusOr<size_t> CapsuleParser::AttemptParseCapsule() { … }
void CapsuleParser::ReportParseFailure(absl::string_view error_message) { … }
void CapsuleParser::ErrorIfThereIsRemainingBufferedData() { … }
bool PrefixWithId::operator==(const PrefixWithId& other) const { … }
bool IpAddressRange::operator==(const IpAddressRange& other) const { … }
bool AddressAssignCapsule::operator==(const AddressAssignCapsule& other) const { … }
bool AddressRequestCapsule::operator==(
const AddressRequestCapsule& other) const { … }
bool RouteAdvertisementCapsule::operator==(
const RouteAdvertisementCapsule& other) const { … }
bool WebTransportStreamDataCapsule::operator==(
const WebTransportStreamDataCapsule& other) const { … }
bool WebTransportResetStreamCapsule::operator==(
const WebTransportResetStreamCapsule& other) const { … }
bool WebTransportStopSendingCapsule::operator==(
const WebTransportStopSendingCapsule& other) const { … }
bool WebTransportMaxStreamDataCapsule::operator==(
const WebTransportMaxStreamDataCapsule& other) const { … }
bool WebTransportMaxStreamsCapsule::operator==(
const WebTransportMaxStreamsCapsule& other) const { … }
}