Home | History | Annotate | Line # | Download | only in netinet
      1 /*	$KAME: dccp_cc_sw.c,v 1.9 2005/10/21 05:33:51 nishida Exp $	*/
      2 /*	$NetBSD: dccp_cc_sw.c,v 1.3 2016/04/26 08:44:44 ozaki-r Exp $ */
      3 
      4 /*
      5  * Copyright (c) 2003  Nils-Erik Mattsson
      6  * All rights reserved.
      7  *
      8  * Redistribution and use in source and binary forms, with or without
      9  * modification, are permitted provided that the following conditions
     10  * are met:
     11  *
     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  * 3. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  *
     31  * Id: dccp_cc_sw.c,v 1.10 2003/05/14 08:14:46 nilmat-8 Exp
     32  */
     33 
     34 #include <sys/cdefs.h>
     35 __KERNEL_RCSID(0, "$NetBSD: dccp_cc_sw.c,v 1.3 2016/04/26 08:44:44 ozaki-r Exp $");
     36 
     37 #ifdef _KERNEL_OPT
     38 #include "opt_dccp.h"
     39 #endif
     40 
     41 #include <sys/param.h>
     42 #include <sys/systm.h>
     43 #include <sys/domain.h>
     44 #include <sys/kernel.h>
     45 #include <sys/lock.h>
     46 #include <sys/malloc.h>
     47 #include <sys/mbuf.h>
     48 #include <sys/proc.h>
     49 #include <sys/protosw.h>
     50 #include <sys/signalvar.h>
     51 #include <sys/socket.h>
     52 #include <sys/socketvar.h>
     53 #include <sys/mutex.h>
     54 #include <sys/sysctl.h>
     55 #include <sys/syslog.h>
     56 #include <sys/queue.h>
     57 
     58 #include <net/if.h>
     59 
     60 #include <netinet/in.h>
     61 #include <netinet/in_systm.h>
     62 #include <netinet/ip.h>
     63 #include <netinet/in_pcb.h>
     64 #include <netinet/in_var.h>
     65 
     66 #include <netinet/ip_icmp.h>
     67 #include <netinet/icmp_var.h>
     68 #include <netinet/ip_var.h>
     69 
     70 #include <netinet/dccp.h>
     71 #include <netinet/dccp_var.h>
     72 #include <netinet/dccp_tcplike.h>
     73 #include <netinet/dccp_tfrc.h>
     74 #include <netinet/dccp_cc_sw.h>
     75 
     76 struct dccp_cc_sw cc_sw[] = {
     77 { 0,			0,			0,
     78   0,						0,
     79   0,			0,			0
     80 },
     81 { dccp_nocc_init,	dccp_nocc_free,		dccp_nocc_send_packet,
     82   dccp_nocc_send_packet_sent,			dccp_nocc_packet_recv,
     83   dccp_nocc_init,	dccp_nocc_free,		dccp_nocc_packet_recv
     84 },
     85 { 0,			0,			0,
     86   0,						0,
     87   0,			0,			0
     88 },
     89 { tcplike_send_init,	tcplike_send_free,	tcplike_send_packet,
     90   tcplike_send_packet_sent,			 tcplike_send_packet_recv,
     91    tcplike_recv_init,	tcplike_recv_free,	tcplike_recv_packet_recv
     92 },
     93 { tfrc_send_init,	tfrc_send_free,		tfrc_send_packet,
     94   tfrc_send_packet_sent,			 tfrc_send_packet_recv,
     95    tfrc_recv_init,	tfrc_recv_free,		tfrc_recv_packet_recv
     96 },
     97 };
     98