NetBSD/share/man/man9/tcp_congctl.9

96 lines
3.1 KiB
Groff
Raw Normal View History

.\" $NetBSD: tcp_congctl.9,v 1.4 2008/04/30 13:10:58 martin Exp $
.\"
.\" 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
.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 *"
Registers a new congestion control algorithm.
The
.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 *);
};
.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
.Dv 0
when there is no error.
If the name is already registered,
.Fn tcp_congctl_register
will return
.Er EEXIST .
.Fn tcp_congctl_unregister
can return
.Er ENOENT
if there is no congestion control algorithm by that name and can return
.Er EBUSY
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 .
.Sh SEE ALSO
.Xr tcp 4