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