ip6_input.c (111119) | ip6_input.c (111888) |
---|---|
1/* $FreeBSD: head/sys/netinet6/ip6_input.c 111119 2003-02-19 05:47:46Z imp $ */ | 1/* $FreeBSD: head/sys/netinet6/ip6_input.c 111888 2003-03-04 23:19:55Z jlemon $ */ |
2/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 75 unchanged lines hidden (view full) --- 85#include <sys/kernel.h> 86#include <sys/syslog.h> 87 88#include <net/if.h> 89#include <net/if_types.h> 90#include <net/if_dl.h> 91#include <net/route.h> 92#include <net/netisr.h> | 2/* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 75 unchanged lines hidden (view full) --- 85#include <sys/kernel.h> 86#include <sys/syslog.h> 87 88#include <net/if.h> 89#include <net/if_types.h> 90#include <net/if_dl.h> 91#include <net/route.h> 92#include <net/netisr.h> |
93#include <net/intrq.h> | |
94#ifdef PFIL_HOOKS 95#include <net/pfil.h> 96#endif 97 98#include <netinet/in.h> 99#include <netinet/in_systm.h> 100#ifdef INET 101#include <netinet/ip.h> --- 25 unchanged lines hidden (view full) --- 127 128#include <netinet6/ip6protosw.h> 129 130#include <net/net_osdep.h> 131 132extern struct domain inet6domain; 133 134u_char ip6_protox[IPPROTO_MAX]; | 93#ifdef PFIL_HOOKS 94#include <net/pfil.h> 95#endif 96 97#include <netinet/in.h> 98#include <netinet/in_systm.h> 99#ifdef INET 100#include <netinet/ip.h> --- 25 unchanged lines hidden (view full) --- 126 127#include <netinet6/ip6protosw.h> 128 129#include <net/net_osdep.h> 130 131extern struct domain inet6domain; 132 133u_char ip6_protox[IPPROTO_MAX]; |
134static struct ifqueue ip6intrq; |
|
135static int ip6qmaxlen = IFQ_MAXLEN; 136struct in6_ifaddr *in6_ifaddr; 137 138extern struct callout in6_tmpaddrtimer_ch; 139 140int ip6_forward_srcrt; /* XXX */ 141int ip6_sourcecheck; /* XXX */ 142int ip6_sourcecheck_interval; /* XXX */ --- 38 unchanged lines hidden (view full) --- 181 ip6_protox[i] = pr - inet6sw; 182 for (pr = (struct ip6protosw *)inet6domain.dom_protosw; 183 pr < (struct ip6protosw *)inet6domain.dom_protoswNPROTOSW; pr++) 184 if (pr->pr_domain->dom_family == PF_INET6 && 185 pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) 186 ip6_protox[pr->pr_protocol] = pr - inet6sw; 187 ip6intrq.ifq_maxlen = ip6qmaxlen; 188 mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF); | 135static int ip6qmaxlen = IFQ_MAXLEN; 136struct in6_ifaddr *in6_ifaddr; 137 138extern struct callout in6_tmpaddrtimer_ch; 139 140int ip6_forward_srcrt; /* XXX */ 141int ip6_sourcecheck; /* XXX */ 142int ip6_sourcecheck_interval; /* XXX */ --- 38 unchanged lines hidden (view full) --- 181 ip6_protox[i] = pr - inet6sw; 182 for (pr = (struct ip6protosw *)inet6domain.dom_protosw; 183 pr < (struct ip6protosw *)inet6domain.dom_protoswNPROTOSW; pr++) 184 if (pr->pr_domain->dom_family == PF_INET6 && 185 pr->pr_protocol && pr->pr_protocol != IPPROTO_RAW) 186 ip6_protox[pr->pr_protocol] = pr - inet6sw; 187 ip6intrq.ifq_maxlen = ip6qmaxlen; 188 mtx_init(&ip6intrq.ifq_mtx, "ip6_inq", NULL, MTX_DEF); |
189 ip6intrq_present = 1; 190 register_netisr(NETISR_IPV6, ip6intr); | 189 netisr_register(NETISR_IPV6, ip6_input, &ip6intrq); |
191 nd6_init(); 192 frag6_init(); 193 /* 194 * in many cases, random() here does NOT return random number 195 * as initialization during bootstrap time occur in fixed order. 196 */ 197 microtime(&tv); 198 ip6_flow_seq = random() ^ tv.tv_usec; --- 26 unchanged lines hidden (view full) --- 225 ip6_temp_regen_advance) * hz, 226 in6_tmpaddrtimer, NULL); 227} 228 229/* cheat */ 230/* This must be after route_init(), which is now SI_ORDER_THIRD */ 231SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); 232 | 190 nd6_init(); 191 frag6_init(); 192 /* 193 * in many cases, random() here does NOT return random number 194 * as initialization during bootstrap time occur in fixed order. 195 */ 196 microtime(&tv); 197 ip6_flow_seq = random() ^ tv.tv_usec; --- 26 unchanged lines hidden (view full) --- 224 ip6_temp_regen_advance) * hz, 225 in6_tmpaddrtimer, NULL); 226} 227 228/* cheat */ 229/* This must be after route_init(), which is now SI_ORDER_THIRD */ 230SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL); 231 |
233/* 234 * IP6 input interrupt handling. Just pass the packet to ip6_input. 235 */ 236void 237ip6intr() 238{ 239 int s; 240 struct mbuf *m; 241 242 for (;;) { 243 s = splimp(); 244 IF_DEQUEUE(&ip6intrq, m); 245 splx(s); 246 if (m == 0) 247 return; 248 ip6_input(m); 249 } 250} 251 | |
252extern struct route_in6 ip6_forward_rt; 253 254void 255ip6_input(m) 256 struct mbuf *m; 257{ 258 struct ip6_hdr *ip6; 259 int off = sizeof(struct ip6_hdr), nest; --- 1404 unchanged lines hidden --- | 232extern struct route_in6 ip6_forward_rt; 233 234void 235ip6_input(m) 236 struct mbuf *m; 237{ 238 struct ip6_hdr *ip6; 239 int off = sizeof(struct ip6_hdr), nest; --- 1404 unchanged lines hidden --- |