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., 675 Mass Ave, Cambridge, MA 02139, USA.
-
- $Id$
+ 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.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "system.h"
/* Purge edges and subnets of unreachable nodes. Use carefully. */
-static void purge(void)
-{
+static void purge(void) {
avl_node_t *nnode, *nnext, *enode, *enext, *snode, *snext;
node_t *n;
edge_t *e;
subnet_t *s;
- cp();
-
ifdebug(PROTOCOL) logger(LOG_DEBUG, _("Purging unreachable nodes"));
/* Remove all edges and subnets owned by unreachable nodes. */
put all file descriptors in an fd_set array
While we're at it, purge stuff that needs to be removed.
*/
-static int build_fdset(fd_set *readset, fd_set *writeset)
-{
+static int build_fdset(fd_set *readset, fd_set *writeset) {
avl_node_t *node, *next;
connection_t *c;
int i, max = 0;
- cp();
-
FD_ZERO(readset);
FD_ZERO(writeset);
- Check if we need to retry making an outgoing connection
- Deactivate the host
*/
-void terminate_connection(connection_t *c, bool report)
-{
- cp();
-
+void terminate_connection(connection_t *c, bool report) {
if(c->status.remove)
return;
end does not reply in time, we consider them dead
and close the connection.
*/
-static void check_dead_connections(void)
-{
+static void check_dead_connections(void) {
avl_node_t *node, *next;
connection_t *c;
- cp();
-
for(node = connection_tree->head; node; node = next) {
next = node->next;
c = node->data;
check all connections to see if anything
happened on their sockets
*/
-static void check_network_activity(fd_set * readset, fd_set * writeset)
-{
+static void check_network_activity(fd_set * readset, fd_set * writeset) {
connection_t *c;
avl_node_t *node;
int result, i;
socklen_t len = sizeof(result);
vpn_packet_t packet;
- cp();
-
/* check input from kernel */
if(device_fd >= 0 && FD_ISSET(device_fd, readset)) {
if(read_packet(&packet)) {
/*
this is where it all happens...
*/
-int main_loop(void)
-{
+int main_loop(void) {
fd_set readset, writeset;
struct timeval tv;
int r, maxfd;
time_t last_ping_check, last_config_check, last_graph_dump;
event_t *event;
- cp();
-
last_ping_check = now;
last_config_check = now;
last_graph_dump = now;
if(errno != EINTR && errno != EAGAIN) {
logger(LOG_ERR, _("Error while waiting for input: %s"),
strerror(errno));
- cp_trace();
dump_connections();
return 1;
}