コード例 #1
0
ファイル: igmp.c プロジェクト: TaoAndHua/linux-1.2.13
static void igmp_heard_report(struct device *dev, unsigned long address)
{
	struct ip_mc_list *im;
	for(im=dev->ip_mc_list;im!=NULL;im=im->next)
		if(im->multiaddr==address)
			igmp_stop_timer(im);
}
コード例 #2
0
ファイル: igmp.c プロジェクト: GNUHurdTR/hurd
static void igmp_heard_report(struct in_device *in_dev, u32 group)
{
	struct ip_mc_list *im;

	/* Timers are only set for non-local groups */

	if (group == IGMP_ALL_HOSTS)
		return;

	for (im=in_dev->mc_list; im!=NULL; im=im->next) {
		if (im->multiaddr == group) {
			igmp_stop_timer(im);
			im->reporter = 0;
			im->unsolicit_count = 0;
			return;
		}
	}
}
コード例 #3
0
static void igmp_heard_report(struct in_device *in_dev, u32 group)
{
    struct ip_mc_list *im;

    /* Timers are only set for non-local groups */

    if (group == IGMP_ALL_HOSTS)
        return;

    read_lock(&in_dev->lock);
    for (im=in_dev->mc_list; im!=NULL; im=im->next) {
        if (im->multiaddr == group) {
            igmp_stop_timer(im);
            break;
        }
    }
    read_unlock(&in_dev->lock);
}
コード例 #4
0
ファイル: igmp.c プロジェクト: GNUHurdTR/hurd
static void igmp_group_dropped(struct ip_mc_list *im)
{
	if (im->loaded) {
		im->loaded = 0;
		ip_mc_filter_del(im->interface, im->multiaddr);
	}

#ifdef CONFIG_IP_MULTICAST
	if (im->multiaddr == IGMP_ALL_HOSTS)
		return;

	start_bh_atomic();
	igmp_stop_timer(im);
	end_bh_atomic();

	if (im->reporter && !IGMP_V1_SEEN(im->interface))
		igmp_send_report(im->interface->dev, im->multiaddr, IGMP_HOST_LEAVE_MESSAGE);
#endif
}
コード例 #5
0
static void igmp_heard_report(struct device *dev, __u32 address, __u32 src)
{
	struct ip_mc_list *im;

	if ((address & IGMP_LOCAL_GROUP_MASK) != IGMP_LOCAL_GROUP) 
	{
		/* Timers are only set for non-local groups */
		for(im=dev->ip_mc_list;im!=NULL;im=im->next) 
		{
			if(im->multiaddr==address)
			{
				if(im->tm_running) 
					igmp_stop_timer(im);
				if(src!=dev->pa_addr)
					im->reporter=0;
				return;
			}
		}
	}
}
コード例 #6
0
ファイル: igmp.c プロジェクト: GNUHurdTR/hurd
static void igmp_heard_query(struct in_device *in_dev, unsigned char max_resp_time,
			     u32 group)
{
	struct ip_mc_list	*im;
	int			max_delay;

	max_delay = max_resp_time*(HZ/IGMP_TIMER_SCALE);

	if (max_resp_time == 0) {
		/* Alas, old v1 router presents here. */

		max_delay = IGMP_Query_Response_Interval;
		in_dev->mr_v1_seen = jiffies + IGMP_V1_Router_Present_Timeout;
		group = 0;
	}
		
	/*
	 * - Start the timers in all of our membership records
	 *   that the query applies to for the interface on
	 *   which the query arrived excl. those that belong
	 *   to a "local" group (224.0.0.X)
	 * - For timers already running check if they need to
	 *   be reset.
	 * - Use the igmp->igmp_code field as the maximum
	 *   delay possible
	 */
	for (im=in_dev->mc_list; im!=NULL; im=im->next) {
		if (group && group != im->multiaddr)
			continue;
		if (im->multiaddr == IGMP_ALL_HOSTS)
			continue;
		im->unsolicit_count = 0;
		if (im->tm_running && (long)(im->timer.expires-jiffies) > max_delay)
			igmp_stop_timer(im);
		igmp_start_timer(im, max_delay);
	}
}
コード例 #7
0
static void igmp_heard_query(struct device *dev,unsigned char max_resp_time)
{
	struct ip_mc_list *im;
	int	mrouter_type;

	/*
	 *	The max_resp_time is in units of 1/10 second.
	 */
	if(max_resp_time>0)
	{
		mrouter_type=IGMP_NEW_ROUTER;

		if(igmp_set_mrouter_info(dev,mrouter_type,0)==NULL)
			return;
		/*
		 * - Start the timers in all of our membership records
		 *   that the query applies to for the interface on
		 *   which the query arrived excl. those that belong
		 *   to a "local" group (224.0.0.X)
		 * - For timers already running check if they need to
		 *   be reset.
		 * - Use the igmp->igmp_code field as the maximum
		 *   delay possible
		 */
		for(im=dev->ip_mc_list;im!=NULL;im=im->next)
		{
			if(im->tm_running)
			{
				if(im->timer.expires>jiffies+max_resp_time*HZ/IGMP_TIMER_SCALE)
				{
					igmp_stop_timer(im);
					igmp_start_timer(im,max_resp_time);
				}
			}
			else
			{
				if((im->multiaddr & IGMP_LOCAL_GROUP_MASK)!=IGMP_LOCAL_GROUP)
					igmp_start_timer(im,max_resp_time);
			}
		}
	}
	else
	{
		mrouter_type=IGMP_OLD_ROUTER;
		max_resp_time=IGMP_MAX_HOST_REPORT_DELAY*IGMP_TIMER_SCALE;

		if(igmp_set_mrouter_info(dev,mrouter_type,IGMP_AGE_THRESHOLD)==NULL)
			return;

		/*
		 * Start the timers in all of our membership records for
		 * the interface on which the query arrived, except those
		 * that are already running and those that belong to a
		 * "local" group (224.0.0.X).
		 */

		for(im=dev->ip_mc_list;im!=NULL;im=im->next)
		{
			if(!im->tm_running && (im->multiaddr & IGMP_LOCAL_GROUP_MASK)!=IGMP_LOCAL_GROUP)
				igmp_start_timer(im,max_resp_time);
		}
	}
}
コード例 #8
0
ファイル: igmp.c プロジェクト: TaoAndHua/linux-1.2.13
static void igmp_timer_expire(unsigned long data)
{
	struct ip_mc_list *im=(struct ip_mc_list *)data;
	igmp_stop_timer(im);
	igmp_send_report(im->interface, im->multiaddr, IGMP_HOST_MEMBERSHIP_REPORT);
}