2008-04-30 17:10:46 +04:00
|
|
|
.\" $NetBSD: tcp_congctl.9,v 1.4 2008/04/30 13:10:58 martin Exp $
|
2006-10-09 20:27:07 +04:00
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Rui Paulo.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
|
|
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2006-10-15 21:48:07 +04:00
|
|
|
.Dd October 15, 2006
|
2006-10-09 20:27:07 +04:00
|
|
|
.Dt TCP_CONGCTL 9
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm tcp_congctl
|
|
|
|
.Nd TCP congestion control API
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.In netinet/tcp_congctl.h
|
|
|
|
.\"
|
|
|
|
.Ft int
|
|
|
|
.Fn tcp_congctl_register "const char *" "struct tcp_congctl *"
|
|
|
|
.\"
|
|
|
|
.Ft int
|
|
|
|
.Fn tcp_congctl_unregister "const char *"
|
|
|
|
.\"
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm tcp_congctrl
|
|
|
|
API is used to add or remove TCP congestion control algorithms
|
|
|
|
on-the-fly and to modularize them.
|
|
|
|
It includes basically two functions:
|
|
|
|
.Bl -tag -width "xxxxx"
|
|
|
|
.It Fn tcp_congctl_register "const char *" "struct tcp_congctl *"
|
2006-10-14 01:14:46 +04:00
|
|
|
Registers a new congestion control algorithm.
|
|
|
|
The
|
2006-10-09 20:27:07 +04:00
|
|
|
.Fa struct tcp_congctl
|
|
|
|
argument must contain a list of callbacks like the following:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
struct tcp_congctl {
|
|
|
|
int (*fast_retransmit)(struct tcpcb *,
|
|
|
|
struct tcphdr *);
|
|
|
|
void (*slow_retransmit)(struct tcpcb *);
|
|
|
|
void (*fast_retransmit_newack)(struct tcpcb *,
|
|
|
|
struct tcphdr *);
|
|
|
|
void (*newack)(struct tcpcb *,
|
|
|
|
struct tcphdr *);
|
2006-10-15 21:48:07 +04:00
|
|
|
void (*cong_exp)(struct tcpcb *);
|
2006-10-09 20:27:07 +04:00
|
|
|
};
|
|
|
|
.Ed
|
|
|
|
.It Fn tcp_congctl_unregister "const char *"
|
|
|
|
If found, unregister the selected TCP congestion control algorithm.
|
|
|
|
.El
|
|
|
|
.Sh RETURN VALUES
|
|
|
|
.Fn tcp_congctl_register
|
|
|
|
and
|
|
|
|
.Fn tcp_congctl_unregister
|
|
|
|
both return
|
2006-10-14 01:14:46 +04:00
|
|
|
.Dv 0
|
2006-10-09 20:27:07 +04:00
|
|
|
when there is no error.
|
|
|
|
If the name is already registered,
|
|
|
|
.Fn tcp_congctl_register
|
|
|
|
will return
|
2006-10-14 01:14:46 +04:00
|
|
|
.Er EEXIST .
|
2006-10-09 20:27:07 +04:00
|
|
|
.Fn tcp_congctl_unregister
|
|
|
|
can return
|
2006-10-14 01:14:46 +04:00
|
|
|
.Er ENOENT
|
2006-10-09 20:27:07 +04:00
|
|
|
if there is no congestion control algorithm by that name and can return
|
2006-10-14 01:14:46 +04:00
|
|
|
.Er EBUSY
|
2006-10-09 20:27:07 +04:00
|
|
|
if the matched algorithm is being used by userspace applications.
|
|
|
|
.Sh FILES
|
|
|
|
Implementation is in
|
|
|
|
.Pa sys/netinet/tcp_congctl.c
|
|
|
|
and the interface is in
|
|
|
|
.Pa sys/netinet/tcp_congctl.h .
|
2006-10-14 01:14:46 +04:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr tcp 4
|