+/* scache_send_flattened_links()
+ *
+ * inputs - client to send to
+ * outputs - the cached links, us, and RPL_ENDOFLINKS
+ * side effects -
+ */
+void
+scache_send_flattened_links(struct Client *source_p)
+{
+ struct scache_entry *scache_ptr;
+ int i;
+ int show;
+
+ for (i = 0; i < SCACHE_HASH_SIZE; i++)
+ {
+ scache_ptr = scache_hash[i];
+ while (scache_ptr)
+ {
+ if (!irccmp(scache_ptr->name, me.name))
+ show = FALSE;
+ else if (scache_ptr->flags & SC_HIDDEN &&
+ !ConfigServerHide.disable_hidden)
+ show = FALSE;
+ else if (scache_ptr->flags & SC_ONLINE)
+ show = scache_ptr->known_since < rb_current_time() - ConfigServerHide.links_delay;
+ else
+ show = scache_ptr->last_split > rb_current_time() - ConfigServerHide.links_delay && scache_ptr->last_split - scache_ptr->known_since > ConfigServerHide.links_delay;
+ if (show)
+ sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
+ scache_ptr->name, me.name, 1, scache_ptr->info);
+
+ scache_ptr = scache_ptr->next;
+ }
+ }
+ sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
+ me.name, me.name, 0, me.info);
+
+ sendto_one_numeric(source_p, RPL_ENDOFLINKS, form_str(RPL_ENDOFLINKS), "*");
+}
+
+#define MISSING_TIMEOUT 86400
+
+/* scache_send_missing()
+ *
+ * inputs - client to send to
+ * outputs - recently split servers
+ * side effects -
+ */
+void
+scache_send_missing(struct Client *source_p)
+{
+ struct scache_entry *scache_ptr;
+ int i;
+
+ for (i = 0; i < SCACHE_HASH_SIZE; i++)
+ {
+ scache_ptr = scache_hash[i];
+ while (scache_ptr)
+ {
+ if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > rb_current_time() - MISSING_TIMEOUT)
+ sendto_one_numeric(source_p, RPL_MAP, "** %s (recently split)",
+ scache_ptr->name);
+
+ scache_ptr = scache_ptr->next;
+ }
+ }
+}