ip6protosw.h revision 53541
153541Sshin/* 253541Sshin * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 353541Sshin * All rights reserved. 453541Sshin * 553541Sshin * Redistribution and use in source and binary forms, with or without 653541Sshin * modification, are permitted provided that the following conditions 753541Sshin * are met: 853541Sshin * 1. Redistributions of source code must retain the above copyright 953541Sshin * notice, this list of conditions and the following disclaimer. 1053541Sshin * 2. Redistributions in binary form must reproduce the above copyright 1153541Sshin * notice, this list of conditions and the following disclaimer in the 1253541Sshin * documentation and/or other materials provided with the distribution. 1353541Sshin * 3. Neither the name of the project nor the names of its contributors 1453541Sshin * may be used to endorse or promote products derived from this software 1553541Sshin * without specific prior written permission. 1653541Sshin * 1753541Sshin * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 1853541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1953541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2053541Sshin * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE 2153541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2253541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2353541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2453541Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2553541Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2653541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2753541Sshin * SUCH DAMAGE. 2853541Sshin * 2953541Sshin * $FreeBSD: head/sys/netinet6/ip6protosw.h 53541 1999-11-22 02:45:11Z shin $ 3053541Sshin */ 3153541Sshin 3253541Sshin/* BSDI protosw.h,v 2.3 1996/10/11 16:02:40 pjd Exp */ 3353541Sshin 3453541Sshin/*- 3553541Sshin * Copyright (c) 1982, 1986, 1993 3653541Sshin * The Regents of the University of California. All rights reserved. 3753541Sshin * 3853541Sshin * Redistribution and use in source and binary forms, with or without 3953541Sshin * modification, are permitted provided that the following conditions 4053541Sshin * are met: 4153541Sshin * 1. Redistributions of source code must retain the above copyright 4253541Sshin * notice, this list of conditions and the following disclaimer. 4353541Sshin * 2. Redistributions in binary form must reproduce the above copyright 4453541Sshin * notice, this list of conditions and the following disclaimer in the 4553541Sshin * documentation and/or other materials provided with the distribution. 4653541Sshin * 3. All advertising materials mentioning features or use of this software 4753541Sshin * must display the following acknowledgement: 4853541Sshin * This product includes software developed by the University of 4953541Sshin * California, Berkeley and its contributors. 5053541Sshin * 4. Neither the name of the University nor the names of its contributors 5153541Sshin * may be used to endorse or promote products derived from this software 5253541Sshin * without specific prior written permission. 5353541Sshin * 5453541Sshin * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 5553541Sshin * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 5653541Sshin * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 5753541Sshin * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 5853541Sshin * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 5953541Sshin * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 6053541Sshin * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 6153541Sshin * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 6253541Sshin * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 6353541Sshin * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 6453541Sshin * SUCH DAMAGE. 6553541Sshin * 6653541Sshin * @(#)protosw.h 8.1 (Berkeley) 6/2/93 6753541Sshin */ 6853541Sshin 6953541Sshin#ifndef _NETINET6_IP6PROTOSW_H_ 7053541Sshin#define _NETINET6_IP6PROTOSW_H_ 7153541Sshin 7253541Sshin/* 7353541Sshin * Protocol switch table for IPv6. 7453541Sshin * All other definitions should refer to sys/protosw.h 7553541Sshin */ 7653541Sshin 7753541Sshinstruct mbuf; 7853541Sshinstruct sockaddr; 7953541Sshinstruct socket; 8053541Sshinstruct domain; 8153541Sshinstruct proc; 8253541Sshinstruct ip6_hdr; 8353541Sshinstruct pr_usrreqs; 8453541Sshin 8553541Sshin/* 8653541Sshin * argument type for the last arg of pr_ctlinput(). 8753541Sshin * should be consulted only with AF_INET6 family. 8853541Sshin */ 8953541Sshinstruct ip6ctlparam { 9053541Sshin struct mbuf *ip6c_m; /* start of mbuf chain */ 9153541Sshin struct ip6_hdr *ip6c_ip6; /* ip6 header of target packet */ 9253541Sshin int ip6c_off; /* offset of the target proto header */ 9353541Sshin}; 9453541Sshin 9553541Sshinstruct ip6protosw { 9653541Sshin int pr_type; /* socket type used for */ 9753541Sshin struct domain *pr_domain; /* domain protocol a member of */ 9853541Sshin short pr_protocol; /* protocol number */ 9953541Sshin short pr_flags; /* see below */ 10053541Sshin 10153541Sshin/* protocol-protocol hooks */ 10253541Sshin int (*pr_input) /* input to protocol (from below) */ 10353541Sshin __P((struct mbuf **, int *, int)); 10453541Sshin int (*pr_output) /* output to protocol (from above) */ 10553541Sshin __P((struct mbuf *, ...)); 10653541Sshin void (*pr_ctlinput) /* control input (from below) */ 10753541Sshin __P((int, struct sockaddr *, void *)); 10853541Sshin int (*pr_ctloutput) /* control output (from above) */ 10953541Sshin __P((struct socket *, struct sockopt *)); 11053541Sshin 11153541Sshin/* user-protocol hook */ 11253541Sshin int (*pr_usrreq) /* user request: see list below */ 11353541Sshin __P((struct socket *, int, struct mbuf *, 11453541Sshin struct mbuf *, struct mbuf *, struct proc *)); 11553541Sshin 11653541Sshin/* utility hooks */ 11753541Sshin void (*pr_init) /* initialization hook */ 11853541Sshin __P((void)); 11953541Sshin 12053541Sshin void (*pr_fasttimo) /* fast timeout (200ms) */ 12153541Sshin __P((void)); 12253541Sshin void (*pr_slowtimo) /* slow timeout (500ms) */ 12353541Sshin __P((void)); 12453541Sshin void (*pr_drain) /* flush any excess space possible */ 12553541Sshin __P((void)); 12653541Sshin struct pr_usrreqs *pr_usrreqs; /* supersedes pr_usrreq() */ 12753541Sshin}; 12853541Sshin 12953541Sshin#endif /* !_NETINET6_IP6PROTOSW_H_ */ 130