*
* @APPLE_LICENSE_HEADER_START@
*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
*
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <net/if.h>
#include <net/if_types.h>
-#include <net/netisr.h>
#include <net/route.h>
#include <net/bpf.h>
#include "bpfilter.h"
-static int dummyioctl __P((struct ifnet *, u_long, caddr_t));
-int dummyoutput __P((struct ifnet *, register struct mbuf *, struct sockaddr *,
- register struct rtentry *));
-static void dummyrtrequest __P((int, struct rtentry *, struct sockaddr *));
+static int dummyioctl(struct ifnet *, u_long, caddr_t);
+int dummyoutput(struct ifnet *, register struct mbuf *, struct sockaddr *,
+ register struct rtentry *);
+static void dummyrtrequest(int, struct rtentry *, struct sockaddr *);
-static void dummyattach __P((void *));
+static void dummyattach(void *);
PSEUDO_SET(dummyattach, if_dummy);
#if TINY_DUMMYMTU
struct sockaddr *dst;
register struct rtentry *rt;
{
- int s, isr;
- register struct ifqueue *ifq = 0;
if ((m->m_flags & M_PKTHDR) == 0)
panic("dummyoutput no HDR");
}
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
-
-#if INET
- case AF_INET:
- ifq = &ipintrq;
- isr = NETISR_IP;
- break;
-#endif
-#if IPX
- case AF_IPX:
- ifq = &ipxintrq;
- isr = NETISR_IPX;
- break;
-#endif
-#if INET6
- case AF_INET6:
- ifq = &ip6intrq;
- isr = NETISR_IPV6;
- break;
-#endif
-#if NS
- case AF_NS:
- ifq = &nsintrq;
- isr = NETISR_NS;
- break;
-#endif
-#if ISO
- case AF_ISO:
- ifq = &clnlintrq;
- isr = NETISR_ISO;
- break;
-#endif
-#if NETATALK
- case AF_APPLETALK:
- ifq = &atintrq2;
- isr = NETISR_ATALK;
- break;
-#endif NETATALK
- default:
- printf("%s: can't handle af%d\n",
- if_name(ifp), dst->sa_family);
- m_freem(m);
- return (EAFNOSUPPORT);
- }
- s = splimp();
- if (IF_QFULL(ifq)) {
- IF_DROP(ifq);
- m_freem(m);
- splx(s);
- return (ENOBUFS);
- }
- IF_ENQUEUE(ifq, m);
- schednetisr(isr);
+ proto_inject(dst->sa_family, m);
ifp->if_ipackets++;
ifp->if_ibytes += m->m_pkthdr.len;
- splx(s);
return (0);
}
switch (cmd) {
case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP | IFF_RUNNING;
+ ifnet_set_flags(ifp, IFF_UP | IFF_RUNNING, IFF_UP | IFF_RUNNING);
ifa = (struct ifaddr *)data;
ifa->ifa_rtrequest = dummyrtrequest;
/*