Annotation of xinu/sys/rarp_in.c, revision 1.1

1.1     ! root        1: /* rarp_in.c - rarp_in */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <proc.h>
        !             6: #include <network.h>
        !             7: 
        !             8: /*------------------------------------------------------------------------
        !             9:  *  rarp_in  -  handle RARP packet coming in from Ethernet network
        !            10:  *------------------------------------------------------------------------
        !            11:  */
        !            12: rarp_in(packet, device)
        !            13: struct epacket *packet;
        !            14: int    device;
        !            15: {
        !            16:        PStype  ps;
        !            17:        int     pid;
        !            18:        int     ret;
        !            19:        struct  arppak  *apacptr;
        !            20:        struct  etblk   *etptr;
        !            21: 
        !            22:        apacptr = (struct arppak *) packet->ep_data;
        !            23:        if ((net2hs(apacptr->ar_op)&LOW16) == AR_RRLY) {
        !            24:                etptr = (struct etblk *)devtab[device].dvioblk;
        !            25:                if ( blkequ(apacptr->ar_tha,etptr->etpaddr,EPADLEN) ) {
        !            26:                        blkcopy(Net.myaddr, apacptr->ar_tpa, IPLEN);
        !            27:                        netnum(Net.mynet, Net.myaddr);
        !            28:                        disable(ps);
        !            29:                        Net.mavalid = TRUE;
        !            30:                        pid = Arp.rarppid;
        !            31:                        if (!isbadpid(pid)) {
        !            32:                                Arp.rarppid = BADPID;
        !            33:                                send(pid, OK);
        !            34:                        }
        !            35:                        restore(ps);
        !            36:                }
        !            37:                ret = OK;
        !            38:        } else
        !            39:                ret = SYSERR;
        !            40:        freebuf(packet);
        !            41:        return(ret);
        !            42: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.