home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / nfsd / src / memory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-24  |  1.2 KB  |  48 lines

  1. /*  Headers for memory handling
  2.  
  3.     ©1998,1999 Joseph Walton
  4.  
  5.     This software is distributed under the terms of the GNU General Public
  6.     License; either version 2 of the License, or (at your option) any
  7.     later version.
  8. */
  9.  
  10. #ifndef NFSD_MEMORY_H
  11. #define NFSD_MEMORY_H
  12.  
  13. #include "rpc.h"
  14. #include "nfs.h"
  15.  
  16. #include <exec/types.h>
  17.  
  18. /* Public prototypes */
  19. BOOL init_memory(void);
  20. void free_memory(void);
  21. APTR AllocVecPooled(ULONG length);
  22. void FreeVecPooled(APTR mem);
  23. STRPTR DupString(STRPTR orig);
  24.  
  25. /* This is a fair bit, but we want to avoid fragmentation */
  26. #define POOL_SIZE 16384
  27.  
  28. /* NFS responses will fit in
  29.    int32[5 + 2 + 11 + 3 * 2 + 1 + INT32S(NFS_MAXDATA)]
  30.     That is, header, SUCCESS, NFS_OK, fattr (with timestamps),
  31.         and the actual data payload.
  32. */
  33.  
  34. #define SEND_BUFFER_BYTES (SINT32 * (5 + 2 + 11 + 3 * 2 + 1 + INT32S(NFS_MAXDATA)))
  35.  
  36. /* Requests should be okay with
  37.     int32[6 + 2 * (1 + 3 + 256 + 16) +
  38.         INT32S(NFS_FHSIZE) + 3 + 1 + INT32S(NFS_MAXDATA)]
  39.      That is, header, authentication (and verifier), a file
  40.      handle, position in file and an opaque payload.
  41. */
  42.  
  43. #define RECV_BUFFER_BYTES (SINT32 * (6 + 2 * (1 + 3 + 256 + 16) \
  44.     + INT32S(NFS_FHSIZE) + 3 + 1 + INT32S(NFS_MAXDATA)))
  45.  
  46. #endif
  47.  
  48.