diff --git a/upnphttp.c b/upnphttp.c
index 2269472..9cf2fa4 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -577,31 +577,68 @@ sendXMLdesc(struct upnphttp * h, char * (f)(int *))
free(desc);
}
+#ifdef READYNAS
+static void
+SendResp_readynas_admin(struct upnphttp * h)
+{
+ char body[128];
+ int l;
+
+ h->respflags = FLAG_HTML;
+ l = snprintf(body, sizeof(body), "",
+ lan_addr[h->iface].str);
+
+ BuildResp_upnphttp(h, body, l);
+ SendResp_upnphttp(h);
+ CloseSocket_upnphttp(h);
+}
+#endif
+
static void
SendResp_presentation(struct upnphttp * h)
{
- char body[1024];
- int l;
+ struct string_s str;
+ char body[4096];
+ int a, v, p, i;
+
+ str.data = body;
+ str.size = sizeof(body);
+ str.off = 0;
+
h->respflags = FLAG_HTML;
-#ifdef READYNAS
- l = snprintf(body, sizeof(body), "",
- lan_addr[h->iface].str);
-#else
- int a, v, p;
a = sql_get_int_field(db, "SELECT count(*) from DETAILS where MIME glob 'a*'");
v = sql_get_int_field(db, "SELECT count(*) from DETAILS where MIME glob 'v*'");
p = sql_get_int_field(db, "SELECT count(*) from DETAILS where MIME glob 'i*'");
- l = snprintf(body, sizeof(body),
+ strcatf(&str,
"
" SERVER_NAME " " MINIDLNA_VERSION ""
""
- "
" SERVER_NAME " status
"
- "Audio files: %d
"
- "Video files: %d
"
- "Image files: %d"
- "\r\n", a, v, p);
-#endif
- BuildResp_upnphttp(h, body, l);
+ "" SERVER_NAME " status
");
+
+ strcatf(&str,
+ "Media library
"
+ ""
+ "Audio files | %d |
"
+ "Video files | %d |
"
+ "Image files | %d |
"
+ "
", a, v, p);
+
+ strcatf(&str,
+ "Connected clients
"
+ ""
+ "ID | Type | IP Address | HW Address |
");
+ for (i = 0; i < CLIENT_CACHE_SLOTS; i++)
+ {
+ if (!clients[i].addr.s_addr)
+ continue;
+ strcatf(&str, "%d | %s | %s | %02X:%02X:%02X:%02X:%02X:%02X |
",
+ i, client_types[clients[i].type].name, inet_ntoa(clients[i].addr),
+ clients[i].mac[0], clients[i].mac[1], clients[i].mac[2],
+ clients[i].mac[3], clients[i].mac[4], clients[i].mac[5]);
+ }
+ strcatf(&str, "