2 * Copyright (c) 2003 Jeffrey Hsu
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Jeffrey M. Hsu.
16 * 4. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 * $DragonFly: src/sys/net/netmsg.h,v 1.8 2008/09/17 11:22:13 sephe Exp $
33 #ifndef _NET_NETMSG_H_
34 #define _NET_NETMSG_H_
36 #ifndef _SYS_THREAD_H_
37 #include <sys/thread.h>
39 #ifndef _SYS_PROTOSW_H_
40 #include <sys/protosw.h>
45 typedef void (*netisr_fn_t)(struct netmsg *);
50 typedef struct netmsg {
51 struct lwkt_msg nm_lmsg;
52 netisr_fn_t nm_dispatch;
55 #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
58 * User protocol requests messages.
60 struct netmsg_pru_abort {
61 struct netmsg nm_netmsg;
62 pru_abort_fn_t nm_prufn;
66 struct netmsg_pru_accept {
67 struct netmsg nm_netmsg;
68 pru_accept_fn_t nm_prufn;
70 struct sockaddr **nm_nam;
73 struct netmsg_pru_attach {
74 struct netmsg nm_netmsg;
75 pru_attach_fn_t nm_prufn;
78 struct pru_attach_info *nm_ai;
81 struct netmsg_pru_bind {
82 struct netmsg nm_netmsg;
83 pru_bind_fn_t nm_prufn;
85 struct sockaddr *nm_nam;
89 struct netmsg_pru_connect {
90 struct netmsg nm_netmsg;
91 pru_connect_fn_t nm_prufn;
93 struct sockaddr *nm_nam;
97 struct netmsg_pru_connect2 {
98 struct netmsg nm_netmsg;
99 pru_connect2_fn_t nm_prufn;
100 struct socket *nm_so1;
101 struct socket *nm_so2;
104 struct netmsg_pru_control {
105 struct netmsg nm_netmsg;
106 pru_control_fn_t nm_prufn;
107 struct socket *nm_so;
110 struct ifnet *nm_ifp;
111 struct thread *nm_td;
114 struct netmsg_pru_detach {
115 struct netmsg nm_netmsg;
116 pru_detach_fn_t nm_prufn;
117 struct socket *nm_so;
120 struct netmsg_pru_disconnect {
121 struct netmsg nm_netmsg;
122 pru_disconnect_fn_t nm_prufn;
123 struct socket *nm_so;
126 struct netmsg_pru_listen {
127 struct netmsg nm_netmsg;
128 pru_listen_fn_t nm_prufn;
129 struct socket *nm_so;
130 struct thread *nm_td;
133 struct netmsg_pru_peeraddr {
134 struct netmsg nm_netmsg;
135 pru_peeraddr_fn_t nm_prufn;
136 struct socket *nm_so;
137 struct sockaddr **nm_nam;
140 struct netmsg_pru_rcvd {
141 struct netmsg nm_netmsg;
142 pru_rcvd_fn_t nm_prufn;
143 struct socket *nm_so;
147 struct netmsg_pru_rcvoob {
148 struct netmsg nm_netmsg;
149 pru_rcvoob_fn_t nm_prufn;
150 struct socket *nm_so;
155 struct netmsg_pru_send {
156 struct netmsg nm_netmsg;
157 pru_send_fn_t nm_prufn;
158 struct socket *nm_so;
161 struct sockaddr *nm_addr;
162 struct mbuf *nm_control;
163 struct thread *nm_td;
166 struct netmsg_pru_sense {
167 struct netmsg nm_netmsg;
168 pru_sense_fn_t nm_prufn;
169 struct socket *nm_so;
170 struct stat *nm_stat;
173 struct netmsg_pru_shutdown {
174 struct netmsg nm_netmsg;
175 pru_shutdown_fn_t nm_prufn;
176 struct socket *nm_so;
179 struct netmsg_pru_sockaddr {
180 struct netmsg nm_netmsg;
181 pru_sockaddr_fn_t nm_prufn;
182 struct socket *nm_so;
183 struct sockaddr **nm_nam;
186 struct netmsg_pru_sosend {
187 struct netmsg nm_netmsg;
188 pru_sosend_fn_t nm_prufn;
189 struct socket *nm_so;
190 struct sockaddr *nm_addr;
193 struct mbuf *nm_control;
195 struct thread *nm_td;
198 struct netmsg_pru_soreceive {
199 struct netmsg nm_netmsg;
200 struct sockaddr *nm_addr;
201 struct socket *nm_so;
202 struct sockaddr **nm_paddr;
204 struct sockbuf *nm_sio;
205 struct mbuf **nm_controlp;
209 struct netmsg_pru_sopoll {
210 struct netmsg nm_netmsg;
211 pru_sopoll_fn_t nm_prufn;
212 struct socket *nm_so;
214 struct ucred *nm_cred;
215 struct thread *nm_td;
218 struct netmsg_pru_ctloutput {
219 struct netmsg nm_netmsg;
220 pru_ctloutput_fn_t nm_prufn;
221 struct socket *nm_so;
222 struct sockopt *nm_sopt;
225 #endif /* _KERNEL || _KERNEL_STRUCTURES */
227 #endif /* !_NET_NETMSG_H_ */