]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_join.c
Merge branch 'stable/3.0'
[mirror_frr.git] / pimd / pim_join.c
index 2da0b993534f7e52e3d42136343c3b2088e1366d..35deecfd81221a3f1bd369d70c42e5d10330460c 100644 (file)
@@ -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 <zebra.h>
 
@@ -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));