tftp_opts.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /**
  2. *
  3. * @file tftp_opts.h
  4. *
  5. * @author Logan Gunthorpe <logang@deltatee.com>
  6. *
  7. * @brief Trivial File Transfer Protocol (RFC 1350) implementation options
  8. *
  9. * Copyright (c) Deltatee Enterprises Ltd. 2013
  10. * All rights reserved.
  11. *
  12. */
  13. /*
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification,are permitted provided that the following conditions are met:
  16. *
  17. * 1. Redistributions of source code must retain the above copyright notice,
  18. * this list of conditions and the following disclaimer.
  19. * 2. Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * 3. The name of the author may not be used to endorse or promote products
  23. * derived from this software without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  26. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  27. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  28. * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  29. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  30. * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  31. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  32. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  33. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  34. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. * Author: Logan Gunthorpe <logang@deltatee.com>
  37. *
  38. */
  39. #ifndef LWIP_HDR_APPS_TFTP_OPTS_H
  40. #define LWIP_HDR_APPS_TFTP_OPTS_H
  41. #include "lwip/opt.h"
  42. #include "lwip/prot/iana.h"
  43. /**
  44. * @defgroup tftp_opts Options
  45. * @ingroup tftp
  46. * @{
  47. */
  48. /**
  49. * Enable TFTP debug messages
  50. */
  51. #if !defined TFTP_DEBUG || defined __DOXYGEN__
  52. #define TFTP_DEBUG LWIP_DBG_OFF
  53. #endif
  54. /**
  55. * TFTP server port
  56. */
  57. #if !defined TFTP_PORT || defined __DOXYGEN__
  58. #define TFTP_PORT LWIP_IANA_PORT_TFTP
  59. #endif
  60. /**
  61. * TFTP timeout
  62. */
  63. #if !defined TFTP_TIMEOUT_MSECS || defined __DOXYGEN__
  64. #define TFTP_TIMEOUT_MSECS 10000
  65. #endif
  66. /**
  67. * Max. number of retries when a file is read from server
  68. */
  69. #if !defined TFTP_MAX_RETRIES || defined __DOXYGEN__
  70. #define TFTP_MAX_RETRIES 5
  71. #endif
  72. /**
  73. * TFTP timer cyclic interval
  74. */
  75. #if !defined TFTP_TIMER_MSECS || defined __DOXYGEN__
  76. #define TFTP_TIMER_MSECS (TFTP_TIMEOUT_MSECS / 10)
  77. #endif
  78. /**
  79. * Max. length of TFTP filename
  80. */
  81. #if !defined TFTP_MAX_FILENAME_LEN || defined __DOXYGEN__
  82. #define TFTP_MAX_FILENAME_LEN 20
  83. #endif
  84. /**
  85. * Max. length of TFTP mode
  86. */
  87. #if !defined TFTP_MAX_MODE_LEN || defined __DOXYGEN__
  88. #define TFTP_MAX_MODE_LEN 10
  89. #endif
  90. /**
  91. * @}
  92. */
  93. #endif /* LWIP_HDR_APPS_TFTP_OPTS_H */