+/**
+ * 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;
+}
+