+ if (type == ENTRY_ROUTE) {
+ buf[buf_len++] = ',';
+ if (!IN6_IS_ADDR_UNSPECIFIED(&e[i].router)) {
+ inet_ntop(AF_INET6, &e[i].router, &buf[buf_len], INET6_ADDRSTRLEN);
+ buf_len += strlen(&buf[buf_len]);
+ }
+ buf_len += snprintf(&buf[buf_len], 24, ",%u", e[i].valid);
+ buf_len += snprintf(&buf[buf_len], 12, ",%u", e[i].priority);
+ } else {
+ buf_len += snprintf(&buf[buf_len], 24, ",%u,%u", e[i].preferred, e[i].valid);
+ }
+
+ if ((type == ENTRY_PREFIX || type == ENTRY_ADDRESS) && e[i].class)
+ buf_len += snprintf(&buf[buf_len], 12, ",class=%u", e[i].class);
+ else if (type == ENTRY_PREFIX)
+ buf_len += snprintf(&buf[buf_len], 16, ",class=%08x", ntohl(e[i].iaid));
+
+ if (type == ENTRY_PREFIX && e[i].priority) {
+ // priority and router are abused for prefix exclusion
+ buf_len += snprintf(&buf[buf_len], 12, ",excluded=");