1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
12 #include "read-agents.h"
20 av_agents = get_agents_with_timeout(GA_ACTIVE, mond.notify_time);
24 mond.agents = av_agents;
28 /* Check if any of the previously available agents are disconnected */
29 cr_agents = mond.agents;
35 while (tmp_av && *tmp_av) {
36 if (strcmp(*cr_agents, *tmp_av) == 0) {
43 /* Agent disconnected */
45 char str[OS_SIZE_1024 + 1];
47 /* Send disconnected message */
48 snprintf(str, OS_SIZE_1024 - 1, OS_AG_DISCON, *cr_agents);
49 if (SendMSG(mond.a_queue, str, ARGV0,
51 merror(QUEUE_SEND, ARGV0);
58 /* Remove old agent list and add current one */
59 free_agents(mond.agents);
60 mond.agents = av_agents;