Lines Matching refs:ifp
164 #define IFP_CHK(ifp, x) \
165 if (ifp2sc[ifp->if_index].magic != 0xDEADBEEF) { x ; }
174 struct ifnet *ifp ;
176 TAILQ_FOREACH(ifp, &ifnet_head, if_link) {
177 if ( (ifp2sc[ifp->if_index].flags & IFF_BDG_PROMISC) ) {
180 ret = ifnet_set_promiscuous(ifp, 0);
182 ifp2sc[ifp->if_index].flags &= ~(IFF_BDG_PROMISC|IFF_MUTE) ;
184 ifp->if_name, ifp->if_unit,
185 ifp->if_flags, ifp2sc[ifp->if_index].flags);)
188 ifp2sc[ifp->if_index].flags &= ~(IFF_USED) ;
189 bdg_stats.s[ifp->if_index].name[0] = '\0';
201 struct ifnet *ifp ;
205 TAILQ_FOREACH(ifp, &ifnet_head, if_link) {
206 if ( !BDG_USED(ifp) )
208 if ( 0 == ( ifp->if_flags & IFF_UP) ) {
210 if_up(ifp);
213 if ( !(ifp2sc[ifp->if_index].flags & IFF_BDG_PROMISC) ) {
216 ret = ifnet_set_promiscuous(ifp, 1);
218 ifp2sc[ifp->if_index].flags |= IFF_BDG_PROMISC ;
220 ifp->if_name, ifp->if_unit,
221 ifp->if_flags, ifp2sc[ifp->if_index].flags);
223 if (BDG_MUTED(ifp)) {
224 printf(">> unmuting %s%d\n", ifp->if_name, ifp->if_unit);
225 BDG_UNMUTE(ifp) ;
286 struct ifnet *ifp = b->ifp ;
288 if (ifp == NULL)
290 sprintf(buf, "%s%d", ifp->if_name, ifp->if_unit);
294 sprintf(bdg_stats.s[ifp->if_index].name,
295 "%s%d:%d", ifp->if_name, ifp->if_unit, cluster);
298 bdg_stats.s[ifp->if_index].name);)
478 struct ifnet *ifp;
487 for (i = 0 , ifp = ifnet.tqh_first ; i < if_index ;
488 i++, ifp = TAILQ_NEXT(ifp, if_link) )
489 if (ifp->if_type == IFT_ETHER) { /* ethernet ? */
490 ifnet_lladdr_copy_bytes(ifp, p->etheraddr, ETHER_ADDR_LEN);
491 bp = &ifp2sc[ifp->if_index] ;
493 "%s%d:1,", ifp->if_name, ifp->if_unit);
495 ifp->if_index,
496 bdg_stats.s[ifp->if_index].name,
497 (int)ifp->if_type, (int) ifp->if_physical,
498 (int)ifp->if_addrlen,
501 bp->ifp = ifp ;
506 sprintf(bdg_stats.s[ifp->if_index].name,
507 "%s%d:%d", ifp->if_name, ifp->if_unit,
525 * ifp ifp of the destination interface.
532 bridge_in(struct ifnet *ifp, struct ether_header *eh)
536 int dropit = BDG_MUTED(ifp) ;
550 } else if (old != ifp) {
559 bdg_table[index].name = ifp ; /* relocate address */
562 ifp->if_name, ifp->if_unit,
578 eh->ether_shost, ".", index, ifp->if_name, ifp->if_unit);)
580 bdg_table[index].name = ifp ;
584 * BDG_BCAST, BDG_MCAST, BDG_LOCAL, BDG_UNKNOWN, BDG_DROP, ifp.
586 * and others to BDG_DROP. Also, for incoming packets, ifp is changed
587 * to BDG_DROP in case ifp == src . These mods are not necessary
590 BDG_STAT(ifp, BDG_IN);
597 BDG_STAT(ifp, dst);
600 if (dst == ifp || dropit )
601 BDG_STAT(ifp, BDG_DROP);
603 BDG_STAT(ifp, BDG_FORWARD);
613 return (dst == ifp ? BDG_DROP : dst ) ;
639 struct ifnet *ifp, *last = NULL ;
678 ifp = ifnet_head.tqh_first ; /* scan all ports */
683 ifp = dst ;
686 if ( (u_int)(ifp) <= (u_int)BDG_FORWARD )
863 if (ifp == NULL)
870 if ( BDG_USED(ifp) && !BDG_MUTED(ifp) && !IF_QFULL(&ifp->if_snd) &&
871 (ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING) &&
872 ifp != src && BDG_SAMECLUSTER(ifp, real_dst) )
873 last = ifp ;
874 ifp = TAILQ_NEXT(ifp, if_link) ;
875 if (ifp == NULL)