Back to index

citadel  8.12
netconfig.h
Go to the documentation of this file.
00001 /*
00002  * This module handles shared rooms, inter-Citadel mail, and outbound
00003  * mailing list processing.
00004  *
00005  * Copyright (c) 2000-2012 by the citadel.org team
00006  *
00007  *  This program is open source software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 3 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * ** NOTE **   A word on the S_NETCONFIGS semaphore:
00022  * This is a fairly high-level type of critical section.  It ensures that no
00023  * two threads work on the netconfigs files at the same time.  Since we do
00024  * so many things inside these, here are the rules:
00025  *  1. begin_critical_section(S_NETCONFIGS) *before* begin_ any others.
00026  *  2. Do *not* perform any I/O with the client during these sections.
00027  *
00028  */
00029 
00030 typedef struct _nodeconf {
00031        int DeleteMe;
00032        StrBuf *NodeName;
00033        StrBuf *Secret;
00034        StrBuf *Host;
00035        StrBuf *Port;
00036 }NodeConf;
00037 
00038 typedef struct __NetMap {
00039        StrBuf *NodeName;
00040        time_t lastcontact;
00041        StrBuf *NextHop;
00042 }NetMap;
00043 
00044 HashList* load_ignetcfg(void);
00045 
00046 HashList* read_network_map(void);
00047 StrBuf *SerializeNetworkMap(HashList *Map);
00048 void network_learn_topology(char *node, char *path, HashList *the_netmap, int *netmap_changed);
00049 
00050 int is_valid_node(const StrBuf **nexthop,
00051                 const StrBuf **secret,
00052                 StrBuf *node,
00053                 HashList *IgnetCfg,
00054                 HashList *the_netmap);