Add DSCP support for POSIX platforms.

This CL only includes the necessary changes in PhysicalSocketServer,
and doesn't include the Java or Objective C API.

Note that this is doing exactly the same thing as UDPSocketPosix
in chromium.

BUG=webrtc:5658

Change-Id: I295455eaccba2a83cdd1bc55848f325c310f8d32
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168260
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30478}
diff --git a/rtc_base/socket_unittest.cc b/rtc_base/socket_unittest.cc
index 2af3a8e..6ea4b47 100644
--- a/rtc_base/socket_unittest.cc
+++ b/rtc_base/socket_unittest.cc
@@ -1027,6 +1027,15 @@
   int current_nd, desired_nd = 1;
   ASSERT_EQ(-1, socket->GetOption(Socket::OPT_NODELAY, &current_nd));
   ASSERT_EQ(-1, socket->SetOption(Socket::OPT_NODELAY, desired_nd));
+
+#if defined(WEBRTC_POSIX)
+  // Check DSCP.
+  int current_dscp, desired_dscp = 1;
+  ASSERT_NE(-1, socket->GetOption(Socket::OPT_DSCP, &current_dscp));
+  ASSERT_NE(-1, socket->SetOption(Socket::OPT_DSCP, desired_dscp));
+  ASSERT_NE(-1, socket->GetOption(Socket::OPT_DSCP, &current_dscp));
+  ASSERT_EQ(desired_dscp, current_dscp);
+#endif
 }
 
 void SocketTest::SocketRecvTimestamp(const IPAddress& loopback) {