#ifndef GRPC_SRC_CORE_LIB_TRANSPORT_TRANSPORT_H
#define GRPC_SRC_CORE_LIB_TRANSPORT_TRANSPORT_H
#include <grpc/support/port_platform.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <functional>
#include <string>
#include <utility>
#include "absl/status/status.h"
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include <grpc/impl/connectivity_state.h>
#include <grpc/slice.h>
#include <grpc/status.h>
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/channel/context.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/debug_location.h"
#include "src/core/lib/gprpp/orphanable.h"
#include "src/core/lib/gprpp/ref_counted.h"
#include "src/core/lib/iomgr/call_combiner.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/endpoint.h"
#include "src/core/lib/iomgr/error.h"
#include "src/core/lib/iomgr/iomgr_fwd.h"
#include "src/core/lib/iomgr/polling_entity.h"
#include "src/core/lib/promise/arena_promise.h"
#include "src/core/lib/promise/context.h"
#include "src/core/lib/promise/detail/status.h"
#include "src/core/lib/promise/pipe.h"
#include "src/core/lib/resource_quota/arena.h"
#include "src/core/lib/slice/slice_buffer.h"
#include "src/core/lib/transport/connectivity_state.h"
#include "src/core/lib/transport/metadata_batch.h"
#include "src/core/lib/transport/transport_fwd.h"
#define GRPC_PROTOCOL_VERSION_MAX_MAJOR …
#define GRPC_PROTOCOL_VERSION_MAX_MINOR …
#define GRPC_PROTOCOL_VERSION_MIN_MAJOR …
#define GRPC_PROTOCOL_VERSION_MIN_MINOR …
#define GRPC_ARG_TRANSPORT …
#define GRPC_WRITE_INTERNAL_COMPRESS …
#define GRPC_WRITE_INTERNAL_TEST_ONLY_WAS_COMPRESSED …
#define GRPC_WRITE_INTERNAL_USED_MASK …
namespace grpc_core {
ServerMetadata;
ServerMetadataHandle;
ClientMetadata;
ClientMetadataHandle;
class Message { … };
MessageHandle;
inline bool IsStatusOk(const ServerMetadataHandle& m) { … }
ServerMetadataHandle ServerMetadataFromStatus(
const absl::Status& status, Arena* arena = GetContext<Arena>());
template <>
struct StatusCastImpl<ServerMetadataHandle, absl::Status> { … };
template <>
struct StatusCastImpl<ServerMetadataHandle, const absl::Status&> { … };
template <>
struct StatusCastImpl<ServerMetadataHandle, absl::Status&> { … };
struct CallArgs { … };
NextPromiseFactory;
}
grpc_stream;
extern grpc_core::DebugOnlyTraceFlag grpc_trace_stream_refcount;
grpc_stream_refcount;
#ifndef NDEBUG
void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
grpc_iomgr_cb_func cb, void* cb_arg,
const char* object_type);
#define GRPC_STREAM_REF_INIT(rc, ir, cb, cb_arg, objtype) …
#else
void grpc_stream_ref_init(grpc_stream_refcount* refcount, int initial_refs,
grpc_iomgr_cb_func cb, void* cb_arg);
#define GRPC_STREAM_REF_INIT …
#endif
#ifndef NDEBUG
inline void grpc_stream_ref(grpc_stream_refcount* refcount,
const char* reason) { … }
#else
inline void grpc_stream_ref(grpc_stream_refcount* refcount) {
refcount->refs.RefNonZero();
}
#endif
void grpc_stream_destroy(grpc_stream_refcount* refcount);
#ifndef NDEBUG
inline void grpc_stream_unref(grpc_stream_refcount* refcount,
const char* reason) { … }
#else
inline void grpc_stream_unref(grpc_stream_refcount* refcount) {
if (GPR_UNLIKELY(refcount->refs.Unref())) {
grpc_stream_destroy(refcount);
}
}
#endif
grpc_slice grpc_slice_from_stream_owned_buffer(grpc_stream_refcount* refcount,
void* buffer, size_t length);
struct grpc_transport_one_way_stats { … };
struct grpc_transport_stream_stats { … };
void grpc_transport_move_one_way_stats(grpc_transport_one_way_stats* from,
grpc_transport_one_way_stats* to);
void grpc_transport_move_stats(grpc_transport_stream_stats* from,
grpc_transport_stream_stats* to);
struct grpc_handler_private_op_data { … };
grpc_transport_stream_op_batch_payload;
struct grpc_transport_stream_op_batch { … };
struct grpc_transport_stream_op_batch_payload { … };
grpc_transport_op;
size_t grpc_transport_stream_size(grpc_transport* transport);
int grpc_transport_init_stream(grpc_transport* transport, grpc_stream* stream,
grpc_stream_refcount* refcount,
const void* server_data,
grpc_core::Arena* arena);
void grpc_transport_set_pops(grpc_transport* transport, grpc_stream* stream,
grpc_polling_entity* pollent);
void grpc_transport_destroy_stream(grpc_transport* transport,
grpc_stream* stream,
grpc_closure* then_schedule_closure);
void grpc_transport_stream_op_batch_finish_with_failure(
grpc_transport_stream_op_batch* batch, grpc_error_handle error,
grpc_core::CallCombiner* call_combiner);
void grpc_transport_stream_op_batch_queue_finish_with_failure(
grpc_transport_stream_op_batch* batch, grpc_error_handle error,
grpc_core::CallCombinerClosureList* closures);
void grpc_transport_stream_op_batch_finish_with_failure_from_transport(
grpc_transport_stream_op_batch* batch, grpc_error_handle error);
std::string grpc_transport_stream_op_batch_string(
grpc_transport_stream_op_batch* op, bool truncate);
std::string grpc_transport_op_string(grpc_transport_op* op);
void grpc_transport_perform_stream_op(grpc_transport* transport,
grpc_stream* stream,
grpc_transport_stream_op_batch* op);
void grpc_transport_perform_op(grpc_transport* transport,
grpc_transport_op* op);
void grpc_transport_ping(grpc_transport* transport, grpc_closure* cb);
void grpc_transport_goaway(grpc_transport* transport, grpc_status_code status,
grpc_slice debug_data);
void grpc_transport_destroy(grpc_transport* transport);
grpc_endpoint* grpc_transport_get_endpoint(grpc_transport* transport);
grpc_transport_op* grpc_make_transport_op(grpc_closure* on_complete);
grpc_transport_stream_op_batch* grpc_make_transport_stream_op(
grpc_closure* on_complete);
namespace grpc_core {
constexpr const char* kKeepaliveThrottlingKey = …;
}
#endif