Annotation of xinu/sys/TEST/test.c.eth3, revision 1.1

1.1     ! root        1: /* test.c - main */
        !             2: 
        !             3: #include <conf.h>
        !             4: #include <kernel.h>
        !             5: #include <deqna.h>
        !             6: #include <ether.h>
        !             7: #include <ip.h>
        !             8: #include <net.h>
        !             9: 
        !            10: /*------------------------------------------------------------------------
        !            11:  *  main  --  fiddle around while Ethernet runs...
        !            12:  *------------------------------------------------------------------------
        !            13:  */
        !            14: main()
        !            15: {
        !            16:        int     snd();
        !            17: 
        !            18:        resume(create(snd, 200, 20, "sender", 0));
        !            19: 
        !            20:        while(TRUE) {
        !            21:                printf("\nAlive\n");
        !            22:                sleep10(200);
        !            23:        }
        !            24: }
        !            25: 
        !            26: /*------------------------------------------------------------------------
        !            27:  *  snd  -  send datagram just for kicks
        !            28:  *------------------------------------------------------------------------
        !            29:  */
        !            30: snd()
        !            31: {
        !            32:        char    *ch;
        !            33:        int     i, r;
        !            34:        struct  epacket *packet;
        !            35: 
        !            36:        sleep10(50);
        !            37:        kprintf("Sending a datagram\n");
        !            38:        packet = (struct epacket *) getbuf(netpool);
        !            39:        ch = (char *) ( (struct udpip *)packet->ep_data)->u_data;
        !            40:        for (i=0 ; i<10; i++)
        !            41:                *ch++ = 'D';
        !            42:        r = udpsend(netgate, 7/*ECHO*/, 50, packet, 10);
        !            43:        kprintf("udpsend returns %d\n",r);
        !            44: }

unix.superglobalmegacorp.com

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