nfs.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /****************************************************************************
  2. * include/nuttx/fs/nfs.h
  3. *
  4. * Copyright (C) 2012 Gregory Nutt. All rights reserved.
  5. * Copyright (C) 2012 Jose Pablo Rojas Vargas. All rights reserved.
  6. * Author: Jose Pablo Rojas Vargas <jrojas@nx-engineering.com>
  7. *
  8. * Some of the content of this file was leveraged from OpenBSD:
  9. *
  10. * Copyright (c) 1989, 1993, 1995
  11. * The Regents of the University of California. All rights reserved.
  12. *
  13. * This code is derived from software contributed to Berkeley by
  14. * Rick Macklem at The University of Guelph.
  15. *
  16. * Redistribution and use in source and binary forms, with or without
  17. * modification, are permitted provided that the following conditions
  18. * are met:
  19. *
  20. * 1. Redistributions of source code must retain the above copyright
  21. * notice, this list of conditions and the following disclaimer.
  22. * 2. Redistributions in binary form must reproduce the above copyright
  23. * notice, this list of conditions and the following disclaimer in the
  24. * documentation and/or other materials provided with the distribution.
  25. * 3. Neither the name of the University nor the names of its contributors
  26. * may be used to endorse or promote products derived from this software
  27. * without specific prior written permission.
  28. *
  29. * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  30. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  31. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  32. * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  33. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  34. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  35. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  36. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  37. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  38. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  39. * SUCH DAMAGE.
  40. *
  41. ****************************************************************************/
  42. #ifndef __INCLUDE_NUTTX_FS_NFS_H
  43. #define __INCLUDE_NUTTX_FS_NFS_H
  44. /****************************************************************************
  45. * Included Files
  46. ****************************************************************************/
  47. #include <sys/socket.h>
  48. /****************************************************************************
  49. * Pre-processor Definitions
  50. ****************************************************************************/
  51. /* NFS mount option flags */
  52. #define NFSMNT_SOFT (1 << 0) /* Soft mount (hard is default) */
  53. #define NFSMNT_WSIZE (1 << 1) /* Set write size */
  54. #define NFSMNT_RSIZE (1 << 2) /* Set read size */
  55. #define NFSMNT_TIMEO (1 << 3) /* Set initial timeout */
  56. #define NFSMNT_RETRANS (1 << 4) /* Set number of request retries */
  57. #define NFSMNT_READDIRSIZE (1 << 5) /* Set readdir size */
  58. /* Default PMAP port number to provide */
  59. #define NFS_PMAPPORT 111
  60. /****************************************************************************
  61. * Public Types
  62. ****************************************************************************/
  63. struct nfs_args
  64. {
  65. uint8_t addrlen; /* Length of address */
  66. uint8_t sotype; /* Socket type */
  67. uint8_t flags; /* Flags, determines if following are valid: */
  68. uint8_t timeo; /* Time value in deciseconds (with NFSMNT_TIMEO) */
  69. uint8_t retrans; /* Times to retry send (with NFSMNT_RETRANS) */
  70. uint16_t wsize; /* Write size in bytes (with NFSMNT_WSIZE) */
  71. uint16_t rsize; /* Read size in bytes (with NFSMNT_RSIZE) */
  72. uint16_t readdirsize; /* readdir size in bytes (with NFSMNT_READDIRSIZE) */
  73. char *path; /* Server's path of the directory being mount */
  74. struct sockaddr_storage addr; /* File server address (requires 32-bit alignment) */
  75. };
  76. /****************************************************************************
  77. * Public Data
  78. ****************************************************************************/
  79. /****************************************************************************
  80. * Public Function Prototypes
  81. ****************************************************************************/
  82. #undef EXTERN
  83. #if defined(__cplusplus)
  84. #define EXTERN extern "C"
  85. extern "C"
  86. {
  87. #else
  88. #define EXTERN extern
  89. #endif
  90. #undef EXTERN
  91. #if defined(__cplusplus)
  92. }
  93. #endif
  94. #endif /* __INCLUDE_NUTTX_FS_NFS_H */