From 5a8bd3750932cf7016ff00fdf93d13f8a9cbcf59 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Mon, 8 Oct 2018 12:48:16 +0200 Subject: [PATCH] Improve TFTP comments --- contrib/examples/tftp/tftp_example.c | 1 + src/include/lwip/apps/tftp_common.h | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/contrib/examples/tftp/tftp_example.c b/contrib/examples/tftp/tftp_example.c index 07c65a80..4af628fd 100644 --- a/contrib/examples/tftp/tftp_example.c +++ b/contrib/examples/tftp/tftp_example.c @@ -77,6 +77,7 @@ tftp_write(void* handle, struct pbuf* p) return 0; } +/* For TFTP client only */ static int tftp_error(void* handle, int err, const char* msg, int size) { diff --git a/src/include/lwip/apps/tftp_common.h b/src/include/lwip/apps/tftp_common.h index 0fa5b524..6c46a8c3 100644 --- a/src/include/lwip/apps/tftp_common.h +++ b/src/include/lwip/apps/tftp_common.h @@ -55,7 +55,7 @@ extern "C" { */ struct tftp_context { /** - * Open file for read/write. + * Open file for read/write (server mode only). * @param fname Filename * @param mode Mode string from TFTP RFC 1350 (netascii, octet, mail) * @param write Flag indicating read (0) or write (!= 0) access @@ -64,12 +64,12 @@ struct tftp_context { void* (*open)(const char* fname, const char* mode, u8_t write); /** * Close file handle - * @param handle File handle returned by open() + * @param handle File handle returned by open()/tftp_put()/tftp_get() */ void (*close)(void* handle); /** * Read from file - * @param handle File handle returned by open() + * @param handle File handle returned by open()/tftp_put()/tftp_get() * @param buf Target buffer to copy read data to * @param bytes Number of bytes to copy to buf * @returns >= 0: Success; < 0: Error @@ -77,7 +77,7 @@ struct tftp_context { int (*read)(void* handle, void* buf, int bytes); /** * Write to file - * @param handle File handle returned by open() + * @param handle File handle returned by open()/tftp_put()/tftp_get() * @param pbuf PBUF adjusted such that payload pointer points * to the beginning of write data. In other words, * TFTP headers are stripped off. @@ -85,8 +85,8 @@ struct tftp_context { */ int (*write)(void* handle, struct pbuf* p); /** - * Error response - * @param handle File handle set by tftp_get/tftp_put + * Error response (client mode only) + * @param handle File handle set by tftp_get()/tftp_put() * @param err error code from server * @param msg error message from server * @param size size of msg