ip6protosw.h revision 56016
143971Snsouch/*
243971Snsouch * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
343971Snsouch * All rights reserved.
443971Snsouch *
543971Snsouch * Redistribution and use in source and binary forms, with or without
643971Snsouch * modification, are permitted provided that the following conditions
743971Snsouch * are met:
843971Snsouch * 1. Redistributions of source code must retain the above copyright
943971Snsouch *    notice, this list of conditions and the following disclaimer.
1043971Snsouch * 2. Redistributions in binary form must reproduce the above copyright
1143971Snsouch *    notice, this list of conditions and the following disclaimer in the
1243971Snsouch *    documentation and/or other materials provided with the distribution.
1343971Snsouch * 3. Neither the name of the project nor the names of its contributors
1443971Snsouch *    may be used to endorse or promote products derived from this software
1543971Snsouch *    without specific prior written permission.
1643971Snsouch *
1743971Snsouch * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1843971Snsouch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1943971Snsouch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2043971Snsouch * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2143971Snsouch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2243971Snsouch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2343971Snsouch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2443971Snsouch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2550476Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2643971Snsouch * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2769860Sru * SUCH DAMAGE.
28203692Sgavin *
2979538Sru * $FreeBSD: head/sys/netinet6/ip6protosw.h 56016 2000-01-15 05:20:40Z shin $
3043971Snsouch */
3143971Snsouch
3275670Sru/*	BSDI protosw.h,v 2.3 1996/10/11 16:02:40 pjd Exp	*/
3343971Snsouch
3456468Sasmodai/*-
3583600Smurray * Copyright (c) 1982, 1986, 1993
3656468Sasmodai *	The Regents of the University of California.  All rights reserved.
3743971Snsouch *
3843971Snsouch * Redistribution and use in source and binary forms, with or without
3971895Sru * modification, are permitted provided that the following conditions
4079727Sschweikh * are met:
4143971Snsouch * 1. Redistributions of source code must retain the above copyright
4270466Sru *    notice, this list of conditions and the following disclaimer.
4343971Snsouch * 2. Redistributions in binary form must reproduce the above copyright
4457731Ssheldonh *    notice, this list of conditions and the following disclaimer in the
4557731Ssheldonh *    documentation and/or other materials provided with the distribution.
4643971Snsouch * 3. All advertising materials mentioning features or use of this software
4743971Snsouch *    must display the following acknowledgement:
4843971Snsouch *	This product includes software developed by the University of
4943971Snsouch *	California, Berkeley and its contributors.
5049831Smpp * 4. Neither the name of the University nor the names of its contributors
5149831Smpp *    may be used to endorse or promote products derived from this software
5243971Snsouch *    without specific prior written permission.
5343971Snsouch *
5443971Snsouch * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
5593020Snsouch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5649831Smpp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5743971Snsouch * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5843971Snsouch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5943971Snsouch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
6049831Smpp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
6143971Snsouch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
6243971Snsouch * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 *	@(#)protosw.h	8.1 (Berkeley) 6/2/93
67 */
68
69#ifndef _NETINET6_IP6PROTOSW_H_
70#define _NETINET6_IP6PROTOSW_H_
71
72/*
73 * Protocol switch table for IPv6.
74 * All other definitions should refer to sys/protosw.h
75 */
76
77struct	mbuf;
78struct	sockaddr;
79struct	socket;
80struct	sockopt;
81struct	domain;
82struct	proc;
83struct	ip6_hdr;
84struct	pr_usrreqs;
85
86/*
87 * argument type for the last arg of pr_ctlinput().
88 * should be consulted only with AF_INET6 family.
89 */
90struct ip6ctlparam {
91	struct	mbuf *ip6c_m;		/* start of mbuf chain */
92	struct	ip6_hdr *ip6c_ip6;	/* ip6 header of target packet */
93	int	ip6c_off;		/* offset of the target proto header */
94};
95
96struct ip6protosw {
97	int	pr_type;		/* socket type used for */
98	struct	domain *pr_domain;	/* domain protocol a member of */
99	short	pr_protocol;		/* protocol number */
100	short	pr_flags;		/* see below */
101
102/* protocol-protocol hooks */
103	int	(*pr_input)		/* input to protocol (from below) */
104			__P((struct mbuf **, int *, int));
105	int	(*pr_output)		/* output to protocol (from above) */
106			__P((struct mbuf *, ...));
107	void	(*pr_ctlinput)		/* control input (from below) */
108			__P((int, struct sockaddr *, void *));
109	int	(*pr_ctloutput)		/* control output (from above) */
110			__P((struct socket *, struct sockopt *));
111
112/* user-protocol hook */
113	int	(*pr_usrreq)		/* user request: see list below */
114			__P((struct socket *, int, struct mbuf *,
115			     struct mbuf *, struct mbuf *, struct proc *));
116
117/* utility hooks */
118	void	(*pr_init)		/* initialization hook */
119			__P((void));
120
121	void	(*pr_fasttimo)		/* fast timeout (200ms) */
122			__P((void));
123	void	(*pr_slowtimo)		/* slow timeout (500ms) */
124			__P((void));
125	void	(*pr_drain)		/* flush any excess space possible */
126			__P((void));
127	struct	pr_usrreqs *pr_usrreqs;	/* supersedes pr_usrreq() */
128};
129
130#endif /* !_NETINET6_IP6PROTOSW_H_ */
131