Lines Matching refs:ifp

92 static int	looutput(struct ifnet *ifp, struct mbuf *m,
106 lo_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags)
108 if (ifp->if_dunit == 0 && (flags & IFC_F_FORCE) == 0)
113 KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__));
116 bpfdetach(ifp);
117 if_detach(ifp);
118 if_free(ifp);
127 struct ifnet *ifp;
129 ifp = if_alloc(IFT_LOOP);
130 if (ifp == NULL)
133 if_initname(ifp, loname, ifd->unit);
134 ifp->if_mtu = LOMTU;
135 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
136 ifp->if_ioctl = loioctl;
137 ifp->if_output = looutput;
138 ifp->if_snd.ifq_maxlen = ifqmaxlen;
139 ifp->if_capabilities = ifp->if_capenable =
141 ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6;
142 if_attach(ifp);
143 bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
145 V_loif = ifp;
146 *ifpp = ifp;
208 looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
219 error = mac_ifnet_check_transmit(ifp, m);
231 if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
232 if_inc_counter(ifp, IFCOUNTER_OBYTES, m->m_pkthdr.len);
247 if (ifp->if_capenable & IFCAP_RXCSUM) {
260 if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) {
276 return (if_simloop(ifp, m, af, 0));
290 if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen)
296 m->m_pkthdr.rcvif = ifp;
299 mac_ifnet_create_mbuf(ifp, m);
306 * -> passes it to ifp's BPF
310 * -> passes to lo0's BPF (even in case of IPv6, where ifp!=lo0)
313 if (bpf_peers_present(ifp->if_bpf)) {
314 bpf_mtap(ifp->if_bpf, m);
318 if ((m->m_flags & M_MCAST) == 0 || V_loif == ifp) {
367 if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
368 if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len);
377 loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
384 ifp->if_flags |= IFF_UP;
385 ifp->if_drv_flags |= IFF_DRV_RUNNING;
386 if_link_state_change(ifp, LINK_STATE_UP);
415 ifp->if_mtu = ifr->ifr_mtu;
419 if_link_state_change(ifp, (ifp->if_flags & IFF_UP) ?
424 mask = ifp->if_capenable ^ ifr->ifr_reqcap;
426 ifp->if_capenable ^= IFCAP_RXCSUM;
428 ifp->if_capenable ^= IFCAP_TXCSUM;
431 ifp->if_capenable ^= IFCAP_RXCSUM_IPV6;
439 ifp->if_capenable ^= IFCAP_TXCSUM_IPV6;
445 ifp->if_hwassist = 0;
446 if (ifp->if_capenable & IFCAP_TXCSUM)
447 ifp->if_hwassist = LO_CSUM_FEATURES;
449 if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
450 ifp->if_hwassist |= LO_CSUM_FEATURES6;