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.2 2004/04/20 01:52:26 dillon 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 pru_abort_fn_t nm_prufn; 42 struct socket *nm_so; 43 }; 44 45 struct netmsg_pru_accept { 46 struct lwkt_msg nm_lmsg; 47 pru_accept_fn_t nm_prufn; 48 struct socket *nm_so; 49 struct sockaddr **nm_nam; 50 }; 51 52 struct netmsg_pru_attach { 53 struct lwkt_msg nm_lmsg; 54 pru_attach_fn_t nm_prufn; 55 struct socket *nm_so; 56 int nm_proto; 57 struct pru_attach_info *nm_ai; 58 }; 59 60 struct netmsg_pru_bind { 61 struct lwkt_msg nm_lmsg; 62 pru_bind_fn_t nm_prufn; 63 struct socket *nm_so; 64 struct sockaddr *nm_nam; 65 struct thread *nm_td; 66 }; 67 68 struct netmsg_pru_connect { 69 struct lwkt_msg nm_lmsg; 70 pru_connect_fn_t nm_prufn; 71 struct socket *nm_so; 72 struct sockaddr *nm_nam; 73 struct thread *nm_td; 74 }; 75 76 struct netmsg_pru_connect2 { 77 struct lwkt_msg nm_lmsg; 78 pru_connect2_fn_t nm_prufn; 79 struct socket *nm_so1; 80 struct socket *nm_so2; 81 }; 82 83 struct netmsg_pru_control { 84 struct lwkt_msg nm_lmsg; 85 pru_control_fn_t nm_prufn; 86 struct socket *nm_so; 87 u_long nm_cmd; 88 caddr_t nm_data; 89 struct ifnet *nm_ifp; 90 struct thread *nm_td; 91 }; 92 93 struct netmsg_pru_detach { 94 struct lwkt_msg nm_lmsg; 95 pru_detach_fn_t nm_prufn; 96 struct socket *nm_so; 97 }; 98 99 struct netmsg_pru_disconnect { 100 struct lwkt_msg nm_lmsg; 101 pru_disconnect_fn_t nm_prufn; 102 struct socket *nm_so; 103 }; 104 105 struct netmsg_pru_listen { 106 struct lwkt_msg nm_lmsg; 107 pru_listen_fn_t nm_prufn; 108 struct socket *nm_so; 109 struct thread *nm_td; 110 }; 111 112 struct netmsg_pru_peeraddr { 113 struct lwkt_msg nm_lmsg; 114 pru_peeraddr_fn_t nm_prufn; 115 struct socket *nm_so; 116 struct sockaddr **nm_nam; 117 }; 118 119 struct netmsg_pru_rcvd { 120 struct lwkt_msg nm_lmsg; 121 pru_rcvd_fn_t nm_prufn; 122 struct socket *nm_so; 123 int nm_flags; 124 }; 125 126 struct netmsg_pru_rcvoob { 127 struct lwkt_msg nm_lmsg; 128 pru_rcvoob_fn_t nm_prufn; 129 struct socket *nm_so; 130 struct mbuf *nm_m; 131 int nm_flags; 132 }; 133 134 struct netmsg_pru_send { 135 struct lwkt_msg nm_lmsg; 136 pru_send_fn_t nm_prufn; 137 struct socket *nm_so; 138 int nm_flags; 139 struct mbuf *nm_m; 140 struct sockaddr *nm_addr; 141 struct mbuf *nm_control; 142 struct thread *nm_td; 143 }; 144 145 struct netmsg_pru_sense { 146 struct lwkt_msg nm_lmsg; 147 pru_sense_fn_t nm_prufn; 148 struct socket *nm_so; 149 struct stat *nm_stat; 150 }; 151 152 struct netmsg_pru_shutdown { 153 struct lwkt_msg nm_lmsg; 154 pru_shutdown_fn_t nm_prufn; 155 struct socket *nm_so; 156 }; 157 158 struct netmsg_pru_sockaddr { 159 struct lwkt_msg nm_lmsg; 160 pru_sockaddr_fn_t nm_prufn; 161 struct socket *nm_so; 162 struct sockaddr **nm_nam; 163 }; 164 165 struct netmsg_pru_sosend { 166 struct lwkt_msg nm_lmsg; 167 pru_sosend_fn_t nm_prufn; 168 struct socket *nm_so; 169 struct sockaddr *nm_addr; 170 struct uio *nm_uio; 171 struct mbuf *nm_top; 172 struct mbuf *nm_control; 173 int nm_flags; 174 struct thread *nm_td; 175 }; 176 177 struct netmsg_pru_soreceive { 178 struct lwkt_msg nm_lmsg; 179 pru_soreceive_fn_t nm_prufn; 180 struct sockaddr *nm_addr; 181 struct socket *nm_so; 182 struct sockaddr **nm_paddr; 183 struct uio *nm_uio; 184 struct mbuf **nm_mp0; 185 struct mbuf **nm_controlp; 186 int *nm_flagsp; 187 }; 188 189 struct netmsg_pru_sopoll { 190 struct lwkt_msg nm_lmsg; 191 pru_sopoll_fn_t nm_prufn; 192 struct socket *nm_so; 193 int nm_events; 194 struct ucred *nm_cred; 195 struct thread *nm_td; 196 }; 197 198 #endif 199