diff --git a/netutils/webserver/httpd_dirlist.c b/netutils/webserver/httpd_dirlist.c index 748a23d58..1c48a5691 100644 --- a/netutils/webserver/httpd_dirlist.c +++ b/netutils/webserver/httpd_dirlist.c @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -59,6 +60,20 @@ * Pre-processor Definitions ****************************************************************************/ +#ifdef CONFIG_ARCH_BOARD_CUSTOM +# ifndef CONFIG_ARCH_BOARD_CUSTOM_NAME +# define BOARD_NAME g_unknown +# else +# define BOARD_NAME CONFIG_ARCH_BOARD_CUSTOM_NAME +# endif +#else +# ifndef CONFIG_ARCH_BOARD +# define BOARD_NAME g_unknown +# else +# define BOARD_NAME CONFIG_ARCH_BOARD +# endif +#endif + #define BUF_SIZE 1024 #define HEADER \ @@ -91,6 +106,7 @@ #define FOOTER \ "
\n" \ "\n" \ + "
uIP web server (%s %s %s %s %s)
\n" \ "\n" \ "\n" @@ -101,6 +117,7 @@ ssize_t httpd_dirlist(int outfd, FAR struct httpd_fs_file *file) { struct dirent *dent; + struct utsname info; struct stat buf; struct tm tm; ssize_t total; @@ -209,7 +226,17 @@ ssize_t httpd_dirlist(int outfd, FAR struct httpd_fs_file *file) errout_with_hdr: - ret = write(outfd, FOOTER, sizeof(FOOTER)); + memset(&info, 0, sizeof(info)); + uname(&info); + + snprintf(tmp, BUF_SIZE, FOOTER, + info.sysname, + info.release, + info.version, + info.machine, + BOARD_NAME); + + ret = write(outfd, tmp, strlen(tmp)); if (-1 != ret) {