Lines Matching defs:ifp
113 typedef int (if_set_bpf_tap_func)(struct ifnet *ifp, int mode, bpf_callback_func * func);
373 static int vlan_input(ifnet_t ifp, protocol_family_t protocol,
375 static int vlan_output(struct ifnet *ifp, struct mbuf *m);
376 static int vlan_ioctl(ifnet_t ifp, u_long cmd, void * addr);
377 static int vlan_set_bpf_tap(ifnet_t ifp, bpf_tap_mode mode,
379 static int vlan_attach_protocol(struct ifnet *ifp);
380 static int vlan_detach_protocol(struct ifnet *ifp);
381 static int vlan_setmulti(struct ifnet *ifp);
383 static int vlan_config(struct ifnet * ifp, struct ifnet * p, int tag);
384 static void vlan_if_free(struct ifnet * ifp);
392 static void interface_link_event(struct ifnet * ifp, u_int32_t event_code);
456 ifnet_get_ifvlan(struct ifnet * ifp)
460 ifv = (ifvlan_ref)ifnet_softc(ifp);
465 ifnet_get_ifvlan_retained(struct ifnet * ifp)
469 ifv = ifnet_get_ifvlan(ifp);
481 ifnet_ifvlan_vlan_parent_ok(struct ifnet * ifp, ifvlan_ref ifv,
486 check_ifv = ifnet_get_ifvlan(ifp);
538 siocgifdevmtu(struct ifnet * ifp, struct ifdevmtu * ifdm_p)
544 error = ifnet_ioctl(ifp, 0,SIOCGIFDEVMTU, &ifr);
552 siocsifaltmtu(struct ifnet * ifp, int mtu)
558 return (ifnet_ioctl(ifp, 0, SIOCSIFALTMTU, &ifr));
562 vlan_bpf_output(struct ifnet * ifp, struct mbuf * m,
566 (*func)(ifp, m);
572 vlan_bpf_input(struct ifnet * ifp, struct mbuf * m,
583 (*func)(ifp, m);
624 struct ifnet * ifp = vlp->vlp_ifp;
625 printf("vlan_parent_release(%s%d)\n", ifnet_name(ifp),
626 ifnet_unit(ifp));
657 struct ifnet * ifp = vlp->vlp_ifp;
659 printf("%s%d: %s msleep\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
667 struct ifnet * ifp = vlp->vlp_ifp;
669 printf("%s%d: %s woke up\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
690 struct ifnet * ifp = vlp->vlp_ifp;
692 printf("%s%d: %s wakeup\n", ifnet_name(ifp), ifnet_unit(ifp), msg);
706 vlan_setmulti(struct ifnet * ifp)
714 ifv = ifnet_get_ifvlan_retained(ifp);
726 if (ifnet_ifvlan_vlan_parent_ok(ifp, ifv, vlp) == FALSE) {
733 error = multicast_list_program(&ifv->ifv_multicast, ifp, p);
875 struct ifnet * ifp = ifv->ifv_ifp;
882 ifnet_detach(ifp);
944 ifnet_t ifp;
959 /* use the interface name as the unique id for ifp recycle */
986 error = ifnet_allocate(&vlan_init, &ifp);
993 ifnet_set_offload(ifp, 0);
994 ifnet_set_addrlen(ifp, ETHER_ADDR_LEN); /* XXX ethernet specific */
995 ifnet_set_baudrate(ifp, 0);
996 ifnet_set_hdrlen(ifp, ETHER_VLAN_ENCAP_LEN);
998 error = ifnet_attach(ifp, NULL);
1000 ifnet_release(ifp);
1004 ifv->ifv_ifp = ifp;
1007 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header));
1025 vlan_clone_destroy(struct ifnet *ifp)
1030 ifv = ifnet_get_ifvlan_retained(ifp);
1042 ifnet_detach(ifp);
1048 vlan_set_bpf_tap(ifnet_t ifp, bpf_tap_mode mode, bpf_packet_func func)
1053 ifv = ifnet_get_ifvlan_retained(ifp);
1083 vlan_output(struct ifnet * ifp, struct mbuf * m)
1104 ifv = ifnet_get_ifvlan_retained(ifp);
1113 (void)ifnet_stat_increment_out(ifp, 1, m->m_pkthdr.len, 0);
1123 vlan_bpf_output(ifp, m, bpf_func);
1128 atomic_add_64(&ifp->if_collisions, 1);
1145 printf("%s%d: unable to prepend VLAN header\n", ifnet_name(ifp),
1146 ifnet_unit(ifp));
1147 atomic_add_64(&ifp->if_oerrors, 1);
1154 printf("%s%d: unable to pullup VLAN header\n", ifnet_name(ifp),
1155 ifnet_unit(ifp));
1156 atomic_add_64(&ifp->if_oerrors, 1);
1204 struct ifnet * ifp = NULL;
1258 ifp = ifv->ifv_ifp;
1262 || (ifnet_flags(ifp) & IFF_UP) == 0) {
1282 m->m_pkthdr.rcvif = ifp;
1284 (void)ifnet_stat_increment_in(ifp, 1,
1286 vlan_bpf_input(ifp, m, bpf_func, frame_header, ETHER_HDR_LEN,
1289 dlil_input_packet_list(ifp, m);
1299 vlan_config(struct ifnet * ifp, struct ifnet * p, int tag)
1318 ifv = ifnet_get_ifvlan_retained(ifp);
1352 if (ifnet_get_ifvlan(ifp) != ifv) {
1407 error = multicast_list_program(&ifv->ifv_multicast, ifp, p);
1417 ifnet_set_lladdr_and_type(ifp, ifnet_lladdr(p), ETHER_ADDR_LEN, IFT_ETHER);
1436 ifnet_set_mtu(ifp, ETHERMTU - ifv->ifv_mtufudge);
1444 ifnet_set_flags(ifp, parent_flags,
1449 ifnet_set_offload(ifp, offload);
1451 ifnet_set_flags(ifp, IFF_RUNNING, IFF_RUNNING);
1506 vlan_link_event(struct ifnet * ifp, struct ifnet * p)
1520 interface_link_event(ifp, event);
1528 struct ifnet * ifp = ifv->ifv_ifp;
1546 if (ifv != ifnet_get_ifvlan(ifp)) {
1577 ifnet_set_lladdr_and_type(ifp, NULL, 0, IFT_L2VLAN);
1587 ifnet_set_mtu(ifp, 0);
1588 ifnet_set_flags(ifp, 0,
1590 ifnet_set_offload(ifp, 0);
1629 vlan_set_promisc(struct ifnet * ifp)
1636 ifv = ifnet_get_ifvlan_retained(ifp);
1646 if ((ifnet_flags(ifp) & IFF_PROMISC) != 0) {
1674 struct ifnet * ifp = ifv->ifv_ifp;
1704 ifnet_set_mtu(ifp, mtu);
1710 vlan_set_mtu(struct ifnet * ifp, int mtu)
1720 ifv = ifnet_get_ifvlan_retained(ifp);
1737 if (ifnet_get_ifvlan(ifp) != ifv
1764 vlan_ioctl(ifnet_t ifp, u_long cmd, void * data)
1778 if (ifnet_type(ifp) != IFT_L2VLAN) {
1786 ifnet_set_flags(ifp, IFF_UP, IFF_UP);
1792 ifv = (ifvlan_ref)ifnet_softc(ifp);
1838 ifv = (ifvlan_ref)ifnet_softc(ifp);
1847 devmtu_p->ifdm_current = ifnet_mtu(ifp);
1861 error = vlan_set_mtu(ifp, ifr->ifr_mtu);
1892 error = vlan_config(ifp, p, vlr.vlr_tag);
1898 (void)vlan_set_promisc(ifp);
1901 vlan_link_event(ifp, p);
1907 ifv = (ifvlan_ref)ifnet_softc(ifp);
1916 interface_link_event(ifp, KEV_DL_LINK_OFF);
1924 ifv = (ifvlan_ref)ifnet_softc(ifp);
1947 error = vlan_set_promisc(ifp);
1952 error = vlan_setmulti(ifp);
1961 vlan_if_free(struct ifnet * ifp)
1965 if (ifp == NULL) {
1968 ifv = (ifvlan_ref)ifnet_softc(ifp);
1973 ifnet_release(ifp);
2012 interface_link_event(struct ifnet * ifp, u_int32_t event_code)
2026 event.header.event_data[0] = ifnet_family(ifp);
2027 event.unit = (u_int32_t) ifnet_unit(ifp);
2028 strncpy(event.if_name, ifnet_name(ifp), IFNAMSIZ);
2029 ifnet_event(ifp, &event.header);
2062 struct ifnet * ifp = ifv->ifv_ifp;
2064 interface_link_event(ifp, event_code);
2088 vlan_attach_protocol(struct ifnet *ifp)
2097 error = ifnet_attach_protocol(ifp, PF_VLAN, ®);
2100 ifnet_name(ifp), ifnet_unit(ifp), error);
2111 vlan_detach_protocol(struct ifnet *ifp)
2115 error = ifnet_detach_protocol(ifp, PF_VLAN);
2118 ifnet_name(ifp), ifnet_unit(ifp), error);
2132 vlan_attach_inet(struct ifnet *ifp, protocol_family_t protocol_family)
2134 return (ether_attach_inet(ifp, protocol_family));
2138 vlan_detach_inet(struct ifnet *ifp, protocol_family_t protocol_family)
2140 ether_detach_inet(ifp, protocol_family);
2145 vlan_attach_inet6(struct ifnet *ifp, protocol_family_t protocol_family)
2147 return (ether_attach_inet6(ifp, protocol_family));
2151 vlan_detach_inet6(struct ifnet *ifp, protocol_family_t protocol_family)
2153 ether_detach_inet6(ifp, protocol_family);
2159 vlan_attach_at(struct ifnet *ifp, protocol_family_t protocol_family)
2161 return (ether_attach_at(ifp, protocol_family));
2165 vlan_detach_at(struct ifnet *ifp, protocol_family_t protocol_family)
2167 ether_detach_at(ifp, protocol_family);