Lines Matching refs:psf
228 static int is_in(struct ip_mc_list *pmc, struct ip_sf_list *psf, int type, in is_in() argument
236 if (!(pmc->gsquery && !psf->sf_gsresp)) { in is_in()
242 if (psf->sf_count[MCAST_INCLUDE]) in is_in()
245 psf->sf_count[MCAST_EXCLUDE]; in is_in()
251 return psf->sf_count[MCAST_INCLUDE] != 0; in is_in()
256 psf->sf_count[MCAST_INCLUDE]) in is_in()
259 psf->sf_count[MCAST_EXCLUDE]; in is_in()
261 if (gdeleted || !psf->sf_crcount) in is_in()
266 return gdeleted || (psf->sf_crcount && sdeleted); in is_in()
267 return psf->sf_crcount && !gdeleted && !sdeleted; in is_in()
275 struct ip_sf_list *psf; in igmp_scount() local
278 for (psf=pmc->sources; psf; psf=psf->sf_next) { in igmp_scount()
279 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) in igmp_scount()
395 struct ip_sf_list *psf, *psf_next, *psf_prev, **psf_list; in add_grec() local
426 for (psf=*psf_list; psf; psf=psf_next) { in add_grec()
429 psf_next = psf->sf_next; in add_grec()
431 if (!is_in(pmc, psf, type, gdeleted, sdeleted)) { in add_grec()
432 psf_prev = psf; in add_grec()
438 psf->sf_gsresp = 0; in add_grec()
459 *psrc = psf->sf_inaddr; in add_grec()
462 type == IGMPV3_BLOCK_OLD_SOURCES) && psf->sf_crcount) { in add_grec()
463 psf->sf_crcount--; in add_grec()
464 if ((sdeleted || gdeleted) && psf->sf_crcount == 0) { in add_grec()
466 psf_prev->sf_next = psf->sf_next; in add_grec()
468 *psf_list = psf->sf_next; in add_grec()
469 kfree(psf); in add_grec()
473 psf_prev = psf; in add_grec()
536 struct ip_sf_list *psf_prev, *psf_next, *psf; in igmpv3_clear_zeros() local
539 for (psf=*ppsf; psf; psf = psf_next) { in igmpv3_clear_zeros()
540 psf_next = psf->sf_next; in igmpv3_clear_zeros()
541 if (psf->sf_crcount == 0) { in igmpv3_clear_zeros()
543 psf_prev->sf_next = psf->sf_next; in igmpv3_clear_zeros()
545 *ppsf = psf->sf_next; in igmpv3_clear_zeros()
546 kfree(psf); in igmpv3_clear_zeros()
548 psf_prev = psf; in igmpv3_clear_zeros()
753 struct ip_sf_list *psf; in igmp_xmarksources() local
757 for (psf=pmc->sources; psf; psf=psf->sf_next) { in igmp_xmarksources()
764 psf->sf_count[MCAST_EXCLUDE]) in igmp_xmarksources()
766 if (srcs[i] == psf->sf_inaddr) { in igmp_xmarksources()
780 struct ip_sf_list *psf; in igmp_marksources() local
788 for (psf=pmc->sources; psf; psf=psf->sf_next) { in igmp_marksources()
792 if (srcs[i] == psf->sf_inaddr) { in igmp_marksources()
793 psf->sf_gsresp = 1; in igmp_marksources()
1041 struct ip_sf_list *psf; in igmpv3_add_delrec() local
1046 for (psf=pmc->sources; psf; psf=psf->sf_next) in igmpv3_add_delrec()
1047 psf->sf_crcount = pmc->crcount; in igmpv3_add_delrec()
1060 struct ip_sf_list *psf, *psf_next; in igmpv3_del_delrec() local
1077 for (psf=pmc->tomb; psf; psf=psf_next) { in igmpv3_del_delrec()
1078 psf_next = psf->sf_next; in igmpv3_del_delrec()
1079 kfree(psf); in igmpv3_del_delrec()
1104 struct ip_sf_list *psf, *psf_next; in igmpv3_clear_delrec() local
1107 psf = pmc->tomb; in igmpv3_clear_delrec()
1110 for (; psf; psf=psf_next) { in igmpv3_clear_delrec()
1111 psf_next = psf->sf_next; in igmpv3_clear_delrec()
1112 kfree(psf); in igmpv3_clear_delrec()
1427 struct ip_sf_list *psf, *psf_prev; in ip_mc_del1_src() local
1431 for (psf=pmc->sources; psf; psf=psf->sf_next) { in ip_mc_del1_src()
1432 if (psf->sf_inaddr == *psfsrc) in ip_mc_del1_src()
1434 psf_prev = psf; in ip_mc_del1_src()
1436 if (!psf || psf->sf_count[sfmode] == 0) { in ip_mc_del1_src()
1440 psf->sf_count[sfmode]--; in ip_mc_del1_src()
1441 if (psf->sf_count[sfmode] == 0) { in ip_mc_del1_src()
1444 if (!psf->sf_count[MCAST_INCLUDE] && !psf->sf_count[MCAST_EXCLUDE]) { in ip_mc_del1_src()
1451 psf_prev->sf_next = psf->sf_next; in ip_mc_del1_src()
1453 pmc->sources = psf->sf_next; in ip_mc_del1_src()
1455 if (psf->sf_oldin && in ip_mc_del1_src()
1457 psf->sf_crcount = in_dev->mr_qrv ? in_dev->mr_qrv : in ip_mc_del1_src()
1459 psf->sf_next = pmc->tomb; in ip_mc_del1_src()
1460 pmc->tomb = psf; in ip_mc_del1_src()
1464 kfree(psf); in ip_mc_del1_src()
1515 struct ip_sf_list *psf; in ip_mc_del_src() local
1524 for (psf=pmc->sources; psf; psf = psf->sf_next) in ip_mc_del_src()
1525 psf->sf_crcount = 0; in ip_mc_del_src()
1542 struct ip_sf_list *psf, *psf_prev; in ip_mc_add1_src() local
1545 for (psf=pmc->sources; psf; psf=psf->sf_next) { in ip_mc_add1_src()
1546 if (psf->sf_inaddr == *psfsrc) in ip_mc_add1_src()
1548 psf_prev = psf; in ip_mc_add1_src()
1550 if (!psf) { in ip_mc_add1_src()
1551 psf = kzalloc(sizeof(*psf), GFP_ATOMIC); in ip_mc_add1_src()
1552 if (!psf) in ip_mc_add1_src()
1554 psf->sf_inaddr = *psfsrc; in ip_mc_add1_src()
1556 psf_prev->sf_next = psf; in ip_mc_add1_src()
1558 pmc->sources = psf; in ip_mc_add1_src()
1560 psf->sf_count[sfmode]++; in ip_mc_add1_src()
1561 if (psf->sf_count[sfmode] == 1) { in ip_mc_add1_src()
1570 struct ip_sf_list *psf; in sf_markstate() local
1573 for (psf=pmc->sources; psf; psf=psf->sf_next) in sf_markstate()
1575 psf->sf_oldin = mca_xcount == in sf_markstate()
1576 psf->sf_count[MCAST_EXCLUDE] && in sf_markstate()
1577 !psf->sf_count[MCAST_INCLUDE]; in sf_markstate()
1579 psf->sf_oldin = psf->sf_count[MCAST_INCLUDE] != 0; in sf_markstate()
1584 struct ip_sf_list *psf, *dpsf; in sf_setstate() local
1590 for (psf=pmc->sources; psf; psf=psf->sf_next) { in sf_setstate()
1592 new_in = mca_xcount == psf->sf_count[MCAST_EXCLUDE] && in sf_setstate()
1593 !psf->sf_count[MCAST_INCLUDE]; in sf_setstate()
1595 new_in = psf->sf_count[MCAST_INCLUDE] != 0; in sf_setstate()
1597 if (!psf->sf_oldin) { in sf_setstate()
1601 if (dpsf->sf_inaddr == psf->sf_inaddr) in sf_setstate()
1612 psf->sf_crcount = qrv; in sf_setstate()
1615 } else if (psf->sf_oldin) { in sf_setstate()
1617 psf->sf_crcount = 0; in sf_setstate()
1623 if (dpsf->sf_inaddr == psf->sf_inaddr) in sf_setstate()
1630 *dpsf = *psf; in sf_setstate()
1688 struct ip_sf_list *psf; in ip_mc_add_src() local
1703 for (psf=pmc->sources; psf; psf = psf->sf_next) in ip_mc_add_src()
1704 psf->sf_crcount = 0; in ip_mc_add_src()
1716 struct ip_sf_list *psf, *nextpsf; in ip_mc_clear_src() local
1718 for (psf=pmc->tomb; psf; psf=nextpsf) { in ip_mc_clear_src()
1719 nextpsf = psf->sf_next; in ip_mc_clear_src()
1720 kfree(psf); in ip_mc_clear_src()
1723 for (psf=pmc->sources; psf; psf=nextpsf) { in ip_mc_clear_src()
1724 nextpsf = psf->sf_next; in ip_mc_clear_src()
1725 kfree(psf); in ip_mc_clear_src()
2247 struct ip_sf_list *psf; in ip_check_mc() local
2259 for (psf=im->sources; psf; psf=psf->sf_next) { in ip_check_mc()
2260 if (psf->sf_inaddr == src_addr) in ip_check_mc()
2263 if (psf) in ip_check_mc()
2264 rv = psf->sf_count[MCAST_INCLUDE] || in ip_check_mc()
2265 psf->sf_count[MCAST_EXCLUDE] != in ip_check_mc()
2437 struct ip_sf_list *psf = NULL; in igmp_mcf_get_first() local
2452 psf = im->sources; in igmp_mcf_get_first()
2453 if (likely(psf != NULL)) { in igmp_mcf_get_first()
2463 return psf; in igmp_mcf_get_first()
2466 static struct ip_sf_list *igmp_mcf_get_next(struct seq_file *seq, struct ip_sf_list *psf) in igmp_mcf_get_next() argument
2470 psf = psf->sf_next; in igmp_mcf_get_next()
2471 while (!psf) { in igmp_mcf_get_next()
2493 psf = state->im->sources; in igmp_mcf_get_next()
2496 return psf; in igmp_mcf_get_next()
2501 struct ip_sf_list *psf = igmp_mcf_get_first(seq); in igmp_mcf_get_idx() local
2502 if (psf) in igmp_mcf_get_idx()
2503 while (pos && (psf = igmp_mcf_get_next(seq, psf)) != NULL) in igmp_mcf_get_idx()
2505 return pos ? NULL : psf; in igmp_mcf_get_idx()
2516 struct ip_sf_list *psf; in igmp_mcf_seq_next() local
2518 psf = igmp_mcf_get_first(seq); in igmp_mcf_seq_next()
2520 psf = igmp_mcf_get_next(seq, v); in igmp_mcf_seq_next()
2522 return psf; in igmp_mcf_seq_next()
2543 struct ip_sf_list *psf = (struct ip_sf_list *)v; in igmp_mcf_seq_show() local
2558 ntohl(psf->sf_inaddr), in igmp_mcf_seq_show()
2559 psf->sf_count[MCAST_INCLUDE], in igmp_mcf_seq_show()
2560 psf->sf_count[MCAST_EXCLUDE]); in igmp_mcf_seq_show()