Lines Matching refs:ifp

103 int		looutput(struct ifnet *ifp, struct mbuf *m,
119 lo_clone_destroy(struct ifnet *ifp)
124 KASSERT(V_loif != ifp, ("%s: destroying lo0", __func__));
127 bpfdetach(ifp);
128 if_detach(ifp);
129 if_free(ifp);
135 struct ifnet *ifp;
137 ifp = if_alloc(IFT_LOOP);
138 if (ifp == NULL)
141 if_initname(ifp, loname, unit);
142 ifp->if_mtu = LOMTU;
143 ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
144 ifp->if_ioctl = loioctl;
145 ifp->if_output = looutput;
146 ifp->if_snd.ifq_maxlen = ifqmaxlen;
147 ifp->if_capabilities = ifp->if_capenable =
149 ifp->if_hwassist = LO_CSUM_FEATURES | LO_CSUM_FEATURES6;
150 if_attach(ifp);
151 bpfattach(ifp, DLT_NULL, sizeof(u_int32_t));
153 V_loif = ifp;
213 looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
227 error = mac_ifnet_check_transmit(ifp, m);
240 ifp->if_opackets++;
241 ifp->if_obytes += m->m_pkthdr.len;
252 if (ifp->if_capenable & IFCAP_RXCSUM) {
265 if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) {
284 return (if_simloop(ifp, m, af, 0));
298 if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen)
304 m->m_pkthdr.rcvif = ifp;
307 mac_ifnet_create_mbuf(ifp, m);
314 * -> passes it to ifp's BPF
318 * -> passes to lo0's BPF (even in case of IPv6, where ifp!=lo0)
321 if (bpf_peers_present(ifp->if_bpf)) {
322 bpf_mtap(ifp->if_bpf, m);
326 if ((m->m_flags & M_MCAST) == 0 || V_loif == ifp) {
385 ifp->if_ipackets++;
386 ifp->if_ibytes += m->m_pkthdr.len;
405 loioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
413 ifp->if_flags |= IFF_UP;
414 ifp->if_drv_flags |= IFF_DRV_RUNNING;
446 ifp->if_mtu = ifr->ifr_mtu;
453 mask = ifp->if_capenable ^ ifr->ifr_reqcap;
455 ifp->if_capenable ^= IFCAP_RXCSUM;
457 ifp->if_capenable ^= IFCAP_TXCSUM;
460 ifp->if_capenable ^= IFCAP_RXCSUM_IPV6;
468 ifp->if_capenable ^= IFCAP_TXCSUM_IPV6;
474 ifp->if_hwassist = 0;
475 if (ifp->if_capenable & IFCAP_TXCSUM)
476 ifp->if_hwassist = LO_CSUM_FEATURES;
478 if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
479 ifp->if_hwassist |= LO_CSUM_FEATURES6;