2 # Parent 61d020b9ec03fb0d7d9eb079b974e4d910647c9d
4 diff -r 61d020b9ec03 ircd/m_endburst.c
5 --- a/ircd/m_endburst.c Sun Jul 14 13:28:04 2013 +0100
6 +++ b/ircd/m_endburst.c Sun Jul 14 13:33:21 2013 +0100
9 /* #include <assert.h> -- Now using assert in ircd_log.h */
14 + * send map of new links to SNO_NETWORK
15 + * using dump_map from m_map.c
17 +void dump_map(struct Client *server, char *mask, int prompt_length,
18 + void (*reply_function)(void **, const char *, int), void **args);
19 +static void report_new_links(void **args, const char *buf, int overflow)
21 + sendto_opmask_butone(0, SNO_NETWORK, " New server: %s", buf);
26 * ms_end_of_burst - server message handler
27 * - Added Xorath 6-14-96, rewritten by Run 24-7-96
32 - sendto_opmask_butone(0, SNO_NETWORK, "Completed net.burst from %C.",
34 sendcmdto_serv_butone(sptr, CMD_END_OF_BURST, cptr, "");
37 + dump_map(sptr, "*", 0, report_new_links, 0);
38 + sendto_opmask_butone(0, SNO_NETWORK, "Completed net.burst from %C.",
41 sendcmdto_one(&me, CMD_END_OF_BURST_ACK, sptr, "");
43 diff -r 61d020b9ec03 ircd/m_map.c
44 --- a/ircd/m_map.c Sun Jul 14 13:28:04 2013 +0100
45 +++ b/ircd/m_map.c Sun Jul 14 13:33:21 2013 +0100
50 -static void dump_map(struct Client *cptr, struct Client *server, char *mask, int prompt_length)
51 +void dump_map(struct Client *server, char *mask, int prompt_length, void (*reply_function)(void **, const char *, int), void **args)
54 static char prompt[64];
56 char *p = prompt + prompt_length;
58 + static char buf[512];
61 if (prompt_length > 60)
62 - send_reply(cptr, RPL_MAPMORE, prompt, cli_name(server));
64 + ircd_snprintf(0, buf, sizeof(buf), "%s%s --> *more*", prompt, cli_name(server));
65 + reply_function(args, buf, 1);
74 - send_reply(cptr, RPL_MAP, prompt, chr, cli_name(server),
75 - lag, (server == &me) ? UserStats.local_clients :
76 - cli_serv(server)->clients);
78 + ircd_snprintf(0, buf, sizeof(buf), "%s%s%s %s [%u clients]",
79 + prompt, chr, cli_name(server), lag,
80 + (server == &me) ? UserStats.local_clients :
81 + cli_serv(server)->clients);
83 + reply_function(args, buf, 0);
85 if (prompt_length > 0)
91 - dump_map(cptr, lp->value.cptr, mask, prompt_length + 2);
92 + dump_map(lp->value.cptr, mask, prompt_length + 2, reply_function, args);
94 if (prompt_length > 0)
98 +static void map_reply(void **args, const char *buf, int overflow)
100 + struct Client *cptr = (struct Client *)args[0];
103 + send_reply(cptr, RPL_MAP, buf);
105 + send_reply(cptr, RPL_MAPMORE, buf);
109 * m_map - generic message handler
112 int m_map(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
115 if (feature_bool(FEAT_HIS_MAP) && !IsAnOper(sptr))
117 sendcmdto_one(&me, CMD_NOTICE, sptr, "%C :%s %s", sptr,
122 - dump_map(sptr, &me, parv[1], 0);
125 + dump_map(&me, parv[1], 0, map_reply, args);
126 send_reply(sptr, RPL_MAPEND);
129 diff -r 61d020b9ec03 ircd/s_err.c
130 --- a/ircd/s_err.c Sun Jul 14 13:28:04 2013 +0100
131 +++ b/ircd/s_err.c Sun Jul 14 13:33:21 2013 +0100
136 - { RPL_MAP, ":%s%s%s %s [%u clients]", "015" },
137 + { RPL_MAP, ":%s", "015" },
139 - { RPL_MAPMORE, ":%s%s --> *more*", "016" },
140 + { RPL_MAPMORE, ":%s", "016" },
142 { RPL_MAPEND, ":End of /MAP", "017" },
144 diff -r 61d020b9ec03 ircd/s_misc.c
145 --- a/ircd/s_misc.c Sun Jul 14 13:28:04 2013 +0100
146 +++ b/ircd/s_misc.c Sun Jul 14 13:33:21 2013 +0100
148 remove_client_from_list(bcptr);
152 + * report_lost_links
153 + * send map of lost links to SNO_NETWORK
154 + * using dump_map from m_map.c
156 +void dump_map(struct Client *server, char *mask, int prompt_length,
157 + void (*reply_function)(void **, const char *, int), void **args);
158 +static void report_lost_links(void **args, const char *buf, int overflow)
160 + sendto_opmask_butone(0, SNO_NETWORK, " Lost: %s", buf);
163 /* exit_downlinks - added by Run 25-9-94 */
165 * Removes all clients and downlinks (+clients) of any server
167 get_client_name(killer, HIDE_IP));
168 sendto_opmask_butone(0, SNO_NETWORK, "Net break: %C %C (%s)",
169 cli_serv(victim)->up, victim, comment);
170 + dump_map(victim, "*", 0, report_lost_links, 0);