Lines Matching defs:ifp
226 #define BRIDGE_BPF_MTAP_INPUT(ifp, m)
387 static void bridge_rtdelete(struct bridge_softc *, struct ifnet *ifp, int);
426 struct ifnet *ifp);
484 __private_extern__ errno_t bridge_bpf_input(ifnet_t ifp, struct mbuf *m);
485 __private_extern__ errno_t bridge_bpf_output(ifnet_t ifp, struct mbuf *m);
487 static void bridge_detach(ifnet_t ifp);
1042 struct ifnet *ifp = NULL;
1077 /* use the interface name as the unique id for ifp recycle */
1107 error = ifnet_allocate_extended(&init_params, &ifp);
1112 sc->sc_ifp = ifp;
1114 error = ifnet_set_mtu(ifp, ETHERMTU);
1119 error = ifnet_set_addrlen(ifp, ETHER_ADDR_LEN);
1124 error = ifnet_set_hdrlen(ifp, ETHER_HDR_LEN);
1129 error = ifnet_set_flags(ifp,
1198 error = ifnet_attach(ifp, NULL);
1204 error = ifnet_set_lladdr_and_type(ifp, eaddr, ETHER_ADDR_LEN,
1220 ifp->if_capabilities =
1234 error = bpf_attach(ifp, DLT_EN10MB, sizeof (struct ether_header),
1252 bridge_clone_destroy(struct ifnet *ifp)
1254 struct bridge_softc *sc = ifp->if_softc;
1265 bridge_ifstop(ifp, 1);
1267 error = ifnet_set_flags(ifp, 0, IFF_UP);
1281 error = ifnet_detach(ifp);
1284 ifp, error);
1285 if ((sc = (struct bridge_softc *)ifnet_softc(ifp)) != NULL) {
1350 bridge_ioctl(struct ifnet *ifp, u_long cmd, void *data)
1352 struct bridge_softc *sc = ifp->if_softc;
1360 printf("%s: ifp %p cmd 0x%08lx (%c%c [%lu] %c %lu)\n",
1361 __func__, ifp, cmd, (cmd & IOC_IN) ? 'I' : ' ',
1370 ifnet_set_flags(ifp, IFF_UP, IFF_UP);
1420 if (!(ifp->if_flags & IFF_UP) &&
1421 (ifp->if_flags & IFF_RUNNING)) {
1427 bridge_ifstop(ifp, 1);
1429 } else if ((ifp->if_flags & IFF_UP) &&
1430 !(ifp->if_flags & IFF_RUNNING)) {
1436 error = bridge_init(ifp);
1442 error = ifnet_set_lladdr(ifp, ifr->ifr_addr.sa_data,
1455 error = ether_ioctl(ifp, cmd, data);
1458 printf("%s: ether_ioctl ifp %p cmd 0x%08lx "
1460 __func__, ifp, cmd, (cmd & IOC_IN) ? 'I' : ' ',
1507 struct ifnet *ifp = bif->bif_ifp;
1514 if (ifp->if_capenable != set) {
1515 IFF_LOCKGIANT(ifp);
1516 error = (*ifp->if_ioctl)(ifp, SIOCSIFCAP, (caddr_t)&ifr);
1517 IFF_UNLOCKGIANT(ifp);
1521 ifnet_unit(sc->sc_ifp), ifp->if_xname);
1535 struct ifnet *ifp;
1541 ifp = bif->bif_ifp;
1543 ifnet_name(ifp), ifnet_unit(ifp));
1572 bridge_iff_input(void *cookie, ifnet_t ifp, __unused protocol_family_t protocol,
1594 ifnet_unit(sc->sc_ifp), ifnet_name(ifp), ifnet_unit(ifp),
1618 error = bridge_input(ifp, m, *frame_ptr);
1642 bridge_iff_output(void *cookie, ifnet_t ifp, __unused protocol_family_t protocol, mbuf_t *data)
1656 ifnet_name(ifp), ifnet_unit(ifp), m, mbuf_data(m));
1660 error = bridge_member_output(sc, ifp, m);
1675 bridge_iff_event(void *cookie, ifnet_t ifp, __unused protocol_family_t protocol,
1686 bridge_ifdetach(bif, ifp);
1692 bstp_linkstate(ifp, event_msg->event_code);
1699 (ifp->if_flags & IFF_UP)) {
1701 ifnet_set_promiscuous(ifp, 1);
1706 __func__, ifnet_name(ifp),
1707 ifnet_unit(ifp), error);
1728 bridge_iff_detached(void *cookie, __unused ifnet_t ifp)
1733 printf("%s: %s%d\n", __func__, ifnet_name(ifp), ifnet_unit(ifp));
1736 bridge_ifdetach(bif, ifp);
1742 bridge_proto_input(ifnet_t ifp, __unused protocol_family_t protocol,
1746 ifnet_name(ifp), ifnet_unit(ifp));
1751 bridge_attach_protocol(struct ifnet *ifp)
1756 printf("%s: %s%d\n", __func__, ifnet_name(ifp), ifnet_unit(ifp));
1761 error = ifnet_attach_protocol(ifp, PF_BRIDGE, ®);
1764 __func__, ifnet_name(ifp), ifnet_unit(ifp), error);
1770 bridge_detach_protocol(struct ifnet *ifp)
1774 printf("%s: %s%d\n", __func__, ifnet_name(ifp), ifnet_unit(ifp));
1776 error = ifnet_detach_protocol(ifp, PF_BRIDGE);
1779 __func__, ifnet_name(ifp), ifnet_unit(ifp), error);
2793 bridge_ifdetach(struct bridge_iflist *bif, struct ifnet *ifp)
2795 struct bridge_softc *sc = ifp->if_bridge;
2798 printf("%s: %s%d\n", __func__, ifnet_name(ifp), ifnet_unit(ifp));
2805 bif = bridge_lookup_member_if(sc, ifp);
2818 if (ifp == bif->bif_ifp) {
2834 bridge_init(struct ifnet *ifp)
2836 struct bridge_softc *sc = (struct bridge_softc *)ifp->if_softc;
2842 if ((ifnet_flags(ifp) & IFF_RUNNING))
2849 error = ifnet_set_flags(ifp, IFF_RUNNING, IFF_RUNNING);
2864 bridge_ifstop(struct ifnet *ifp, __unused int disable)
2866 struct bridge_softc *sc = ifp->if_softc;
2870 if ((ifnet_flags(ifp) & IFF_RUNNING) == 0)
2880 (void) ifnet_set_flags(ifp, 0, IFF_RUNNING);
2966 bridge_dummynet(struct mbuf *m, struct ifnet *ifp)
2970 sc = ifp->if_bridge;
2987 if (bridge_pfil(&m, sc->sc_ifp, ifp, PFIL_OUT) != 0)
2993 (void) bridge_enqueue(sc, ifp, m);
3009 bridge_member_output(struct ifnet *ifp, struct mbuf *m,
3019 printf("%s: ifp %p %s%d\n", __func__, ifp, ifnet_name(ifp),
3020 ifnet_unit(ifp));
3030 sc = ifp->if_bridge;
3041 dst_if = ifp;
3051 dst_if = ifp;
3090 if (dst_if != ifp && (bif->bif_flags & IFBIF_STP) &&
3434 bridge_output(struct ifnet *ifp, struct mbuf *m)
3436 struct bridge_softc *sc = ifnet_softc(ifp);
3474 atomic_add_64(&ifp->if_obytes, m->m_pkthdr.len);
3475 atomic_add_64(&ifp->if_opackets, 1);
3479 bridge_bpf_output(ifp, m);
3484 bridge_broadcast(sc, ifp, m, 0);
3506 bridge_start(struct ifnet *ifp)
3511 if (ifnet_dequeue(ifp, &m) != 0)
3514 (void) bridge_output(ifp, m);
3530 struct ifnet *src_if, *dst_if, *ifp;
3545 ifp = sc->sc_ifp;
3547 (void) ifnet_stat_increment_in(ifp, 1, m->m_pkthdr.len, 0);
3601 atomic_add_64(&ifp->if_imcasts, 1);
3617 m->m_pkthdr.rcvif = ifp;
3619 bridge_bpf_input(ifp, m);
3631 if (bridge_pfil(&m, ifp, src_if, PFIL_IN) != 0)
3689 if (bridge_pfil(&m, ifp, dst_if, PFIL_OUT) != 0)
3731 bridge_input(struct ifnet *ifp, struct mbuf *m, __unused void *frame_header)
3733 struct bridge_softc *sc = ifp->if_bridge;
3745 ifnet_name(ifp), ifnet_unit(ifp), m, mbuf_data(m));
3785 bif = bridge_lookup_member_if(sc, ifp);
3818 m = bstp_input(&bif->bif_stp, ifp, m);
3924 #define PFIL_PHYS(sc, ifp, m) do { \
3927 if (bridge_pfil(&m, NULL, ifp, \
3935 #define PFIL_PHYS(sc, ifp, m)
4032 if (memcmp(eh->ether_dhost, ifnet_lladdr(ifp), ETHER_ADDR_LEN) == 0) {
4444 bridge_rtdelete(struct bridge_softc *sc, struct ifnet *ifp, int full)
4451 if (brt->brt_ifp == ifp && (full ||
4646 bridge_rtable_expire(struct ifnet *ifp, int age)
4648 struct bridge_softc *sc = ifp->if_bridge;
4658 bridge_rtdelete(sc, ifp, IFBF_FLUSHDYN);
4665 if (brt->brt_ifp == ifp &&
4681 bridge_state_change(struct ifnet *ifp, int state)
4683 struct bridge_softc *sc = ifp->if_bridge;
4696 stpstates[state], ifnet_name(ifp), ifnet_unit(ifp));
4704 * question.) If *bifp or *ifp are NULL then packet filtering is skipped for
4708 bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir)
4816 if (IPFW_LOADED && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) {
4823 args.oif = ifp;
4845 args.oif = ifp;
4885 if (pfil_member && ifp != NULL)
4886 error = pfil_run_hooks(&inet_pfil_hook, mp, ifp,
4900 if (pfil_member && ifp != NULL && dir == PFIL_OUT) {
4902 if (i > ifp->if_mtu) {
4903 error = bridge_fragment(ifp, *mp, &eh2, snap,
4939 if (pfil_member && ifp != NULL)
4940 error = pfil_run_hooks(&inet6_pfil_hook, mp, ifp,
5150 bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh,
5162 error = ip_fragment(ip, &m, ifp->if_mtu, ifp->if_hwassist,
5203 bridge_set_bpf_tap(ifnet_t ifp, bpf_tap_mode mode, bpf_packet_func bpf_callback)
5205 struct bridge_softc *sc = (struct bridge_softc *)ifnet_softc(ifp);
5237 bridge_detach(ifnet_t ifp)
5239 struct bridge_softc *sc = (struct bridge_softc *)ifnet_softc(ifp);
5252 ifnet_release(ifp);
5260 bridge_bpf_input(ifnet_t ifp, struct mbuf *m)
5262 struct bridge_softc *sc = (struct bridge_softc *)ifnet_softc(ifp);
5265 if (mbuf_pkthdr_rcvif(m) != ifp) {
5266 printf("%s: rcvif: %p != ifp %p\n", __func__,
5267 mbuf_pkthdr_rcvif(m), ifp);
5269 (*sc->sc_bpf_input)(ifp, m);
5275 bridge_bpf_output(ifnet_t ifp, struct mbuf *m)
5277 struct bridge_softc *sc = (struct bridge_softc *)ifnet_softc(ifp);
5280 (*sc->sc_bpf_output)(ifp, m);