1.\" $NetBSD: tcp_congctl.9,v 1.4 2008/04/30 13:10:58 martin Exp $ 2.\" 3.\" Copyright (c) 2006 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Rui Paulo. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd October 15, 2006 31.Dt TCP_CONGCTL 9 32.Os 33.Sh NAME 34.Nm tcp_congctl 35.Nd TCP congestion control API 36.Sh SYNOPSIS 37.In netinet/tcp_congctl.h 38.\" 39.Ft int 40.Fn tcp_congctl_register "const char *" "struct tcp_congctl *" 41.\" 42.Ft int 43.Fn tcp_congctl_unregister "const char *" 44.\" 45.Sh DESCRIPTION 46The 47.Nm tcp_congctrl 48API is used to add or remove TCP congestion control algorithms 49on-the-fly and to modularize them. 50It includes basically two functions: 51.Bl -tag -width "xxxxx" 52.It Fn tcp_congctl_register "const char *" "struct tcp_congctl *" 53Registers a new congestion control algorithm. 54The 55.Fa struct tcp_congctl 56argument must contain a list of callbacks like the following: 57.Bd -literal -offset indent 58struct tcp_congctl { 59 int (*fast_retransmit)(struct tcpcb *, 60 struct tcphdr *); 61 void (*slow_retransmit)(struct tcpcb *); 62 void (*fast_retransmit_newack)(struct tcpcb *, 63 struct tcphdr *); 64 void (*newack)(struct tcpcb *, 65 struct tcphdr *); 66 void (*cong_exp)(struct tcpcb *); 67}; 68.Ed 69.It Fn tcp_congctl_unregister "const char *" 70If found, unregister the selected TCP congestion control algorithm. 71.El 72.Sh RETURN VALUES 73.Fn tcp_congctl_register 74and 75.Fn tcp_congctl_unregister 76both return 77.Dv 0 78when there is no error. 79If the name is already registered, 80.Fn tcp_congctl_register 81will return 82.Er EEXIST . 83.Fn tcp_congctl_unregister 84can return 85.Er ENOENT 86if there is no congestion control algorithm by that name and can return 87.Er EBUSY 88if the matched algorithm is being used by userspace applications. 89.Sh FILES 90Implementation is in 91.Pa sys/netinet/tcp_congctl.c 92and the interface is in 93.Pa sys/netinet/tcp_congctl.h . 94.Sh SEE ALSO 95.Xr tcp 4 96