X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=pimd%2Fpim_join.c;fp=pimd%2Fpim_join.c;h=35deecfd81221a3f1bd369d70c42e5d10330460c;hb=326452238a0f2610b778678fd639730c7bdd40fb;hp=2da0b993534f7e52e3d42136343c3b2088e1366d;hpb=f87b96392c19d18342f0f986858409b10875fcbd;p=mirror_frr.git diff --git a/pimd/pim_join.c b/pimd/pim_join.c index 2da0b9935..35deecfd8 100644 --- a/pimd/pim_join.c +++ b/pimd/pim_join.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 @@ -59,6 +58,8 @@ static void recv_join(struct interface *ifp, struct prefix_sg *sg, uint8_t source_flags) { + struct pim_interface *pim_ifp = NULL; + if (PIM_DEBUG_PIM_TRACE) { char up_str[INET_ADDRSTRLEN]; char neigh_str[INET_ADDRSTRLEN]; @@ -72,6 +73,11 @@ static void recv_join(struct interface *ifp, up_str, holdtime, neigh_str, ifp->name); } + pim_ifp = ifp->info; + zassert(pim_ifp); + + ++pim_ifp->pim_ifstat_join_recv; + /* * If the RPT and WC are set it's a (*,G) * and the source is the RP @@ -104,6 +110,8 @@ static void recv_prune(struct interface *ifp, struct prefix_sg *sg, uint8_t source_flags) { + struct pim_interface *pim_ifp = NULL; + if (PIM_DEBUG_PIM_TRACE) { char up_str[INET_ADDRSTRLEN]; char neigh_str[INET_ADDRSTRLEN]; @@ -117,6 +125,11 @@ static void recv_prune(struct interface *ifp, up_str, holdtime, neigh_str, ifp->name); } + pim_ifp = ifp->info; + zassert(pim_ifp); + + ++pim_ifp->pim_ifstat_prune_recv; + if ((source_flags & PIM_RPT_BIT_MASK) && (source_flags & PIM_WILDCARD_BIT_MASK)) { @@ -521,6 +534,9 @@ int pim_joinprune_send(struct pim_rpf *rpf, packet_size += group_size; pim_msg_build_jp_groups (grp, group, group_size); + pim_ifp->pim_ifstat_join_send += ntohs(grp->joins); + pim_ifp->pim_ifstat_prune_send += ntohs(grp->prunes); + if (PIM_DEBUG_PIM_TRACE) zlog_debug ("%s: interface %s num_joins %u num_prunes %u", __PRETTY_FUNCTION__, rpf->source_nexthop.interface->name, ntohs(grp->joins), ntohs (grp->prunes));