Annotation of xinu/sys/netin.c, revision 1.1.1.1

1.1       root        1: /* netin.c */
                      2: 
                      3: #include <conf.h>
                      4: #include <kernel.h>
                      5: #include <proc.h>
                      6: #include <network.h>
                      7: 
                      8: /*------------------------------------------------------------------------
                      9:  *  netin - initialize net, start output side, and become input daemon
                     10:  *------------------------------------------------------------------------
                     11:  */
                     12: PROCESS        netin(userpid)
                     13: int    userpid;                        /* user process to resume       */
                     14: {
                     15:        register struct epacket *packet;
                     16:        struct  epacket *getbuf();
                     17:        int     icmpp;
                     18: 
                     19:        arpinit();
                     20:        netinit();
                     21:        icmpp = pcreate(NETFQ);
                     22:        resume(create(NETOUT, NETOSTK, NETIPRI-1, NETONAM,
                     23:                        2, userpid,icmpp));
                     24: 
                     25:        for (packet = getbuf(Net.netpool) ; TRUE ;) {
                     26:                Net.npacket++;
                     27:                if ( read(ETHER,packet,sizeof(*packet)) == SYSERR ) {
                     28:                        Net.ndrop++;
                     29:                        continue;
                     30:                }
                     31:                switch (net2hs(packet->ep_hdr.e_ptype)&LOW16) {
                     32: 
                     33:                    case EP_ARP:
                     34:                        arp_in(packet, ETHER);
                     35:                        packet = getbuf(Net.netpool);
                     36:                        break;
                     37: 
                     38:                    case EP_RARP:
                     39:                        rarp_in(packet, ETHER);
                     40:                        packet = getbuf(Net.netpool);
                     41:                        break;
                     42: 
                     43:                    case EP_IP:
                     44:                        ip_in(packet, icmpp, NETFQ);
                     45:                        packet = getbuf(Net.netpool);
                     46:                        break;
                     47: 
                     48:                    default: /* just drop packet */
                     49:                        Net.ndrop++;
                     50:                }
                     51:        }
                     52: }

unix.superglobalmegacorp.com

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