nfsfh.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
  3. * Western Research Laboratory. All rights reserved.
  4. * Copyright (c) 2001 Compaq Computer Corporation. All rights reserved.
  5. *
  6. * Permission to use, copy, and modify this software and its
  7. * documentation is hereby granted only under the following terms and
  8. * conditions. Both the above copyright notice and this permission
  9. * notice must appear in all copies of the software, derivative works
  10. * or modified versions, and any portions thereof, and both notices
  11. * must appear in supporting documentation.
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. * 1. Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. * 2. Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in
  20. * the documentation and/or other materials provided with the
  21. * distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS" AND COMPAQ COMPUTER CORPORATION
  24. * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  25. * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
  26. * EVENT SHALL COMPAQ COMPUTER CORPORATION BE LIABLE FOR ANY
  27. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  28. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
  29. * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  30. * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  31. * SOFTWARE.
  32. */
  33. /*
  34. * nfsfh.h - NFS file handle definitions (for portable use)
  35. *
  36. * Jeffrey C. Mogul
  37. * Digital Equipment Corporation
  38. * Western Research Laboratory
  39. */
  40. /*
  41. * Internal representation of dev_t, because different NFS servers
  42. * that we might be spying upon use different external representations.
  43. */
  44. typedef struct {
  45. uint32_t Minor; /* upper case to avoid clashing with macro names */
  46. uint32_t Major;
  47. } my_devt;
  48. #define dev_eq(a,b) ((a.Minor == b.Minor) && (a.Major == b.Major))
  49. /*
  50. * Many file servers now use a large file system ID. This is
  51. * our internal representation of that.
  52. */
  53. typedef struct {
  54. my_devt Fsid_dev; /* XXX avoid name conflict with AIX */
  55. char Opaque_Handle[2 * 32 + 1];
  56. uint32_t fsid_code;
  57. } my_fsid;
  58. #define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
  59. dev_eq(a.Fsid_dev, b.Fsid_dev))
  60. extern void Parse_fh(const unsigned char *, u_int, my_fsid *, uint32_t *, const char **, const char **, int);