#include <grpc/support/port_platform.h>
#include "src/core/lib/iomgr/buffer_list.h"
#include <grpc/support/log.h>
#include <grpc/support/time.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/iomgr/port.h"
#ifdef GRPC_LINUX_ERRQUEUE
#include <netinet/in.h>
#include <string.h>
#include <time.h>
namespace grpc_core {
namespace {
void FillGprFromTimestamp(gpr_timespec* gts, const struct timespec* ts) { … }
void DefaultTimestampsCallback(void* , Timestamps* ,
absl::Status ) { … }
void (*g_timestamps_callback)(void*, Timestamps*,
grpc_error_handle shutdown_err) = …;
template <typename T>
T ReadUnaligned(const void* ptr) { … }
void ExtractOptStatsFromTcpInfo(ConnectionMetrics* metrics,
const tcp_info* info) { … }
void ExtractOptStatsFromCmsg(ConnectionMetrics* metrics,
const cmsghdr* opt_stats) { … }
int GetSocketTcpInfo(struct tcp_info* info, int fd) { … }
}
bool TracedBufferList::TracedBuffer::Finished(gpr_timespec ts) { … }
void TracedBufferList::AddNewEntry(int32_t seq_no, int fd, void* arg) { … }
void TracedBufferList::ProcessTimestamp(struct sock_extended_err* serr,
struct cmsghdr* opt_stats,
struct scm_timestamping* tss) { … }
void TracedBufferList::Shutdown(void* remaining, absl::Status shutdown_err) { … }
void grpc_tcp_set_write_timestamps_callback(
void (*fn)(void*, Timestamps*, grpc_error_handle error)) { … }
}
#else
namespace grpc_core {
void grpc_tcp_set_write_timestamps_callback(
void (*fn)(void*, Timestamps*, grpc_error_handle error)) {
(void)fn;
gpr_log(GPR_DEBUG, "Timestamps callback is not enabled for this platform");
}
}
#endif