1/* |
2 * Copyright (c) 2004, Robert N. M. Watson |
3 * Copyright (c) 1995, Mike Mitchell 4 * Copyright (c) 1984, 1985, 1986, 1987, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright --- 20 unchanged lines hidden (view full) --- 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * 35 * @(#)ipx_input.c 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/netipx/ipx_input.c 139444 2004-12-30 17:49:40Z rwatson $"); |
40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/mbuf.h> 44#include <sys/protosw.h> 45#include <sys/socket.h> 46#include <sys/kernel.h> 47#include <sys/random.h> --- 32 unchanged lines hidden (view full) --- 80 .s_net[1] = 0xffff }; 81const union ipx_host ipx_broadhost = { .s_host[0] = 0xffff, 82 .s_host[1] = 0xffff, 83 .s_host[2] = 0xffff }; 84 85struct ipxstat ipxstat; 86struct sockaddr_ipx ipx_netmask, ipx_hostmask; 87 |
88/* 89 * IPX protocol control block (pcb) lists. 90 */ 91struct ipxpcbhead ipxpcb_list; 92struct ipxpcbhead ipxrawpcb_list; |
93 94static int ipxqmaxlen = IFQ_MAXLEN; 95static struct ifqueue ipxintrq; 96 97long ipx_pexseq; 98 99static int ipx_do_route(struct ipx_addr *src, struct route *ro); 100static void ipx_undo_route(struct route *ro); --- 4 unchanged lines hidden (view full) --- 105 * IPX initialization. 106 */ 107 108void 109ipx_init() 110{ 111 112 read_random(&ipx_pexseq, sizeof ipx_pexseq); |
113 |
114 LIST_INIT(&ipxpcb_list); 115 LIST_INIT(&ipxrawpcb_list); 116 |
117 ipx_netmask.sipx_len = 6; 118 ipx_netmask.sipx_addr.x_net = ipx_broadnet; 119 120 ipx_hostmask.sipx_len = 12; 121 ipx_hostmask.sipx_addr.x_net = ipx_broadnet; 122 ipx_hostmask.sipx_addr.x_host = ipx_broadhost; 123 124 ipxintrq.ifq_maxlen = ipxqmaxlen; --- 27 unchanged lines hidden (view full) --- 152 (m = m_pullup(m, sizeof(struct ipx))) == 0) { 153 ipxstat.ipxs_toosmall++; 154 return; 155 } 156 157 /* 158 * Give any raw listeners a crack at the packet 159 */ |
160 LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { |
161 struct mbuf *m1 = m_copy(m, 0, (int)M_COPYALL); 162 if (m1 != NULL) 163 ipx_input(m1, ipxp); 164 } 165 166 ipx = mtod(m, struct ipx *); 167 len = ntohs(ipx->ipx_len); 168 /* --- 296 unchanged lines hidden (view full) --- 465struct ifnet *ifp; 466{ 467 register struct ipxpcb *ipxp; 468 register struct ifaddr *ifa; 469 register struct ipx_ifaddr *ia; 470 /* 471 * Give any raw listeners a crack at the packet 472 */ |
473 LIST_FOREACH(ipxp, &ipxrawpcb_list, ipxp_list) { |
474 struct mbuf *m0 = m_copy(m, 0, (int)M_COPYALL); 475 if (m0 != NULL) { 476 register struct ipx *ipx; 477 478 M_PREPEND(m0, sizeof(*ipx), M_DONTWAIT); 479 if (m0 == NULL) 480 continue; 481 ipx = mtod(m0, struct ipx *); --- 22 unchanged lines hidden --- |