Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: net/tools/quic/quic_socket_utils.h

Issue 2229703003: Introduce TTL in QuicReceivedPacket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@129359661
Patch Set: git pull from upper stream Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_packet_reader.cc ('k') | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_socket_utils.h
diff --git a/net/tools/quic/quic_socket_utils.h b/net/tools/quic/quic_socket_utils.h
index fd72697fa9c223025f1d323f309cce2457a53a04..f8cc5392c5f81fc8b1aa3868294d1f087c6fc8eb 100644
--- a/net/tools/quic/quic_socket_utils.h
+++ b/net/tools/quic/quic_socket_utils.h
@@ -38,12 +38,13 @@ class QuicSocketUtils {
public:
// The first integer is for overflow. The in6_pktinfo is the larger of the
// address structures present. LinuxTimestamping is present for socket
- // timestamping.
+ // timestamping. The subsequent int is for ttl.
// The final int is a sentinel so the msg_controllen feedback
// can be used to detect larger control messages than there is space for.
static const int kSpaceForCmsg =
CMSG_SPACE(CMSG_LEN(sizeof(int)) + CMSG_LEN(sizeof(in6_pktinfo)) +
CMSG_LEN(sizeof(LinuxTimestamping)) +
+ CMSG_LEN(sizeof(int)) +
CMSG_LEN(sizeof(int)));
// Fills in |address| if |hdr| contains IP_PKTINFO or IPV6_PKTINFO. Fills in
@@ -58,6 +59,10 @@ class QuicSocketUtils {
static bool GetOverflowFromMsghdr(struct msghdr* hdr,
QuicPacketCount* dropped_packets);
+ // If the msghdr contains an IP_TTL entry, this will set ttl to the correct
+ // value and return true. Otherwise it will return false.
+ static bool GetTtlFromMsghdr(struct msghdr* hdr, int* ttl);
+
// Sets either IP_PKTINFO or IPV6_PKTINFO on the socket, based on
// address_family. Returns the return code from setsockopt.
static int SetGetAddressInfo(int fd, int address_family);
« no previous file with comments | « net/tools/quic/quic_packet_reader.cc ('k') | net/tools/quic/quic_socket_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698