Lines Matching refs:sc
256 struct stf_softc *sc = ifnet_softc(ifp);
258 sc->tap_mode = mode;
259 sc->tap_callback = callback;
267 struct stf_softc *sc;
277 sc = _MALLOC(sizeof(struct stf_softc), M_DEVBUF, M_WAITOK);
278 if (sc == 0) {
283 bzero(sc, sizeof(*sc));
286 &in_stf_protosw, sc);
289 FREE(sc, M_DEVBUF);
292 sc->encap_cookie = p;
303 stf_init.softc = sc;
307 error = ifnet_allocate(&stf_init, &sc->sc_if);
310 encap_detach(sc->encap_cookie);
311 FREE(sc, M_DEVBUF);
314 ifnet_set_mtu(sc->sc_if, IPV6_MMTU);
315 ifnet_set_flags(sc->sc_if, 0, 0xffff); /* clear all flags */
318 ifnet_set_flags(sc->sc_if, IFF_LINK2, IFF_LINK2);
322 mac_ifnet_label_init(&sc->sc_if);
325 error = ifnet_attach(sc->sc_if, NULL);
328 encap_detach(sc->encap_cookie);
329 ifnet_release(sc->sc_if);
330 FREE(sc, M_DEVBUF);
334 bpfattach(sc->sc_if, DLT_NULL, sizeof(u_int));
348 struct stf_softc *sc;
351 sc = (struct stf_softc *)arg;
352 if (sc == NULL)
355 if ((ifnet_flags(sc->sc_if) & IFF_UP) == 0)
359 if ((ifnet_flags(sc->sc_if) & IFF_LINK0) != 0)
371 ia6 = stf_getsrcifa6(sc->sc_if);
455 struct stf_softc *sc;
465 sc = ifnet_softc(ifp);
535 dst4 = (struct sockaddr_in *)&sc->sc_ro.ro_dst;
543 if (sc->sc_ro.ro_rt) {
544 rtfree(sc->sc_ro.ro_rt);
545 sc->sc_ro.ro_rt = NULL;
549 if (sc->sc_ro.ro_rt == NULL) {
550 rtalloc(&sc->sc_ro);
551 if (sc->sc_ro.ro_rt == NULL) {
556 result = ip_output_list(m, 0, NULL, &sc->sc_ro, 0, NULL, NULL);
577 struct stf_softc *sc,
614 if (sc && (ifnet_flags(sc->sc_if) & IFF_LINK2) == 0 && inifp) {
626 "due to ingress filter\n", if_name(sc->sc_if),
641 struct stf_softc *sc,
649 return stf_checkaddr4(sc, GET_V4(in6), inifp);
668 struct stf_softc *sc;
686 sc = (struct stf_softc *)encap_getarg(m);
688 if (sc == NULL || (ifnet_flags(sc->sc_if) & IFF_UP) == 0) {
693 ifp = sc->sc_if;
703 if (stf_checkaddr4(sc, &ip->ip_dst, NULL) < 0 ||
704 stf_checkaddr4(sc, &ip->ip_src, m->m_pkthdr.rcvif) < 0) {
716 if (stf_checkaddr6(sc, &ip6.ip6_dst, NULL) < 0 ||
717 stf_checkaddr6(sc, &ip6.ip6_src, m->m_pkthdr.rcvif) < 0) {