* This module handles shared rooms, inter-Citadel mail, and outbound
* mailing list processing.
*
- * Copyright (C) 2000-2009 by Art Cancro and others.
- * This code is released under the terms of the GNU General Public License.
+ * Copyright (c) 2000-2009 by the citadel.org team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ** NOTE ** A word on the S_NETCONFIGS semaphore:
* This is a fairly high-level type of critical section. It ensures that no
#include "citserver.h"
#include "support.h"
#include "config.h"
-#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
#include "database.h"
#include "snprintf.h"
#endif
+#include "context.h"
#include "ctdl_module.h"
* Normally this should never happen, but once in a while maybe a room gets
* queued for networking and then deleted before it can happen.
*/
- if (getroom(&CC->room, room_to_spool) != 0) {
+ if (CtdlGetRoom(&CC->room, room_to_spool) != 0) {
CtdlLogPrintf(CTDL_CRIT, "ERROR: cannot load <%s>\n", room_to_spool);
return;
}
if (strcmp(connected_to, node))
{
snprintf (err_buf, sizeof(err_buf), "Connected to node \"%s\" but I was expecting to connect to node \"%s\".", connected_to, node);
- aide_message(err_buf, "IGNet Networking error.");
+ CtdlAideMessage(err_buf, "IGNet Networking error.");
}
/* Identify ourselves */
*/
if (full_processing && !CtdlThreadCheckStop()) {
CtdlLogPrintf(CTDL_DEBUG, "network: loading outbound queue\n");
- ForEachRoom(network_queue_room, NULL);
+ CtdlForEachRoom(network_queue_room, NULL);
}
if (rplist != NULL) {
v = is_valid_node(nexthop, secret, node);
if (v != 0) {
- snprintf (err_buf, sizeof(err_buf), "Unknown node <%s>\n", node);
+ snprintf(err_buf, sizeof err_buf,
+ "An unknown Citadel server called \"%s\" attempted to connect from %s [%s].\n",
+ node, CC->cs_host, CC->cs_addr
+ );
CtdlLogPrintf(CTDL_WARNING, err_buf);
- cprintf("%d authentication failed\n",
- ERROR + PASSWORD_REQUIRED);
- aide_message(err_buf, "IGNet Networking.");
+ cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
+ CtdlAideMessage(err_buf, "IGNet Networking.");
return;
}
if (strcasecmp(pass, secret)) {
- snprintf (err_buf, sizeof(err_buf), "Bad password for network node <%s>", node);
+ snprintf(err_buf, sizeof err_buf,
+ "A Citadel server at %s [%s] failed to authenticate as network node \"%s\".\n",
+ CC->cs_host, CC->cs_addr, node
+ );
CtdlLogPrintf(CTDL_WARNING, err_buf);
cprintf("%d authentication failed\n", ERROR + PASSWORD_REQUIRED);
- aide_message(err_buf, "IGNet Networking.");
+ CtdlAideMessage(err_buf, "IGNet Networking.");
return;
}
safestrncpy(CC->net_node, node, sizeof CC->net_node);
network_talking_to(node, NTT_ADD);
- CtdlLogPrintf(CTDL_NOTICE, "Network node <%s> logged in\n", CC->net_node);
- cprintf("%d authenticated as network node '%s'\n", CIT_OK,
- CC->net_node);
+ CtdlLogPrintf(CTDL_NOTICE, "Network node <%s> logged in from %s [%s]\n",
+ CC->net_node, CC->cs_host, CC->cs_addr
+ );
+ cprintf("%d authenticated as network node '%s'\n", CIT_OK, CC->net_node);
}
+
int network_room_handler (struct ctdlroom *room)
{
network_queue_room(room, NULL);
return 0;
}
+
/*
* Module entry point
*/