Lines Matching defs:interface
101 ifnet_t *interface)
162 *interface = ifp;
167 *interface = 0;
175 function. If the interface is attached, the interface will be
176 recycled when the interface's if_free function is called. If the
177 interface is never attached, the if_free function will never be
178 called and the interface will never be recycled.
214 ifnet_t interface)
216 return interface == NULL ? NULL : interface->if_softc;
221 ifnet_t interface)
223 return interface == NULL ? NULL : interface->if_name;
228 ifnet_t interface)
230 return interface == NULL ? 0 : interface->if_family;
235 ifnet_t interface)
237 return interface == NULL ? (u_int32_t)0xffffffff : (u_int32_t)interface->if_unit;
242 ifnet_t interface)
244 return interface == NULL ? (u_int32_t)0xffffffff : interface->if_index;
249 ifnet_t interface,
255 if (interface == NULL) return EINVAL;
256 lock = (interface->if_lock != 0);
258 if (lock) ifnet_lock_exclusive(interface);
262 if_updown(interface, (new_flags & IFF_UP) == IFF_UP);
265 interface->if_flags = (new_flags & mask) | (interface->if_flags & ~mask);
266 if (lock) ifnet_lock_done(interface);
273 ifnet_t interface)
275 return interface == NULL ? 0 : interface->if_flags;
280 ifnet_t interface,
286 if (interface == NULL) return EINVAL;
287 lock = (interface->if_lock != 0);
289 if (lock) ifnet_lock_exclusive(interface);
290 interface->if_eflags = (new_flags & mask) | (interface->if_eflags & ~mask);
291 if (lock) ifnet_lock_done(interface);
298 ifnet_t interface)
300 return interface == NULL ? 0 : interface->if_eflags;
310 ifnet_t interface,
315 if (interface == NULL) return EINVAL;
316 lock = (interface->if_lock != 0);
318 if (lock) ifnet_lock_exclusive(interface);
319 interface->if_hwassist = (offload & offload_mask);
320 if (lock) ifnet_lock_done(interface);
327 ifnet_t interface)
329 return interface == NULL ? 0 : (interface->if_hwassist & offload_mask);
337 ifnet_t interface,
343 if (interface == NULL) return EINVAL;
344 lock = (interface->if_lock != 0);
346 if (lock) ifnet_lock_exclusive(interface);
347 interface->if_linkmib = (void*)mibData;
348 interface->if_linkmiblen = mibLen;
349 if (lock) ifnet_lock_done(interface);
355 ifnet_t interface,
362 if (interface == NULL) return EINVAL;
363 lock = (interface->if_lock != NULL);
365 if (lock) ifnet_lock_shared(interface);
366 if (*mibLen < interface->if_linkmiblen)
368 if (result == 0 && interface->if_linkmib == NULL)
372 *mibLen = interface->if_linkmiblen;
373 bcopy(interface->if_linkmib, mibData, *mibLen);
375 if (lock) ifnet_lock_done(interface);
382 ifnet_t interface)
384 return interface == NULL ? 0 : interface->if_linkmiblen;
389 ifnet_t interface,
395 if (interface == NULL || protocol_family == 0 || m == NULL) {
400 return dlil_output(interface, protocol_family, m, route, dest, 0);
405 ifnet_t interface,
409 if (interface == NULL || m == NULL) {
414 return dlil_output(interface, protocol_family, m, NULL, NULL, 1);
419 ifnet_t interface,
422 if (interface == NULL) return EINVAL;
423 interface->if_data.ifi_mtu = mtu;
429 ifnet_t interface)
432 retval = interface == NULL ? 0 : interface->if_data.ifi_mtu;
438 ifnet_t interface)
442 retval = interface == NULL ? 0 : interface->if_data.ifi_type;
449 ifnet_t interface,
452 int lock = (interface->if_lock != 0);
453 if (lock) ifnet_lock_exclusive(interface);
454 interface->if_data.ifi_typelen = typelen;
455 if (lock) ifnet_lock_done(interface);
461 ifnet_t interface)
464 retval = interface == NULL ? 0 : interface->if_data.ifi_typelen;
471 ifnet_t interface,
474 if (interface == NULL) return EINVAL;
475 interface->if_data.ifi_addrlen = addrlen;
481 ifnet_t interface)
484 retval = interface == NULL ? 0 : interface->if_data.ifi_addrlen;
490 ifnet_t interface,
493 if (interface == NULL) return EINVAL;
494 interface->if_data.ifi_hdrlen = hdrlen;
500 ifnet_t interface)
503 retval = interface == NULL ? 0 : interface->if_data.ifi_hdrlen;
509 ifnet_t interface,
512 if (interface == NULL) return EINVAL;
513 interface->if_data.ifi_metric = metric;
519 ifnet_t interface)
522 retval = interface == NULL ? 0 : interface->if_data.ifi_metric;
528 ifnet_t interface,
531 if (interface == NULL) return EINVAL;
533 interface->if_data.ifi_baudrate = baudrate > 0xFFFFFFFF ? 0xFFFFFFFF : baudrate;
539 ifnet_t interface)
542 retval = interface == NULL ? 0 : interface->if_data.ifi_baudrate;
548 ifnet_t interface,
552 if (interface == NULL) return EINVAL;
554 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
559 interface->if_data.ifi_ipackets += counts->packets_in;
560 interface->if_data.ifi_ibytes += counts->bytes_in;
561 interface->if_data.ifi_ierrors += counts->errors_in;
563 interface->if_data.ifi_opackets += counts->packets_out;
564 interface->if_data.ifi_obytes += counts->bytes_out;
565 interface->if_data.ifi_oerrors += counts->errors_out;
567 interface->if_data.ifi_collisions += counts->collisions;
568 interface->if_data.ifi_iqdrops += counts->dropped;
571 TOUCHLASTCHANGE(&interface->if_lastchange);
580 ifnet_t interface,
587 if (interface == NULL) return EINVAL;
589 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
594 interface->if_data.ifi_ipackets += packets_in;
595 interface->if_data.ifi_ibytes += bytes_in;
596 interface->if_data.ifi_ierrors += errors_in;
598 TOUCHLASTCHANGE(&interface->if_lastchange);
607 ifnet_t interface,
613 if (interface == NULL) return EINVAL;
615 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
620 interface->if_data.ifi_opackets += packets_out;
621 interface->if_data.ifi_obytes += bytes_out;
622 interface->if_data.ifi_oerrors += errors_out;
624 TOUCHLASTCHANGE(&interface->if_lastchange);
633 ifnet_t interface,
638 if (interface == NULL) return EINVAL;
640 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
645 interface->if_data.ifi_ipackets = stats->packets_in;
646 interface->if_data.ifi_ibytes = stats->bytes_in;
647 interface->if_data.ifi_imcasts = stats->multicasts_in;
648 interface->if_data.ifi_ierrors = stats->errors_in;
650 interface->if_data.ifi_opackets = stats->packets_out;
651 interface->if_data.ifi_obytes = stats->bytes_out;
652 interface->if_data.ifi_omcasts = stats->multicasts_out;
653 interface->if_data.ifi_oerrors = stats->errors_out;
655 interface->if_data.ifi_collisions = stats->collisions;
656 interface->if_data.ifi_iqdrops = stats->dropped;
657 interface->if_data.ifi_noproto = stats->no_protocol;
660 TOUCHLASTCHANGE(&interface->if_lastchange);
669 ifnet_t interface,
674 if (interface == NULL) return EINVAL;
676 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
681 stats->packets_in = interface->if_data.ifi_ipackets;
682 stats->bytes_in = interface->if_data.ifi_ibytes;
683 stats->multicasts_in = interface->if_data.ifi_imcasts;
684 stats->errors_in = interface->if_data.ifi_ierrors;
686 stats->packets_out = interface->if_data.ifi_opackets;
687 stats->bytes_out = interface->if_data.ifi_obytes;
688 stats->multicasts_out = interface->if_data.ifi_omcasts;
689 stats->errors_out = interface->if_data.ifi_oerrors;
691 stats->collisions = interface->if_data.ifi_collisions;
692 stats->dropped = interface->if_data.ifi_iqdrops;
693 stats->no_protocol = interface->if_data.ifi_noproto;
702 ifnet_t interface)
706 if (interface == NULL) return EINVAL;
708 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
713 TOUCHLASTCHANGE(&interface->if_lastchange);
722 ifnet_t interface,
727 if (interface == NULL) return EINVAL;
729 if ((thread = interface->if_input_thread) == NULL || (dlil_multithreaded_input == 0))
734 *last_change = interface->if_data.ifi_lastchange;
748 ifnet_t interface,
752 return ifnet_get_address_list_family(interface, addresses, 0);
757 ifnet_t interface,
771 if (interface && ifp != interface) continue;
775 if (interface == NULL || interface == ifp)
785 else if (interface != NULL) {
801 if (interface && ifp != interface) continue;
805 if (interface == NULL || (struct ifnet*)interface == ifp)
820 if (interface || count == cmax)
847 ifnet_t interface)
849 if (interface == NULL) return NULL;
850 return LLADDR(SDL(interface->if_addrhead.tqh_first->ifa_addr));
855 ifnet_t interface,
860 if (interface == NULL || addr == NULL || out_len == NULL) return EINVAL;
862 *out_len = interface->if_broadcast.length;
864 if (buffer_len < interface->if_broadcast.length) {
868 if (interface->if_broadcast.length == 0)
871 if (interface->if_broadcast.length <= sizeof(interface->if_broadcast.u.buffer)) {
872 bcopy(interface->if_broadcast.u.buffer, addr, interface->if_broadcast.length);
875 bcopy(interface->if_broadcast.u.ptr, addr, interface->if_broadcast.length);
883 ifnet_t interface,
888 if (interface == NULL || lladdr == NULL) return EINVAL;
890 sdl = SDL(interface->if_addrhead.tqh_first->ifa_addr);
907 ifnet_t interface,
917 if (interface == NULL) return EINVAL;
919 if (lladdr_len != 0 && (lladdr_len != interface->if_addrlen || lladdr == 0))
923 ifa = ifnet_addrs[interface->if_index - 1];
930 bzero(LLADDR(sdl), interface->if_addrlen);
945 dlil_post_msg(interface, KEV_DL_SUBCLASS,
954 ifnet_t interface,
958 return ifnet_set_lladdr_internal(interface, lladdr, lladdr_len, 0, 0);
963 ifnet_t interface,
968 return ifnet_set_lladdr_internal(interface, lladdr, lladdr_len, type, 1);
973 ifnet_t interface,
977 if (interface == NULL || maddr == NULL) return EINVAL;
978 return if_addmulti(interface, maddr, address);
989 errno_t ifnet_get_multicast_list(ifnet_t interface, ifmultiaddr_t **addresses)
996 if (interface == NULL || addresses == NULL)
999 lock = (interface->if_lock != 0);
1000 if (lock) ifnet_lock_shared(interface);
1001 if ((interface->if_eflags & IFEF_DETACHING) == 0) {
1002 LIST_FOREACH(addr, &interface->if_multiaddrs, ifma_link)
1008 if (lock) ifnet_lock_done(interface);
1014 if (lock) ifnet_lock_done(interface);
1018 LIST_FOREACH(addr, &interface->if_multiaddrs, ifma_link)
1027 if (lock) ifnet_lock_done(interface);
1051 ifnet_t *interface)
1060 *interface = NULL;
1081 *interface = ifp;
1082 ifnet_reference(*interface);
1301 ifnet_t interface)
1303 if (addr == NULL || interface == NULL) return NULL;
1304 return ifaof_ifpforaddr(addr, interface);