Annotation of researchv10dc/cmd/worm/scsi/sony/alt.c, revision 1.1

1.1     ! root        1: #include       <stdio.h>
        !             2: #include       "../scsi.h"
        !             3: #include       "../scsish.h"
        !             4: #include       "../tcl.h"
        !             5: #include       "fns.h"
        !             6: 
        !             7: static
        !             8: table(int drive, int tab, uchar *data)
        !             9: {
        !            10:        int n, i;
        !            11: 
        !            12:        n = data[6];
        !            13:        printf("(%d,%d): alternate table %d (%d entries)\n", s_id, drive, tab, n);
        !            14:        for(data += 0x18, i = 0; i < n; data += 4, i++)
        !            15:                printf("%ld%c", data[0]+256L*data[1]+256L*256*data[2],
        !            16:                        (i%10 == 9)? '\n':' ');
        !            17:        if((i%10) && n)
        !            18:                putchar('\n');
        !            19: }
        !            20: 
        !            21: int
        !            22: sony_alt(ClientData cd, Tcl_Interp *it, int argc, char **argv)
        !            23: {
        !            24:        struct scsi_cmd cmd;
        !            25:        struct scsi_return ret;
        !            26:        int unit, i;
        !            27: 
        !            28:        if(argc <= 1)
        !            29:                argv[i = 0] = "0";
        !            30:        else
        !            31:                i = 1;
        !            32:        for(; i < argc; i++){
        !            33:                unit = atoi(argv[i]);
        !            34:                set6(cmd, 0xC3, unit<<5, 0, 0, 0, 0);
        !            35:                if(s_io(0, &cmd, 0, &ret, 4096, cd->err))
        !            36:                        ERR_RETURN
        !            37:                for(i = 0; i < 4; i++)
        !            38:                        table(unit, i+1, &ret.data[1024*i]);
        !            39:        }
        !            40:        return(TCL_OK);
        !            41: }

unix.superglobalmegacorp.com

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