@@ -1295,6 +1295,48 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
12951295 return & value , err
12961296}
12971297
1298+ // GetsockoptTCPCCVegasInfo returns algorithm specific congestion control information for a socket using the "vegas"
1299+ // algorithm.
1300+ //
1301+ // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
1302+ //
1303+ // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
1304+ func GetsockoptTCPCCVegasInfo (fd , level , opt int ) (* TCPVegasInfo , error ) {
1305+ var value [SizeofTCPCCInfo / 4 ]uint32 // ensure proper alignment
1306+ vallen := _Socklen (SizeofTCPCCInfo )
1307+ err := getsockopt (fd , level , opt , unsafe .Pointer (& value [0 ]), & vallen )
1308+ out := (* TCPVegasInfo )(unsafe .Pointer (& value [0 ]))
1309+ return out , err
1310+ }
1311+
1312+ // GetsockoptTCPCCDCTCPInfo returns algorithm specific congestion control information for a socket using the "dctp"
1313+ // algorithm.
1314+ //
1315+ // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
1316+ //
1317+ // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
1318+ func GetsockoptTCPCCDCTCPInfo (fd , level , opt int ) (* TCPDCTCPInfo , error ) {
1319+ var value [SizeofTCPCCInfo / 4 ]uint32 // ensure proper alignment
1320+ vallen := _Socklen (SizeofTCPCCInfo )
1321+ err := getsockopt (fd , level , opt , unsafe .Pointer (& value [0 ]), & vallen )
1322+ out := (* TCPDCTCPInfo )(unsafe .Pointer (& value [0 ]))
1323+ return out , err
1324+ }
1325+
1326+ // GetsockoptTCPCCBBRInfo returns algorithm specific congestion control information for a socket using the "bbr"
1327+ // algorithm.
1328+ //
1329+ // The socket's congestion control algorighm can be retrieved via [GetsockoptString] with the [TCP_CONGESTION] option:
1330+ //
1331+ // algo, err := unix.GetsockoptString(fd, unix.IPPROTO_TCP, unix.TCP_CONGESTION)
1332+ func GetsockoptTCPCCBBRInfo (fd , level , opt int ) (* TCPBBRInfo , error ) {
1333+ var value [SizeofTCPCCInfo / 4 ]uint32 // ensure proper alignment
1334+ vallen := _Socklen (SizeofTCPCCInfo )
1335+ err := getsockopt (fd , level , opt , unsafe .Pointer (& value [0 ]), & vallen )
1336+ out := (* TCPBBRInfo )(unsafe .Pointer (& value [0 ]))
1337+ return out , err
1338+ }
1339+
12981340// GetsockoptString returns the string value of the socket option opt for the
12991341// socket associated with fd at the given socket level.
13001342func GetsockoptString (fd , level , opt int ) (string , error ) {
0 commit comments