]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/if_ethersubr.c
xnu-517.9.5.tar.gz
[apple/xnu.git] / bsd / net / if_ethersubr.c
index ab0c05d0a426aba86c76aa8f21428049a05c6808..0df1345ba84d75f40253e3d0cbfe5bdc877206e6 100644 (file)
  * 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>
@@ -76,9 +70,8 @@
 #include <net/if_llc.h>
 #include <net/if_dl.h>
 #include <net/if_types.h>
-#include <net/ndrv.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
@@ -126,8 +99,6 @@ extern struct ifqueue pkintrq;
 #include <net/if_vlan_var.h>
 #endif /* NVLAN > 0 */
 
-static int ether_resolvemulti __P((struct ifnet *, struct sockaddr **, 
-                                   struct sockaddr *));
 extern u_char  etherbroadcastaddr[];
 #define senderr(e) do { error = (e); goto bad;} while (0)
 #define IFP2AC(IFP) ((struct arpcom *)IFP)
@@ -137,17 +108,18 @@ extern u_char     etherbroadcastaddr[];
  */
 
 
+/* 
+    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;
@@ -155,24 +127,10 @@ ether_ifattach(ifp)
        ifp->if_addrlen = 6;
        ifp->if_hdrlen = 14;
        ifp->if_mtu = ETHERMTU;
-       ifp->if_resolvemulti = ether_resolvemulti;
        if (ifp->if_baudrate == 0)
            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);
 }