X-Git-Url: http://sjero.net/git/?p=iperf;a=blobdiff_plain;f=src%2Fsockets.c;fp=src%2Fsockets.c;h=2787c267de3e61c1ca1ecc1640d0c2f730729ba4;hp=72eddd82a8c288fee619f9e536ce52a9cf76ab6f;hb=90fc1e2c0c74319759b21d4a177c32691b88fdf3;hpb=fad82d47d76abc8f4ac6767e58b89859ad35a2ca diff --git a/src/sockets.c b/src/sockets.c index 72eddd8..2787c26 100644 --- a/src/sockets.c +++ b/src/sockets.c @@ -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.