]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_macro.c
Merge pull request #5767 from ton31337/fix/replace_s_addr_0_to_INADDR_ANY
[mirror_frr.git] / pimd / pim_macro.c
index d54f2ba4694f0390fe943a696b1044050594c882..bdef83925adf6ae0ff33797397209a4b5184af98 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>
 
@@ -92,11 +91,11 @@ int pim_macro_chisin_joins(const struct pim_ifchannel *ch)
 
    lost_assert(S,G) =
        { all interfaces I such that
-        lost_assert(S,G,I) == TRUE }
+        lost_assert(S,G,I) == true }
 
      bool lost_assert(S,G,I) {
        if ( RPF_interface(S) == I ) {
-         return FALSE
+         return false
        } else {
          return ( AssertWinner(S,G,I) != NULL AND
                   AssertWinner(S,G,I) != me  AND
@@ -151,7 +150,7 @@ int pim_macro_ch_lost_assert(const struct pim_ifchannel *ch)
 
    pim_include(S,G) =
        { all interfaces I such that:
-        ( (I_am_DR( I ) AND lost_assert(S,G,I) == FALSE )
+        ( (I_am_DR( I ) AND lost_assert(S,G,I) == false )
           OR AssertWinner(S,G,I) == me )
          AND  local_receiver_include(S,G,I) }
 
@@ -179,7 +178,7 @@ int pim_macro_chisin_pim_include(const struct pim_ifchannel *ch)
        return (
                /* I_am_DR( I ) ? */
                PIM_I_am_DR(pim_ifp) &&
-               /* lost_assert(S,G,I) == FALSE ? */
+               /* lost_assert(S,G,I) == false ? */
                (!pim_macro_ch_lost_assert(ch)));
 }
 
@@ -229,7 +228,7 @@ int pim_macro_ch_could_assert_eval(const struct pim_ifchannel *ch)
                return 0; /* false */
        }
 
-       /* SPTbit(S,G) == TRUE */
+       /* SPTbit(S,G) == true */
        if (ch->upstream->sptbit == PIM_UPSTREAM_SPTBIT_FALSE)
                return 0; /* false */
 
@@ -273,9 +272,9 @@ struct pim_assert_metric pim_macro_spt_assert_metric(const struct pim_rpf *rpf,
    following pseudocode:
 
   assert_metric  my_assert_metric(S,G,I) {
-    if( CouldAssert(S,G,I) == TRUE ) {
+    if( CouldAssert(S,G,I) == true ) {
       return spt_assert_metric(S,I)
-    } else if( CouldAssert(*,G,I) == TRUE ) {
+    } else if( CouldAssert(*,G,I) == true ) {
       return rpt_assert_metric(G,I)
     } else {
       return infinite_assert_metric()
@@ -296,7 +295,7 @@ pim_macro_ch_my_assert_metric_eval(const struct pim_ifchannel *ch)
                }
        }
 
-       return qpim_infinite_assert_metric;
+       return router->infinite_assert_metric;
 }
 
 /*
@@ -366,11 +365,11 @@ int pim_macro_chisin_oiflist(const struct pim_ifchannel *ch)
        (+) ( pim_include(*,G) (-) pim_exclude(S,G) )
        (-) lost_assert(*,G)
        (+) joins(S,G) ) )
-     OR (local_receiver_include(S,G,I) == TRUE
+     OR (local_receiver_include(S,G,I) == true
         AND (I_am_DR(I) OR (AssertWinner(S,G,I) == me)))
-     OR ((RPF_interface(S) == I) AND (JoinDesired(S,G) == TRUE))
-     OR ((RPF_interface(RP(G)) == I) AND (JoinDesired(*,G) == TRUE)
-        AND (SPTbit(S,G) == FALSE))
+     OR ((RPF_interface(S) == I) AND (JoinDesired(S,G) == true))
+     OR ((RPF_interface(RP(G)) == I) AND (JoinDesired(*,G) == true)
+        AND (SPTbit(S,G) == false))
 
   AssertTrackingDesired(S,G,I) is true on any interface in which an
   (S,G) assert might affect our behavior.