Lines Matching refs:filter
189 static int dlil_detach_filter_internal(interface_filter_t filter, int detached);
608 struct ifnet_filter *filter;
610 MALLOC(filter, struct ifnet_filter *, sizeof(*filter), M_NKE, M_WAITOK);
611 if (filter == NULL)
613 bzero(filter, sizeof(*filter));
616 filter->filt_ifp = ifp;
617 filter->filt_cookie = if_filter->iff_cookie;
618 filter->filt_name = if_filter->iff_name;
619 filter->filt_protocol = if_filter->iff_protocol;
620 filter->filt_input = if_filter->iff_input;
621 filter->filt_output = if_filter->iff_output;
622 filter->filt_event = if_filter->iff_event;
623 filter->filt_ioctl = if_filter->iff_ioctl;
624 filter->filt_detached = if_filter->iff_detached;
628 FREE(filter, M_NKE);
631 TAILQ_INSERT_TAIL(&ifp->if_flt_head, filter, filt_next);
633 *filter_ref = filter;
639 interface_filter_t filter,
657 * read, either the read or write is held. Verify the filter
663 if (entry == filter)
666 if (entry == filter)
671 if (entry != filter) {
672 /* filter parameter is not a valid filter ref */
681 filter->filt_detaching = 1;
687 /* Remove the filter from the list */
688 TAILQ_REMOVE(&ifp->if_flt_head, filter, filt_next);
693 if (filter->filt_detached)
694 filter->filt_detached(filter->filt_cookie, filter->filt_ifp);
696 /* Free the filter */
697 FREE(filter, M_NKE);
703 dlil_detach_filter(interface_filter_t filter)
705 if (filter == NULL)
707 dlil_detach_filter_internal(filter, 0);
955 struct ifnet_filter * filter;
957 TAILQ_FOREACH(filter, &ifp->if_flt_head, filt_next) {
960 if (filter->filt_input
961 && (filter->filt_protocol == 0
962 || filter->filt_protocol == protocol_family)) {
963 result = (*filter->filt_input)(filter->filt_cookie,
1134 struct ifnet_filter *filter;
1140 TAILQ_FOREACH(filter, &ifp->if_flt_head, filt_next) {
1141 if (filter->filt_event)
1142 filter->filt_event(filter->filt_cookie, ifp, filter->filt_protocol, event);
1253 struct ifnet_filter *filter;
1345 TAILQ_FOREACH(filter, &ifp->if_flt_head, filt_next) {
1346 if ((filter->filt_protocol == 0 || (filter->filt_protocol == proto_family)) &&
1347 filter->filt_output) {
1348 retval = filter->filt_output(filter->filt_cookie, ifp, proto_family, &m);
1432 struct ifnet_filter *filter;
1524 TAILQ_FOREACH(filter, &ifp->if_flt_head, filt_next) {
1525 if ((filter->filt_protocol == 0 || (filter->filt_protocol == proto_family)) &&
1526 filter->filt_output) {
1527 retval = filter->filt_output(filter->filt_cookie, ifp, proto_family, &m);
1603 struct ifnet_filter *filter;
1623 TAILQ_FOREACH(filter, &ifp->if_flt_head, filt_next) {
1624 if ((filter->filt_protocol == 0 || (filter->filt_protocol == proto_fam)) &&
1625 filter->filt_ioctl != NULL) {
1626 result = filter->filt_ioctl(filter->filt_cookie, ifp, proto_fam, ioctl_code, ioctl_arg);
2275 * When detaching a protocol filter, if we find that we
2340 // take this interface filter off the interface filter list
2343 // put this interface filter on the detached filters list
2600 struct ifnet_filter *filter;
2705 for (filter = TAILQ_FIRST(&fhead); filter; filter = filter_next) {
2706 filter_next = TAILQ_NEXT(filter, filt_next);
2707 dlil_detach_filter_internal(filter, 1);