/*
- * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2020 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <net/ether_if_module.h>
#include <sys/socketvar.h>
#include <net/if_vlan_var.h>
+#include <net/if_6lowpan_var.h>
#if BOND
#include <net/if_bond_internal.h>
#endif /* BOND */
#if IF_FAKE
#include <net/if_fake_var.h>
#endif /* IF_FAKE */
+#if IF_HEADLESS
+extern void if_headless_init(void);
+#endif /* IF_HEADLESS */
#include <net/dlil.h>
};
/* descriptors are allocated in blocks of ETHER_DESC_BLK_SIZE */
-#if CONFIG_EMBEDDED
+#if !XNU_TARGET_OS_OSX
#define ETHER_DESC_BLK_SIZE (2) /* IP, ARP */
-#else
+#else /* XNU_TARGET_OS_OSX */
#define ETHER_DESC_BLK_SIZE (10)
-#endif
+#endif /* XNU_TARGET_OS_OSX */
/*
* Header for the demux list, hangs off of IFP at if_family_cookie
m->m_flags &= ~M_HASFCS;
}
- if (ifp->if_eflags & IFEF_BOND) {
- /* if we're bonded, bond "protocol" gets all the packets */
- *protocol_family = PF_BOND;
- return 0;
- }
-
if ((eh->ether_dhost[0] & 1) == 0) {
/*
* When the driver is put into promiscuous mode we may receive
}
}
+ /* check for IEEE 802.15.4 */
+ if (ether_type == htons(ETHERTYPE_IEEE802154)) {
+ *protocol_family = PF_802154;
+ return 0;
+ }
+
/* check for VLAN */
if ((m->m_pkthdr.csum_flags & CSUM_VLAN_TAG_VALID) != 0) {
if (EVL_VLANOFTAG(m->m_pkthdr.vlan_tag) != 0) {
error);
goto done;
}
-#if INET6
if ((error = proto_register_plumber(PF_INET6, APPLE_IF_FAM_ETHERNET,
ether_attach_inet6, ether_detach_inet6)) != 0) {
printf("proto_register_plumber failed for PF_INET6 error=%d\n",
error);
goto done;
}
-#endif /* INET6 */
#if VLAN
vlan_family_init();
#endif /* VLAN */
#if IF_FAKE
if_fake_init();
#endif /* IF_FAKE */
-
+#if IF_HEADLESS
+ if_headless_init();
+#endif /* IF_HEADLESS */
+#if SIXLOWPAN
+ sixlowpan_family_init();
+#endif /* VLAN */
done:
return error;