Annotation of 43BSD/contrib/xns/examples/authchtest/getdata.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: #include <sys/types.h>
        !             3: #include <netns/ns.h>
        !             4: #include <netns/sp.h>
        !             5: #include "Clearinghouse_support.c"
        !             6: #include <xnscourier/except.h>
        !             7: #define MAXPACKS 5
        !             8: #define nextSegment_case nextSegment2_33_case
        !             9: #define lastSegment_case lastSegment2_34_case
        !            10: 
        !            11: ProcessObjectName(obj)
        !            12:        ObjectName obj;
        !            13: {
        !            14:        printf("\t%s:%s:%s\n", obj.object, obj.domain, obj.organization);
        !            15: }
        !            16: 
        !            17: GetData(conn)
        !            18:        CourierConnection *conn;
        !            19: {
        !            20:        int count, i;
        !            21:        Unspecified buffer[MAXWORDS*MAXPACKS], *bp, *bufend;
        !            22:        StreamOfObjectName obnames;
        !            23:        
        !            24:        bufend = buffer;
        !            25:        bp = buffer+((MAXWORDS-1)*MAXPACKS);    /* end of available space */
        !            26:        while (count = BDTread(conn, (char*)bufend, 
        !            27:                                MAXWORDS*sizeof(Unspecified))
        !            28:                ) {
        !            29:                bufend += count/sizeof(Unspecified);
        !            30:                if (bufend > bp) {
        !            31:                        fprintf(stderr,"BDT read too big to fit\n");
        !            32:                        BDTabort(conn);
        !            33:                        /* should clear out stuff here if we knew how much */
        !            34:                }
        !            35:        }
        !            36:        bp = buffer;
        !            37:        while (bp < bufend) {
        !            38:                bp += internalize_StreamOfObjectName(&obnames,bp);
        !            39:                if (0 == (int) obnames.designator)
        !            40:                   for (i = 0; i < obnames.nextSegment_case.segment.length; i++)
        !            41:                        ProcessObjectName(
        !            42:                                obnames.nextSegment_case.segment.sequence[i]);
        !            43:                else {
        !            44:                   for (i = 0; i < obnames.lastSegment_case.length; i++)
        !            45:                        ProcessObjectName(
        !            46:                                obnames.lastSegment_case.sequence[i]);
        !            47:                   return;
        !            48:                }
        !            49:        }
        !            50: }

unix.superglobalmegacorp.com

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