1 /* 2 * Copyright (c) 2003 Jeffrey Hsu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 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. 18 * 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. 29 * 30 * $DragonFly: src/sys/net/netmsg.h,v 1.1 2004/03/06 02:36:25 hsu Exp $ 31 */ 32 33 #ifndef _NETMSG_H_ 34 #define _NETMSG_H_ 35 36 /* 37 * User protocol requests messages. 38 */ 39 struct netmsg_pru_abort { 40 struct lwkt_msg nm_lmsg; 41 netisr_fn_t nm_handler; 42 pru_abort_fn_t nm_prufn; 43 struct socket *nm_so; 44 }; 45 46 struct netmsg_pru_accept { 47 struct lwkt_msg nm_lmsg; 48 netisr_fn_t nm_handler; 49 pru_accept_fn_t nm_prufn; 50 struct socket *nm_so; 51 struct sockaddr **nm_nam; 52 }; 53 54 struct netmsg_pru_attach { 55 struct lwkt_msg nm_lmsg; 56 netisr_fn_t nm_handler; 57 pru_attach_fn_t nm_prufn; 58 struct socket *nm_so; 59 int nm_proto; 60 struct pru_attach_info *nm_ai; 61 }; 62 63 struct netmsg_pru_bind { 64 struct lwkt_msg nm_lmsg; 65 netisr_fn_t nm_handler; 66 pru_bind_fn_t nm_prufn; 67 struct socket *nm_so; 68 struct sockaddr *nm_nam; 69 struct thread *nm_td; 70 }; 71 72 struct netmsg_pru_connect { 73 struct lwkt_msg nm_lmsg; 74 netisr_fn_t nm_handler; 75 pru_connect_fn_t nm_prufn; 76 struct socket *nm_so; 77 struct sockaddr *nm_nam; 78 struct thread *nm_td; 79 }; 80 81 struct netmsg_pru_connect2 { 82 struct lwkt_msg nm_lmsg; 83 netisr_fn_t nm_handler; 84 pru_connect2_fn_t nm_prufn; 85 struct socket *nm_so1; 86 struct socket *nm_so2; 87 }; 88 89 struct netmsg_pru_control { 90 struct lwkt_msg nm_lmsg; 91 netisr_fn_t nm_handler; 92 pru_control_fn_t nm_prufn; 93 struct socket *nm_so; 94 u_long nm_cmd; 95 caddr_t nm_data; 96 struct ifnet *nm_ifp; 97 struct thread *nm_td; 98 }; 99 100 struct netmsg_pru_detach { 101 struct lwkt_msg nm_lmsg; 102 netisr_fn_t nm_handler; 103 pru_detach_fn_t nm_prufn; 104 struct socket *nm_so; 105 }; 106 107 struct netmsg_pru_disconnect { 108 struct lwkt_msg nm_lmsg; 109 netisr_fn_t nm_handler; 110 pru_disconnect_fn_t nm_prufn; 111 struct socket *nm_so; 112 }; 113 114 struct netmsg_pru_listen { 115 struct lwkt_msg nm_lmsg; 116 netisr_fn_t nm_handler; 117 pru_listen_fn_t nm_prufn; 118 struct socket *nm_so; 119 struct thread *nm_td; 120 }; 121 122 struct netmsg_pru_peeraddr { 123 struct lwkt_msg nm_lmsg; 124 netisr_fn_t nm_handler; 125 pru_peeraddr_fn_t nm_prufn; 126 struct socket *nm_so; 127 struct sockaddr **nm_nam; 128 }; 129 130 struct netmsg_pru_rcvd { 131 struct lwkt_msg nm_lmsg; 132 netisr_fn_t nm_handler; 133 pru_rcvd_fn_t nm_prufn; 134 struct socket *nm_so; 135 int nm_flags; 136 }; 137 138 struct netmsg_pru_rcvoob { 139 struct lwkt_msg nm_lmsg; 140 netisr_fn_t nm_handler; 141 pru_rcvoob_fn_t nm_prufn; 142 struct socket *nm_so; 143 struct mbuf *nm_m; 144 int nm_flags; 145 }; 146 147 struct netmsg_pru_send { 148 struct lwkt_msg nm_lmsg; 149 netisr_fn_t nm_handler; 150 pru_send_fn_t nm_prufn; 151 struct socket *nm_so; 152 int nm_flags; 153 struct mbuf *nm_m; 154 struct sockaddr *nm_addr; 155 struct mbuf *nm_control; 156 struct thread *nm_td; 157 }; 158 159 struct netmsg_pru_sense { 160 struct lwkt_msg nm_lmsg; 161 netisr_fn_t nm_handler; 162 pru_sense_fn_t nm_prufn; 163 struct socket *nm_so; 164 struct stat *nm_stat; 165 }; 166 167 struct netmsg_pru_shutdown { 168 struct lwkt_msg nm_lmsg; 169 netisr_fn_t nm_handler; 170 pru_shutdown_fn_t nm_prufn; 171 struct socket *nm_so; 172 }; 173 174 struct netmsg_pru_sockaddr { 175 struct lwkt_msg nm_lmsg; 176 netisr_fn_t nm_handler; 177 pru_sockaddr_fn_t nm_prufn; 178 struct socket *nm_so; 179 struct sockaddr **nm_nam; 180 }; 181 182 struct netmsg_pru_sosend { 183 struct lwkt_msg nm_lmsg; 184 netisr_fn_t nm_handler; 185 pru_sosend_fn_t nm_prufn; 186 struct socket *nm_so; 187 struct sockaddr *nm_addr; 188 struct uio *nm_uio; 189 struct mbuf *nm_top; 190 struct mbuf *nm_control; 191 int nm_flags; 192 struct thread *nm_td; 193 }; 194 195 struct netmsg_pru_soreceive { 196 struct lwkt_msg nm_lmsg; 197 netisr_fn_t nm_handler; 198 pru_soreceive_fn_t nm_prufn; 199 struct sockaddr *nm_addr; 200 struct socket *nm_so; 201 struct sockaddr **nm_paddr; 202 struct uio *nm_uio; 203 struct mbuf **nm_mp0; 204 struct mbuf **nm_controlp; 205 int *nm_flagsp; 206 }; 207 208 struct netmsg_pru_sopoll { 209 struct lwkt_msg nm_lmsg; 210 netisr_fn_t nm_handler; 211 pru_sopoll_fn_t nm_prufn; 212 struct socket *nm_so; 213 int nm_events; 214 struct ucred *nm_cred; 215 struct thread *nm_td; 216 }; 217 218 #endif 219