FreeBSD/sys/netinet/in_mcast.c
/*
 * Merge socket-layer source into IGMP-layer source.
 * If rollback is non-zero, perform the inverse of the merge.
 */
Merge socket-layer source into IGMP-layer source.
If rollback is non-zero, perform the inverse of the merge.
Merge socket - layer source into IGMP - layer source . If rollback is non - zero perform the inverse of the merge .
static void
ims_merge(struct ip_msource *ims, const struct in_msource *lims,
    const int rollback)
{
	int n = rollback ? -1 : 1;
#ifdef KTR
	struct in_addr ia;
	ia.s_addr = htonl(ims->ims_haddr);
#endif
	if (lims->imsl_st[0] == MCAST_EXCLUDE) {
		CTR3(KTR_IGMPV3, "%s: t1 ex -= %d on %s",
		    __func__, n, inet_ntoa(ia));
		ims->ims_st[1].ex -= n;
	} else if (lims->imsl_st[0] == MCAST_INCLUDE) {
		CTR3(KTR_IGMPV3, "%s: t1 in -= %d on %s",
		    __func__, n, inet_ntoa(ia));
		ims->ims_st[1].in -= n;
	}
	if (lims->imsl_st[1] == MCAST_EXCLUDE) {
		CTR3(KTR_IGMPV3, "%s: t1 ex += %d on %s",
		    __func__, n, inet_ntoa(ia));
		ims->ims_st[1].ex += n;
	} else if (lims->imsl_st[1] == MCAST_INCLUDE) {
		CTR3(KTR_IGMPV3, "%s: t1 in += %d on %s",
		    __func__, n, inet_ntoa(ia));
		ims->ims_st[1].in += n;
	}
}
static void ims_merge ( struct ip_msource * ims , const struct in_msource * lims , const int rollback ) { int n = rollback ? -1 : 1 ; #ifdef KTR struct in_addr ia ; ia . s_addr = htonl ( ims -> ims_haddr ) ; #endif if ( lims -> imsl_st [ 0 ] == MCAST_EXCLUDE ) { CTR3 ( KTR_IGMPV3 , " " , __func__ , n , inet_ntoa ( ia ) ) ; ims -> ims_st [ 1 ] . ex -= n ; } else if ( lims -> imsl_st [ 0 ] == MCAST_INCLUDE ) { CTR3 ( KTR_IGMPV3 , " " , __func__ , n , inet_ntoa ( ia ) ) ; ims -> ims_st [ 1 ] . in -= n ; } if ( lims -> imsl_st [ 1 ] == MCAST_EXCLUDE ) { CTR3 ( KTR_IGMPV3 , " " , __func__ , n , inet_ntoa ( ia ) ) ; ims -> ims_st [ 1 ] . ex += n ; } else if ( lims -> imsl_st [ 1 ] == MCAST_INCLUDE ) { CTR3 ( KTR_IGMPV3 , " " , __func__ , n , inet_ntoa ( ia ) ) ; ims -> ims_st [ 1 ] . in += n ; } }
Merge socket-layer source into IGMP-layer source.
Merge socket - layer source into IGMP - layer source .