+ case SILC_COMMAND_WATCH:
+ break;
+
+ case SILC_COMMAND_STATS:
+ {
+ SilcClientStats *cstats;
+ char tmp[40];
+ const char *tmptime;
+ int days, hours, mins, secs;
+
+ if (SILC_STATUS_IS_ERROR(status))
+ return;
+
+ cstats = va_arg(vp, SilcClientStats *);
+ if (!cstats) {
+ printtext(server, NULL, MSGLEVEL_CRAP, "No statistics available");
+ return;
+ }
+
+ tmptime = silc_time_string(cstats->starttime);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local server start time", tmptime);
+
+ days = cstats->uptime / (24 * 60 * 60);
+ cstats->uptime -= days * (24 * 60 * 60);
+ hours = cstats->uptime / (60 * 60);
+ cstats->uptime -= hours * (60 * 60);
+ mins = cstats->uptime / 60;
+ cstats->uptime -= mins * 60;
+ secs = cstats->uptime;
+ snprintf(tmp, sizeof(tmp) - 1, "%d days %d hours %d mins %d secs",
+ days, hours, mins, secs);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local server uptime", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->my_clients);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local server clients", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->my_channels);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local server channels", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->my_server_ops);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local server operators", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->my_router_ops);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local router operators", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->cell_clients);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local cell clients", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->cell_channels);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local cell channels", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->cell_servers);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Local cell servers", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->clients);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total clients", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->channels);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total channels", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->servers);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total servers", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->routers);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total routers", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->server_ops);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total server operators", tmp);
+
+ snprintf(tmp, sizeof(tmp) - 1, "%d", (int)cstats->router_ops);
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_STATS,
+ "Total router operators", tmp);
+ }
+ break;
+
+ case SILC_COMMAND_CMODE:
+ {
+ SilcChannelEntry channel_entry;
+ SilcDList chpks;
+
+ channel_entry = va_arg(vp, SilcChannelEntry);
+ (void)va_arg(vp, SilcUInt32);
+ (void)va_arg(vp, SilcPublicKey);
+ chpks = va_arg(vp, SilcDList);
+
+ if (SILC_STATUS_IS_ERROR(status) || !cmode_list_chpks ||
+ !channel_entry || !channel_entry->channel_name)
+ return;
+
+ /* Print the channel public key list */
+ if (chpks)
+ silc_parse_channel_public_keys(server, channel_entry, chpks);
+ else
+ printformat_module("fe-common/silc", server, NULL,
+ MSGLEVEL_CRAP, SILCTXT_CHANNEL_PK_NO_LIST,
+ channel_entry->channel_name);
+
+ }
+ break;
+
+ case SILC_COMMAND_LEAVE:
+ {
+ if (SILC_STATUS_IS_ERROR(status))
+ return;
+
+ /* We might be cycling, so disable queueing again */
+ silc_queue_disable(conn);
+ }
+ break;
+
+ case SILC_COMMAND_DETACH:
+ {
+ /* Save the detachment data to file. */
+ char *file;
+ SilcBuffer detach;
+
+ if (SILC_STATUS_IS_ERROR(status))
+ return;
+
+ detach = va_arg(vp, SilcBuffer);
+ file = silc_get_session_filename(server);
+ silc_file_writefile(file, silc_buffer_data(detach),
+ silc_buffer_len(detach));
+ silc_free(file);
+ }
+ break;
+
+ case SILC_COMMAND_KILL:
+ {
+ SilcClientEntry client_entry;