-void
-ndrv_init()
-{
- int retval;
- struct kev_request kev_request;
-
- ndrvl.nd_next = ndrvl.nd_prev = &ndrvl;
-
- /* Create a PF_SYSTEM socket so we can listen for events */
- retval = socreate(PF_SYSTEM, &ndrv_so, SOCK_RAW, SYSPROTO_EVENT);
- if (retval != 0 || ndrv_so == NULL)
- retval = KERN_FAILURE;
-
- /* Install a callback function for the socket */
- ndrv_so->so_rcv.sb_flags |= SB_NOTIFY|SB_UPCALL;
- ndrv_so->so_upcall = ndrv_read_event;
- ndrv_so->so_upcallarg = NULL;
-
- /* Configure the socket to receive the events we're interested in */
- kev_request.vendor_code = KEV_VENDOR_APPLE;
- kev_request.kev_class = KEV_NETWORK_CLASS;
- kev_request.kev_subclass = KEV_DL_SUBCLASS;
- retval = ndrv_so->so_proto->pr_usrreqs->pru_control(ndrv_so, SIOCSKEVFILT, (caddr_t)&kev_request, 0, 0);
- if (retval != 0)
- {
- /*
- * We will not get attaching or detaching events in this case.
- * We should probably prevent any sockets from binding so we won't
- * panic later if the interface goes away.
- */
- log(LOG_WARNING, "PF_NDRV: ndrv_init - failed to set event filter (%d)",
- retval);
- }
-}
+#if NDRV_DEMUXTYPE_ETHERTYPE != DLIL_DESC_ETYPE2
+#error NDRV_DEMUXTYPE_ETHERTYPE must match DLIL_DESC_ETYPE2
+#endif
+#if NDRV_DEMUXTYPE_SAP != DLIL_DESC_SAP
+#error NDRV_DEMUXTYPE_SAP must match DLIL_DESC_SAP
+#endif
+#if NDRV_DEMUXTYPE_SNAP != DLIL_DESC_SNAP
+#error NDRV_DEMUXTYPE_SNAP must match DLIL_DESC_SNAP
+#endif