Lines Matching refs:gnode

183 					      struct amt_group_node *gnode,  in amt_lookup_src()  argument
190 hlist_for_each_entry_rcu(snode, &gnode->sources[hash], node) in amt_lookup_src()
211 struct amt_group_node *gnode; in amt_lookup_group() local
213 hlist_for_each_entry_rcu(gnode, &tunnel->groups[hash], node) { in amt_lookup_group()
214 if (amt_addr_equal(&gnode->group_addr, group) && in amt_lookup_group()
215 amt_addr_equal(&gnode->host_addr, host) && in amt_lookup_group()
216 gnode->v6 == v6) in amt_lookup_group()
217 return gnode; in amt_lookup_group()
225 struct amt_group_node *gnode = snode->gnode; in amt_destroy_source() local
228 tunnel = gnode->tunnel_list; in amt_destroy_source()
230 if (!gnode->v6) { in amt_destroy_source()
231 netdev_dbg(snode->gnode->amt->dev, in amt_destroy_source()
234 &gnode->group_addr.ip4); in amt_destroy_source()
237 netdev_dbg(snode->gnode->amt->dev, in amt_destroy_source()
240 &gnode->group_addr.ip6); in amt_destroy_source()
247 gnode->nr_sources--; in amt_destroy_source()
253 static void amt_del_group(struct amt_dev *amt, struct amt_group_node *gnode) in amt_del_group() argument
259 if (cancel_delayed_work(&gnode->group_timer)) in amt_del_group()
261 hlist_del_rcu(&gnode->node); in amt_del_group()
262 gnode->tunnel_list->nr_groups--; in amt_del_group()
264 if (!gnode->v6) in amt_del_group()
266 &gnode->group_addr.ip4); in amt_del_group()
270 &gnode->group_addr.ip6); in amt_del_group()
273 hlist_for_each_entry_safe(snode, t, &gnode->sources[i], node) in amt_del_group()
279 kfree_rcu(gnode, rcu); in amt_del_group()
292 struct amt_group_node *gnode = snode->gnode; in amt_source_work() local
293 struct amt_dev *amt = gnode->amt; in amt_source_work()
296 tunnel = gnode->tunnel_list; in amt_source_work()
299 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_source_work()
301 if (!gnode->nr_sources) in amt_source_work()
302 amt_del_group(amt, gnode); in amt_source_work()
314 struct amt_group_node *gnode, in amt_act_src() argument
330 gnode->group_timer.timer.expires); in amt_act_src()
350 if (!gnode->v6) in amt_act_src()
353 &gnode->group_addr.ip4, in amt_act_src()
359 &gnode->group_addr.ip6, in amt_act_src()
364 static struct amt_source_node *amt_alloc_snode(struct amt_group_node *gnode, in amt_alloc_snode() argument
374 snode->gnode = gnode; in amt_alloc_snode()
410 struct amt_group_node *gnode = container_of(to_delayed_work(work), in amt_group_work() local
413 struct amt_tunnel_list *tunnel = gnode->tunnel_list; in amt_group_work()
414 struct amt_dev *amt = gnode->amt; in amt_group_work()
423 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_group_work()
432 &gnode->sources[i], node) { in amt_group_work()
443 amt_del_group(amt, gnode); in amt_group_work()
445 gnode->filter_mode = MCAST_INCLUDE; in amt_group_work()
469 struct amt_group_node *gnode; in amt_add_group() local
476 gnode = kzalloc(sizeof(*gnode) + in amt_add_group()
479 if (unlikely(!gnode)) in amt_add_group()
482 gnode->amt = amt; in amt_add_group()
483 gnode->group_addr = *group; in amt_add_group()
484 gnode->host_addr = *host; in amt_add_group()
485 gnode->v6 = v6; in amt_add_group()
486 gnode->tunnel_list = tunnel; in amt_add_group()
487 gnode->filter_mode = MCAST_INCLUDE; in amt_add_group()
488 INIT_HLIST_NODE(&gnode->node); in amt_add_group()
489 INIT_DELAYED_WORK(&gnode->group_timer, amt_group_work); in amt_add_group()
491 INIT_HLIST_HEAD(&gnode->sources[i]); in amt_add_group()
494 hlist_add_head_rcu(&gnode->node, &tunnel->groups[hash]); in amt_add_group()
497 if (!gnode->v6) in amt_add_group()
499 &gnode->group_addr.ip4); in amt_add_group()
503 &gnode->group_addr.ip6); in amt_add_group()
506 return gnode; in amt_add_group()
1173 struct amt_group_node *gnode; in amt_dev_xmit() local
1273 hlist_for_each_entry_rcu(gnode, &tunnel->groups[hash], in amt_dev_xmit()
1276 if (gnode->group_addr.ip4 == iph->daddr) in amt_dev_xmit()
1280 if (ipv6_addr_equal(&gnode->group_addr.ip6, in amt_dev_xmit()
1322 struct amt_group_node *gnode; in amt_clear_groups() local
1329 hlist_for_each_entry_safe(gnode, t, &tunnel->groups[i], node) in amt_clear_groups()
1330 amt_del_group(amt, gnode); in amt_clear_groups()
1354 struct amt_group_node *gnode) in amt_cleanup_srcs() argument
1362 hlist_for_each_entry_safe(snode, t, &gnode->sources[i], node) { in amt_cleanup_srcs()
1370 hlist_for_each_entry_rcu(snode, &gnode->sources[i], node) { in amt_cleanup_srcs()
1372 if (!gnode->v6) in amt_cleanup_srcs()
1373 netdev_dbg(snode->gnode->amt->dev, in amt_cleanup_srcs()
1376 &gnode->group_addr.ip4); in amt_cleanup_srcs()
1379 netdev_dbg(snode->gnode->amt->dev, in amt_cleanup_srcs()
1382 &gnode->group_addr.ip6); in amt_cleanup_srcs()
1389 struct amt_group_node *gnode, void *grec, in amt_add_srcs() argument
1423 if (amt_lookup_src(tunnel, gnode, AMT_FILTER_ALL, &src)) in amt_add_srcs()
1426 snode = amt_alloc_snode(gnode, &src); in amt_add_srcs()
1429 hlist_add_head_rcu(&snode->node, &gnode->sources[hash]); in amt_add_srcs()
1431 gnode->nr_sources++; in amt_add_srcs()
1433 if (!gnode->v6) in amt_add_srcs()
1434 netdev_dbg(snode->gnode->amt->dev, in amt_add_srcs()
1437 &gnode->group_addr.ip4); in amt_add_srcs()
1440 netdev_dbg(snode->gnode->amt->dev, in amt_add_srcs()
1443 &gnode->group_addr.ip6); in amt_add_srcs()
1469 struct amt_group_node *gnode, in amt_lookup_act_srcs() argument
1511 snode = amt_lookup_src(tunnel, gnode, filter, &src); in amt_lookup_act_srcs()
1514 amt_act_src(tunnel, gnode, snode, act); in amt_lookup_act_srcs()
1520 hlist_for_each_entry_safe(snode, t, &gnode->sources[i], in amt_lookup_act_srcs()
1523 amt_act_src(tunnel, gnode, snode, act); in amt_lookup_act_srcs()
1534 snode = amt_lookup_src(tunnel, gnode, filter, &src); in amt_lookup_act_srcs()
1537 amt_act_src(tunnel, gnode, snode, act); in amt_lookup_act_srcs()
1543 hlist_for_each_entry_safe(snode, t, &gnode->sources[i], in amt_lookup_act_srcs()
1560 amt_act_src(tunnel, gnode, snode, act); in amt_lookup_act_srcs()
1576 snode = amt_lookup_src(tunnel, gnode, AMT_FILTER_ALL, in amt_lookup_act_srcs()
1579 snode = amt_lookup_src(tunnel, gnode, in amt_lookup_act_srcs()
1582 amt_act_src(tunnel, gnode, snode, act); in amt_lookup_act_srcs()
1594 struct amt_group_node *gnode, in amt_mcast_is_in_handler() argument
1597 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_is_in_handler()
1603 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_is_in_handler()
1608 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_is_in_handler()
1613 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_is_in_handler()
1623 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_is_in_handler()
1628 amt_lookup_act_srcs(tunnel, gnode, zero_grec, AMT_OPS_UNI, in amt_mcast_is_in_handler()
1633 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_is_in_handler()
1638 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB, in amt_mcast_is_in_handler()
1647 struct amt_group_node *gnode, in amt_mcast_is_ex_handler() argument
1650 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_is_ex_handler()
1658 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_is_ex_handler()
1663 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_is_ex_handler()
1668 amt_lookup_act_srcs(tunnel, gnode, zero_grec, AMT_OPS_UNI, in amt_mcast_is_ex_handler()
1673 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_mcast_is_ex_handler()
1676 gnode->filter_mode = MCAST_EXCLUDE; in amt_mcast_is_ex_handler()
1687 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_is_ex_handler()
1692 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_is_ex_handler()
1697 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_is_ex_handler()
1702 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_mcast_is_ex_handler()
1711 struct amt_group_node *gnode, in amt_mcast_to_in_handler() argument
1714 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_to_in_handler()
1721 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_to_in_handler()
1726 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_to_in_handler()
1731 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_to_in_handler()
1743 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_to_in_handler()
1748 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_to_in_handler()
1756 amt_lookup_act_srcs(tunnel, gnode, zero_grec, AMT_OPS_UNI, in amt_mcast_to_in_handler()
1763 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_to_in_handler()
1772 struct amt_group_node *gnode, in amt_mcast_to_ex_handler() argument
1775 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_to_ex_handler()
1784 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_to_ex_handler()
1789 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_to_ex_handler()
1794 amt_lookup_act_srcs(tunnel, gnode, zero_grec, AMT_OPS_UNI, in amt_mcast_to_ex_handler()
1799 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_mcast_to_ex_handler()
1802 gnode->filter_mode = MCAST_EXCLUDE; in amt_mcast_to_ex_handler()
1814 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_to_ex_handler()
1819 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_to_ex_handler()
1824 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_to_ex_handler()
1829 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_mcast_to_ex_handler()
1838 struct amt_group_node *gnode, in amt_mcast_allow_handler() argument
1841 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_allow_handler()
1847 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_allow_handler()
1852 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_allow_handler()
1862 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_allow_handler()
1867 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB, in amt_mcast_allow_handler()
1874 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_INT, in amt_mcast_allow_handler()
1883 struct amt_group_node *gnode, in amt_mcast_block_handler() argument
1886 if (gnode->filter_mode == MCAST_INCLUDE) { in amt_mcast_block_handler()
1892 amt_lookup_act_srcs(tunnel, gnode, zero_grec, AMT_OPS_UNI, in amt_mcast_block_handler()
1903 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_block_handler()
1908 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_block_handler()
1913 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_SUB_REV, in amt_mcast_block_handler()
1918 amt_lookup_act_srcs(tunnel, gnode, grec, AMT_OPS_UNI, in amt_mcast_block_handler()
1942 struct amt_group_node *gnode; in amt_igmpv2_report_handler() local
1950 gnode = amt_lookup_group(tunnel, &group, &host, false); in amt_igmpv2_report_handler()
1951 if (!gnode) { in amt_igmpv2_report_handler()
1952 gnode = amt_add_group(amt, tunnel, &group, &host, false); in amt_igmpv2_report_handler()
1953 if (!IS_ERR(gnode)) { in amt_igmpv2_report_handler()
1954 gnode->filter_mode = MCAST_EXCLUDE; in amt_igmpv2_report_handler()
1955 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_igmpv2_report_handler()
1979 struct amt_group_node *gnode; in amt_igmpv2_leave_handler() local
1987 gnode = amt_lookup_group(tunnel, &group, &host, false); in amt_igmpv2_leave_handler()
1988 if (gnode) in amt_igmpv2_leave_handler()
1989 amt_del_group(amt, gnode); in amt_igmpv2_leave_handler()
1999 struct amt_group_node *gnode; in amt_igmpv3_report_handler() local
2021 gnode = amt_lookup_group(tunnel, &group, &host, false); in amt_igmpv3_report_handler()
2022 if (!gnode) { in amt_igmpv3_report_handler()
2023 gnode = amt_add_group(amt, tunnel, &group, &host, in amt_igmpv3_report_handler()
2025 if (IS_ERR(gnode)) in amt_igmpv3_report_handler()
2029 amt_add_srcs(amt, tunnel, gnode, grec, false); in amt_igmpv3_report_handler()
2032 amt_mcast_is_in_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2036 amt_mcast_is_ex_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2040 amt_mcast_to_in_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2044 amt_mcast_to_ex_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2048 amt_mcast_allow_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2052 amt_mcast_block_handler(amt, tunnel, gnode, grec, in amt_igmpv3_report_handler()
2058 amt_cleanup_srcs(amt, tunnel, gnode); in amt_igmpv3_report_handler()
2103 struct amt_group_node *gnode; in amt_mldv1_report_handler() local
2109 gnode = amt_lookup_group(tunnel, &group, &host, true); in amt_mldv1_report_handler()
2110 if (!gnode) { in amt_mldv1_report_handler()
2111 gnode = amt_add_group(amt, tunnel, &group, &host, true); in amt_mldv1_report_handler()
2112 if (!IS_ERR(gnode)) { in amt_mldv1_report_handler()
2113 gnode->filter_mode = MCAST_EXCLUDE; in amt_mldv1_report_handler()
2114 if (!mod_delayed_work(amt_wq, &gnode->group_timer, in amt_mldv1_report_handler()
2140 struct amt_group_node *gnode; in amt_mldv1_leave_handler() local
2147 gnode = amt_lookup_group(tunnel, &group, &host, true); in amt_mldv1_leave_handler()
2148 if (gnode) { in amt_mldv1_leave_handler()
2149 amt_del_group(amt, gnode); in amt_mldv1_leave_handler()
2161 struct amt_group_node *gnode; in amt_mldv2_report_handler() local
2183 gnode = amt_lookup_group(tunnel, &group, &host, true); in amt_mldv2_report_handler()
2184 if (!gnode) { in amt_mldv2_report_handler()
2185 gnode = amt_add_group(amt, tunnel, &group, &host, in amt_mldv2_report_handler()
2187 if (IS_ERR(gnode)) in amt_mldv2_report_handler()
2191 amt_add_srcs(amt, tunnel, gnode, grec, true); in amt_mldv2_report_handler()
2194 amt_mcast_is_in_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2198 amt_mcast_is_ex_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2202 amt_mcast_to_in_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2206 amt_mcast_to_ex_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2210 amt_mcast_allow_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2214 amt_mcast_block_handler(amt, tunnel, gnode, grec, in amt_mldv2_report_handler()
2220 amt_cleanup_srcs(amt, tunnel, gnode); in amt_mldv2_report_handler()