home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / aix / 11599 < prev    next >
Encoding:
Text File  |  1992-11-15  |  1.7 KB  |  75 lines

  1. Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!senator-bedfellow.mit.edu!bed.mit.edu!probe
  2. From: probe@mit.edu (Richard Basch)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: UDP Checksum on NFS in AIX 3.2?
  5. Followup-To: comp.unix.aix
  6. Date: 15 Nov 1992 17:42:54 GMT
  7. Organization: Massachusetts Institute of Technology
  8. Lines: 61
  9. Message-ID: <PROBE.92Nov15114254@tardis.mit.edu>
  10. References: <BxKvzC.5p9@well.sf.ca.us> <30286@nntp_server.ems.cdc.com>
  11. NNTP-Posting-Host: tardis.mit.edu
  12. In-reply-to: bguest@ateam.ems.cdc.com's message of 12 Nov 92 14:57:47 GMT
  13.  
  14.  
  15. I had this complaint about AIX 3.1 and wrote the following program (it
  16. works under AIX 3.2 as well).
  17.  
  18. -Richard Basch
  19. MIT IS/DCNS Systems Development
  20.  
  21. [Standard disclaimer applies.]
  22.  
  23. ------------------------------ cut here ------------------------------
  24. #include <stdio.h>
  25. #include <sys/types.h>
  26. #include <sys/file.h>
  27.  
  28. #include <nlist.h>
  29.  
  30. struct nlist nl[] =
  31. {
  32. #define X_NFSUDP 0
  33.     {"nfsudpcksum"},
  34.     0,
  35. };
  36.  
  37. int nnl = sizeof(nl)/sizeof(struct nlist) - 1;
  38.  
  39. main(argc, argv)
  40. int argc;
  41. register char *argv[];
  42. {
  43.     register int mem;
  44.     register int i;
  45.     unsigned long x;
  46.  
  47.     knlist(nl, nnl, sizeof(struct nlist));
  48.  
  49.     if ((mem = open ("/dev/kmem", O_RDWR, 0)) == -1) {
  50.     perror ("open(mem)");
  51.     return 3;
  52.     }
  53.  
  54. #ifdef DEBUG
  55.     for (i=0; i<nnl; i++) {
  56.     printf("name=%s value=0x%08x", nl[i].n_name, nl[i].n_value);
  57.     if (nl[i].n_value) {
  58.         lseek(mem, nl[i].n_value, L_SET);
  59.         read(mem, &x, sizeof(x));
  60.         printf(" *value=0x%08x\n", x);
  61.     } else
  62.         printf("\n");
  63.     }
  64. #else
  65.     if (nl[X_NFSUDP].n_value) {
  66.     lseek(mem, nl[X_NFSUDP].n_value, L_SET);
  67.     x = 1;
  68.     write(mem, &x, sizeof(x));
  69.     } else
  70.         fprintf(stderr, "Unable to enable NFS UDP checksumming.\n");
  71. #endif
  72.     
  73.     return 0;
  74. }
  75.