*
* @APPLE_LICENSE_HEADER_START@
*
- * 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.
+ * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * 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
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * 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.
*
* @APPLE_LICENSE_HEADER_END@
*/
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
+ * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.70.2.17 2001/08/01 00:47:49 fenner Exp $
*/
-#if NOTFB31
-#include "opt_atalk.h"
-#include "opt_inet.h"
-#include "opt_ipx.h"
-#include "opt_bdg.h"
-#endif
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <net/if_dl.h>
#include <net/if_types.h>
-#if INET
+#if INET || INET6
#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/if_ether.h>
#include <netipx/ipx_if.h>
#endif
-#if NS
-#include <netns/ns.h>
-#include <netns/ns_if.h>
-ushort ns_nettype;
-int ether_outputdebug = 0;
-int ether_inputdebug = 0;
-#endif
-
-#if ISO
-#include <netiso/argo_debug.h>
-#include <netiso/iso.h>
-#include <netiso/iso_var.h>
-#include <netiso/iso_snpac.h>
-#endif
-
-/*#if LLC
-#include <netccitt/dll.h>
-#include <netccitt/llc_var.h>
-#endif*/
-
#include <sys/socketvar.h>
#if LLC && CCITT
*/
+/*
+ IONetworkingFamily should call dlil_if_attach
+ ether_ifattach becomes obsolete, but remains for
+ temporary compatibility with third parties extensions
+*/
void
ether_ifattach(ifp)
register struct ifnet *ifp;
{
- register struct ifaddr *ifa;
- register struct sockaddr_dl *sdl;
boolean_t funnel_state;
funnel_state = thread_funnel_set(network_flock, TRUE);
- printf("ether_ifattach called for %s\n", ifp->if_name);
- ether_family_init();
ifp->if_name = "en";
ifp->if_family = APPLE_IF_FAM_ETHERNET;
ifp->if_baudrate = 10000000;
dlil_if_attach(ifp);
- ifa = ifnet_addrs[ifp->if_index - 1];
- if (ifa == 0) {
- printf("ether_ifattach: no lladdr!\n");
- (void) thread_funnel_set(network_flock, funnel_state);
- return;
- }
- sdl = (struct sockaddr_dl *)ifa->ifa_addr;
- sdl->sdl_type = IFT_ETHER;
- sdl->sdl_alen = ifp->if_addrlen;
- bcopy((IFP2AC(ifp))->ac_enaddr, LLADDR(sdl), ifp->if_addrlen);
-#ifdef INET6
- in6_ifattach_getifid(ifp);
-#endif
(void) thread_funnel_set(network_flock, funnel_state);
}