diff options
Diffstat (limited to 'pimd/pim_igmp.c')
| -rw-r--r-- | pimd/pim_igmp.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c index ee88e7d8ea..b9be8fc040 100644 --- a/pimd/pim_igmp.c +++ b/pimd/pim_igmp.c @@ -1,22 +1,21 @@ /* - PIM for Quagga - Copyright (C) 2008 Everton da Silva Marques - - 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 2 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; see the file COPYING; if not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA -*/ + * PIM for Quagga + * Copyright (C) 2008 Everton da Silva Marques + * + * 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 2 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; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #include <zebra.h> @@ -39,6 +38,7 @@ #include "pim_zebra.h" static void group_timer_off(struct igmp_group *group); +static int pim_igmp_general_query(struct thread *t); /* This socket is used for TXing IGMP packets only, IGMP RX happens * in pim_mroute_msg() @@ -172,8 +172,11 @@ static int pim_igmp_other_querier_expire(struct thread *t) /* We are the current querier, then re-start sending general queries. + RFC 2236 - sec 7 Other Querier + present timer expired (Send General + Query, Set Gen. Query. timer) */ - pim_igmp_general_query_on(igmp); + pim_igmp_general_query(t); return 0; } @@ -247,9 +250,9 @@ void pim_igmp_other_querier_timer_on(struct igmp_sock *igmp) other_querier_present_interval_msec % 1000); } - THREAD_TIMER_MSEC_ON(master, igmp->t_other_querier_timer, - pim_igmp_other_querier_expire, - igmp, other_querier_present_interval_msec); + thread_add_timer_msec(master, pim_igmp_other_querier_expire, igmp, + other_querier_present_interval_msec, + &igmp->t_other_querier_timer); } void pim_igmp_other_querier_timer_off(struct igmp_sock *igmp) @@ -497,8 +500,6 @@ int pim_igmp_packet(struct igmp_sock *igmp, char *buf, size_t len) return -1; } -static int pim_igmp_general_query(struct thread *t); - void pim_igmp_general_query_on(struct igmp_sock *igmp) { struct pim_interface *pim_ifp; @@ -551,9 +552,8 @@ void pim_igmp_general_query_on(struct igmp_sock *igmp) igmp->fd); } igmp->t_igmp_query_timer = NULL; - THREAD_TIMER_ON(master, igmp->t_igmp_query_timer, - pim_igmp_general_query, - igmp, query_interval); + thread_add_timer(master, pim_igmp_general_query, igmp, query_interval, + &igmp->t_igmp_query_timer); } void pim_igmp_general_query_off(struct igmp_sock *igmp) @@ -896,7 +896,7 @@ igmp_read_on (struct igmp_sock *igmp) igmp->fd); } igmp->t_igmp_read = NULL; - THREAD_READ_ON(master, igmp->t_igmp_read, pim_igmp_read, igmp, igmp->fd); + thread_add_read(master, pim_igmp_read, igmp, igmp->fd, &igmp->t_igmp_read); } @@ -1029,9 +1029,8 @@ void igmp_group_timer_on(struct igmp_group *group, */ zassert(group->group_filtermode_isexcl); - THREAD_TIMER_MSEC_ON(master, group->t_group_timer, - igmp_group_timer, - group, interval_msec); + thread_add_timer_msec(master, igmp_group_timer, group, interval_msec, + &group->t_group_timer); } struct igmp_group * |
