home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!senator-bedfellow.mit.edu!bed.mit.edu!probe
- From: probe@mit.edu (Richard Basch)
- Newsgroups: comp.unix.aix
- Subject: Re: UDP Checksum on NFS in AIX 3.2?
- Followup-To: comp.unix.aix
- Date: 15 Nov 1992 17:42:54 GMT
- Organization: Massachusetts Institute of Technology
- Lines: 61
- Message-ID: <PROBE.92Nov15114254@tardis.mit.edu>
- References: <BxKvzC.5p9@well.sf.ca.us> <30286@nntp_server.ems.cdc.com>
- NNTP-Posting-Host: tardis.mit.edu
- In-reply-to: bguest@ateam.ems.cdc.com's message of 12 Nov 92 14:57:47 GMT
-
-
- I had this complaint about AIX 3.1 and wrote the following program (it
- works under AIX 3.2 as well).
-
- -Richard Basch
- MIT IS/DCNS Systems Development
-
- [Standard disclaimer applies.]
-
- ------------------------------ cut here ------------------------------
- #include <stdio.h>
- #include <sys/types.h>
- #include <sys/file.h>
-
- #include <nlist.h>
-
- struct nlist nl[] =
- {
- #define X_NFSUDP 0
- {"nfsudpcksum"},
- 0,
- };
-
- int nnl = sizeof(nl)/sizeof(struct nlist) - 1;
-
- main(argc, argv)
- int argc;
- register char *argv[];
- {
- register int mem;
- register int i;
- unsigned long x;
-
- knlist(nl, nnl, sizeof(struct nlist));
-
- if ((mem = open ("/dev/kmem", O_RDWR, 0)) == -1) {
- perror ("open(mem)");
- return 3;
- }
-
- #ifdef DEBUG
- for (i=0; i<nnl; i++) {
- printf("name=%s value=0x%08x", nl[i].n_name, nl[i].n_value);
- if (nl[i].n_value) {
- lseek(mem, nl[i].n_value, L_SET);
- read(mem, &x, sizeof(x));
- printf(" *value=0x%08x\n", x);
- } else
- printf("\n");
- }
- #else
- if (nl[X_NFSUDP].n_value) {
- lseek(mem, nl[X_NFSUDP].n_value, L_SET);
- x = 1;
- write(mem, &x, sizeof(x));
- } else
- fprintf(stderr, "Unable to enable NFS UDP checksumming.\n");
- #endif
-
- return 0;
- }
-