Lines Matching refs:ifp

438 void fr_forgetifp(ifp, ifs)
439 void *ifp;
447 if (f->fr_ifa == ifp)
451 if (f->fr_ifa == ifp)
455 if (f->fr_ifa == ifp)
459 if (f->fr_ifa == ifp)
464 if (f->fr_ifa == ifp)
468 if (f->fr_ifa == ifp)
472 if (f->fr_ifa == ifp)
476 if (f->fr_ifa == ifp)
480 fr_natifpsync(IPFSYNC_OLDIFP, 4, ifp, NULL, ifs);
481 fr_natifpsync(IPFSYNC_OLDIFP, 6, ifp, NULL, ifs);
501 static int no_output(ifp, m, s)
504 static int no_output (ifp, m, s, rt, cp)
507 static int no_output(ifp, m, s, rt)
511 struct ifnet *ifp;
520 static int write_output(ifp, m, s)
523 static int write_output (ifp, m, s, rt, cp)
526 static int write_output(ifp, m, s, rt)
530 struct ifnet *ifp;
545 sprintf(fname, "/tmp/%s", ifp->if_xname);
547 sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
560 static void fr_setifpaddr(ifp, addr)
561 struct ifnet *ifp;
571 if (ifp->if_addrlist.tqh_first != NULL)
574 if (ifp->in_ifaddr != NULL)
576 if (ifp->if_addrlist != NULL)
583 ifp->if_addrlist.tqh_first = ifa;
586 ifp->in_ifaddr = ifa;
588 ifp->if_addrlist = ifa;
612 struct ifnet *ifp, **ifpp, **old_ifneta;
625 for (ifpp = ifneta; ifpp && (ifp = *ifpp); ifpp++) {
626 if (!strcmp(name, ifp->if_xname)) {
628 fr_setifpaddr(ifp, addr);
629 return ifp;
642 for (ifpp = ifneta; ifpp && (ifp = *ifpp); ifpp++) {
643 COPYIFNAME(ifp, ifname, 0);
646 fr_setifpaddr(ifp, addr);
647 return ifp;
653 ifneta = (struct ifnet **)malloc(sizeof(ifp) * 2);
657 ifneta[0] = (struct ifnet *)calloc(1, sizeof(*ifp));
667 (nifs + 1) * sizeof(ifp));
674 ifneta[nifs - 1] = (struct ifnet *)malloc(sizeof(*ifp));
680 ifp = ifneta[nifs - 1];
685 (void) strncpy(ifp->if_xname, name, sizeof(ifp->if_xname));
690 ifp->if_unit = atoi(s);
691 ifp->if_name = (char *)malloc(s - name + 1);
692 if (ifp->if_name == NULL) {
700 (void) strncpy(ifp->if_name, name, s - name);
701 ifp->if_name[s - name] = '\0';
703 ifp->if_name = strdup(name);
704 ifp->if_unit = -1;
707 ifp->if_output = no_output;
710 fr_setifpaddr(ifp, addr);
713 return ifp;
717 char *get_ifname(ifp)
718 struct ifnet *ifp;
724 sprintf(ifname, "%s", ifp->if_xname);
726 sprintf(ifname, "%s%d", ifp->if_name, ifp->if_unit);
735 struct ifnet *ifp, **ifpp;
742 for (ifpp = ifneta; ifpp && (ifp = *ifpp); ifpp++) {
743 ifp->if_output = write_output;
744 sprintf(fname, "/tmp/%s", ifp->if_xname);
753 for (ifpp = ifneta; ifpp && (ifp = *ifpp); ifpp++) {
754 ifp->if_output = write_output;
755 sprintf(fname, "/tmp/%s%d", ifp->if_name, ifp->if_unit);
771 struct ifnet *ifp = fdp->fd_ifp;
774 if (!ifp)
781 (*ifp->if_output)(ifp, (void *)ip, NULL);
783 (*ifp->if_output)(ifp, (void *)m, NULL, 0, 0);
785 (*ifp->if_output)(ifp, (void *)m, NULL, 0);
994 struct ifnet *ifp = ifptr;
1002 ifa = ifp->if_addrlist.tqh_first;
1005 ifa = (struct in_ifaddr *)ifp->in_ifaddr;
1007 ifa = ifp->if_addrlist;