Cleanup: Use common IP overhead definitions in test and prod code

This avoid duplication. As part of this moving the overhead calculation
to the IP address class so it's easier to find and more natural to use.

Bug: webrtc:9883
Change-Id: If4d865f445bc1a302572896932966ce30294e339
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/169445
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30657}
This commit is contained in:
Sebastian Jansson
2020-03-02 11:32:23 +01:00
committed by Commit Bot
parent 61f74d91f8
commit db5d7e470f
7 changed files with 28 additions and 40 deletions

View File

@ -21,8 +21,8 @@ extern const char TCP_PROTOCOL_NAME[];
extern const char SSLTCP_PROTOCOL_NAME[];
extern const char TLS_PROTOCOL_NAME[];
// Get the network layer overhead per packet based on the IP address family.
int GetIpOverhead(int addr_family);
constexpr int kTcpHeaderSize = 20;
constexpr int kUdpHeaderSize = 8;
// Get the transport layer overhead per packet based on the protocol.
int GetProtocolOverhead(const std::string& protocol);