Annotation of 43BSDReno/sys/nfs/TEST/unix-tests/tools/pmaptst.c, revision 1.1

1.1     ! root        1: /*     @(#)pmaptst.c   1.2 90/01/03 NFS Rev 2 Testsuite
        !             2:  *     1.3 Lachman ONC Test Suite source
        !             3:  */
        !             4: #include <sys/types.h>
        !             5: #include <netinet/in.h>
        !             6: 
        !             7: #define RPCINFO "rpcinfo -p"
        !             8: 
        !             9: #ifdef SVR3
        !            10: #define PROG    ((u_long)432123)
        !            11: #define VERS   ((u_long)4)
        !            12: #else
        !            13: #define PROG    ((ulong)432123)
        !            14: #define VERS   ((ulong)4)
        !            15: #endif
        !            16: #define UPORT    2345
        !            17: #define TPORT    2346
        !            18: 
        !            19: extern int pmap_set();
        !            20: extern int pmap_unset();
        !            21: 
        !            22: main(argc, argv)
        !            23: char *argv[];
        !            24: {
        !            25:        int ret, errs = 0;
        !            26: 
        !            27:        printf("portmapper set/unset test.\n");
        !            28:        printf("rpcinfo before pmap_set:\n");
        !            29:        system(RPCINFO);
        !            30: 
        !            31:        printf("\n--- Registering udp program %d version %d port %d...  ",
        !            32:                PROG, VERS, UPORT);
        !            33:        if (pmap_set(PROG, VERS, IPPROTO_UDP, UPORT))
        !            34:                printf("done.\n");
        !            35:        else {
        !            36:                printf("failed.\n");
        !            37:                errs++;
        !            38:        }
        !            39:        printf("rpcinfo after udp pmap_set:\n");
        !            40:        system(RPCINFO);
        !            41: 
        !            42:        printf("\n--- Registering tcp program %d version %d port %d...  ",
        !            43:                PROG, VERS, TPORT);
        !            44:        if (pmap_set(PROG, VERS, IPPROTO_TCP, TPORT))
        !            45:                printf("done.\n");
        !            46:        else {
        !            47:                printf("failed.\n");
        !            48:                errs++;
        !            49:        }
        !            50:        printf("rpcinfo after tcp pmap_set:\n");
        !            51:        system(RPCINFO);
        !            52: 
        !            53:        printf("\n--- Unregistering program %d version %d... ", PROG, VERS);
        !            54:        if (pmap_unset(PROG, VERS))
        !            55:                printf("done.\n");
        !            56:        else {
        !            57:                printf("failed.\n");
        !            58:                errs++;
        !            59:        }
        !            60:        printf("rpcinfo after pmap_unset:\n");
        !            61:        system(RPCINFO);
        !            62:        if (!errs)
        !            63:                printf("Test complete ok\n");
        !            64:        exit(errs);
        !            65: }

unix.superglobalmegacorp.com

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