/*
- * Copyright (C) 2006-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2006-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
* (C) 2005 Ian McDonald <imcdnzl@gmail.com>
*/
+#include <regex.h>
#include <sys/types.h>
#include <dirent.h>
+#include <osl.h>
#include "para.h"
#include "error.h"
}
static void dccp_send(long unsigned current_chunk,
- __a_unused long unsigned chunks_sent, const char *buf, size_t len)
+ __a_unused long unsigned chunks_sent, const char *buf,
+ size_t len, const char *header_buf, size_t header_len)
{
struct sender_client *sc, *tmp;
list_for_each_entry_safe(sc, tmp, &dss->client_list, node)
send_chunk(sc, dss, DCCP_MAX_BYTES_PER_WRITE, current_chunk, buf,
- len);
+ len, header_buf, header_len);
}
static void dccp_shutdown_clients(void)
return 1;
}
+/**
+ * Return list of available CCIDs or warning, in static buffer.
+ */
+static const char *dccp_list_available_ccids(void)
+{
+ uint8_t ccids[DCCP_MAX_HOST_CCIDS];
+ uint8_t nccids = sizeof(ccids), i, len;
+ /* Worst case length: n * 3 digits + n-1 spaces + '\0' */
+ static char list[DCCP_MAX_HOST_CCIDS * 4];
+
+ if (dccp_available_ccids(ccids, &nccids) == NULL) {
+ snprintf(list, sizeof(list), "Unable to query available CCIDs");
+ } else {
+ for (i = len = 0; i < nccids; i++)
+ len += snprintf(list + len, sizeof(list) - len,
+ "%s%d", i ? " " : "", ccids[i]);
+ }
+ return list;
+}
+
static char *dccp_info(void)
{
- return get_sender_info(dss, "dccp");
+ char *info = get_sender_info(dss, "dccp");
+ char *ret = make_message("%s" "\tsupported ccids: %s\n",
+ info, dccp_list_available_ccids());
+ free(info);
+ return ret;
}
/**