| plan 9 kernel history: overview | file list | diff list |
1999/0625/pc/devether.c (diff list | history)
| 1999/0402/sys/src/9/pc/devether.c:130,140 – 1999/0625/sys/src/9/pc/devether.c:130,140 (short | long | prev | next) | ||
| 1997/0327 | } Block* | |
| 1999/0625 | etheriq(Ether* ether, Block* bp, int fromwire) | |
| 1997/0327 | { Etherpkt *pkt; | |
| 1993/1120 | ushort type; | |
| 1999/0316 |
| |
| 1999/0625 | int len, multi, tome, fromme; | |
| 1997/0327 | Netfile **ep, *f, **fp, *fx; Block *xbp; | |
| 1993/1120 | ||
| 1999/0402/sys/src/9/pc/devether.c:150,156 – 1999/0625/sys/src/9/pc/devether.c:150,156 | ||
| 1997/0404 | /* check for valid multcast addresses */ | |
| 1999/0316 | if(multi && memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) && ether->prom == 0){ | |
| 1997/0404 | if(!activemulti(ether, pkt->d, sizeof(pkt->d))){ | |
| 1999/0625 | if(fromwire){ | |
| 1997/0404 | freeb(bp); bp = 0; } | |
| 1999/0402/sys/src/9/pc/devether.c:158,176 – 1999/0625/sys/src/9/pc/devether.c:158,182 | ||
| 1997/0404 | } } | |
| 1999/0316 |
| |
| 1999/0625 | /* is it for me? */ tome = memcmp(pkt->d, ether->ea, sizeof(pkt->d)) == 0; fromme = memcmp(pkt->s, ether->ea, sizeof(pkt->s)) == 0; | |
| 1999/0316 | ||
| 1997/0327 | /* * Multiplex the packet to all the connections which want it. | |
| 1999/0625 | * If the packet is not to be used subsequently (fromwire != 0), | |
| 1997/0327 | * attempt to simply pass it into one of the connections, thereby * saving a copy of the data (usual case hopefully). */ for(fp = ether->f; fp < ep; fp++){ | |
| 1999/0316 |
| |
| 1995/0713 |
| |
| 1997/0327 |
| |
| 1999/0625 | if(f = *fp) if(f->type == type || f->type < 0) if(tome || multi || f->prom){ /* Don't want to hear bridged packets */ if(f->bridge && !fromwire && !fromme) continue; if(!f->headersonly){ if(fromwire && fx == 0) | |
| 1997/0327 | fx = f; else if(xbp = iallocb(len)){ memmove(xbp->wp, pkt, len); | |
| 1999/0402/sys/src/9/pc/devether.c:190,196 – 1999/0625/sys/src/9/pc/devether.c:196,202 | ||
| 1998/1013 | ether->soverflows++; | |
| 1997/0327 | return 0; } | |
| 1999/0625 | if(fromwire){ | |
| 1997/0327 | freeb(bp); return 0; } | |
| 1999/0402/sys/src/9/pc/devether.c:201,207 – 1999/0625/sys/src/9/pc/devether.c:207,213 | ||
| 1993/1120 | static int | |
| 1997/0327 | etheroq(Ether* ether, Block* bp) | |
| 1993/1120 | { | |
| 1999/0316 |
| |
| 1999/0625 | int len, loopback, s; | |
| 1997/0327 | Etherpkt *pkt; | |
| 1993/1120 | ||
| 1997/0327 | ether->outpackets++; | |
| 1999/0402/sys/src/9/pc/devether.c:217,228 – 1999/0625/sys/src/9/pc/devether.c:223,232 | ||
| 1997/0327 | */ pkt = (Etherpkt*)bp->rp; len = BLEN(bp); | |
| 1997/0808 |
| |
| 1999/0316 |
| |
| 1999/0625 | loopback = memcmp(pkt->d, ether->ea, sizeof(pkt->d)) == 0; | |
| 1997/0808 | if(loopback || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom){ | |
| 1997/0327 | s = splhi(); | |
| 1999/0625 | etheriq(ether, bp, 0); | |
| 1997/0327 | splx(s); } | |
| 1994/0702 | ||
| 1999/0402/sys/src/9/pc/devether.c:229,235 – 1999/0625/sys/src/9/pc/devether.c:233,240 | ||
| 1997/0327 | if(!loopback){ qbwrite(ether->oq, bp); ether->transmit(ether); | |
| 1999/0625 | } else freeb(bp); | |
| 1997/0327 | return len; | |
| 1993/1120 | } | |