]> sjero.net Git - iperf/blobdiff - src/sockets.c
DCCP support for iperf
[iperf] / src / sockets.c
index 72eddd82a8c288fee619f9e536ce52a9cf76ab6f..2787c267de3e61c1ca1ecc1640d0c2f730729ba4 100644 (file)
@@ -118,6 +118,22 @@ int getsock_tcp_mss( int inSock ) {
     return theMSS;
 } /* end getsock_tcp_mss */
 
+/* -------------------------------------------------------------------
+ * returns the DCCP maximum datagram (payload) size
+ * ------------------------------------------------------------------- */
+int getsock_dccp_mps(int inSock)
+{
+    int rc, theMPS = 0;
+    Socklen_t len = sizeof(theMPS);
+
+    assert(inSock >= 0);
+
+    rc = getsockopt(inSock, SOL_DCCP, DCCP_SOCKOPT_GET_CUR_MPS, &theMPS, &len);
+    WARN_errno(rc == SOCKET_ERROR, "getsockopt DCCP_SOCKOPT_GET_CUR_MPS");
+
+    return theMPS;
+}
+
 /* -------------------------------------------------------------------
  * Attempts to reads n bytes from a socket.
  * Returns number actually read, or -1 on error.