- for (ptr = MotdList.other; ptr; ptr = ptr->next) {
- if (ptr->type == MOTD_CLASS) /* class requires special handling */
- send_reply(to, SND_EXPLICIT | RPL_STATSTLINE, "T %d %s", ptr->id.class,
- ptr->path);
- else if (ptr->type == MOTD_HOSTMASK)
- send_reply(to, RPL_STATSTLINE, 'T', ptr->id.hostmask, ptr->path);
+ for (ptr = MotdList.other; ptr; ptr = ptr->next)
+ send_reply(to, SND_EXPLICIT | RPL_STATSTLINE, "T %s %s",
+ ptr->hostmask, ptr->path);
+}
+
+/** Report MOTD memory usage to a client.
+ * @param[in] cptr Client requesting memory usage.
+ */
+void
+motd_memory_count(struct Client *cptr)
+{
+ struct Motd *ptr;
+ struct MotdCache *cache;
+ unsigned int mt = 0, /* motd count */
+ mtc = 0, /* motd cache count */
+ mtf = 0; /* motd free list count */
+ size_t mtm = 0, /* memory consumed by motd */
+ mtcm = 0; /* memory consumed by motd cache */
+ if (MotdList.local)
+ {
+ mt++;
+ mtm += sizeof(struct Motd);
+ mtm += MotdList.local->path ? (strlen(MotdList.local->path) + 1) : 0;